@djb25/digit-ui-module-commonpt 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
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"),i=require("react-router-dom"),r=require("react-query"),a=require("react-hook-form");const u=[{head:"PT_LOCATION_DETAILS",body:[{type:"component",route:"property-type",isMandatory:!0,component:"CPTPropertyLocationDetails",texts:{headerCaption:"",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},nextStep:{COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY:"landarea",COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY:"PtUnits",COMMON_PROPTYPE_VACANT:"area"},key:"locationDet",withoutLabel:!0,colSpan:"span 2"}]},{head:"PT_PROPERTY_WATER_CONNECTION",body:[{type:"component",route:"property-type",isMandatory:!1,component:"PropertyWaterConnection",texts:{headerCaption:"",header:"PT_PROPERTY_WATER_CONNECTION",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},key:"waterConnection",withoutLabel:!0,colSpan:"span 2"}]},{head:"PT_OWNERSHIP_DETAILS",body:[{type:"component",route:"institutional-owner-address",isMandatory:!1,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",colSpan:"span 2"}]}];var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(e,t){return e(t={exports:{}},t.exports),t.exports}var c=s(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]",s="[object Error]",c="[object Function]",v="[object GeneratorFunction]",p="[object Map]",m="[object Number]",f="[object Object]",E="[object RegExp]",y="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",I="[object Uint8Array]",O="[object Uint16Array]",P="[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),U=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,$=RegExp(V.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\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",ve="["+ce+"]",pe="["+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]",ge="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ce="(?:"+pe+"|"+ye+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,_e,he].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",_e,he].join("|")+")"+Ae,Ne="(?:"+[ge+pe+"?",pe,_e,he,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(pe,"g"),Pe=RegExp(ye+"(?="+ye+")|"+Ne+Ae,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,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,De].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[D]=Fe[N]=Fe[I]=Fe["[object Uint8ClampedArray]"]=Fe[O]=Fe[P]=!0,Fe[i]=Fe[r]=Fe[S]=Fe[a]=Fe[b]=Fe[u]=Fe[s]=Fe[c]=Fe[p]=Fe[m]=Fe[f]=Fe[E]=Fe[y]=Fe[g]=Fe[h]=!1;var ke={};ke[i]=ke[r]=ke[S]=ke[b]=ke[a]=ke[u]=ke[T]=ke[C]=ke[A]=ke[D]=ke[N]=ke[p]=ke[m]=ke[f]=ke[E]=ke[y]=ke[g]=ke[_]=ke[I]=ke["[object Uint8ClampedArray]"]=ke[O]=ke[P]=!0,ke[s]=ke[c]=ke[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Be=parseFloat,He=parseInt,je="object"==typeof d&&d&&d.Object===Object&&d,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ve=t&&!t.nodeType&&t,$e=Ve&&e&&!e.nodeType&&e,Ye=$e&&$e.exports===Ve,Ke=Ye&&je.process,qe=function(){try{return $e&&$e.require&&$e.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ge=qe&&qe.isArrayBuffer,Ze=qe&&qe.isDate,Xe=qe&&qe.isMap,Je=qe&&qe.isRegExp,Qe=qe&&qe.isSet,et=qe&&qe.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 vt(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 pt(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,_t,n)}function gt(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function _t(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 Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):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 Pt(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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Ue[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 Ut(e,t){return function(n){return e(t(n))}}function Bt(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 Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(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=Pe.lastIndex=0;Pe.test(e);)++t;return t}(e):mt(e)}function zt(e){return Ft(e)?function(e){return e.match(Pe)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var $t=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var d,K=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,se=t.Date,ce=t.Error,ve=t.Function,pe=t.Math,me=t.Object,fe=t.RegExp,Ee=t.String,ye=t.TypeError,ge=K.prototype,_e=me.prototype,he=t["__core-js_shared__"],Se=ve.prototype.toString,be=_e.hasOwnProperty,Te=0,Ce=(d=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Ae=_e.toString,De=Se.call(me),Ne=ze._,Pe=fe("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ye?t.Buffer:void 0,Ue=t.Symbol,je=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,Ve=Ut(me.getPrototypeOf,me),$e=me.create,Ke=_e.propertyIsEnumerable,qe=ge.splice,mt=Ue?Ue.isConcatSpreadable:void 0,bt=Ue?Ue.iterator:void 0,Kt=Ue?Ue.toStringTag:void 0,qt=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Zt=se&&se.now!==ze.Date.now&&se.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=pe.ceil,Qt=pe.floor,en=me.getOwnPropertySymbols,tn=Re?Re.isBuffer:void 0,nn=t.isFinite,ln=ge.join,on=Ut(me.keys,me),rn=pe.max,an=pe.min,un=se.now,dn=t.parseInt,sn=pe.random,cn=ge.reverse,vn=Qo(t,"DataView"),pn=Qo(t,"Map"),mn=Qo(t,"Promise"),fn=Qo(t,"Set"),En=Qo(t,"WeakMap"),yn=Qo(me,"create"),gn=En&&new En,_n={},hn=Ii(vn),Sn=Ii(pn),bn=Ii(mn),Tn=Ii(fn),Cn=Ii(En),An=Ue?Ue.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function In(e){if($r(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(!Vr(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Pn(){}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 Un(e,t){var n=xr(e),l=!n&&Lr(e),o=!n&&!l&&Ur(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 Bn(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function Hn(e,t){return Ti(yo(e),Gn(t,0,e.length))}function jn(e){return Ti(yo(e))}function Wn(e,t,n){(void 0!==n&&!Pr(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&Pr(l,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(Pr(e[n][0],t))return n;return-1}function $n(e,t,n,l){return el(e,function(e,o,i){t(l,e,n(e),i)}),l}function Yn(e,t){return e&&go(t,Sa(t),e)}function Kn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,o=K(l),i=null==e;++n<l;)o[n]=i?void 0:Ea(e,t[n]);return o}function Gn(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,s=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(!Vr(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),!s)return yo(e,d)}else{var L=ni(e),x=L==c||L==v;if(Ur(e))return co(e,s);if(L==f||L==i||x&&!o){if(d=h||x?{}:oi(e),!s)return h?function(e,t){return go(e,ti(e),t)}(e,function(e,t){return e&&go(t,ba(t),e)}(d,e)):function(e,t){return go(e,ei(e),t)}(e,Yn(d,e))}else{if(!ke[L])return o?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case S:return vo(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?vo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case C:case A:case D:case N:case I:case"[object Uint8ClampedArray]":case O:case P:return po(e,n);case p:return new l;case m:case g: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 _:return Dn?me(Dn.call(e)):{}}}(e,L,s)}}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))}):Yr(e)&&e.forEach(function(l,o){d.set(o,Zn(l,t,n,o,e,r))});var F=R?void 0:(w?h?Yo:$o:h?ba:Sa)(e);return lt(F||e,function(l,o){F&&(l=e[o=l]),zn(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 _i(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 v=d;v--;)if(t[v]===c)continue e;u.push(s)}else i(t,c,l)||u.push(s)}return u}In.templateSettings={escape:U,evaluate:B,interpolate:H,variable:"",imports:{_:In}},(In.prototype=Pn.prototype).constructor=In,(wn.prototype=On(Pn.prototype)).constructor=wn,(Rn.prototype=On(Pn.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=Vn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return Vn(this.__data__,e)>-1},xn.prototype.set=function(e,t){var n=this.__data__,l=Vn(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(pn||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(!pn||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 jr(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 vl(e,t,n){var l=t(e);return xr(e)?l:st(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=be.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var l=!0}catch(e){}var o=Ae.call(e);return l&&(t?e[Kt]=n:delete e[Kt]),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=K(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,v=a[0];e:for(;++c<o&&d.length<u;){var p=s[c],m=t?t(p):p;if(p=n||0!==p?p:0,!(v?Ot(v,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}v&&v.push(m),d.push(p)}}return d}function gl(e,t,n){var l=null==(e=fi(e,t=ro(t,e)))?e:e[Ni(Hi(t))];return null==l?void 0:tt(l,e,n)}function _l(e){return $r(e)&&pl(e)==i}function hl(e,t,n,l,o){return e===t||(null==e||null==t||!$r(e)&&!$r(t)?e!=e&&t!=t:function(e,t,n,l,o,d){var c=xr(e),v=xr(t),h=c?r:ni(e),T=v?r:ni(t),C=(h=h==i?f:h)==f,A=(T=T==i?f:T)==f,D=h==T;if(D&&Ur(e)){if(!Ur(t))return!1;c=!0,C=!1}if(D&&!C)return d||(d=new kn),c||Qr(e)?zo(e,t,n,l,o,d):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 je(e),new je(t)));case a:case u:case m:return Pr(+e,+t);case s:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case p:var d=kt;case y:if(d||(d=Ht),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 v=zo(d(e),d(t),l,o,i,r);return r.delete(e),v;case _:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,h,n,l,o,d);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,P=I?t.value():t;return d||(d=new kn),o(O,P,n,l,d)}}return!!D&&(d||(d=new kn),function(e,t,n,l,o,i){var r=1&n,a=$o(e),u=a.length;if(u!=$o(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),v=i.get(t);if(c&&v)return c==t&&v==e;var p=!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)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var g=e.constructor,_=t.constructor;g==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,l,o,d))}(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 v=l(d,s,u,e,t,c);if(!(void 0===v?hl(s,d,3,l,c):v))return!1}}return!0}function bl(e){return!(!Vr(e)||(t=e,Ce&&Ce in t))&&(jr(e)?Pe:oe).test(Ii(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ka:"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 Dl(e,t){var n=-1,l=Fr(e)?K(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]?pi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Il(e,t){return ui(e)&&vi(t)?pi(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),Vr(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 v=xr(u),p=!v&&Ur(u),m=!v&&!p&&Qr(u);s=u,v||p||m?xr(a)?s=a:kr(a)?s=yo(a):p?(c=!1,s=co(u,!0)):m?(c=!1,s=po(u,!0)):s=[]:qr(u)||Lr(u)?(s=a,Lr(a)?s=aa(a):Vr(a)&&!jr(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 Pl(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}):[Ka];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}(Dl(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)&&Hl(i,ro(r,e),a)}return i}function Ll(e,t,n,l){var o=l?gt: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&&qe.call(a,u,1),qe.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)?qe.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,Ka),e+"")}function Ul(e){return Bn(Pa(e))}function Bl(e,t){var n=Pa(e);return Ti(n,Gn(t,0,n.length))}function Hl(e,t,n,l){if(!Vr(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=Vr(s)?s:ri(t[o+1])?[]:{})}zn(a,u,d),a=a[u]}return e}var jl=gn?function(e,t){return gn.set(e,t),e}:Ka,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:Va(t),writable:!0})}:Ka;function zl(e){return Ti(Pa(e))}function Vl(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=K(o);++l<o;)i[l]=e[l+t];return i}function $l(e,t){var n;return el(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Yl(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 Kl(e,t,Ka,n)}function Kl(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]),v=void 0!==c,p=null===c,m=c==c,f=Jr(c);if(r)var E=l||m;else E=d?m&&(l||v):a?m&&v&&(l||!p):u?m&&v&&!p&&(l||!f):!p&&!f&&(l?c<=t:c<t);E?o=s+1:i=s}return an(i,4294967294)}function ql(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||!Pr(a,u)){var u=a;i[o++]=0===r?0:r}}return i}function Gl(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 Ht(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 v=u.length;v--;)if(u[v]===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(Hi(t))]}function Ql(e,t,n,l){return Hl(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?Vl(e,l?0:i,l?i+1:o):Vl(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=K(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:Ka}function ro(e,t){return xr(e)?e:ui(e,t)?[e]:Di(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:Vl(e,t,n)}var so=Gt||function(e){return ze.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 vo(e){var t=new e.constructor(e.byteLength);return new je(t).set(new je(e)),t}function po(e,t){var n=t?vo(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=K(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=K(s+d),v=!l;++o<s;)c[o]=e[o];for(var p=o;++u<d;)c[p+u]=t[u];for(;++r<a;)(v||o<i)&&(c[p+n[r]]=e[o++]);return c}function yo(e,t){var n=-1,l=e.length;for(t||(t=K(l));++n<l;)t[n]=e[n];return t}function go(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?Kn(n,a,u):zn(n,a,u)}return n}function _o(e,t){return function(n,l){var o=xr(n)?nt:$n,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))?zt(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(ja(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 Vr(l)?l:n}}function Do(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 Vo(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"==qo(r))var a=new wn([],!0)}for(o=a?o:l;++o<l;){var u=qo(r=t[o]),d="wrapper"==u?Ko(r):void 0;a=d&&di(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?a[qo(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,v=2&t,p=24&t,m=512&t,f=v?void 0:Ao(e);return function E(){for(var y=arguments.length,g=K(y),_=y;_--;)g[_]=arguments[_];if(p)var h=Go(E),S=Rt(g,h);if(l&&(g=fo(g,l,o,p)),i&&(g=Eo(g,i,r,p)),y-=S,p&&y<d){var b=Bt(g,h);return Mo(e,t,Io,E.placeholder,n,g,b,a,u,d-y)}var T=c?n:this,C=v?T[e]:e;return y=g.length,a?g=Ei(g,a):m&&y>1&&g.reverse(),s&&u<y&&(g.length=u),this&&this!==ze&&this instanceof E&&(C=f||Ao(C)),C.apply(T,g)}}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 Po(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=Gl(n),l=Gl(l)),o=e(n,l)}return o}}function wo(e){return Vo(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(zt(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=K(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],v=n.apply(void 0,c);return di(e)&&gi(v,c),v.placeholder=l,Si(v,e,t)}function Fo(e){var t=pe[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/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Uo(e){return function(t){var n=ni(t);return n==p?kt(t):n==y?jt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bo(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 v=i,p=r;i=r=void 0}var m=s?void 0:Ko(e),f=[e,t,o,i,r,v,p,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?Bt(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?Eo(a,r,t[6]):r,e[6]=a?Bt(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=K(i),a=i,u=Go(o);a--;)r[a]=arguments[a];var d=i<3&&r[0]!==u&&r[i-1]!==u?[]:Bt(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!==ze&&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=K(d+a),c=this&&this!==ze&&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!==ze&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((m?jl:gi)(E,f),e,t)}function Ho(e,t,n,l){return void 0===e||Pr(e,_e[n])&&!be.call(l,n)?t:e}function jo(e,t,n,l,o,i){return Vr(e)&&Vr(t)&&(i.set(t,e),Ol(e,t,void 0,jo,i),i.delete(t)),e}function Wo(e){return qr(e)?void 0:e}function zo(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,v=!0,p=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;v=!1;break}if(p){if(!pt(t,function(e,t){if(!Ot(p,t)&&(m===e||o(m,e,n,l,i)))return p.push(t)})){v=!1;break}}else if(m!==f&&!o(m,f,n,l,i)){v=!1;break}}return i.delete(e),i.delete(t),v}function Vo(e){return hi(mi(e,void 0,Mi),e+"")}function $o(e){return vl(e,Sa,ei)}function Yo(e){return vl(e,ba,ti)}var Ko=gn?function(e){return gn.get(e)}:Ja;function qo(e){for(var t=e.name+"",n=_n[t],l=be.call(_n,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function Go(e){return(be.call(In,"placeholder")?In:e).placeholder}function Zo(){var e=In.iteratee||qa;return e=e===qa?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,vi(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 Ke.call(e,t)}))}:iu,ti=en?function(e){for(var t=[];e;)st(t,ei(e)),e=Ve(e);return t}:iu,ni=pl;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)&&zr(o)&&ri(r,o)&&(xr(e)||Lr(e))}function oi(e){return"function"!=typeof e.constructor||ci(e)?{}:On(Ve(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(!Vr(n))return!1;var l=typeof t;return!!("number"==l?Fr(n)&&ri(t,n.length):"string"==l&&t in n)&&Pr(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)||!j.test(e)||null!=t&&e in me(t)}function di(e){var t=qo(e),n=In[t];if("function"!=typeof n||!(t in Rn.prototype))return!1;if(e===n)return!0;var l=Ko(n);return!!l&&e===l[0]}(vn&&ni(new vn(new ArrayBuffer(1)))!=b||pn&&ni(new pn)!=p||mn&&"[object Promise]"!=ni(mn.resolve())||fn&&ni(new fn)!=y||En&&ni(new En)!=h)&&(ni=function(e){var t=pl(e),n=t==f?e.constructor:void 0,l=n?Ii(n):"";if(l)switch(l){case hn:return b;case Sn:return p;case bn:return"[object Promise]";case Tn:return y;case Cn:return h}return t});var si=he?jr:ru;function ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function vi(e){return e==e&&!Vr(e)}function pi(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=K(i);++o<i;)r[o]=l[t+o];o=-1;for(var a=K(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,Vl(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 gi=bi(jl),_i=Xt||function(e,t){return ze.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(q,"{\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(G);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,Di=(Ci=Cr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,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 Pi=kl(function(e,t){return kr(e)?Qn(e,il(t,1,kr,!0)):[]}),wi=kl(function(e,t){var n=Hi(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=Hi(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):[]}),Ui=kl(function(e){var t=Hi(e),n=dt(e,oo);return t===Hi(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yl(n,Zo(t,2)):[]}),Bi=kl(function(e){var t=Hi(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 Hi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var ji=kl(Wi);function Wi(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var zi=Vo(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return xl(e,dt(t,function(e){return ri(e,n)?+e:e}).sort(mo)),l});function Vi(e){return null==e?e:cn.call(e)}var $i=kl(function(e){return Xl(il(e,1,kr,!0))}),Yi=kl(function(e){var t=Hi(e);return kr(t)&&(t=void 0),Xl(il(e,1,kr,!0),Zo(t,2))}),Ki=kl(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,Xl(il(e,1,kr,!0),void 0,t)});function qi(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 Gi(e,t){if(!e||!e.length)return[];var n=qi(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=Hi(e);return kr(t)&&(t=void 0),no(rt(e,kr),Zo(t,2))}),Qi=kl(function(e){var t=Hi(e);return t="function"==typeof t?t:void 0,no(rt(e,kr),void 0,t)}),er=kl(qi),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,Gi(e,n)});function nr(e){var t=In(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var or=Vo(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return qn(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=_o(function(e,t,n){be.call(e,n)?++e[n]:Kn(e,n,1)}),rr=Do(Li),ar=Do(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=_o(function(e,t,n){be.call(e,n)?e[n].push(t):Kn(e,n,[t])}),cr=kl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fr(e)?K(e.length):[];return el(e,function(e){i[++l]=o?tt(t,e,n):gl(e,t,n)}),i}),vr=_o(function(e,t,n){Kn(e,n,t)});function pr(e,t){return(xr(e)?dt:Dl)(e,Zo(t,3))}var mr=_o(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 ze.Date.now()};function yr(e,t,n){return t=n?void 0:t,Bo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function gr(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 _r=kl(function(e,t,n){var l=1;if(n.length){var o=Bt(n,Go(_r));l|=32}return Bo(e,l,t,n,o)}),hr=kl(function(e,t,n){var l=3;if(n.length){var o=Bt(n,Go(hr));l|=32}return Bo(t,l,e,n,o)});function Sr(e,t,l){var o,i,r,a,u,d,s=0,c=!1,v=!1,p=!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=_i(y,t),c?m(e):a}function E(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-s>=r}function y(){var e=Er();if(E(e))return g(e);u=_i(y,function(e){var n=t-(e-d);return v?an(n,r-(e-s)):n}(e))}function g(e){return u=void 0,p&&o?m(e):(o=i=void 0,a)}function _(){var e=Er(),n=E(e);if(o=arguments,i=this,d=e,n){if(void 0===u)return f(d);if(v)return so(u),u=_i(y,t),m(d)}return void 0===u&&(u=_i(y,t)),a}return t=ra(t)||0,Vr(l)&&(c=!!l.leading,r=(v="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,p="trailing"in l?!!l.trailing:p),_.cancel=function(){void 0!==u&&so(u),s=0,o=d=i=u=void 0},_.flush=function(){return void 0===u?a:g(Er())},_}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 Dr=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 Bo(e,32,void 0,t,Bt(t,Go(Nr)))}),Ir=kl(function(e,t){return Bo(e,64,void 0,t,Bt(t,Go(Ir)))}),Or=Vo(function(e,t){return Bo(e,256,void 0,void 0,void 0,t)});function Pr(e,t){return e===t||e!=e&&t!=t}var wr=xo(ml),Rr=xo(function(e,t){return e>=t}),Lr=_l(function(){return arguments}())?_l:function(e){return $r(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},xr=K.isArray,Mr=Ge?Nt(Ge):function(e){return $r(e)&&pl(e)==S};function Fr(e){return null!=e&&zr(e.length)&&!jr(e)}function kr(e){return $r(e)&&Fr(e)}var Ur=tn||ru,Br=Ze?Nt(Ze):function(e){return $r(e)&&pl(e)==u};function Hr(e){if(!$r(e))return!1;var t=pl(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qr(e)}function jr(e){if(!Vr(e))return!1;var t=pl(e);return t==c||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==oa(e)}function zr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Vr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function $r(e){return null!=e&&"object"==typeof e}var Yr=Xe?Nt(Xe):function(e){return $r(e)&&ni(e)==p};function Kr(e){return"number"==typeof e||$r(e)&&pl(e)==m}function qr(e){if(!$r(e)||pl(e)!=f)return!1;var t=Ve(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Gr=Je?Nt(Je):function(e){return $r(e)&&pl(e)==E},Zr=Qe?Nt(Qe):function(e){return $r(e)&&ni(e)==y};function Xr(e){return"string"==typeof e||!xr(e)&&$r(e)&&pl(e)==g}function Jr(e){return"symbol"==typeof e||$r(e)&&pl(e)==_}var Qr=et?Nt(et):function(e){return $r(e)&&zr(e.length)&&!!Fe[pl(e)]},ea=xo(Al),ta=xo(function(e,t){return e<=t});function na(e){if(!e)return[];if(Fr(e))return Xr(e)?zt(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==p?kt:t==y?Ht:Pa)(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?Gn(oa(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if(Vr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||ie.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return go(e,ba(e))}function ua(e){return null==e?"":Zl(e)}var da=ho(function(e,t){if(ci(t)||Fr(t))go(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),sa=ho(function(e,t){go(t,ba(t),e)}),ca=ho(function(e,t,n,l){go(t,ba(t),e,l)}),va=ho(function(e,t,n,l){go(t,Sa(t),e,l)}),pa=Vo(qn),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||Pr(s,_e[d])&&!be.call(e,d))&&(e[d]=i[d])}return e}),fa=kl(function(e){return e.push(void 0,jo),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 ga=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Va(Ka)),_a=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(gl);function Sa(e){return Fr(e)?Un(e):Cl(e)}function ba(e){return Fr(e)?Un(e,!0):function(e){if(!Vr(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=Vo(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}),go(e,Yo(e),n),l&&(n=Zn(n,7,Wo));for(var o=t.length;o--;)Jl(n,t[o]);return n}),Da=Vo(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(Yo(e),function(e){return[e]});return t=Zo(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Ia=Uo(Sa),Oa=Uo(ba);function Pa(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 Ha(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()}),Ua=Co(function(e,t,n){return e+(n?" ":"")+Ha(t)}),Ba=Co(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ha=To("toUpperCase");function ja(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 Hr(e)?e:new ce(e)}}),za=Vo(function(e,t){return lt(t,function(t){t=Ni(t),Kn(e,t,_r(e[t],e))}),e});function Va(e){return function(){return e}}var $a=No(),Ya=No(!0);function Ka(e){return e}function qa(e){return Tl("function"==typeof e?e:Zn(e,1))}var Ga=kl(function(e,t){return function(n){return gl(n,e,t)}}),Za=kl(function(e,t){return function(n){return gl(e,n,t)}});function Xa(e,t,n){var l=Sa(t),o=sl(t,l);null!=n||Vr(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sa(t)));var i=!(Vr(n)&&"chain"in n&&!n.chain),r=jr(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(pt);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=Po(function(e,t){return e+t},0),du=Fo("ceil"),su=Po(function(e,t){return e/t},1),cu=Fo("floor"),vu=Po(function(e,t){return e*t},1),pu=Fo("round"),mu=Po(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=va,In.at=pa,In.before=gr,In.bind=_r,In.bindAll=za,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=K(Jt(l/t));o<l;)r[i++]=Vl(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=K(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=Va,In.countBy=ir,In.create=function(e,t){var n=On(e);return null==t?n:Yn(n,t)},In.curry=function e(t,n,l){var o=Bo(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=Bo(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=Pi,In.differenceBy=wi,In.differenceWith=Ri,In.drop=function(e,t,n){var l=null==e?0:e.length;return l?Vl(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?Vl(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(pr(e,t),1)},In.flatMapDeep=function(e,t){return il(pr(e,t),1/0)},In.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),il(pr(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 Bo(e,512)},In.flow=$a,In.flowRight=Ya,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?Vl(e,0,-1):[]},In.intersection=ki,In.intersectionBy=Ui,In.intersectionWith=Bi,In.invert=ga,In.invertBy=_a,In.invokeMap=cr,In.iteratee=qa,In.keyBy=vr,In.keys=Sa,In.keysIn=ba,In.map=pr,In.mapKeys=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){Kn(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){Kn(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=Ga,In.methodOf=Za,In.mixin=Xa,In.negate=Ar,In.nthArg=function(e){return e=oa(e),kl(function(t){return Pl(t,e)})},In.omit=Aa,In.omitBy=function(e,t){return Na(e,Ar(Zo(t)))},In.once=function(e){return gr(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=Dr,In.overEvery=eu,In.overSome=tu,In.partial=Nr,In.partialRight=Ir,In.partition=mr,In.pick=Da,In.pickBy=Na,In.property=nu,In.propertyOf=function(e){return function(t){return null==e?void 0:cl(e,t)}},In.pull=ji,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=zi,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=Vi,In.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),(xr(e)?Hn:Bl)(e,t)},In.set=function(e,t,n){return null==e?e:Hl(e,t,n)},In.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Hl(e,t,n,l)},In.shuffle=function(e){return(xr(e)?jn:zl)(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)),Vl(e,t,n)):[]},In.sortBy=fr,In.sortedUniq=function(e){return e&&e.length?ql(e):[]},In.sortedUniqBy=function(e,t){return e&&e.length?ql(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&&!Gr(t))&&!(t=Zl(t))&&Ft(e)?uo(zt(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?Vl(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?Vl(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?Vl(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 Vr(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(Di(ua(e)))},In.toPlainObject=aa,In.transform=function(e,t,n){var l=xr(e),o=l||Ur(e)||Qr(e);if(t=Zo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:Vr(e)&&jr(i)?On(Ve(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=$i,In.unionBy=Yi,In.unionWith=Ki,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=qi,In.unzipWith=Gi,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=Pa,In.valuesIn=function(e){return null==e?[]:It(e,ba(e))},In.without=Zi,In.words=ja,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||[],zn)},In.zipObjectDeep=function(e,t){return lo(e||[],t||[],Hl)},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),Gn(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:Gn(oa(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},In.eq=Pr,In.escape=function(e){return(e=ua(e))&&k.test(e)?e.replace(M,xt):e},In.escapeRegExp=function(e){return(e=ua(e))&&$.test(e)?e.replace(V,"\\$&"):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=Ka,In.includes=function(e,t,n,l){e=Fr(e)?e:Pa(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||$r(e)&&pl(e)==a},In.isBuffer=Ur,In.isDate=Br,In.isElement=function(e){return $r(e)&&1===e.nodeType&&!qr(e)},In.isEmpty=function(e){if(null==e)return!0;if(Fr(e)&&(xr(e)||"string"==typeof e||"function"==typeof e.splice||Ur(e)||Qr(e)||Lr(e)))return!e.length;var t=ni(e);if(t==p||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=Hr,In.isFinite=function(e){return"number"==typeof e&&nn(e)},In.isFunction=jr,In.isInteger=Wr,In.isLength=zr,In.isMap=Yr,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 Kr(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=Kr,In.isObject=Vr,In.isObjectLike=$r,In.isPlainObject=qr,In.isRegExp=Gr,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 $r(e)&&ni(e)==h},In.isWeakSet=function(e){return $r(e)&&"[object WeakSet]"==pl(e)},In.join=function(e,t){return null==e?"":ln.call(e,t)},In.kebabCase=xa,In.last=Hi,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,_t,o,!0)},In.lowerCase=Ma,In.lowerFirst=Fa,In.lt=ea,In.lte=ta,In.max=function(e){return e&&e.length?ll(e,Ka,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,Ka)},In.meanBy=function(e,t){return ht(e,Zo(t,2))},In.min=function(e){return e&&e.length?ll(e,Ka,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=vu,In.nth=function(e,t){return e&&e.length?Pl(e,oa(t)):void 0},In.noConflict=function(){return ze._===this&&(ze._=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(Y,""),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+Be("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)?vt: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=jr(i)?i.call(e):i}return e},In.round=pu,In.runInContext=e,In.sample=function(e){return(xr(e)?Bn:Ul)(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==p||t==y?e.size:Cl(e).length},In.snakeCase=ka,In.some=function(e,t,n){var l=xr(e)?pt:$l;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},In.sortedIndex=function(e,t){return Yl(e,t)},In.sortedIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2))},In.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Pr(e[l],t))return l}return-1},In.sortedLastIndex=function(e,t){return Yl(e,t,!0)},In.sortedLastIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2),!0)},In.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Pr(e[n],t))return n}return-1},In.startCase=Ua,In.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Gn(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,Ka):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,Ho);var o,i,r=ca({},t.imports,l.imports,Ho),a=Sa(r),u=It(r,a),d=0,s=t.interpolate||ue,c="__p += '",v=fe((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,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 ve(a,p+"return "+c).apply(void 0,u)});if(f.source=c,Hr(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?Gn(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 Dt(e);if(!e||!(t=Zl(t)))return e;var l=zt(e),o=zt(t);return uo(l,Pt(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,Vt(e)+1);if(!e||!(t=Zl(t)))return e;var l=zt(e);return uo(l,0,wt(l,zt(t))+1).join("")},In.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Zl(t)))return e;var l=zt(e);return uo(l,Pt(l,zt(t))).join("")},In.truncate=function(e,t){var n=30,l="...";if(Vr(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=zt(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),Gr(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 v=u.lastIndexOf(o);v>-1&&(u=u.slice(0,v))}return u+l},In.unescape=function(e){return(e=ua(e))&&F.test(e)?e.replace(x,$t):e},In.uniqueId=function(e){var t=++Te;return ua(e)+t},In.upperCase=Ba,In.upperFirst=Ha,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(Ka)},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 gl(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__,v=!!this.__actions__.length,p=i&&!c,m=a&&!v;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 p&&m?e.apply(this,r):(f=this.thru(s),p?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[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(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[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,v=0,p=an(u,this.__takeCount__);if(!n||!l&&o==u&&p==u)return to(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var f=-1,E=e[d+=t];++f<c;){var y=s[f],g=y.type,_=(0,y.iteratee)(E);if(2==g)E=_;else if(!_){if(1==g)continue e;break e}}m[v++]=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 Pn;){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:[Vi],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(Vi)},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}();$e?(($e.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(d)});const v=e=>{var t,n,l,o,i,r,a,u,d,s,c,v;let{locationDet:p,propertyAddress:m}=e,f=(Array.isArray(p)?p[0]:p)||(Array.isArray(m)?m[0]:m);if(console.log(f,"address_debug"),!f)return e;let E={city:(null==f||null===(t=f.city)||void 0===t?void 0:t.code)||(null==f||null===(n=f.city)||void 0===n?void 0:n.name)||(null==f?void 0:f.city),houseNo:(null==f?void 0:f.houseNo)||(null==f?void 0:f.houseDoorNo)||(null==f?void 0:f.doorNo),street:(null==f?void 0:f.street)||(null==f?void 0:f.buildingColonyName)||(null==f?void 0:f.streetName),landmark:(null==f?void 0:f.landmark)||(null==f?void 0:f.landmarkName),pincode:(null==f?void 0:f.pincode)||(null==f?void 0:f.pinCode),latitude:(null==f?void 0:f.latitude)||(null==f?void 0:f.Latitude),longitude:(null==f?void 0:f.longitude)||(null==f?void 0:f.Longitude),locality:{code:(null==f||null===(l=f.locality)||void 0===l?void 0:l.code)||(null==f||null===(o=f.locality)||void 0===o?void 0:o.name)||(null==f?void 0:f.locality),latitude:null==f||null===(i=f.locality)||void 0===i?void 0:i.latitude,longitude:null==f||null===(r=f.locality)||void 0===r?void 0:r.longitude},addressLine1:null==f?void 0:f.addressLine1,addressLine2:null==f?void 0:f.addressLine2,assembly:(null==f?void 0:f.assembly)||(null==f?void 0:f.Assembly),block:null==f?void 0:f.block,zone:null==f?void 0:f.zone,zroLocation:(null==f||null===(a=f.zro)||void 0===a?void 0:a.code)||(null==f?void 0:f.zro),addressType:(null==f||null===(u=f.addressType)||void 0===u?void 0:u.code)||(null==f?void 0:f.addressType),subLocality:(null==f?void 0:f.subLocality)||(null==f||null===(d=f.subLocality)||void 0===d?void 0:d.name)||(null==f?void 0:f.subLocality),actualWard:(null==f?void 0:f.actualWard)||(null==f||null===(s=f.actualWard)||void 0===s?void 0:s.name)||(null==f?void 0:f.actualWard),actualAssembly:(null==f?void 0:f.actualAssembly)||(null==f||null===(c=f.actualAssembly)||void 0===c?void 0:c.name)||(null==f?void 0:f.actualAssembly),actualZone:(null==f?void 0:f.actualZone)||(null==f||null===(v=f.actualZone)||void 0===v?void 0:v.name)||(null==f?void 0:f.actualZone)};return e.address=E,e},p=e=>{var t,n,l;const{locationDet:o,owners:i}=e;let r={},a=[],u=[];e.ownershipCategory=(null==e||null===(t=e.owners)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.ownershipCategory)||"INDIVIDUAL.SINGLEOWNER";const d="string"==typeof e.ownershipCategory?e.ownershipCategory:null===(l=e.ownershipCategory)||void 0===l?void 0:l.code;var s,c,v,p,m,f,E,y,g,_,h,S,b,T,C;if(null!=d&&d.includes("INSTITUTIONALPRIVATE")||null!=d&&d.includes("INSTITUTIONALGOVERNMENT"))r.designation=null==i||null===(s=i[0])||void 0===s?void 0:s.designation,r.name=null==i||null===(c=i[0])||void 0===c?void 0:c.institutionName,r.type=null==i||null===(v=i[0])||void 0===v||null===(p=v.institutionType)||void 0===p||null===(m=p.code)||void 0===m||null===(f=m.split("."))||void 0===f?void 0:f[1],r.landlineNumber=null==i||null===(E=i[0])||void 0===E?void 0:E.altContactNumber,r.tenantId=(null==o||null===(y=o.city)||void 0===y?void 0:y.code)||(null==o?void 0:o.city),a.push({altContactNumber:null==i||null===(g=i[0])||void 0===g?void 0:g.altContactNumber,permanentAddress:null==i||null===(_=i[0])||void 0===_?void 0:_.permanentAddress,correspondenceAddress:null==i||null===(h=i[0])||void 0===h?void 0:h.permanentAddress,sameAsPropertyAddress:(null==i||null===(S=i[0])||void 0===S?void 0:S.isCorrespondenceAddress)||(null==i||null===(b=i[0])||void 0===b?void 0:b.isCoresAddr),mobileNumber:null==i||null===(T=i[0])||void 0===T?void 0:T.mobileNumber,name:null==i||null===(C=i[0])||void 0===C?void 0:C.name,ownerType:"NONE",status:"ACTIVE",documents:u}),e.institution=r,e.owners=a;else if(i&&i.length>0)i.map(e=>{var t,n,l,o;a.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.code)||(null==e||null===(n=e.gender)||void 0===n?void 0:n.value)||(null==e?void 0:e.gender),sameAsPropertyAddress:(null==e?void 0:e.isCorrespondenceAddress)||(null==e?void 0:e.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)||(null==e?void 0:e.ownerType)||"NONE",permanentAddress:null==e?void 0:e.permanentAddress,relationship:(null==e||null===(o=e.relationship)||void 0===o?void 0:o.code)||(null==e?void 0:e.relationship),documents:(null==e?void 0:e.documents)||u})}),e.owners=a;else if(null!=e&&e.applicant&&null!=e&&e.contact){var A;const{applicant:t,contact:n,useDetails:l}=e;a.push({name:`${t.firstName}${t.middleName?" "+t.middleName:""}${t.lastName?" "+t.lastName:""}`,mobileNumber:n.mobileNumber,gender:(null==l||null===(A=l.gender)||void 0===A?void 0:A.code)||(null==l?void 0:l.gender)||"MALE",fatherOrHusbandName:t.ParentorSpouse||"NA",relationship:"FATHER",ownerType:"NONE",status:"ACTIVE"}),e.owners=a}return e},m=e=>{var t,n,l,o,i,r,a,u,d;let s={};const{waterConnection:c,useDetails:v}=e,p=(null==c?void 0:c.useDetails)||v;return s={propertyType:(null==p||null===(t=p.propertyType)||void 0===t?void 0:t.code)||(null==p?void 0:p.propertyType),usageCategory:(null==p||null===(n=p.propertyCategory)||void 0===n?void 0:n.code)||(null==p?void 0:p.propertyCategory),landArea:parseFloat(null==p?void 0:p.plotArea),superBuiltUpArea:parseFloat(null==p?void 0:p.builtUpArea),noOfFloors:"BASEMENT"===(null==p||null===(l=p.noOfFloors)||void 0===l?void 0:l.code)?0:parseInt((null==p||null===(o=p.noOfFloors)||void 0===o||null===(i=o.code)||void 0===i||null===(r=i.split("_"))||void 0===r?void 0:r[0])||(null==p||null===(a=p.noOfFloors)||void 0===a||null===(u=a.split)||void 0===u||null===(d=u.call(a,"_"))||void 0===d?void 0:d[0]))||1},e.propertyDetails=s,e},f=function(e){var t,n,l,o,i,r,a,u,d,s,c,f,E,y,g,_,h,S,b,T,C,A,D,N,I,O,P,w,R,L,x,M,F,k,U,B,H,j,W,z,V,$;void 0===e&&(e={}),e=p(e),e=v(e);let Y=null===(t=(e=m(e)).propertyDetails)||void 0===t?void 0:t.propertyType,K=(null===(n=e.propertyDetails)||void 0===n?void 0:n.noOfFloors)||1,q=null===(l=e)||void 0===l||null===(o=l.owners)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.ownershipCategory;const G={Property:{tenantId:e.tenantId,address:e.address,propertyType:Y,...e.propertyDetails,ownershipCategory:"INDIVIDUAL.SINGLEOWNER",usageCategory:null===(r=e.propertyDetails)||void 0===r?void 0:r.usageCategory,owners:[...(e.owners||[]).map((e,t)=>{var n,l,o,i,r;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:e.documents?Array.isArray(e.documents)?e.documents:Object.keys(e.documents).map(t=>{var n;const l=e.documents[t];return{documentType:(null==l||null===(n=l.documentType)||void 0===n?void 0:n.code)||(null==l?void 0:l.documentType)||"",fileStoreId:(null==l?void 0:l.fileStoreId)||""}}):[],gender:"string"==typeof e.gender?e.gender:(null===(n=e.gender)||void 0===n?void 0:n.code)||(null===(l=e.gender)||void 0===l?void 0:l.value),ownerType:(null===(o=e.ownerType)||void 0===o?void 0:o.code)||e.ownerType||"NONE",relationship:(null===(i=e.relationship)||void 0===i?void 0:i.code)||e.relationship,inistitutetype:null==e||null===(r=e.inistitutetype)||void 0===r?void 0:r.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})],noOfFloors:K,additionalDetails:{isRainwaterHarvesting:!1,propertyType:Y,propertyCategory:null===(a=e.propertyDetails)||void 0===a?void 0:a.usageCategory,categoryType:(null===(u=e.waterConnection)||void 0===u||null===(d=u.useDetails)||void 0===d||null===(s=d.categoryType)||void 0===s?void 0:s.code)||(null===(c=e.useDetails)||void 0===c||null===(f=c.categoryType)||void 0===f?void 0:f.code),waterConnectionUsageType:(null===(E=e.waterConnection)||void 0===E||null===(y=E.useDetails)||void 0===y||null===(g=y.WaterConnectionUsageType)||void 0===g?void 0:g.code)||(null===(_=e.useDetails)||void 0===_||null===(h=_.WaterConnectionUsageType)||void 0===h?void 0:h.code),yearOfConstruction:(null===(S=e.waterConnection)||void 0===S||null===(b=S.useDetails)||void 0===b||null===(T=b.SelectYearofConstruction)||void 0===T?void 0:T.value)||(null===(C=e.useDetails)||void 0===C||null===(A=C.SelectYearofConstruction)||void 0===A?void 0:A.value),numberOfDwellingUnits:(null===(D=e.waterConnection)||void 0===D||null===(N=D.useDetails)||void 0===N?void 0:N.NumberofDwellingUnits)||(null===(I=e.useDetails)||void 0===I?void 0:I.NumberofDwellingUnits),numberOfRooms:(null===(O=e.waterConnection)||void 0===O||null===(P=O.useDetails)||void 0===P?void 0:P.NumberofRooms)||(null===(w=e.useDetails)||void 0===w?void 0:w.NumberofRooms),numberOfFloors:(null===(R=e.waterConnection)||void 0===R||null===(L=R.useDetails)||void 0===L||null===(x=L.noOfFloors)||void 0===x?void 0:x.code)||(null===(M=e.useDetails)||void 0===M||null===(F=M.noOfFloors)||void 0===F?void 0:F.code)||1,plotArea:(null===(k=e.waterConnection)||void 0===k||null===(U=k.useDetails)||void 0===U?void 0:U.plotArea)||(null===(B=e.useDetails)||void 0===B?void 0:B.plotArea),builtUpArea:(null===(H=e.waterConnection)||void 0===H||null===(j=H.useDetails)||void 0===j?void 0:j.builtUpArea)||(null===(W=e.useDetails)||void 0===W?void 0:W.builtUpArea),numberOfBeds:(null===(z=e.waterConnection)||void 0===z||null===(V=z.useDetails)||void 0===V?void 0:V.hospitalBeds)||(null===($=e.useDetails)||void 0===$?void 0:$.hospitalBeds),owners:[...(e.owners||[]).map((e,t)=>{var n,l,o,i,r;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:e.documents?Array.isArray(e.documents)?e.documents:Object.keys(e.documents).map(t=>{var n;const l=e.documents[t];return{documentType:(null==l||null===(n=l.documentType)||void 0===n?void 0:n.code)||(null==l?void 0:l.documentType)||"",fileStoreId:(null==l?void 0:l.fileStoreId)||""}}):[],gender:"string"==typeof e.gender?e.gender:(null===(n=e.gender)||void 0===n?void 0:n.code)||(null===(l=e.gender)||void 0===l?void 0:l.value),ownerType:(null===(o=e.ownerType)||void 0===o?void 0:o.code)||e.ownerType||"NONE",relationship:(null===(i=e.relationship)||void 0===i?void 0:i.code)||e.relationship,inistitutetype:null==e||null===(r=e.inistitutetype)||void 0===r?void 0:r.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})]},creationReason:"CREATE",source:"MUNICIPAL_RECORDS",channel:"SYSTEM"}},Z="string"==typeof q?q:null==q?void 0:q.code;var X;return(null!=Z&&Z.includes("INSTITUTIONALPRIVATE")||null!=Z&&Z.includes("INSTITUTIONALGOVERNMENT"))&&(G.Property.institution=null===(X=e)||void 0===X?void 0:X.institution),G},E=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},y=e=>{var r;let{config:a,onSelect:d,value:s,userType:v}=e;const[p,m]=n.useState(null),E=Digit.ULBService.getCurrentTenantId(),{t:y}=(Digit.Hooks.pt.useTenants(),o.useTranslation()),g=i.useLocation(),[_,h]=n.useState(!0),S={...s};i.useHistory(),i.useRouteMatch(),sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!0);const b=window.Digit.Utils.browser.isMobile();let T=null===(r=Digit.Hooks.pt.useTenants())||void 0===r?void 0:r.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")&&(T=Digit.SessionStorage.get("OBPS_TENANTS")),window.location.href.includes("fsm")&&(T=Digit.SessionStorage.get("FSM_TENANTS"));const[C,A]=n.useState(""),[D,N]=n.useState([]);n.useEffect(()=>{if(null!=g&&g.state&&(!D||0===D.length)){var e,t,n,l;const o=null===(e=g.state)||void 0===e?void 0:e.applicant,i=null===(t=g.state)||void 0===t?void 0:t.contact,r=null===(n=g.state)||void 0===n?void 0:n.useDetails,a=null===(l=g.state)||void 0===l?void 0:l.propertyAddress;o&&i&&N([{name:`${o.firstName}${o.middleName?" "+o.middleName:""}${o.lastName?" "+o.lastName:""}`,mobileNumber:i.mobileNumber,gender:(null==r?void 0:r.gender)||{code:"MALE",name:"Male"},fatherOrHusbandName:o.ParentorSpouse||"NA",relationship:{code:"FATHER",name:"Father"},ownerType:{code:"NONE",name:"None"},ownershipCategory:"INDIVIDUAL.SINGLEOWNER"}]),(a||r)&&A({locationDet:{cityCode:(null==a?void 0:a.cityCode)||(null==a?void 0:a.city),locality:null==a?void 0:a.locality,houseDoorNo:(null==a?void 0:a.houseNo)||(null==a?void 0:a.houseDoorNo),buildingColonyName:(null==a?void 0:a.street)||(null==a?void 0:a.buildingColonyName),landmarkName:(null==a?void 0:a.landmark)||(null==a?void 0:a.landmarkName)},waterConnection:{useDetails:r}})}},[null==g?void 0:g.state]);const[I,O]=n.useState("");let P="employee"!=v&&((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"),U=Digit.Hooks.pt.usePropertyAPI(E,!0);return n.useEffect(()=>{R(!1),F()},[]),k?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"employee-form-section-wrapper"},l.createElement(t.VerticalTimeline,{config:[{timeLine:[{actions:(()=>{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")})(),currentStep:1}]}],showFinalStep:!1}),l.createElement(t.FormComposer,{onSkip:()=>{d("isSkip",!0)},showSkip:P,skipStyle:b?{}:{textAlign:"right",marginRight:"55px"},onSubmit:function(){try{var e,t,n,l,o,i,r;const a=D&&D.length>0?D:null==C?void 0:C.owners;if((null!=C&&null!==(e=C.owners)&&void 0!==e&&null!==(t=e.ownershipCategory)&&void 0!==t&&t.includes("MULTIPLEOWNERS")||null!=C&&null!==(n=C.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==C||null===(r=C.owners)||void 0===r?void 0:r.length))m({key:!0,label:"PT_COMMON_ONE_MORE_OWNER_INFROMATION_REQUIRED"});else if(a&&0!==a.length){const e=f({...C,owners:a});e.Property.tenantId=E,U.mutate(e,{onSuccess:e=>{var t,n,l,o;null!=e&&e.Errors&&(null==e?void 0:e.Errors.length)>0?m({key:!0,label:(null==e||null===(l=e.Errors[0])||void 0===l?void 0:l.message)||y("PT_COMMON_FAILED_TO_CREATE_PROPERTY")}):(m({key:!1,label:`${y("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS")} - ${null==e||null===(t=e.Properties)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.propertyId}`}),d&&d("cptNewProperty",{property:null==e||null===(o=e.Properties)||void 0===o?void 0:o[0]}))},onError:e=>{var t,n,l,o;m({key:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.Errors)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.message)||y("PT_COMMON_FAILED_TO_CREATE_PROPERTY")})}})}else m({key:!0,label:y("PT_COMMON_OWNER_DETAILS_REQUIRED")});return Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:u,label:y("SUBMIT"),isDisabled:!_,defaultValues:S,onFormValueChange:(e,t,n)=>{c.isEqual(t,C)||A(t),h(!0)},noBreakLine:!0,noCard:!0})),p&&l.createElement(t.Toast,{error:p.key,label:p.label,onClose:()=>{m(null)}}))},g=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")},h={padding:"4px 0px",justifyContent:"space-between"},S=e=>{var n,o,i;return l.createElement(t.Banner,{message:g(e),applicationNumber:null===(n=e.data)||void 0===n||null===(o=n.Properties)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.acknowldgementNumber,info:e.isSuccess?e.t("PT_APPLICATION_NO"):"",successful:e.isSuccess})},b=e=>{var r,a,u,d,s,c,E,y,g,_,b,T,C,A;let{onSuccess:D,onSelect:N,formData:I,redirectUrl:O,userType:P}=e;const{t:w}=o.useTranslation(),R=i.useLocation(),L=Digit.ULBService.getStateId(),x=Digit.ULBService.getCurrentTenantId(),M=i.useHistory();let F=null==R||null===(r=R.state)||void 0===r?void 0:r.data;var k;N&&(F=null==I||null===(k=I.cptNewProperty)||void 0===k?void 0:k.property);const U=(null==R||null===(a=R.state)||void 0===a?void 0:a.property)||(N&&null!=I&&null!==(u=I.cptNewProperty)&&void 0!==u&&u.property?null==I||null===(d=I.cptNewProperty)||void 0===d?void 0:d.property:null);let B=!1,{data:H}=Digit.Hooks.pt.useMDMS(L,"PropertyTax","PTWorkflow");((null==H||null===(s=H.PropertyTax)||void 0===s?void 0:s.PTWorkfow)||[]).forEach(e=>{e.enable&&e.businessService.includes("WNS")&&(B=!0)});const j=Digit.Hooks.pt.usePropertyAPI(null!==(c=F)&&void 0!==c&&null!==(E=c.locationDet)&&void 0!==E&&E.city?null===(y=F.locationDet)||void 0===y||null===(g=y.city)||void 0===g?void 0:g.code:x,!0),W=Digit.Hooks.pt.usePropertyAPI(null!==(_=F)&&void 0!==_&&null!==(b=_.locationDet)&&void 0!==b&&b.city?null===(T=F.locationDet)||void 0===T||null===(C=T.city)||void 0===C?void 0:C.code:x,!1);Digit.Hooks.useStore.getInitData(),n.useEffect(()=>{if(!U)try{var e,t,n,l;let o="employee"===P?x:null===(e=F)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;F.tenantId=o;let i=f(F);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,j.mutate(i,{onSuccess:D})}catch(e){}},[]),n.useEffect(()=>{new URLSearchParams(R.search).get("redirectToUrl")},[j]),n.useEffect(()=>{if(j.isSuccess&&B)try{var e,t,n,l;let o="employee"===P?x:null===(e=F)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;F.tenantId=o;let i=function(e){var t,n,l,o,i,r,a,u,d,s,c,f,E,y,g,_,h,S,b,T,C,A,D,N,I,O,P,w,R,L,x,M,F,k,U,B,H,j,W,z;void 0===e&&(e={}),e=p(e),e=v(e);let V=null===(t=(e=m(e)).propertyDetails)||void 0===t?void 0:t.propertyType,$=(null===(n=e.propertyDetails)||void 0===n?void 0:n.noOfFloors)||1;const Y={Property:{id:e.id,accountId:e.accountId,acknowldgementNumber:e.acknowldgementNumber,propertyId:e.propertyId,status:e.status||"INWORKFLOW",tenantId:e.tenantId,address:e.address,propertyType:V,ownershipCategory:"INDIVIDUAL.SINGLEOWNER",owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...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:$,additionalDetails:{isRainwaterHarvesting:!1,categoryType:(null===(l=e.waterConnection)||void 0===l||null===(o=l.useDetails)||void 0===o||null===(i=o.categoryType)||void 0===i?void 0:i.code)||(null===(r=e.useDetails)||void 0===r||null===(a=r.categoryType)||void 0===a?void 0:a.code),waterConnectionUsageType:(null===(u=e.waterConnection)||void 0===u||null===(d=u.useDetails)||void 0===d||null===(s=d.WaterConnectionUsageType)||void 0===s?void 0:s.code)||(null===(c=e.useDetails)||void 0===c||null===(f=c.WaterConnectionUsageType)||void 0===f?void 0:f.code),yearOfConstruction:(null===(E=e.waterConnection)||void 0===E||null===(y=E.useDetails)||void 0===y||null===(g=y.SelectYearofConstruction)||void 0===g?void 0:g.value)||(null===(_=e.useDetails)||void 0===_||null===(h=_.SelectYearofConstruction)||void 0===h?void 0:h.value),numberOfDwellingUnits:(null===(S=e.waterConnection)||void 0===S||null===(b=S.useDetails)||void 0===b?void 0:b.NumberofDwellingUnits)||(null===(T=e.useDetails)||void 0===T?void 0:T.NumberofDwellingUnits),numberOfRooms:(null===(C=e.waterConnection)||void 0===C||null===(A=C.useDetails)||void 0===A?void 0:A.NumberofRooms)||(null===(D=e.useDetails)||void 0===D?void 0:D.NumberofRooms),numberOfFloors:(null===(N=e.waterConnection)||void 0===N||null===(I=N.useDetails)||void 0===I||null===(O=I.noOfFloors)||void 0===O?void 0:O.code)||(null===(P=e.useDetails)||void 0===P||null===(w=P.noOfFloors)||void 0===w?void 0:w.code)||1,plotArea:(null===(R=e.waterConnection)||void 0===R||null===(L=R.useDetails)||void 0===L?void 0:L.plotArea)||(null===(x=e.useDetails)||void 0===x?void 0:x.plotArea),builtUpArea:(null===(M=e.waterConnection)||void 0===M||null===(F=M.useDetails)||void 0===F?void 0:F.builtUpArea)||(null===(k=e.useDetails)||void 0===k?void 0:k.builtUpArea),hospitalBeds:(null===(U=e.waterConnection)||void 0===U||null===(B=U.useDetails)||void 0===B?void 0:B.hospitalBeds)||(null===(H=e.useDetails)||void 0===H?void 0:H.hospitalBeds),owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...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 K=JSON.parse(sessionStorage.getItem("propertyInitialObject"));if(checkArrayLength(null==K?void 0:K.units)&&checkIsAnArray(null===(j=Y.Property)||void 0===j?void 0:j.units)&&null!==(W=e)&&void 0!==W&&W.isEditProperty){var q;K.units=K.units.filter(e=>e.active);let e=K.units.map(e=>({...e,active:!1}));null===(q=Y.Property)||void 0===q||q.units.push(...e)}return checkArrayLength(null==K?void 0:K.owners)&&checkIsAnArray(null===(z=Y.Property)||void 0===z?void 0:z.owners)&&(Y.Property.owners=[...K.owners]),null!=K&&K.auditDetails&&(Y.Property.auditDetails={...K.auditDetails}),Y}(F);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,W.mutate(i,{onSuccess:D})}catch(e){}},[j.isSuccess]);const z=!U&&(j.isLoading||j.isIdle),V=!!U||j.isSuccess,$=U?{Properties:[U]}:j.data;return z?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(S,{t:w,data:$,isSuccess:V,isLoading:z}),V&&l.createElement(t.CardText,null,window.location.href.includes("employee")?w("CS_CREATE_PROPERTY_SUCCESS_EMP_RESPONSE"):w("CS_CREATE_PROPERTY_SUCCESS_CITIZEN_RESPONSE")),!V&&l.createElement(t.CardText,null,w("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(t.StatusTable,null,V&&l.createElement(t.Row,{rowContainerStyle:h,last:!0,label:w("PT_COMMON_TABLE_COL_PT_ID"),text:null==$||null===(A=$.Properties[0])||void 0===A?void 0:A.propertyId,textStyle:{whiteSpace:"pre",width:"200%"}})),V&&(window.location.href.includes("/citizen/")||window.location.href.includes("/employee/"))&&l.createElement(t.SubmitBar,N?{label:w("CS_COMMON_PROCEED"),onSubmit:()=>{if(V){var e,t;sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(null==$||null===(e=$.Properties)||void 0===e?void 0:e[0])),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==$||null===(t=$.Properties)||void 0===t?void 0:t[0]));const r=new URLSearchParams(R.search).get("redirectToUrl"),a=O&&"undefined"!==O?O:r&&"undefined"!==r?r:null;var n,l,o,i;if(a)return void M.push(`${a}?propertyId=${null==$||null===(n=$.Properties[0])||void 0===n?void 0:n.propertyId}&tenantId=${null==$||null===(l=$.Properties[0])||void 0===l?void 0:l.tenantId}`,{...null==R||null===(o=R.state)||void 0===o?void 0:o.prevState});N&&N("cpt",{details:null==$||null===(i=$.Properties)||void 0===i?void 0:i[0]})}}}:{label:w("CS_COMMON_PROCEED"),onSubmit:()=>{const e=new URLSearchParams(R.search).get("redirectToUrl"),t=O&&"undefined"!==O?O:e&&"undefined"!==e?e:null;var n,l,o;t?M.push(`${t}?propertyId=${null==$||null===(n=$.Properties[0])||void 0===n?void 0:n.propertyId}&tenantId=${null==$||null===(l=$.Properties[0])||void 0===l?void 0:l.tenantId}`,{...null==R||null===(o=R.state)||void 0===o?void 0:o.prevState}):M.push(window.location.href.includes("/employee/")?"/digit-ui/employee":"/digit-ui/citizen")}}))},T=e=>{const n=r.useQueryClient(),a=i.useRouteMatch(),u=(o.useTranslation(),i.useLocation(),i.useHistory()),d=Digit.ULBService.getStateId(),[s,c,v]=Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{});let{isLoading:p}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=i.useLocation().search,f=new URLSearchParams(m).get("redirectUrl");return p?l.createElement(t.Loader,null):l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:""+a.path},l.createElement(y,{onSelect:function(e,t){try{return u.push({pathname:a.path+"/save-property",search:m,state:{property:null==t?void 0:t.property}}),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"citizen"})),l.createElement(i.Route,{exact:!0,path:a.path+"/save-property"},l.createElement(b,{data:s,onSuccess:()=>{v(),n.invalidateQueries("PT_CREATE_PROPERTY")},redirectUrl:f,userType:"citizen"})))},C=[{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"}]}];function A(){return(A=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)}var D="function"==typeof Symbol&&Symbol.for,N=D?Symbol.for("react.element"):60103,I=D?Symbol.for("react.portal"):60106,O=D?Symbol.for("react.fragment"):60107,P=D?Symbol.for("react.strict_mode"):60108,w=D?Symbol.for("react.profiler"):60114,R=D?Symbol.for("react.provider"):60109,L=D?Symbol.for("react.context"):60110,x=D?Symbol.for("react.async_mode"):60111,M=D?Symbol.for("react.concurrent_mode"):60111,F=D?Symbol.for("react.forward_ref"):60112,k=D?Symbol.for("react.suspense"):60113,U=D?Symbol.for("react.suspense_list"):60120,B=D?Symbol.for("react.memo"):60115,H=D?Symbol.for("react.lazy"):60116,j=D?Symbol.for("react.block"):60121,W=D?Symbol.for("react.fundamental"):60117,z=D?Symbol.for("react.responder"):60118,V=D?Symbol.for("react.scope"):60119;function $(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case N:switch(e=e.type){case x:case M:case O:case w:case P:case k:return e;default:switch(e=e&&e.$$typeof){case L:case F:case H:case B:case R:return e;default:return t}}case I:return t}}}function Y(e){return $(e)===M}var K={AsyncMode:x,ConcurrentMode:M,ContextConsumer:L,ContextProvider:R,Element:N,ForwardRef:F,Fragment:O,Lazy:H,Memo:B,Portal:I,Profiler:w,StrictMode:P,Suspense:k,isAsyncMode:function(e){return Y(e)||$(e)===x},isConcurrentMode:Y,isContextConsumer:function(e){return $(e)===L},isContextProvider:function(e){return $(e)===R},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===N},isForwardRef:function(e){return $(e)===F},isFragment:function(e){return $(e)===O},isLazy:function(e){return $(e)===H},isMemo:function(e){return $(e)===B},isPortal:function(e){return $(e)===I},isProfiler:function(e){return $(e)===w},isStrictMode:function(e){return $(e)===P},isSuspense:function(e){return $(e)===k},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===O||e===M||e===w||e===P||e===k||e===U||"object"==typeof e&&null!==e&&(e.$$typeof===H||e.$$typeof===B||e.$$typeof===R||e.$$typeof===L||e.$$typeof===F||e.$$typeof===W||e.$$typeof===z||e.$$typeof===V||e.$$typeof===j)},typeOf:$},q=s(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,v=e?Symbol.for("react.suspense"):60113,p=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,g=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case d:case s:case o:case r:case i:case v:return p;default:var E=p&&p.$$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,D=o,N=f,I=m,O=l,P=r,w=i,R=v,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=D,t.Lazy=N,t.Memo=I,t.Portal=O,t.Profiler=P,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)===v},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===r||e===i||e===v||e===p||"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===g||e.$$typeof===_||e.$$typeof===E)},t.typeOf=h}()}),G=s(function(e){e.exports="production"===process.env.NODE_ENV?K:q}),Z=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;function Q(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ee=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=Q(e),i=1;i<arguments.length;i++){for(var r in n=Object(arguments[i]))X.call(n,r)&&(o[r]=n[r]);if(Z){l=Z(n);for(var a=0;a<l.length;a++)J.call(n,l[a])&&(o[l[a]]=n[l[a]])}}return o},te="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ne=Function.call.bind(Object.prototype.hasOwnProperty),le=function(){};if("production"!==process.env.NODE_ENV){var oe=te,ie={},re=ne;le=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function ae(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(re(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,oe)}catch(e){r=e}if(!r||r instanceof Error||le((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 ie)){ie[r.message]=!0;var u=o?o():"";le("Failed "+n+" type: "+r.message+(null!=u?u:""))}}}ae.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ie={})};var ue=ae,de=function(){};function se(){return null}function ce(){}function ve(){}"production"!==process.env.NODE_ENV&&(de=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ve.resetWarningCache=ce;var pe=s(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(se),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+"]",te);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 G.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(ne(a,d)){var c=e(a,d,l,o,r+"."+d,te);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&de(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),se;function t(t,n,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&&de("Invalid argument supplied to oneOfType, expected an instance of array."),se;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return de("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(n)+" at index "+t+"."),se}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,te);if(null==d)return null;d.data&&ne(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 v in e){var p=e[v];if("function"!=typeof p)return u(l,o,r,v,c(p));var m=p(a,v,l,o,r+"."+v,te);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 v=ee({},t[n],e);for(var p in v){var m=e[p];if(ne(e,p)&&"function"!=typeof m)return u(l,o,r,p,c(m));if(!m)return new i("Invalid "+o+" `"+r+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=m(a,p,l,o,r+"."+p,te);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!==te){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 v(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=ue,l.resetWarningCache=ue.resetWarningCache,l.PropTypes=l,l}(G.isElement):function(){function e(e,t,n,l,o,i){if(i!==te){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:ve,resetWarningCache:ce};return n.PropTypes=n,n}()});function me(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 fe={type:"login"},Ee=e=>{var r,a,u,d,s,v,p;let{template:m,header:f,actionButtonLabel:E,onSelect:y,clearParams:g=(()=>{}),stateCode:_,redirectToUrl:h,searchQuery:S}=e;const{t:b}=o.useTranslation(),T=n.useRef(),{mobileNumber:C,propertyIds:A,oldPropertyIds:D,locality:N,city:I,tenantId:O,doorNo:P,name:w,PToffset:R}=Digit.Hooks.useQueryParams(),L={},[x,M]=n.useState(!1),F=Digit.ComponentRegistryService.getComponent("WSInfoLabel");let k,U,B=R;isNaN(parseInt(B))?k=5:(U=B,k=parseInt(B)+5);let H=isNaN(parseInt(B))?{sortOrder:"ASC",sortBy:"createdTime",offset:"0"}:{sortOrder:"ASC",sortBy:"createdTime",offset:U};Digit.Hooks.useClickOutside(T,()=>{M(!1)},x);const j=(null==S?void 0:S.mobileNumber)||(null==S?void 0:S.mobileNo),W=(null==S?void 0:S.propertyIds)||(null==S?void 0:S.propertyId),z=(null==S?void 0:S.oldPropertyIds)||(null==S?void 0:S.oldPropertyId),V=e=>e&&"undefined"!==e?e:null,$=V(C)||V(j);$&&(L.mobileNumber=$);const Y=V(A)||V(W);Y&&(L.propertyIds=Y);const K=V(D)||V(z);K&&(L.oldPropertyIds=K);const q=V(N)||V(null==S?void 0:S.locality);q&&(L.locality=q);const G=V(P)||V(null==S?void 0:S.doorNo);G&&(L.doorNo=G);const Z=V(w)||V(null==S?void 0:S.name);Z&&(L.name=Z),L.limit=H.limit,L.sortOrder=H.sortOrder,L.sortBy=H.sortBy,L.offset=H.offset,L.status||(L.status="ACTIVE,INWORKFLOW");const[X,J,Q]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS",null),[ee,te,ne]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH",null),le=(i.useRouteMatch(),Digit.Hooks.useQueryParams());n.useEffect(()=>{J([]),g(),te("")},[]);const oe=Digit.ULBService.getCurrentTenantId(),ie=I||O||(null==S?void 0:S.city)||oe,re=Digit.Hooks.pt.usePropertySearch(ie?{tenantId:ie,filters:L,auth:!1}:{filters:L,auth:!1},{privacy:Digit.Utils.getPrivacyObject()}),ae=(null==re||null===(r=re.data)||void 0===r?void 0:r.Properties)||(null==re||null===(a=re.data)||void 0===a?void 0:a.properties)||(Array.isArray(null==re?void 0:re.data)?null==re?void 0:re.data:[]),ue=null==ae||null===(u=ae.map)||void 0===u?void 0:u.call(ae,e=>e.propertyId||e.id).filter(e=>e).join(",");!re.isSuccess||ae&&0!==ae.length||console.warn("Property Search: No properties found in result.data",re.data);const de=Digit.Hooks.useFetchBillsForBuissnessService({businessService:"PT",...C?{mobileNumber:C,consumerCode:ue}:{consumerCode:ue},tenantId:ie},{enabled:!(!ue||!ie),retry:!1}),se=i.useHistory();if(de.isLoading||re.isLoading)return l.createElement(t.Loader,null);if(re.error||re.isSuccess&&(!ae||0===ae.length))return l.createElement("div",{style:{height:"150px"}},l.createElement(t.Card,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},b("CS_PT_NO_PROPERTIES_FOUND")));const ce={};null==de||null===(d=de.data)||void 0===d||null===(s=d.Bill)||void 0===s||s.forEach(e=>{null!=e&&e.consumerCode&&(ce[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 ve=null===(v=ae||[])||void 0===v?void 0:v.map(e=>{var t,n,l,o,i,r,a,u,d,s,v,p,m;let f=(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)||0)-((null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)||0)}))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.name,property_address:[f.doorNo||"",f.buildingName||"",f.street||"",b("TENANTS_MOHALLA_"+(null===(l=f.locality)||void 0===l?void 0:l.code))!=="TENANTS_MOHALLA_"+(null===(o=f.locality)||void 0===o?void 0:o.code)?b("TENANTS_MOHALLA_"+(null===(i=f.locality)||void 0===i?void 0:i.code)):(null===(r=f.locality)||void 0===r?void 0:r.name)||""].filter(e=>e).join(", "),zroLocation:(null==e||null===(a=e.address)||void 0===a?void 0:a.zroLocation)||(null==e||null===(u=e.address)||void 0===u?void 0:u.zroLocation),total_due:(null===(d=ce[null==e?void 0:e.propertyId])||void 0===d?void 0:d.total_due)||0,bil_due__date:(null===(s=ce[null==e?void 0:e.propertyId])||void 0===s?void 0:s.bil_due__date)||b("N/A"),status:b(e.status),owner_mobile:null===(v=((null==e?void 0:e.owners)||[])[0])||void 0===v?void 0:v.mobileNumber,address:null==e?void 0:e.address,owners:e.owners,propertyDetails:e,privacy:{property_address:{uuid:null==e||null===(p=e.owners)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.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=>(c.get(e,"Properties[0].address.doorNo")?c.get(e,"Properties[0].address.doorNo")+", ":"")+(c.get(e,"Properties[0].address.street")?c.get(e,"Properties[0].address.street")+", ":"")+(c.get(e,"Properties[0].address.landmark")?""+c.get(e,"Properties[0].address.landmark"):"")}}}}}),pe=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen";return l.createElement("div",{style:{marginTop:"16px"}},l.createElement("div",null,f&&l.createElement(t.Header,{style:{marginLeft:"8px"}},b(f)," (",null==ve?void 0:ve.length,")"),F&&l.createElement(F,{t:b}),window.Digit.Utils.browser.isMobile()?l.createElement(t.ResponseComposer,{data:ve,template:m,actionButtonLabel:E,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(!y){const t={mobileNumber:null==e?void 0:e.owner_mobile,tenantId:_,userType:Digit.UserService.getType()};return Promise.resolve(function(e){return Promise.resolve(me(function(){return Promise.resolve(Digit.UserService.sendOtp(e,_)).then(function(e){return[e,null]})},function(e){return[null,e]}))}({otp:{...t,...fe}})).then(function(n){let[l,o]=n;if(o)se.push("/digit-ui/citizen/",{from:pe(location.state,le),data:t});else{let t="/digit-ui/citizen/commonPt/property/link-success/"+e.property_id;h&&(t=h+"?propertyId="+e.property_id+"&tenantId="+oe),se.replace("/digit-ui/citizen/commonPt/property/citizen-otp",{from:pe(location.state,le),mobileNumber:e.owner_mobile,redirectBackTo:t})}})}y("cptId",{id:e.property_id})}())}catch(e){return Promise.reject(e)}}}):l.createElement(t.Table,{t:b,data:ve,totalCount:null==ve?void 0:ve.length,totalRecords:null==ve?void 0:ve.length,manualPagination:!1,disableSort:!0,columns:[{Header:b("PT_PROPERTY_PTUID"),disableSortBy:!0,accessor:"property_id"},{Header:b("PT_OWNER_NAME"),disableSortBy:!0,accessor:"owner_name"},{Header:b("PT_PROPERTY_ADDRESS_SUB_HEADER"),disableSortBy:!0,accessor:"property_address"},{Header:b("zroLocation"),disableSortBy:!0,accessor:"zroLocation"}]})),x?l.createElement(t.Modal,{hideSubmit:!0,isDisabled:!1,popupStyles:{width:"319px",height:"250px",margin:"auto"},formId:"modal-action"},l.createElement("div",{ref:T},l.createElement(t.KeyNote,{keyValue:b("PT_AMOUNT_DUE"),note:"₹ "+(null==x||null===(p=x.total_due)||void 0===p?void 0:p.toLocaleString("en-IN")),noteStyle:{fontSize:"24px",fontWeight:"bold"}}),l.createElement("p",null,b("PT_YOU_HAVE")+" ₹ "+(null==x?void 0:x.total_due.toLocaleString("en-IN"))+" "+b("PT_PENDING_AMOUNT")+" "+b("PT_INORDER_TO_TRANSFER")),l.createElement(t.SubmitBar,{submit:!1,onSubmit:()=>{se.push("/digit-ui/citizen/payment/my-bills/PT/"+x.property_id,{tenantId:oe})},style:{marginTop:"14px",width:"100%"},label:b("PT_PROCEED_PAYMENT")}))):null,0===(null==ve?void 0:ve.length)&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_NO_PROP_FOUND_MSG")),0!==(null==ve?void 0:ve.length)&&(5==(null==ve?void 0:ve.length)||50==(null==ve?void 0:ve.length))&&(N||S&&S.locality)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_LOAD_MORE_MSG")," ",l.createElement("span",{className:"link"},l.createElement(i.Link,{to:`/digit-ui/citizen/pt/property/search-results?mobileNumber=${C||S.mobileNumber?C||(null==S?void 0:S.mobileNumber):""}&propertyIds=${A||null!=S&&S.propertyIds?A||(null==S?void 0:S.propertyIds):""}&oldPropertyIds=${D||null!=S&&S.oldPropertyIds?D||(null==S?void 0:S.oldPropertyIds):""}&doorNo=${P||null!=S&&S.doorNo?P||(null==S?void 0:S.doorNo):""}&name=${w||null!=S&&S.name?w||(null==S?void 0:S.name):""}&city=${I||""}&locality=${N||null!=S&&S.locality?N||(null==S?void 0:S.locality):""}&PToffset=${k}`},b("PT_COMMON_CLICK_HERE"))))))};Ee.propTypes={template:pe.any,header:pe.string,actionButtonLabel:pe.string},Ee.defaultProps={template:[],header:null,actionButtonLabel:null};const ye=e=>{var r,a,u,d,s,v,p,m,f,E,y,g,_;let{config:h,onSelect:S,redirectToUrl:b}=e;const{t:T}=o.useTranslation(),C=i.useHistory(),{action:D=0}=Digit.Hooks.useQueryParams(),[N,I]=n.useState(()=>{var e,t;const n=null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber,l=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getStateId()||"dl";return n&&window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")?{filters:{mobileNumber:n},city:l}:{}}),[O,P]=n.useState(null);sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!1);let w=null===(r=Digit.Hooks.pt.useTenants())||void 0===r?void 0:r.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)});w=w||(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")?w=Digit.SessionStorage.get("OBPS_TENANTS"):window.location.href.includes("fsm")&&(w=[{i18nKey:"TENANT_TENANTS_PG_CITYA",code:Digit.ULBService.getCurrentTenantId(),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:Digit.ULBService.getCurrentTenantId(),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",w);const[R,L]=n.useState(),[x,M]=n.useState(),[F,k]=n.useState(!1);window.Digit.Utils.browser.isMobile();const{data:U,isLoading:B,error:H}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:null==N?void 0:N.city,filters:null==N?void 0:N.filters,auth:!1,configs:{enabled:Object.keys(N).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}});n.useEffect(()=>{var e,t,n;(null==N||null===(e=N.filters)||void 0===e||!e.mobileNumber||1!=(null===(t=Object.values(null==N?void 0:N.filters))||void 0===t||null===(n=t.filter(e=>void 0!==e))||void 0===n?void 0:n.length))&&(null==U?void 0:U.Properties.length)>0&&null!=j&&j.maxResultValidation&&(null==U?void 0:U.Properties.length)>(null==j?void 0:j.maxPropertyResult)&&!F&&P({error:!0,warning:!0,label:"ERR_PLEASE_REFINED_UR_SEARCH"})},[U]),n.useEffect(()=>{O&&"ERR_PLEASE_REFINED_UR_SEARCH"!==(null==O?void 0:O.label)&&"NO_PROPERTIES_FOUND"!==(null==O?void 0:O.label)&&P(null)},[D,B]),n.useEffect(()=>{var e;!B&&U&&N&&(null==U||null===(e=U.Properties)||void 0===e?void 0:e.length)<=0&&P({error:!0,warning:!0,label:"NO_PROPERTIES_FOUND"})},[null==U||null===(u=U.Properties)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.propertyId,B]),n.useLayoutEffect(()=>{const e=()=>{let t=document.querySelector("div.action-bar-wrap"),n=document.querySelector(".primary-label-btn");t&&n?(t.style.position="static",t.style.padding="8px 0",t.style.boxShadow="none",t.style.marginBottom="16px",t.style.display="flex",t.style.justifyContent="flex-end",t.style.alignItems="center",t.style.zIndex="0",n.style.margin="0",n.style.marginRight="24px",n.style.marginLeft="auto",n.parentElement!==t&&t.insertBefore(n,t.firstChild)):setTimeout(()=>{e()},100)};e()},[D]);const{data:j,isLoading:W}=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}}),[z,V,$,Y,K]=h.inputs,q=[{body:[{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:(null===(s=w)||void 0===s?void 0:s.find(e=>"dl.djb"===e.code||"dl"===e.code))||(null===(v=w)||void 0===v?void 0:v[0])||null,rules:{required:!0},customProps:{t:T,isMandatory:!0,option:[...w],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,A({},n,{disable:!0,selected:e.value,select:t=>{Digit.ULBService.getCurrentTenantId(),t.code!==R&&e.setValue("locality",null),e.onChange(t)}}))}},{label:z.label,type:z.type,populators:{defaultValue:(null===(p=Digit.UserService.getUser())||void 0===p||null===(m=p.info)||void 0===m?void 0:m.mobileNumber)||"",name:z.name,validation:null==z?void 0:z.validation},isMandatory:!1},{label:"",labelChildren:l.createElement("div",{className:"tooltip"},l.createElement("div",{style:{display:"flex",gap:"0 4px"}},l.createElement("h2",null,T(V.label)),l.createElement(t.InfoBannerIcon,{fill:"#0b0c0c"}),l.createElement("span",{className:"tooltiptext",style:{position:"absolute",width:"72%",marginLeft:"50%",fontSize:"medium"}},T(V.description)+" PG-PT-xxxx-xxxxxx"))),type:V.type,populators:{name:V.name,defaultValue:"",validation:null==V?void 0:V.validation},isMandatory:!1,isInsideBox:!0,placementinbox:1}],body1:[{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:(null===(f=w)||void 0===f?void 0:f.find(e=>"dl.djb"===e.code||"dl"===e.code))||(null===(E=w)||void 0===E?void 0:E[0])||null,rules:{required:!0},customProps:{t:T,isMandatory:!0,option:[...w],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,A({},n,{disable:!0,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!==R&&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:R,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10",maxHeight:"300px"},selected:null==x?void 0:x.locality,disable:!R,disableLoader:!0})}},{label:K.label,type:K.type,populators:{defaultValue:"",name:K.name,validation:null==K?void 0:K.validation},isMandatory:!1},{label:Y.label,type:Y.type,populators:{defaultValue:"",name:Y.name,validation:null==Y?void 0:Y.validation},isMandatory:!1}]}];if(W)return l.createElement(t.Loader,null);let G=!(null!=j&&j.maxResultValidation&&(null==N||null===(y=N.filters)||void 0===y||!y.mobileNumber||1!=(null===(g=Object.values(null==N?void 0:N.filters))||void 0===g||null===(_=g.filter(e=>void 0!==e))||void 0===_?void 0:_.length)))||(null==U?void 0:U.Properties.length)<(null==j?void 0:j.maxPropertyResult)&&(null==O||null!==O&&!(null!=O&&O.error));if(U&&!B&&!H&&G){var Z,X,J,Q,ee;let e={};if(e={...N.filters,city:N.city},(null==N||null===(Z=N.filters)||void 0===Z||!Z.mobileNumber||1!=(null===(X=Object.values(null==N?void 0:N.filters))||void 0===X||null===(J=X.filter(e=>void 0!==e))||void 0===J?void 0:J.length))&&null!=j&&j.ptSearchCount&&null!=N&&null!==(Q=N.filters)&&void 0!==Q&&Q.locality&&B&&null!=B&&null!==(ee=B.Properties)&&void 0!==ee&&ee.length&&B.Properties.length>(null==j?void 0:j.ptSearchCount))!O&&P({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"});else if("MUTATION"===h.action)S(h.key,e,null,null,null,{queryParams:{...e}});else if(b&&!window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search"))C.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(e).filter(t=>void 0!==e[t]&&""!==e[t]).map(t=>`${t}=${e[t]}`).join("&")}${b?"&redirectToUrl="+b:""}`);else if(!window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")){var te,ne,le,oe,ie,re,ae,ue,de,se;let t={};t=0==D?{city:null===(te=e)||void 0===te?void 0:te.city,mobileNumber:(null===(ne=e)||void 0===ne?void 0:ne.mobileNumber)||"",propertyIds:(null===(le=e)||void 0===le?void 0:le.propertyIds)||"",oldPropertyIds:(null===(oe=e)||void 0===oe?void 0:oe.oldPropertyIds)||"",locality:"",doorNo:"",name:""}:{city:null===(ie=e)||void 0===ie?void 0:ie.city,locality:(null===(re=e)||void 0===re?void 0:re.locality)||"",doorNo:(null===(ae=e)||void 0===ae?void 0:ae.doorNumber)||(null===(ue=e)||void 0===ue?void 0:ue.doorNo)||"",name:(null===(de=e)||void 0===de?void 0:de.name)||"",mobileNumber:"",propertyIds:"",oldPropertyIds:""},!B&&(null==U||null===(se=U.Properties)||void 0===se?void 0:se.length)>0&&S("cptSearchQuery",t,null,null,null,{queryParams:{...t}})}}var ce,ve,pe,me;return H&&!O&&P({error:!0,label:(null==H||null===(ce=H.response)||void 0===ce||null===(ve=ce.data)||void 0===ve||null===(pe=ve.Errors)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.code)||H}),1==D&&(q[0].body=[...q[0].body1]),l.createElement("div",null,l.createElement("div",{className:"search-tabs-container",style:{marginBottom:"16px",display:"flex",gap:"24px",justifyContent:"flex-start",borderBottom:"1px solid #ccc"}},l.createElement("div",{className:"search-tab "+(0==D?"active":""),style:{padding:"8px 16px",cursor:"pointer",borderBottom:0==D?"2px solid #f47738":"2px solid transparent",color:0==D?"#f47738":"#0b0c0c",fontWeight:0==D?"bold":"normal"},onClick:()=>{var e,t;C.replace(C.location.pathname+"?action=0");const n=null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber,l=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getStateId()||"dl";I(n?{filters:{mobileNumber:n},city:l}:{})}},T("PT_KNOW_PTID")),l.createElement("div",{className:"search-tab "+(1==D?"active":""),style:{padding:"8px 16px",cursor:"pointer",borderBottom:1==D?"2px solid #f47738":"2px solid transparent",color:1==D?"#f47738":"#0b0c0c",fontWeight:1==D?"bold":"normal"},onClick:()=>{var e,t;C.replace(C.location.pathname+"?action=1");const n=null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber,l=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getStateId()||"dl";I(n?{filters:{mobileNumber:n},city:l}:{})}},T("PT_SEARCH_DOOR_NO")),l.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center"}},window.location.href.includes("/obps/bpa/")?l.createElement(i.Link,{to:"/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location",style:{padding:"8px 24px",textDecoration:"none",borderRadius:"2px"}},T("CORE_COMMON_SKIP_CONTINUE")):l.createElement(i.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",style:{padding:"8px 24px",textDecoration:"none",borderRadius:"2px"}},T("CPT_REG_NEW_PROPERTY")))),l.createElement(t.FormComposer,{key:D,onSubmit:function(e){try{var t,n;if(null!=j&&j.maxResultValidation&&(null==U?void 0:U.Properties.length)>0&&(null==U?void 0:U.Properties.length)>(null==j?void 0:j.maxPropertyResult)&&F)return k(!0),Promise.resolve();if(null==e||null===(t=e.city)||void 0===t||!t.code)return P({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(0==D){var l,o,i,r,a,u,d,s,c,v,p,m,f,E,y;if(!(null!=e&&e.mobileNumber||null!=e&&e.propertyIds||null!=e&&e.oldPropertyId))return P({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==z||null===(o=z.validation)||void 0===o||null===(i=o.pattern)||void 0===i?void 0:i.value)))return P({error:!0,label:null==z||null===(v=z.validation)||void 0===v||null===(p=v.pattern)||void 0===p?void 0:p.message}),Promise.resolve();if(null!=e&&e.propertyIds&&(null===(r=e.propertyIds)||void 0===r||!r.match(null==V||null===(a=V.validation)||void 0===a||null===(u=a.pattern)||void 0===u?void 0:u.value)))return P({error:!0,label:null==V||null===(m=V.validation)||void 0===m||null===(f=m.pattern)||void 0===f?void 0:f.message}),Promise.resolve();if(null!=e&&e.oldPropertyId&&(null===(d=e.oldPropertyId)||void 0===d||!d.match(null==$||null===(s=$.validation)||void 0===s||null===(c=s.pattern)||void 0===c?void 0:c.value)))return P({error:!0,label:null==$||null===(E=$.validation)||void 0===E||null===(y=E.pattern)||void 0===y?void 0:y.message}),Promise.resolve()}else{var g,_,h,S,b,T,C,A,N,w,R;if(null==e||null===(g=e.locality)||void 0===g||!g.code)return P({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(!(null!=e&&e.doorNumber||null!=e&&e.name))return P({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.name&&(null===(_=e.name)||void 0===_||!_.match(null==Y||null===(h=Y.validation)||void 0===h||null===(S=h.pattern)||void 0===S?void 0:S.value)))return P({error:!0,label:null==Y||null===(A=Y.validation)||void 0===A||null===(N=A.pattern)||void 0===N?void 0:N.message}),Promise.resolve();if(null!=e&&e.doorNumber&&(null===(b=e.doorNumber)||void 0===b||!b.match(null==K||null===(T=K.validation)||void 0===T||null===(C=T.pattern)||void 0===C?void 0:C.value)))return P({error:!0,label:null==K||null===(w=K.validation)||void 0===w||null===(R=w.pattern)||void 0===R?void 0:R.message}),Promise.resolve()}"ERR_PLEASE_REFINED_UR_SEARCH"===(null==O?void 0:O.label)&&"NO_PROPERTIES_FOUND"===(null==O?void 0:O.label)||P(null),null!=e&&e.doorNumber&&""!==(null==e?void 0:e.doorNumber)&&""!==(null==e?void 0:e.propertyIds)&&(e.propertyIds="");let G=Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{}),Z=G.city;var L,x,M;if(G.doorNo=G.doorNumber||(null===(n=G)||void 0===n?void 0:n.doorNo),delete G.addParam,delete G.addParam1,delete G.city,"0"===D)G={oldPropertyId:null===(L=G)||void 0===L?void 0:L.oldPropertyId,mobileNumber:null===(x=G)||void 0===x?void 0:x.mobileNumber,propertyIds:null===(M=G)||void 0===M?void 0:M.propertyIds};else if("1"===D){var B,H,W,q;G={name:null===(B=G)||void 0===B?void 0:B.name,doorNo:(null===(H=G)||void 0===H?void 0:H.doorNumber)||(null===(W=G)||void 0===W?void 0:W.doorNo),locality:null===(q=G)||void 0===q?void 0:q.locality}}return I({city:Z,filters:G}),Promise.resolve()}catch(e){return Promise.reject(e)}},config:q,label:h.texts.submitButtonLabel,secondaryActionLabel:T("ES_COMMON_CLEAR_SEARCH"),onSecondayActionClick:()=>{I({}),C.replace(C.location.pathname+"?action=0")},text:T(h.texts.text),onFormValueChange:(e,t,n)=>{const l=(null==t?void 0:t.city)||w[0];console.log("citycity",l),L(l.code),(null==l?void 0:l.code)!==R&&L(null==l?void 0:l.code),c.isEqual(t,x)||M(t)}}),Object.keys(N).length>0&&l.createElement(Ee,{searchQuery:{...N.filters,city:N.city},city:N.city,stateCode:Digit.ULBService.getStateId(),onSelect:S,config:h}),O&&l.createElement(t.Toast,{isDleteBtn:!0,error:O.error,warning:O.warning,label:T(O.label),onClose:()=>{P(null)}}))};ye.propTypes={loginParams:pe.any},ye.defaultProps={loginParams:null};const ge=e=>{let{onSelect:t}=e;const{t:r}=o.useTranslation(),{path:a}=i.useRouteMatch(),u=i.useLocation().search,d=new URLSearchParams(u).get("redirectToUrl"),s=n.useMemo(()=>C.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[C]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+a,exact:!0},l.createElement(ye,{config:s[0],onSelect:t,redirectToUrl:d})))},_e=[{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"}]}],he=[{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}}]}],Se=e=>{const{config:t,onSelect:r,clearParams:a,formData:u,stateCode:d}=e,{t:s}=o.useTranslation(),{path:c}=i.useRouteMatch(),v=i.useLocation().search,p=new URLSearchParams(v).get("redirectToUrl");let m=_e;const f=n.useMemo(()=>{var e;return null==m||null===(e=m.map)||void 0===e?void 0:e.call(m,e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}})},[m]);return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+c,exact:!0},l.createElement(Ee,{template:f[0].labels,header:f[0].texts.header,actionButtonLabel:f[0].texts.actionButtonLabel,t:s,isMutation:"MUTATION"===(null==t?void 0:t.action),onSelect:r,config:t,clearParams:a,stateCode:d,redirectToUrl:p,searchQuery:null==u?void 0:u.cptSearchQuery})))},be=e=>{let{onSelect:r}=e;const{t:a}=o.useTranslation(),{propertyIds:u}=i.useParams(),d=i.useHistory(),{data:s}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:u}},{filters:{propertyIds:u}}),[c,v]=n.useState(()=>(null==s?void 0:s.Properties[0])||" ");return n.useEffect(()=>{s&&v(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,r?{submit:!1,label:a("CS_COMMONS_NEXT"),onSubmit:()=>{r&&r("propertyId",u)}}:{submit:!1,label:a("PT_PROPERTY_CREATE"),onSubmit:()=>d.push("/digit-ui/citizen/commonPt/property/new-application")}))))},Te=e=>{let{config:o,otp:i,onOtpChange:r,onResend:a,onSelect:u,t:d,error:s,userType:c="citizen"}=e;const[v,p]=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])}(()=>{p(v-1)},v>0?1e3:null);const m=()=>{a(),p(2)};return"employee"===c?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),v>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${v} ${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}),v>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${v} ${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")))},Ce=e=>{const{t:t}=o.useTranslation(),r=(i.useRouteMatch(),i.useLocation()),a=i.useHistory(),[u,d]=n.useState({mobileNumber:r.state.mobileNumber,otp:""}),[s,c]=n.useState(!0),v=()=>Digit.UserService.getType(),p=n.useMemo(()=>he.map(e=>{const n={};for(const l in e.texts)n[l]=t(e.texts[l]);return{...e,texts:n}},[he]));return l.createElement(Te,{config:{...p[1],texts:{...p[1].texts,cardText:`${p[1].texts.cardText} ${u.mobileNumber||""}`}},onOtpChange:e=>{d({...u,otp:e})},onResend:function(){try{const{mobileNumber:t}=u,n={mobileNumber:t,tenantId:e.stateCode,userType:v()};return Promise.resolve(sendOtp({otp:{...n,...TYPE_LOGIN}})).then(function(){})}catch(e){return Promise.reject(e)}},onSelect:function(){try{const t=me(function(){c(!0);const{mobileNumber:t,otp:n}=u,l={username:t,password:n,tenantId:e.stateCode,userType:v()};return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){var t;let{...n}=e;var l,o;null!==(t=r.state)&&void 0!==t&&t.redirectBackTo?a.replace(null===(l=r.state)||void 0===l?void 0:l.redirectBackTo,{data:null===(o=r.state)||void 0===o?void 0:o.redirectData}):a.replace("digit-ui/citizen/")})},function(){c(!1)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},otp:u.otp,error:s,t:t})},Ae=e=>l.createElement("h1",{className:"heading-m"},e.label),De=()=>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"})),Ne=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(De,null)),Ie=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=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)}),{isLoading:E,data:y}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,_]=n.useState({}),[h,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState(null),[D,N]=n.useState(null),[I,O]=n.useState(null),[P,w]=n.useState(null),[R,L]=n.useState([]),[x,M]=n.useState(null),[F,k]=n.useState(!1);function U(e){N(e.target.files[0])}return n.useEffect(()=>{var e;y&&y["egf-master"]&&L(null===(e=y["egf-master"])||void 0===e?void 0:e.FinancialYear)},[y]),n.useEffect(()=>{var e;T(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{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,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)}}()},[D]),n.useEffect(()=>{a&&_(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:R,selectedFinancialYear:x,setSelectedFinancialYear:M}):(e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${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(v||"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:b,selectedApprover:C,setSelectedApprover:A,selectFile:U,uploadedFile:I,setUploadedFile:O,businessService:v}))},[a,b,R,x,I]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ae,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Ne,{onClick:d}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!x:f||(null==a?void 0:a.docUploadRequired)&&!I,formId:"modal-action"},E?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"};c.creationReason="STATUS",s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:{...c,workflow:t}})}else if(null!=a&&a.showFinancialYearsModal)s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==x?void 0:x.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,source:null==c?void 0:c.source,channel:null==c?void 0:c.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=a&&a.isTerminateState||!C?[]:[C],I&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:I}]),s({Property:{...c,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Oe=e=>l.createElement("h1",{className:"heading-m"},e.label),Pe=()=>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"})),we=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pe,null)),Re=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const{data:p}=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:m,data:f}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,y]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,N]=n.useState(null),[I,O]=n.useState(null),[P,w]=n.useState([]),[R,L]=n.useState(null);function x(e){A(e.target.files[0])}return n.useEffect(()=>{var e;f&&f["egf-master"]&&w(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]),n.useEffect(()=>{var e;S(null==p||null===(e=p.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}}))},[p]),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=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(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_NEWTL_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("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:h,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:v}))},[a,h,P,R,D]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Oe,{label:r(E.label.heading)}),headerBarEnd:l.createElement(we,{onClick:d}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,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:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null},s({Licenses:[c]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Le=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),xe=()=>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"})),Me=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xe,null)),Fe=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const{data:p,isLoading: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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState({}),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function P(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==p||null===(e=p.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}}))},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))I(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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)}}()},[T]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(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_BPAREG_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("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:v})}]}]}})({t:r,action:a,approvers:_,selectedApprover:S,setSelectedApprover:b,selectFile:P,uploadedFile:A,setUploadedFile:D,businessService:v,error:N}))},[a,_,A,N]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Le,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Me,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:A?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},ke=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"})),Be=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ue,null)),He=e=>{var o,i,a,u,d,s,c,v,p,m,f,E;let{t:y,action:g,tenantId:_,closeModal:h,submitAction:S,applicationDetails:b,applicationData:T,businessService:C,workflowDetails:A}=e;Digit.Hooks.obps.useObpsAPI(null!==(o=T)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(u=T)||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:_,!1);const{data:D,isLoading:N}=Digit.Hooks.useEmployeeSearch(_,{roles:null==A||null===(c=A.data)||void 0===c||null===(v=c.initialActionState)||void 0===v||null===(p=v.nextActions)||void 0===p||null===(m=p.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===m||null===(f=m[0])||void 0===f||null===(E=f.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[I,O]=(r.useQueryClient(),n.useState({})),[P,w]=n.useState({}),[R,L]=n.useState([]),[x,M]=n.useState({}),[F,k]=n.useState(null),[U,B]=n.useState(null),[H,j]=n.useState(null),[W,z]=n.useState(null),V=!!Digit.Utils.browser.isMobile();function $(e){k(e.target.files[0])}n.useEffect(()=>{var e;L(null==D||null===(e=D.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}}))},[D]),n.useEffect(()=>{!function(){try{j(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)j(y("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))j(y("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==_?void 0:_.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?B(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):j(y("CS_FILE_UPLOAD_ERROR"))})},function(){j(y("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)}}()},[F]);const Y=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},K=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},q=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:Y(e.Documents),date:e.InspectionDate,questions:K(e),time:null==e?void 0:e.InspectionTime})}),o=o.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},G=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},Z=()=>{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&&O((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,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_${p}_${null==i?void 0:i.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:i.isTerminateState||f?null:o(v||"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:y,action:g,approvers:R,selectedApprover:x,setSelectedApprover:M,selectFile:$,uploadedFile:U,setUploadedFile:B,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:H}))},[g,R,W,U,H]),g&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ke,{label:y(I.label.heading)}),headerBarEnd:l.createElement(Be,{onClick:h}),actionCancelLabel:y(I.label.cancel),actionCancelOnSubmit:h,actionSaveLabel:y(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:V?{width:"720px"}:{},style:V?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:V?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.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;T={...T,documents:G(),additionalDetails:{...null===(t=T)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:q(T),pendingapproval:Z()},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!=x&&x.uuid?[null==x?void 0:x.uuid]:null,assignes:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,varificationDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,wfDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null};const a=null==b||null===(o=b.nocData)||void 0===o?void 0:o.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...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(_,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,v,p,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===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.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)}),S({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):l.createElement(t.Loader,null)},je=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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"})),ze=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(We,null)),Ve=e=>{var o,a;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:v,applicationData:p,businessService:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.assigneeRoles)||void 0===o||null===(a=o.map)||void 0===a?void 0:a.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[y,g]=(r.useQueryClient(),n.useState({})),[_,h]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function R(e){D(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;b(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{P(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)P(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))P(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",A,Digit.ULBService.getStateId()||(null==s?void 0:s.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?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(u("CS_FILE_UPLOAD_ERROR"))})},function(){P(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)}}()},[A]),n.useEffect(()=>{d&&g((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,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_${p}_${null==i?void 0:i.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(v||"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:d,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:I,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[d,S,N,O]),d&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(je,{label:u(y.label.heading)}),headerBarEnd:l.createElement(ze,{onClick:c}),actionCancelLabel:u(y.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:y.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=p)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=p)||void 0===l?void 0:l.documents]:[];o.map((e,t)=>{i.push(e)}),p={...p,workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:N?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null},documents:i},v({Noc:p},!1,{isNoc:!0})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)};var $e=function(e,t){return e===t||e!=e&&t!=t},Ye=function(e,t){for(var n=e.length;n--;)if($e(e[n][0],t))return n;return-1},Ke=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=Ye(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},qe.prototype.get=function(e){var t=this.__data__,n=Ye(t,e);return n<0?void 0:t[n][1]},qe.prototype.has=function(e){return Ye(this.__data__,e)>-1},qe.prototype.set=function(e,t){var n=this.__data__,l=Ye(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ge,Ze=qe,Xe="object"==typeof d&&d&&d.Object===Object&&d,Je="object"==typeof self&&self&&self.Object===Object&&self,Qe=Xe||Je||Function("return this")(),et=Qe.Symbol,tt=Object.prototype,nt=tt.hasOwnProperty,lt=tt.toString,ot=et?et.toStringTag:void 0,it=Object.prototype.toString,rt=et?et.toStringTag:void 0,at=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":rt&&rt in Object(e)?function(e){var t=nt.call(e,ot),n=e[ot];try{e[ot]=void 0;var l=!0}catch(e){}var o=lt.call(e);return l&&(t?e[ot]=n:delete e[ot]),o}(e):function(e){return it.call(e)}(e)},ut=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},dt=function(e){if(!ut(e))return!1;var t=at(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},st=Qe["__core-js_shared__"],ct=(Ge=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||""))?"Symbol(src)_1."+Ge:"",vt=Function.prototype.toString,pt=function(e){if(null!=e){try{return vt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},mt=/^\[object .+?Constructor\]$/,ft=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Et=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ut(e)||(t=e,ct&&ct in t))&&(dt(e)?ft:mt).test(pt(e));var t}(n)?n:void 0},yt=Et(Qe,"Map"),gt=Et(Object,"create"),_t=Object.prototype.hasOwnProperty,ht=Object.prototype.hasOwnProperty;function St(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])}}St.prototype.clear=function(){this.__data__=gt?gt(null):{},this.size=0},St.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},St.prototype.get=function(e){var t=this.__data__;if(gt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return _t.call(t,e)?t[e]:void 0},St.prototype.has=function(e){var t=this.__data__;return gt?void 0!==t[e]:ht.call(t,e)},St.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gt&&void 0===t?"__lodash_hash_undefined__":t,this};var bt=St,Tt=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 Ct(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])}}Ct.prototype.clear=function(){this.size=0,this.__data__={hash:new bt,map:new(yt||Ze),string:new bt}},Ct.prototype.delete=function(e){var t=Tt(this,e).delete(e);return this.size-=t?1:0,t},Ct.prototype.get=function(e){return Tt(this,e).get(e)},Ct.prototype.has=function(e){return Tt(this,e).has(e)},Ct.prototype.set=function(e,t){var n=Tt(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var At=Ct;function Dt(e){var t=this.__data__=new Ze(e);this.size=t.size}Dt.prototype.clear=function(){this.__data__=new Ze,this.size=0},Dt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Dt.prototype.get=function(e){return this.__data__.get(e)},Dt.prototype.has=function(e){return this.__data__.has(e)},Dt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ze){var l=n.__data__;if(!yt||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new At(l)}return n.set(e,t),this.size=n.size,this};var Nt=Dt,It=function(){try{var e=Et(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ot=function(e,t,n){"__proto__"==t&&It?It(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Pt=Object.prototype.hasOwnProperty,wt=function(e,t,n){var l=e[t];Pt.call(e,t)&&$e(l,n)&&(void 0!==n||t in e)||Ot(e,t,n)},Rt=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?Ot(n,a,u):wt(n,a,u)}return n},Lt=function(e){return null!=e&&"object"==typeof e},xt=function(e){return Lt(e)&&"[object Arguments]"==at(e)},Mt=Object.prototype,Ft=Mt.hasOwnProperty,kt=Mt.propertyIsEnumerable,Ut=xt(function(){return arguments}())?xt:function(e){return Lt(e)&&Ft.call(e,"callee")&&!kt.call(e,"callee")},Bt=Array.isArray,Ht=function(){return!1},jt=s(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?Qe.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Ht}),Wt=/^(?:0|[1-9]\d*)$/,zt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Wt.test(e))&&e>-1&&e%1==0&&e<t},Vt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},$t={};$t["[object Float32Array]"]=$t["[object Float64Array]"]=$t["[object Int8Array]"]=$t["[object Int16Array]"]=$t["[object Int32Array]"]=$t["[object Uint8Array]"]=$t["[object Uint8ClampedArray]"]=$t["[object Uint16Array]"]=$t["[object Uint32Array]"]=!0,$t["[object Arguments]"]=$t["[object Array]"]=$t["[object ArrayBuffer]"]=$t["[object Boolean]"]=$t["[object DataView]"]=$t["[object Date]"]=$t["[object Error]"]=$t["[object Function]"]=$t["[object Map]"]=$t["[object Number]"]=$t["[object Object]"]=$t["[object RegExp]"]=$t["[object Set]"]=$t["[object String]"]=$t["[object WeakMap]"]=!1;var Yt=function(e){return function(t){return e(t)}},Kt=s(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&Xe.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),qt=Kt&&Kt.isTypedArray,Gt=qt?Yt(qt):function(e){return Lt(e)&&Vt(e.length)&&!!$t[at(e)]},Zt=Object.prototype.hasOwnProperty,Xt=function(e,t){var n=Bt(e),l=!n&&Ut(e),o=!n&&!l&&jt(e),i=!n&&!l&&!o&&Gt(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&&!Zt.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||zt(d,u))||a.push(d);return a},Jt=Object.prototype,Qt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Jt)},en=function(e,t){return function(n){return e(t(n))}},tn=en(Object.keys,Object),nn=Object.prototype.hasOwnProperty,ln=function(e){return null!=e&&Vt(e.length)&&!dt(e)},on=function(e){return ln(e)?Xt(e):function(e){if(!Qt(e))return tn(e);var t=[];for(var n in Object(e))nn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},rn=Object.prototype.hasOwnProperty,an=function(e){return ln(e)?Xt(e,!0):function(e){if(!ut(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Qt(e),n=[];for(var l in e)("constructor"!=l||!t&&rn.call(e,l))&&n.push(l);return n}(e)},un=s(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?Qe.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}}),dn=function(){return[]},sn=Object.prototype.propertyIsEnumerable,cn=Object.getOwnPropertySymbols,vn=cn?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];sn.call(e,a)&&(r[i++]=a)}return r}(cn(e)))}:dn,pn=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e},mn=en(Object.getPrototypeOf,Object),fn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)pn(t,vn(e)),e=mn(e);return t}:dn,En=function(e,t,n){var l=t(e);return Bt(e)?l:pn(l,n(e))},yn=function(e){return En(e,on,vn)},gn=function(e){return En(e,an,fn)},_n=Et(Qe,"DataView"),hn=Et(Qe,"Promise"),Sn=Et(Qe,"Set"),bn=Et(Qe,"WeakMap"),Tn=pt(_n),Cn=pt(yt),An=pt(hn),Dn=pt(Sn),Nn=pt(bn),In=at;(_n&&"[object DataView]"!=In(new _n(new ArrayBuffer(1)))||yt&&"[object Map]"!=In(new yt)||hn&&"[object Promise]"!=In(hn.resolve())||Sn&&"[object Set]"!=In(new Sn)||bn&&"[object WeakMap]"!=In(new bn))&&(In=function(e){var t=at(e),n="[object Object]"==t?e.constructor:void 0,l=n?pt(n):"";if(l)switch(l){case Tn:return"[object DataView]";case Cn:return"[object Map]";case An:return"[object Promise]";case Dn:return"[object Set]";case Nn:return"[object WeakMap]"}return t});var On=In,Pn=Object.prototype.hasOwnProperty,wn=Qe.Uint8Array,Rn=function(e){var t=new e.constructor(e.byteLength);return new wn(t).set(new wn(e)),t},Ln=/\w*$/,xn=et?et.prototype:void 0,Mn=xn?xn.valueOf:void 0,Fn=Object.create,kn=function(){function e(){}return function(t){if(!ut(t))return{};if(Fn)return Fn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Un=Kt&&Kt.isMap,Bn=Un?Yt(Un):function(e){return Lt(e)&&"[object Map]"==On(e)},Hn=Kt&&Kt.isSet,jn=Hn?Yt(Hn):function(e){return Lt(e)&&"[object Set]"==On(e)},Wn={};Wn["[object Arguments]"]=Wn["[object Array]"]=Wn["[object ArrayBuffer]"]=Wn["[object DataView]"]=Wn["[object Boolean]"]=Wn["[object Date]"]=Wn["[object Float32Array]"]=Wn["[object Float64Array]"]=Wn["[object Int8Array]"]=Wn["[object Int16Array]"]=Wn["[object Int32Array]"]=Wn["[object Map]"]=Wn["[object Number]"]=Wn["[object Object]"]=Wn["[object RegExp]"]=Wn["[object Set]"]=Wn["[object String]"]=Wn["[object Symbol]"]=Wn["[object Uint8Array]"]=Wn["[object Uint8ClampedArray]"]=Wn["[object Uint16Array]"]=Wn["[object Uint32Array]"]=!0,Wn["[object Error]"]=Wn["[object Function]"]=Wn["[object WeakMap]"]=!1;var zn=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(!ut(t))return t;var c=Bt(t);if(c){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Pn.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 v=On(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(jt(t))return un(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!i){if(a=d||p?{}:function(e){return"function"!=typeof e.constructor||Qt(e)?{}:kn(mn(e))}(t),!u)return d?function(e,t){return Rt(e,fn(e),t)}(t,function(e,t){return e&&Rt(t,an(t),e)}(a,t)):function(e,t){return Rt(e,vn(e),t)}(t,function(e,t){return e&&Rt(t,on(t),e)}(a,t))}else{if(!Wn[v])return i?t:{};a=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return Rn(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?Rn(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?Rn(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,Ln.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return Mn?Object(Mn.call(e)):{}}}(t,v,u)}}r||(r=new Nt);var m=r.get(t);if(m)return m;r.set(t,a),jn(t)?t.forEach(function(o){a.add(e(o,n,l,o,t,r))}):Bn(t)&&t.forEach(function(o,i){a.set(i,e(o,n,l,i,t,r))});var f=c?void 0:(s?d?gn:yn:d?an:on)(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]),wt(a,i,e(o,n,l,i,t,r))}),a},Vn=function(e){return zn(e,5)};const $n=e=>l.createElement("h1",{className:"heading-m"},e.label),Yn=()=>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"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yn,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}},Gn=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,cardClassName:p,cardFormWrapperClassName:m,cardFormClassName:f,formClassName:E}=e;const{data:y,isLoading:g}=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)}),[_,h]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[D,N]=n.useState({}),[I,O]=n.useState(null),[P,w]=n.useState(null),[R,L]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");function F(e){O(e.target.files[0])}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(()=>{!function(){try{L(null);const e=function(){if(I){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(I.size>=5242880)L(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=I&&I.type&&!e.test(null==I?void 0:I.type))L(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",I,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?w(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):L(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(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)}}()},[I]),n.useEffect(()=>{var e,n,o,i;"DisconnectWSConnection"==(null===(e=c)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=c)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?a&&h((e=>{var n;let{t:o,action:i,selectFile:r,uploadedFile:a,setUploadedFile:u,businessService:d,error:s}=e,c=!1;return null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK"),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(c=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==d?void 0:d.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[c&&{label:o("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!c,type:"custom",populators:c?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,A({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:r,onDelete:()=>{u(null)},message:a?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:s,iserror:s,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:T,selectedApprover:D,setSelectedApprover:N,selectFile:F,uploadedFile:P,setUploadedFile:w,businessService:v,error:R})):a&&h((e=>{var n;let{t:o,action:i,selectFile:r,uploadedFile:a,setUploadedFile:u,businessService:d,error:s}=e;return null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK"),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==d?void 0:d.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{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:r,onDelete:()=>{u(null)},message:a?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:s,iserror:s,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:T,selectedApprover:D,setSelectedApprover:N,selectFile:F,uploadedFile:P,setUploadedFile:w,businessService:v,error:R}))},[a,T,P,R]),a&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement($n,{label:r(_.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:d}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&M?{width:"100%",height:"auto"}:{}},g?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,o,i,r,d,v,p,m;if(null!==(t=c)&&void 0!==t&&t.isBillAmend){var f,E,y,g,_,h,S,b,T;const t={...null===(f=c)||void 0===f||null===(E=f.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(y=c)||void 0===y?void 0:y.billAmendmentDetails,workflow:{businessId:null===(g=c)||void 0===g||null===(_=g.billAmendmentDetails)||void 0===_?void 0:_.amendmentId,action:null==a?void 0:a.action,tenantId:u,businessService:null!==(h=c)&&void 0!==h&&null!==(S=h.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=c)&&void 0!==b&&null!==(T=b.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]}};s({AmendmentUpdate:n})}else{if(c={...c,action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:[],assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:null,processInstance:{...null===(n=c)||void 0===n?void 0:n.processInstance,action:null==a?void 0:a.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]}},null!=e&&e.date&&null!==(l=c)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=Vn(null==e?void 0:e.date);c.disconnectionExecutionDate=qn(t)}else if(null!=e&&e.date){const t=Vn(null==e?void 0:e.date);c.connectionExecutionDate=qn(t)}var C;if("DisconnectWSConnection"==(null===(i=c)||void 0===i||null===(r=i.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(d=c)||void 0===d||null===(v=d.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(C=c)||void 0===C?void 0:C.serviceType)?s({WaterConnection:c,disconnectRequest:!0}):s({SewerageConnection:c,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=c)||void 0===p?void 0:p.applicationType))s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=c)||void 0===m?void 0:m.applicationType))s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!0});else{var A,N,O,w,R,L,x,M,F,k,U,B,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(A=t.value)&&void 0!==A&&A.adhocPenalty&&(c.additionalDetails.adhocPenalty=parseInt(null==t||null===(N=t.value)||void 0===N?void 0:N.adhocPenalty)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyComment&&(c.additionalDetails.adhocPenaltyComment=(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(c.additionalDetails.adhocPenaltyReason=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyReason)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocRebate&&(c.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(c.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(c.additionalDetails.adhocRebateReason=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateReason)||""),"WATER"==(null===(H=c)||void 0===H?void 0:H.serviceType)?s({WaterConnection:c,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:c,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:S,formId:"modal-action",cardFormClassName:f,cardFormWrapperClassName:m,cardClassName:p,formClassName:E})):l.createElement(t.Loader,null)},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=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;console.log("applicationData",c);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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(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{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,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):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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)}}()},[T]),n.useEffect(()=>{a&&E((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:_,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:v}))},[a,_,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Zn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:A}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},el=e=>l.createElement("h1",{className:"heading-m"},e.label),tl=()=>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"})),nl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tl,null)),ll=e=>{var o,r,a;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:v,applicationData:p,businessService:m,moduleCode:f,cardClassName:E,cardFormWrapperClassName:y,cardFormClassName:g,formClassName:_}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(r=o[0])||void 0===r||null===(a=r.map)||void 0===a?void 0:a.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),S=i.useHistory(),[b,T]=n.useState({}),[C,A]=n.useState({}),[D,N]=n.useState([]),[I,O]=n.useState(null),[P,w]=n.useState(null);return n.useEffect(()=>{var e;N(null==h||null===(e=h.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}}))},[h]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?S.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):T((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:d,approvers:D,selectedApprover:I,setSelectedApprover:O,uploadedFile:P,setUploadedFile:w,businessService:m}))},[d,D,P]),d&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(el,{label:u(b.label.heading)}),headerBarEnd:l.createElement(nl,{onClick:c}),actionCancelLabel:u(b.label.cancel),actionCancelOnSubmit:c,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==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:f};P&&(t.documents=[]),v({Asset:{...p,workflow:t}})},defaultValues:C,formId:"modal-action",cardFormClassName:g,cardFormWrapperClassName:y,cardClassName:E,formClassName:_})):l.createElement(t.Loader,null)},ol=e=>l.createElement("h1",{className:"heading-m"},e.label),il=()=>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"})),rl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(il,null)),al=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(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{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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)}}()},[T]),n.useEffect(()=>{a&&E((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:_,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:v}))},[a,_,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ol,{label:r(f.label.heading)}),headerBarEnd:l.createElement(rl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({hallsBookingApplication:{...c,workflow:t}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},ul=e=>l.createElement("h1",{className:"heading-m"},e.label),dl=()=>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"})),sl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(dl,null)),cl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;console.log("snjdskbjdfbjskfjkbs",a);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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(null),[w,R]=n.useState(!1);function L(e){D(e.target.files[0])}return n.useEffect(()=>{var e;h(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{P(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)P(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",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):P(r("CS_FILE_UPLOAD_ERROR"))})},function(){P(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((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:_,selectedApprover:S,setSelectedApprover:b,selectFile:L,uploadedFile:N,setUploadedFile:I,businessService:v}))},[a,_,N]),console.log("conggg",f),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ul,{label:r(f.label.heading)}),headerBarEnd:l.createElement(sl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p};console.log("applicationData",e),N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:N},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},vl=e=>l.createElement("h1",{className:"heading-m"},e.label),pl=()=>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"})),ml=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pl,null)),fl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=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?void 0:a.isTerminateState}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){P(!0),C(e.target.files[0])}return n.useEffect(()=>{var e;h(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{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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(P(!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)}}()},[T]),console.log("actyhdesh,jhfsefsef",a,c),n.useEffect(()=>{E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const v=()=>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(v,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:_,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:v,isUploading:O}))},[a,_,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vl,{label:r(f.label.heading)}),headerBarEnd:l.createElement(ml,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null};A&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({streetVendingDetail:{...c,workflow:n}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},El=e=>l.createElement("h1",{className:"heading-m"},e.label),yl=()=>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(yl,null)),_l=e=>{var o,i,r,a,u;let{t:d,action:s,tenantId:c,closeModal:v,submitAction:p,applicationData:m,businessService:f,moduleCode:E,cardClassName:y,cardFormWrapperClassName:g,cardFormClassName:_,formClassName:h}=e;const{data:S}=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:b}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let T=[];null==b||null===(r=b.vendor)||void 0===r||r.forEach(e=>{var t,n;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.serviceType)){var l;const t=`${null==e?void 0:e.name} (${null==e||null===(l=e.owner)||void 0===l?void 0:l.mobileNumber})`;T.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const{data:C}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,filters:{vendorId:null==m?void 0:m.vendorId},config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let A=[];null==C||null===(a=C.vehicle)||void 0===a||null===(u=a.filter(e=>{var t,n,l;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.id)||(null==e||null===(l=e.owner)||void 0===l?void 0:l.id)}))||void 0===u||u.map(e=>{var t,n,l;A.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,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.ownerId)||(null==e?void 0:e.ownerId)||(null==e||null===(l=e.owner)||void 0===l?void 0:l.uuid)})});const[D,N]=n.useState({}),[I,O]=n.useState({}),[P,w]=n.useState([]),[R,L]=n.useState(null),[x,M]=n.useState(null),[F,k]=n.useState(null),[U,B]=n.useState(null),[H,j]=n.useState(null);function W(e){L(e.target.files[0])}return n.useEffect(()=>{var e;w(null==S||null===(e=S.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}}))},[S]),n.useEffect(()=>{!function(){try{k(null);const e=function(){if(R){const e=function(){if(R.size>=5242880)k(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",R,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?M(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):k(d("CS_FILE_UPLOAD_ERROR"))})},function(){k(d("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)}}()},[R]),n.useEffect(()=>{s&&N((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,selectedVendor:u,setSelectedVendor:d,vendorDescription:s,vehicleDescription:c,selectVehicle:v,setSelectVehicle:p}=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)&&"ASSIGN_VEHICLE_DRIVER"!==(null==o?void 0:o.action)?{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)||"ASSIGN_VEHICLE_DRIVER"===(null==o?void 0:o.action)?{label:n("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:c,t:n,optionKey:"i18nKey",select:p,selected:v})}:"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:d,action:s,selectFile:W,uploadedFile:x,setUploadedFile:M,selectedVendor:U,setSelectedVendor:B,vendorDescription:b?T:void 0,vehicleDescription:C||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?A:void 0,selectVehicle:H,setSelectVehicle:j}))},[s,P,x,b,H,C]),s&&D.form?l.createElement(t.Modal,{headerBarMain:l.createElement(El,{label:d(D.label.heading)}),headerBarEnd:l.createElement(gl,{onClick:v}),actionCancelLabel:d(D.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:d(D.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:D.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};x&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==R?void 0:R.name,fileStoreId:x}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(m.vendorId=null==U?void 0:U.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(m.vehicleId=null==H?void 0:H.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(m.vehicleId=null==H?void 0:H.vehicleId,m.driverId=null==H?void 0:H.driverId),"watertanker-fixedpoint"===f&&(t.moduleName="request-service.water_tanker",t.businessService="watertanker-fixedpoint");let n="watertanker"===f||"watertanker-fixedpoint"===f?{waterTankerBookingDetail:{...m,workflow:t}}:{mobileToiletBookingDetail:{...m,workflow:t}};p(n)},defaultValues:I,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:g,cardClassName:y,formClassName:h})):l.createElement(t.Loader,null)},hl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ie,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Qn,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(Re,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Fe,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(He,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Ve,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Gn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(ll,e):null!=e&&e.businessService.includes("ewst")?l.createElement(cl,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(al,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(fl,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?l.createElement(_l,e):void 0;function Sl(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 bl=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)||[],v=Digit.ULBService.getStateId(),[p,m]=n.useState((null==r||null===(o=r.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[y,g]=n.useState([]),[_,h]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,data:D}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:N,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,r;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==D||null===(i=D.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)),g(d)},[!A,!N]),n.useEffect(()=>{let e=0;y.map(t=>{let n=!1;p.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||!(p.length>0))},[p,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(Tl,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:m,documents:p,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:y,checkEnablingDocs:T}))))};function Tl(e){var o,i;let{t:r,document:a,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:v}=e;const p=null==d?void 0:d.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],m=Digit.ULBService.getStateId(),[f,E]=n.useState(p?{...p,active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}:1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{}),[y,g]=n.useState(null),[_,h]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[S,b]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==_?void 0:_.length)||null===_?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==f?void 0:f.code,fileStoreId:_,documentUid:_,fileName:(null==y?void 0:y.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[_,f]),n.useEffect(()=>{try{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],S.map(e=>{var t,n,l;null!=f&&f.code&&a.newUploadedDocs.push({documentType:null==f?void 0:f.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})}),c[s]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[S,f]),n.useEffect(()=>{},[y]),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(Sl,{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:f,optionKey:"i18nKey",select:e=>E(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:m,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);0!==Object.keys(n).length&&b(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 Cl(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(Sl,{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 Al(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,v]=n.useState(),[p,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==p?void 0:p.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(p){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(p.size>=5242880)a(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=p&&p.type&&!e.test(null==p?void 0:p.type))a(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,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)}}()},[p]),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 Dl=e=>{var o;let{t:i,noc:r,docs:a,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(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(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:y}=Digit.Hooks.obps.useMDMS(v,"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,[]),[D,N]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;_(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 v=[];o&&o.length>0&&(o.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),S(v))},[f,g]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===p&&(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:"#2E9E8F"}:{color:"#D83A2F"}}:{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(Sl,{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(Al,{key:t,document:e,t:i,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},Nl=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}))),[d,s,c]=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?{...e,checked:l}:e))})(e,0,n),isLabelFirst:!0,index:n})),null==d?void 0:d.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.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=[...d];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Il(e){let{documents:i,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState(()=>[]),[c,v]=(Digit.ULBService.getCurrentTenantId(),n.useState({})),[p,m]=n.useState(null);n.useEffect(()=>{var e;let t=[];null==i||i.forEach(e=>{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=>{v(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[d]);const f=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),E=window.location.href.includes("employee/ws"),y=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},(()=>{if(!p)return null;const e=p.toLowerCase().includes(".pdf")||p.toLowerCase().includes("pdf");return l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},"Document Preview"),headerBarEnd:l.createElement("div",{onClick:()=>m(null),style:{cursor:"pointer",padding:"5px",marginTop:"-5px"}},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#000000",width:"24px",height:"24px"},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"}))),hideSubmit:!0,popupStyles:{maxWidth:"80vw",width:"100%"},popupModuleMianStyles:{display:"flex",justifyContent:"center",alignItems:"center",padding:"0",overflowY:"hidden"}},e?l.createElement("iframe",{src:p,title:"Document Preview",style:{width:"100%",height:"80vh",border:"none",display:"block"}}):l.createElement("img",{src:p,alt:"Document Preview",style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block"}}))})(),!y&&(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:f?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,E?l.createElement("div",{style:{marginTop:"8px"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?e.values.map((e,n)=>((e,n)=>{var o,i,r,a;const d=null===(o=c[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],s=(e=>{if(!e)return"";const t=e.split(".");return(t[t.length-1]||"").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())})(null==e?void 0:e.documentType),v=(null==e?void 0:e.documentUid)||"",p=null==e?void 0:e.isPhoto;let f="",E="",y="";return"WS_IDENTITY_PROOF"===e.title?(f="Identity Proof*",E="Identity Proof Document Number",y="Upload Identity Proof Document*"):"WS_OWNERSHIP_PROOF"===e.title?(f="Ownership Proof*",E="Ownership Proof Document Number",y="Upload Ownership Proof*"):"WS_OTHER_DOCUMENTS"===e.title?(f="Other Documents*",E="Other Document Number",y="Upload Other Documents*"):"WS_APPLICANT_PHOTO"===e.title?y="Upload Applicant Photo*":(f=((null==e?void 0:e.categoryLabel)||"Document")+"*",E="Document Number",y="Upload Document*"),l.createElement("div",{key:n,style:{marginBottom:"24px"}},l.createElement(t.StatusTable,null,!p&&l.createElement(l.Fragment,null,l.createElement(t.Row,{label:f,text:s||u("NA")}),l.createElement(t.Row,{label:E,text:v||u("NA")})),l.createElement(t.Row,{label:y,text:l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"16px"}},p?d?l.createElement("div",{style:{position:"relative"}},l.createElement("img",{src:d,alt:"Applicant Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"4px",border:"1px solid #ccc"}})):l.createElement("div",{style:{fontSize:"14px",color:"#505A5F"}},u("NA")):l.createElement("div",{onClick:()=>{d&&m(d)},disabled:!d,style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null)),!p&&l.createElement("label",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",color:"#0B0C0C",margin:0}},l.createElement("input",{key:`chk-${null==e||null===(i=e.originalDoc)||void 0===i?void 0:i.id}-${null==e||null===(r=e.originalDoc)||void 0===r?void 0:r.isVerified}`,type:"checkbox",style:{width:"18px",height:"18px",accentColor:"#F47738"},defaultChecked:null==e||null===(a=e.originalDoc)||void 0===a?void 0:a.isVerified,onChange:t=>{null!=e&&e.originalDoc&&(e.originalDoc.isVerified=t.target.checked)}}),"Check Verified"))})))})(e,n)):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))):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:f?{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")))))})),y&&(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 Ol(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 Pl(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 wl(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"},d={position:"relative",padding:"8px"},s={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"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),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:d},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:s}))}))))})))}const Rl=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:"#2E9E8F"}},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))))))))},Ll=e=>{var i,r,a,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:v}=o.useTranslation(),p=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:v(""+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:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(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:v("BPA_FLOOR_NAME_"+e.number)})}),n}function g(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?""+v("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"}},v(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+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"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:y(e),columns:E,getCellProps:e=>({style:{}})})))})))},xl=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))},Ml=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(xl,{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,t)=>l.createElement("div",{className:"TLComments",key:t},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 Fl(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 kl(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 Ul=e=>{var n;let{wsAdditionalDetails:i}=e;const{t:r}=o.useTranslation();(a=location.search)&&(/^[?#]/.test(a)?a.slice(1):a).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{});var a,{connectionDetails:u}=(null==i?void 0:i.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(l.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==i||null===(n=i.additionalDetails)||void 0===n?void 0:n.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},r("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==u?void 0:u.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+r(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""}))))))))},Bl=[{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"}],Hl=[{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"}],jl=e=>{var i,r,a,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[c,v,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[m,f,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),y=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[g,h]=n.useState(!1),[S,b]=n.useState(c||{}),[T,C]=n.useState(null),[D,N]=n.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[I,O]=n.useState(d.additionalDetails.values?d.additionalDetails.values:[]),P=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(P,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const o={...null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==c||null===(n=c.billDetails)||void 0===n?void 0:n.length)>0){var i,r,a,u,s,p,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==c||null===(i=c.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==c||null===(a=c.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==c||null===(s=c.billDetails)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.taxAmount)}];O(e),N(null==c||null===(m=c.billDetails)||void 0===m?void 0:m[0])}else v(o),b(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={...S};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:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"100%",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:""+s(""+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:""+s("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(y?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:y?{color:"#2E9E8F"}:{color:"#D83A2F"}}))),null!=d&&null!==(r=d.additionalDetails)&&void 0!==r&&r.isAdhocRebate?l.createElement("div",{onClick:e=>{h(!0)}},l.createElement("span",{className:"add-details-link hover-button",style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,g&&l.createElement(t.Modal,{headerBarMain:l.createElement(R,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{b(c),h(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(c),h(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,n=null!=S&&S.adhocRebate?Number(null==S?void 0:S.adhocRebate):0;var l,o;if(t||n)if(n>(null==d||null===(l=d.additionalDetails)||void 0===l||null===(o=l.data)||void 0===o?void 0:o.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,r,a,u,c,p,m,E,y,g;const e=null==d||null===(i=d.additionalDetails)||void 0===i||null===(r=i.appDetails)||void 0===r?void 0:r.applicationNo,t=null==d||null===(a=d.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n={...null==d||null===(c=d.additionalDetails)||void 0===c||null===(p=c.appDetails)||void 0===p?void 0:p.additionalDetails,...S};d.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==d||null===(m=d.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let o="WATER"==(null==d||null===(y=d.additionalDetails)||void 0===y||null===(g=y.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,r,a,u,d,s,c,p,m,E,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===(E=e.Calculation)||void 0===E||null===(y=E[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 b=[{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}];f(Vn(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),O(b),S.billDetails=null==e?void 0:e.Calculation,v(S),h(!1)}).catch(e=>{var t,n,l,o,i,r;C({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?s(""+(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)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto",background:"#f0f3f7"}},l.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},l.createElement(t.Card,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Bl,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s}))),"PT_OTHERS"===(null==S||null===(a=S.adhocPenaltyReason_data)||void 0===a?void 0:a.title)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==S?void 0:S.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))),l.createElement(t.Card,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Hl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s}))),"PT_OTHERS"===(null==S||null===(u=S.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_REASON")),l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==S?void 0:S.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,A({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==S?void 0:S.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")}))))))),T&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==T?void 0:T.isWarning,error:null==T||!T.isWarning,label:s(null==T?void 0:T.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},Wl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...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"})))},zl=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(Wl,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},Vl=e=>{var i,r,a,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:p}=o.useTranslation(),[m,f]=n.useState(!1),[E,y]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),_=()=>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(_,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.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",{className:"add-details-link hover-button"},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(g,{label:p("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"}},p("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:""+p(""+(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:""+p("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"}},p("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:""+p(""+(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:""+p("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:""+p(""+(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:""+p("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"}})))))},$l={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:{}},Yl=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:$l.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:$l.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...$l.cell,...$l.cellLeft,...$l.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...$l.cell,...n.length==t+1?$l.cellRight:{},...$l.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...$l.cell,...$l.cellLeft},component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,o)=>l.createElement("td",{style:{...$l.cell,textAlign:"left",...n.length==o+1?$l.cellRight:{},whiteSpace:"pre"},key:o,numeric:!0},o>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...$l.cell,...$l.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...$l.cell,...$l.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:{...$l.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:$l.cell,key:t,numeric:!0})))))))},Kl={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 v="₹ "+((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 p={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{p[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[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:Kl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Yl,{headers:[...m],values:d,arrears:v}),!f&&l.createElement("div",{style:Kl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Kl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Gl=()=>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"})),Zl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gl,null)),Xl=e=>{let{t:n,closeModal:o}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const r=i.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(Zl,{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:()=>{r.push("renew-application/info")}}),l.createElement(t.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),r.push("renew-application/check/makePayment")}})))))},Jl=()=>{const{t:e}=o.useTranslation(),[i,r]=n.useState(""),[a,u]=n.useState([]),d=n.useMemo(()=>[{Header:e("K No."),accessor:"kno"},{Header:e("Full Name"),accessor:"fullName"},{Header:e("Full Address"),accessor:"fullAddress"},{Header:e("Due Amount"),accessor:"dueAmount"},{Header:e("Total Amount"),accessor:"totalAmount"}],[e]);return l.createElement("div",{style:{marginBottom:"20px"}},l.createElement("h2",{style:{fontSize:"24px",fontWeight:"bold",color:"#4f6cfc",marginBottom:"16px"}},e("Due Verification")),l.createElement("div",{style:{display:"flex",alignItems:"flex-end",gap:"20px",marginBottom:"20px"}},l.createElement("div",{style:{flex:1}},l.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("K No.(Existing KNo of same property)")," ",l.createElement("span",{style:{color:"red"}},"*")),l.createElement(t.TextInput,{type:"number",value:i,onChange:e=>r(e.target.value),style:{width:"100%",marginBottom:"0"}})),l.createElement("div",{style:{flex:1,paddingBottom:"2px"}},l.createElement("button",{type:"button",onClick:()=>{if(i){const e={kno:i,fullName:"John Doe",fullAddress:"123 Main St, New Delhi, Delhi 110001",dueAmount:"1500",totalAmount:"1500"};u([...a,e]),r("")}},style:{backgroundColor:"#4f6cfc",color:"white",padding:"8px 24px",borderRadius:"4px",border:"none",cursor:"pointer"}},e("Add")))),a.length>0&&l.createElement("div",{style:{marginTop:"30px",overflowX:"auto"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:e,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,data:a,columns:d,getCellProps:e=>({style:{padding:"12px"}})})))};function Ql(e){var r,a,u,d,s,c,v,p,m,f,E,y,g,h;let{applicationDetails:S,workflowDetails:b,isDataLoading:T,applicationData:C,timelineStatusPrefix:A,showTimeLine:D=!0,statusAttribute:N="status",paymentsList:I,oldValue:O,isInfoLabel:P=!1}=e;const{t:w}=o.useTranslation(),[R,L]=n.useState(!1);let{id:x}=i.useParams();function M(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const[F,k]=n.useState({}),[U,B]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!==(null==C?void 0:C.status)||U.loading||U.loaded||U.canLoad||B({loading:!1,loaded:!1,canLoad:!0}),null==U||!U.canLoad||U.loading||U.loaded||(B({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==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,k,B));const H=e=>{if(null==e||void 0===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()}`},j=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:H(null==C||null===(o=C.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(Ml,{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,v,p,m,f,E,y,g,h,b,T,A;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==S?void 0:S.tenantId,businessIds:null==S?void 0:S.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}}},D=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==C||null===(s=C.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=C&&null!==(f=C.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(y=E[0])&&void 0!==y&&y.mobileNumber?null==C||null===(g=C.processInstance)||void 0===g||null===(h=g.assignes)||void 0===h||null===(b=h[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.mobileNumber,comment:w(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Ml,{data:N,OpenImage:M,privacy:o})}{var D,N,I,O,P;const t={date:H(null==C||null===(D=C.auditDetails)||void 0===D?void 0:D.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===(P=O[0])||void 0===P?void 0:P.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Ml,{data:t,OpenImage:M})}},W=(e,t)=>e?t?e:w(e):w("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/obps"),Y=()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{},K=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${w(null==e?void 0:e.isUnit)}`:w("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):w("N/A"),[q,G]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},P?l.createElement(zl,{t:w,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==S||null===(r=S.applicationDetails)||void 0===r?void 0:r.map((e,n)=>{var o,r,a,u,d,s,c,v,p,m,f,E,y,g,_,h,T,A,D,N,P,R,M,k,U,B,H,j,W,q,G,Z,X,J,Q,ee,te,ne,le,oe;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")||z?{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}:{}},(null==e||null===(o=e.title)||void 0===o?void 0:o.trim())&&(0!==n||e.asSectionHeader?l.createElement(t.CardSectionHeader,{style:0===n&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},w(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},w(e.title))),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},w(e)))),null==e?void 0:e.tableRows.map((n,o)=>l.createElement("tr",{key:o},n.map((n,r)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:r},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;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:r,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(i.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+x,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," ")),l.createElement("div",{key:o,onClick:()=>{L(!0)},style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null))):w(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(r=e.values)||void 0===r?void 0:r.map((n,o)=>{var r,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:w(n.title),label:w(n.title),text:l.createElement("img",{src:w(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):!0===(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:w(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},w(null==n?void 0:n.title)))):V||$?""+w(n.title):w(n.title),text:l.createElement("div",null,l.createElement(i.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:Y(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",{key:o},window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+w(""+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:w(n.title),label:w(n.title),text:K(n),last:o===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:Y(),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=F.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Rl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:I}),(null==S||null===(u=S.applicationData)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&l.createElement(Cl,{fiReport:null==S||null===(v=S.applicationData)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(Pl,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(wl,{owners:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.owners}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units)&&l.createElement(kl,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.accessories)&&l.createElement(Fl,{units:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.accessories}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==b||null===(D=b.data)||void 0===D||null===(N=D.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(Nl,{applicationData:null==S?void 0:S.applicationData,t:w,permissions:null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.permissions}),(null==e||null===(R=e.additionalDetails)||void 0===R?void 0:R.obpsDocuments)&&l.createElement(bl,{t:w,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.noc)&&l.createElement(Dl,{t:w,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(k=e.additionalDetails)||void 0===k?void 0:k.data,bpaActionsDetails:b}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.scruntinyDetails)&&l.createElement(Rl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(Rl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.subOccupancyTableDetails)&&l.createElement(Ll,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl)&&l.createElement(Sl,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.documents)&&l.createElement(Il,{documents:null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.documents}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.taxHeadEstimatesCalculation)&&l.createElement(Ol,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Ul,{wsAdditionalDetails:e,oldValue:O}),(null==e?void 0:e.isDueVerification)&&"PENDING_FOR_FIELD_INSPECTION"===(null==C?void 0:C.applicationStatus)&&l.createElement(Jl,null),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.redirectUrl)&&l.createElement(i.Link,{to:null==e||null===(Q=e.additionalDetails)||void 0===Q||null===(ee=Q.redirectUrl)||void 0===ee?void 0:ee.url},l.createElement("span",{className:"add-details-link hover-button"},null==e||null===(te=e.additionalDetails)||void 0===te||null===(ne=te.redirectUrl)||void 0===ne?void 0:ne.title)),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(jl,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(oe=e.additionalDetails)||void 0===oe?void 0:oe.estimationDetails)&&l.createElement(Vl,{wsAdditionalDetails:e,workflowDetails:b}))}),D&&(null==b||null===(a=b.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==b?void 0:b.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=b&&b.isLoading)&&!T&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},w("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(d=b.data)&&void 0!==d&&d.timeline&&1===(null==b||null===(s=b.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:w(`${A}${null==b||null===(v=b.data)||void 0===v||null===(p=v.timeline[0])||void 0===p?void 0:p.state}`),customChild:j(null==b||null===(m=b.data)||void 0===m?void 0:m.timeline[0],null==b||null===(f=b.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)&&(null==b||null===(y=b.data)||void 0===y?void 0:y.timeline.slice(0,q?null==b?void 0:b.data.timeline.length:2).map((e,n,o)=>{var i;let r="";var a,u,d,s,c,v;return window.location.href.includes("/obps/")&&(r=null!=b&&null!==(a=b.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!=b&&null!==(s=b.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.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:w(`${A}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[N]}${r}`),customChild:j(e,n,null==b||null===(i=b.data)||void 0===i?void 0:i.timeline)}))}))),(null==b||null===(g=b.data)||void 0===g||null===(h=g.timeline)||void 0===h?void 0:h.length)>2&&l.createElement(t.LinkButton,{label:w(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{G(e=>!e)}})))),l.createElement("div",null,R&&l.createElement(Xl,{t:w,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function eo(e){var n,o,i,r,a,u,d,s,c,v,p,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 D;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===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.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===(p=b.error)||void 0===p?void 0:p.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===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.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 to(e){var i,r,a,u,d,s,c,v,p,m,f,E,y,g,_,h,S,b,T;let{workflowDetails:C,displayMenu:A,onActionSelect:D,setDisplayMenu:N,businessService:I,forcedActionPrefix:O,ActionBarStyle:P={},MenuStyle:w={},isAction:R,applicationDetails:L}=e;const{t:x}=o.useTranslation();let M=Digit.UserService.getUser();const F=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):{};M=null==t?void 0:t.value}const k=null===(i=M)||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,B=!1,H=(null==C||null===(u=C.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(c=C.data)||void 0===c||null===(v=c.nextActions)||void 0===v?void 0:v.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{N(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==H?void 0:H.length)||null!=H&&null!==(p=H[0])&&void 0!==p&&null!==(m=p.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==H?void 0:H.length)?(B=!1,U=!0):(null==H?void 0:H.length)>0&&(B=!0,U=!1);const j=Digit.SessionStorage.get("User"),W=null==j||null===(f=j.info)||void 0===f?void 0:f.uuid,z=null==L||null===(E=L.applicationData)||void 0===E||null===(y=E.auditDetails)||void 0===y?void 0:y.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&B&&!U&&!R&&l.createElement(t.ActionBar,{style:{...P}},A&&(null!=C&&null!==(g=C.data)&&void 0!==g&&null!==(_=g.actionState)&&void 0!==_&&_.nextActions||null!=C&&null!==(h=C.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==I?void 0:I.toUpperCase()),options:H,optionKey:"action",t:x,onSelect:D,style:w}):null,"ewst"===I?z===W||null==z?l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>N(!A)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+x("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>N(!A)})),!(null!=C&&C.isLoading)&&!B&&U&&!R&&l.createElement(t.ActionBar,{style:{...P}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==H||null===(S=H[0])||void 0===S?void 0:S.action,value:null==H||null===(b=H[0])||void 0===b?void 0:b.action,onClick:e=>{D((null==H?void 0:H[0])||{})}},x(`${O||"WF_EMPLOYEE_"+(null==I?void 0:I.toUpperCase())}_${null==H||null===(T=H[0])||void 0===T?void 0:T.action}`))))}const no=()=>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"})),lo=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(no,null));function oo(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(lo,{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 io=e=>{var a;const u=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{t:s}=o.useTranslation(),c=i.useHistory();let{id:v}=i.useParams();const[p,m]=n.useState(!1),[f,E]=n.useState(null),[y,g]=n.useState(!1),[_,h]=n.useState(!1),[S,b]=n.useState(!1),{applicationDetails:T,showToast:C,setShowToast:A,isLoading:D,isDataLoading:N,applicationData:I,mutate:O,nocMutation:P,workflowDetails:w,id:R,businessService:L,closeToast:x,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:k,statusAttribute:U,ActionBarStyle:B,MenuStyle:H,paymentsList:j,showTimeLine:W=!0,oldValue:z,isInfoLabel:V=!1,clearDataDetails:$,isAction:Y=!1}=e;n.useEffect(()=>{C&&w.revalidate()},[C]);const K=r.useQueryClient(),q=()=>{E(null),g(!1)};return D||_?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,D?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Ql,{applicationDetails:T,id:R,workflowDetails:w,isDataLoading:N,applicationData:I,businessService:L,timelineStatusPrefix:F,statusAttribute:U,paymentsList:j,showTimeLine:W,oldValue:z,isInfoLabel:V}),y?l.createElement(hl,{t:s,action:f,tenantId:u,state:d,id:v,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:q,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,d,v,p,m,E,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===(d=u.comment)||void 0===d?void 0:d.length)&&0!=(null==e||null===(v=e.WaterConnection)||void 0===v||null===(p=v.comment)||void 0===p?void 0:p.length)&&0!=(null==e||null===(m=e.SewerageConnection)||void 0===m||null===(E=m.comment)||void 0===E?void 0:E.length)&&0!=(null==e||null===(y=e.BPA)||void 0===y||null===(g=y.comment)||void 0===g?void 0:g.length)){function _(t){if(l)return t;O&&(h(!0),O(e,{onError:(e,t)=>{h(!1),A({key:"error",error:e}),setTimeout(x,5e3)},onSuccess:(e,t)=>{var l,o,i,r,a,u,d,v,p,m,E,y;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),h(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=f,c.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=f,c.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.isNoc&&c.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")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(v=d.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(p=t.AmendmentUpdate)&&void 0!==p&&null!==(m=p.workflow)&&void 0!==m&&m.action.includes("APPROVE")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(y=E.workflow)&&void 0!==y&&y.action.includes("REJECT")&&A({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(A({key:"success",action:f}),$&&setTimeout($,3e3),setTimeout(x,5e3),K.clear(),K.refetchQueries("APPLICATION_SEARCH"))}})),q()}h(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const o=function(){if(!1!==t&&P){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==P?void 0:P.mutateAsync(e)),o=me(function(){return h(!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,c,v,p,m;h(!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?s(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===(c=e.response)||void 0===c||null===(v=c.data)||void 0===v||null===(p=v.Errors)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.message)||e;q(),A({key:"error",error:{message:f}}),setTimeout(x,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(_):_(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==w||null===(a=w.data)||void 0===a?void 0:a.timeline,businessService:L,workflowDetails:w,moduleCode:M,cardFormWrapperClassName:"modal-form"}):null,S?l.createElement(oo,{action:f,workflowDetails:w,businessService:L,isWarningPop:S,closeWarningPopup:()=>{b(!1)}}):null,l.createElement(eo,{t:s,showToast:C,closeToast:x,businessService:L}),l.createElement(to,{isAction:Y,workflowDetails:w,displayMenu:p,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)A({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(x,5e3);else if(null!=e&&e.isWarningPopUp)b(!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))c.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;c.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 d,s;c.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else g(!0);E(e),m(!1)},setDisplayMenu:m,businessService:L,forcedActionPrefix:k,ActionBarStyle:B,MenuStyle:H,applicationDetails:T})))},ro=()=>{var e;const{t:r}=o.useTranslation(),{propertyId:a,tenantId:u,redirectToUrl:d}=Digit.Hooks.useQueryParams(),{isLoading:s,data:c}=Digit.Hooks.pt.useGenericViewProperty(r,u,a,{}),{state:v}=i.useLocation(),p=i.useHistory();return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),p.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",null,l.createElement("div",null,l.createElement(t.Header,null,r("PT_PROPERTY_INFO_HEADER"))),l.createElement(io,{applicationDetails:c,isLoading:s,isDataLoading:s,workflowDetails:{},applicationData:null==c?void 0:c.applicationData,moduleCode:"PT"}),window.location.href.includes("redirectToUrl")&&"INACTIVE"!==(null==c||null===(e=c.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:r("PT_ADD_PROPERTY_TO_APP"),onSubmit:()=>(()=>{var e,t,n,l,o,i,r;const s=null!=d&&d.includes("employee/tl")?1600:300;return setTimeout(()=>window.scrollTo(0,s),400),p.push(`${d}?propertyId=${a}&tenantId=${(null==c?void 0:c.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}`:""}`,{...v})})()}))))},ao=e=>{let{stateCode:n}=e;const{t:r}=o.useTranslation(),{path:a,...u}=i.useRouteMatch(),d=[{icon:t.HomeIcon,path:"/digit-ui/employee"},{label:r((()=>{const e=location.pathname;return e.includes("/commonpt/search")?"SEARCH_PROPERTY":e.includes("/view-property")?"PT_PROPERTY_INFORMATION":e.includes("/property/new-application")?"PT_CREATE_PROPERTY":"ES_COMMON_INBOX"})())}];return l.createElement(t.AppContainer,null,l.createElement("div",{className:"ground-container employee-app-container form-container"},l.createElement(t.ModuleHeader,{leftContent:l.createElement(l.Fragment,null,l.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:d}),l.createElement("div",{className:"employee-form"},l.createElement("div",{className:"employee-form-content"},l.createElement("span",{className:"pt-citizen",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(i.Route,{path:a+"/search",component:ge}),l.createElement(i.Route,{path:a+"/property/citizen-search",component:ge}),l.createElement(i.Route,{path:a+"/property/search-results"},l.createElement(Se,{stateCode:n})),l.createElement(i.Route,{path:a+"/property/citizen-otp"},l.createElement(Ce,{stateCode:n})," "),l.createElement(t.PrivateRoute,{path:a+"/property/link-success/:propertyIds",component:be}),l.createElement(t.PrivateRoute,{path:a+"/property/new-application",component:T}),l.createElement(t.PrivateRoute,{path:a+"/view-property",component:()=>l.createElement(ro,null)})))))))},uo=e=>{o.useTranslation();const n=r.useQueryClient(),a=i.useRouteMatch(),u=(i.useLocation(),i.useHistory()),d=Digit.ULBService.getStateId(),[s,c,v]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{}));let{isLoading:p}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=i.useLocation().search;return new URLSearchParams(m).get("redirectToUrl"),p?l.createElement(t.Loader,null):l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:""+a.path},l.createElement(y,{onSelect:function(e,t){try{return u.push({pathname:a.path+"/save-property",search:m,state:{property:null==t?void 0:t.property}}),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"employee"})),l.createElement(i.Route,{exact:!0,path:a.path+"/save-property"},l.createElement(b,{data:s,onSuccess:()=>{v(),n.invalidateQueries("PT_CREATE_PROPERTY")},userType:"employee"})))},so={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"}}}}},co={propertyIds:"",mobileNumber:"",oldPropertyId:"",locality:"",name:"",doorNo:""},vo=e=>{const{t:r}=o.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,d]=n.useState({}),[s,c]=n.useState(co),[v,p]=n.useState("searchId"),[m,f]=n.useState(null),E=i.useLocation().search,y=new URLSearchParams(E).get("redirectToUrl"),g=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchForm")),_=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchResults")),{data:h,isLoading:S}=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&&p("searchDetail")},[v]);const b=n.useCallback(()=>{c(co),d({}),f(null)}),T=n.useCallback(e=>{c(e),Object.keys(e).filter(t=>e[t]&&"object"!=typeof e[t]).length>0?(d(Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{})),f(null)):f({warning:!0,label:"ERR_PT_FILL_VALID_FIELDS"})});return S?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(g,{t:r,payload:s,searchBy:v,setSearchBy:p,PTSearchFields:so,tenantId:a,onSubmit:T,onReset:b})),Object.keys(u).length>0&&l.createElement(_,{t:r,showToast:m,setShowToast:f,tenantId:a,payload:u,ptSearchConfig:{...h},redirectToUrl:y}),m&&l.createElement(t.Toast,{error:m.error,warning:m.warning,label:r(m.label),onClose:()=>{f(null)}}))},po=e=>{let{path:n,userType:r}=e;const{t:a}=o.useTranslation(),u=i.useLocation(),d=(new URLSearchParams(i.useLocation().search).get("propertyId"),new URLSearchParams(i.useLocation().search).get("tenantId"),[{icon:t.HomeIcon,path:"/digit-ui/employee"},{label:a((()=>{const e=u.pathname;return e.includes("/commonpt/search")?"SEARCH_PROPERTY":e.includes("/view-property")?"PT_PROPERTY_INFORMATION":"ES_COMMON_INBOX"})())}]);return l.createElement(t.AppContainer,null,l.createElement("div",{className:"ground-container employee-app-container form-container"},l.createElement(t.ModuleHeader,{leftContent:l.createElement(l.Fragment,null,l.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:d}),l.createElement("div",{className:"employee-form"},l.createElement("div",{className:"employee-form-content"},l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{exact:!0,path:n+"/",component:()=>l.createElement(bo,{matchPath:n,userType:r})}),l.createElement(t.PrivateRoute,{path:n+"/new-application",component:uo}),l.createElement(t.PrivateRoute,{path:n+"/search",component:vo}),l.createElement(t.PrivateRoute,{path:n+"/view-property",component:ro}))))))},mo=/^\d+$/,fo=/^\d+(\.\d{1,2})?$/,Eo=e=>l.createElement("div",{className:"search-tabs-container PropertySearchFormSwitcher",style:{marginBottom:"16px",display:"flex",gap:"24px",justifyContent:"flex-start",borderBottom:"1px solid #ccc"}},e.keys.map(t=>{const n=e.searchBy===t;return l.createElement("div",{key:t,className:"search-tab "+(n?"active":""),style:{padding:"8px 16px",cursor:"pointer",borderBottom:n?"2px solid #f47738":"2px solid transparent",color:n?"#f47738":"#0b0c0c",fontWeight:n?"bold":"normal"},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())))})),yo=e=>l.createElement("span",{className:"cell-text"},e);let go=[];const _o=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":go=[];break;case"WS":go=["WS_COMMON_CONNECTION_DETAIL","WS_COMMON_DOCUMENT_DETAILS","WS_COMMON_SUMMARY"];break;case"TL":go=["TL_COMMON_TR_DETAILS","TL_LOCATION_AND_OWNER_DETAILS","TL_DOCUMENT_DETAIL","TL_COMMON_SUMMARY"];default:go=[]}})(i),l.createElement("div",{className:"timeline-container",style:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},go.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")}))))},ho=()=>{var e;const{t:n}=o.useTranslation(),i={Icon:l.createElement(t.PropertyHouse,null),moduleName:n("ACTION_TEST_COMMON_PROPERTY_TAX"),kpis:[{label:n("PT_TOTAL_APPLICATIONS"),value:0}],links:[{label:n("PT_SEARCH"),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)},So=e=>{let{userType:t,tenants:o}=e;const{path:r,url:a}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({moduleCode:["PT","ws"],language:u}),Digit.SessionStorage.set("PT_TENANTS",o),n.useEffect(()=>"employee"===t&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===t?l.createElement(po,{path:r,url:a,userType:t,tenants:o}):l.createElement(ao,null)},bo=e=>{let{matchPath:n}=e;const{t:i}=o.useTranslation(),r=[{link:n+"/property/citizen-search",i18nKey:i("PT_SEARCH_AND_PAY")},{link:n+"/property/new-application",i18nKey:i("PT_CREATE_PROPERTY")}];return l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_COMMON_PROPERTY_TAX"),links:r,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},To={CommonPTModule:So,CommonPTCard:ho,CommonPTLinks:bo,CPTPropertySearchForm:e=>{let{tenantId:o,t:i,onSubmit:r,onReset:u,searchBy:d,PTSearchFields:s,setSearchBy:c,payload:v}=e;const{register:p,control:m,handleSubmit:f,watch:E,getValues:y,formState:g}=a.useForm({defaultValues:{...v}}),_=E(),h=(null==s?void 0:s[d])||{};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:f},l.createElement(Eo,{keys:Object.keys(s||{}),searchBy:d,onReset:u,t:i,onSwitch:c}),l.createElement("div",{className:"formcomposer-section-grid"},h&&Object.keys(h).map(e=>{var n,r,u;let d=h[e],s=(null==d?void 0:d.validation)||{};return l.createElement(t.SearchField,{key:e},l.createElement("label",null,i(null==d?void 0:d.label),null!=d&&null!==(n=d.validation)&&void 0!==n&&n.required?"*":""),"custom"===(null==d?void 0:d.type)?l.createElement(a.Controller,{name:e,defaultValue:null==_?void 0:_[e],rules:d.validation,control:m,render:(t,n)=>l.createElement(d.customComponent,A({selectLocality:e=>{t.onChange(e)},tenantId:o,selected:null==_?void 0:_[e]},d.customCompProps))}):l.createElement("div",{className:"field-container"},null!=d&&d.componentInFront?l.createElement("span",{className:"employee-card-input employee-card-input--front",style:{flex:"none"}},null==d?void 0:d.componentInFront):null,l.createElement(t.TextInput,{name:e,type:null==d?void 0:d.type,inputRef:p({value:y(e),shouldUnregister:!0,...s})})),l.createElement(t.CardLabelError,null,i(null==g||null===(r=g.errors)||void 0===r||null===(u=r[e])||void 0===u?void 0:u.message)))})),l.createElement("div",{className:"formcomposer-section-button",style:{marginTop:"16px",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}},l.createElement("div",{className:"pt-search-action-reset generic-button clear-search",style:{margin:0}},l.createElement("p",{onClick:()=>{u({})}},i("ES_COMMON_CLEAR_SEARCH"))),l.createElement("div",{className:"pt-search-action-submit submit-bar generic-button",style:{margin:0}},l.createElement(t.SubmitBar,{label:i("ES_COMMON_SEARCH"),submit:!0})))))},CPTPropertySearchResults:e=>{var o,r;let{tenantId:a,t:u,payload:d,showToast:s,setShowToast:c,ptSearchConfig:v,redirectToUrl:p}=e;const m=i.useHistory(),{state:f}=i.useLocation(),E=i.useLocation().search,y=new URLSearchParams(E).get("propertyId");let g=window.location.href.includes("&")?window.location.href.substring(window.location.href.indexOf("&")+1,window.location.href.length):"";const[_,h]=n.useState({...d}),{data:S,isLoading:b,error:T}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:a,filters:_,configs:{enabled:Object.keys(d).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}}),C=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:()=>{const e=window.location.href.includes("/citizen/")?"citizen":"employee";m.push(`/digit-ui/${e}/commonpt/view-property?propertyId=${t.original.propertyId}&tenantId=${a}&redirectToUrl=${p}`,{...f})}},t.original.propertyId)))}},{Header:u("PT_COMMON_TABLE_COL_OWNER_NAME"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return yo(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 yo(u(t.original.locality)||"")}},{Header:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{var t;let{row:n}=e;return yo(u((null==n||null===(t=n.original)||void 0===t?void 0:t.status)||"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"},p?l.createElement("span",{onClick:()=>{m.push(g?`${p}?${null==g?void 0:g.replace(y,n.original.propertyId)}`:`${p}?propertyId=${n.original.propertyId}&tenantId=${a}`,{...f});const e=null!=p&&p.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,e),400)}},u("CPT_SELECT_PROPERTY")):null):u("PT_NA"))}}],[]);let A=window.Digit.Utils.browser.isMobile();if(b)return s&&c(null),l.createElement(t.Loader,null);var D,N,I,O;if(T)return!s&&c({error:!0,label:(null==T||null===(D=T.response)||void 0===D||null===(N=D.data)||void 0===N||null===(I=N.Errors)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.code)||T}),null;const P=n.memo(Digit.ComponentRegistryService.getComponent("PTEmptyResultInbox")),w=Object.values((null==S?void 0:S.FormattedData)||{})||[];return null!=v&&v.ptSearchCount&&d.locality&&w&&w.length>(null==v?void 0:v.ptSearchCount)?(!s&&c({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"}),null):l.createElement(l.Fragment,null,0===(null==S||null===(o=S.Properties)||void 0===o?void 0:o.length)?l.createElement(P,{data:!0}):A?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 C.forEach(n=>{n.Cell&&(t[n.Header]=n.Cell({row:{original:e}}))}),t})}(w),t:u}):l.createElement(t.Table,{t:u,data:w,totalRecords:null==S||null===(r=S.Properties)||void 0===r?void 0:r.length,columns:C,getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),manualPagination:!1,disableSort:!0}))},CPTSearchProperty:ge,CPTPropertyAssemblyDetails:e=>{var o,i,r,u,d,s,v,p,m,f,y,g;let{t:_,config:h,onSelect:S,formData:b,formState:T,setError:C,clearErrors:A}=e;const[D,N]=l.useState({...b.assemblyDet,BuildingType:null==b?void 0:b.PropertyType,floorarea:null==b?void 0:b.landArea,constructionArea:null==b?void 0:b.constructionArea,usageCategoryMajor:null!=b&&b.usageCategoryMajor&&"NONRESIDENTIAL.OTHERS"===(null==b||null===(o=b.usageCategoryMajor)||void 0===o?void 0:o.code)?{code:""+(null==b||null===(i=b.usageCategoryMajor)||void 0===i?void 0:i.code),i18nKey:"PROPERTYTAX_BILLING_SLAB_OTHERS"}:null==b?void 0:b.usageCategoryMajor}),[I,O]=l.useState("");let P=Digit.ULBService.getCurrentTenantId();const[w,R]=n.useState(!1),L=window.Digit.Utils.browser.isMobile();let x=[];console.log("Calling usePropertyMDMS with tenantId:",P);const{data:M=[]}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","PTPropertyType")||{};x=(null==M||null===(r=M.PropertyTax)||void 0===r?void 0:r.PropertyType)||(Array.isArray(M)?M:[]);const{data:F=[]}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","UsageCategory")||{};console.log("UsageCategory Menu Data (transformed):",F);let k=(null==F||null===(u=F.PropertyTax)||void 0===u?void 0:u.UsageCategory)||(Array.isArray(F)?F:[]);function U(e){let t=[];if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++)1!=n&&4!=n&&t.push({i18nKey:"COMMON_PROPTYPE_"+E(e[n].code,".","_"),code:e[n].code});return t.sort((e,t)=>e.i18nKey.split("_").pop().localeCompare(t.i18nKey.split("_").pop())),t}function B(e){let t=[];for(let u=0;u<e.length;u++){var n,l,o,i,r,a;Array.isArray(e)&&e.length>0&&"NONRESIDENTIAL"==(null===(n=e[u])||void 0===n||null===(l=n.code)||void 0===l||null===(o=l.split)||void 0===o?void 0:o.call(l,".")[0])&&2==(null===(i=e[u])||void 0===i||null===(r=i.code)||void 0===r||null===(a=r.split)||void 0===a?void 0:a.call(r,".").length)&&t.push({i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e[u].code.split(".")[1],code:e[u].code})}return t}const{control:H,formState:{errors:j,touched:W},trigger:z,watch:V,clearErrors:$}=a.useForm(),Y=V(),K={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.useEffect(()=>{let e=!1;const t={};Object.keys(D).forEach(e=>{t[e]=null==Y?void 0:Y[e]}),c.isEqual(t,D)||Object.keys(D).forEach(t=>{D[t]?(e=!1,$(t)):e=!0}),e?C(null==h?void 0:h.key,{type:j}):A(null==h?void 0:h.key),z(),R(e),S(null==h?void 0:h.key,D)},[D]),l.useEffect(()=>{var e;Object.keys(j).length&&!c.isEqual((null===(e=T.errors[h.key])||void 0===e?void 0:e.type)||{},j)?C(h.key,{type:j}):!Object.keys(j).length&&T.errors[h.key]&&w&&A(h.key)},[j]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_PROP_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"BuildingType",control:H,defaultValue:null==D?void 0:D.BuildingType,rules:{required:_("REQUIRED_FIELD")},key:null==h?void 0:h.key,render:e=>{var n,o;return l.createElement(t.Dropdown,{selected:1===(null===(n=U(x))||void 0===n?void 0:n.length)?U(x)[0]:null==D?void 0:D.BuildingType,disable:1===(null===(o=U(x))||void 0===o?void 0:o.length),option:U(x),autoFocus:"BuildingType"===I,select:t=>{e.onChange(t),N({...D,BuildingType:t}),O("BuildingType")},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:_})}}))),(null==W?void 0:W.BuildingType)&&(null==j||null===(d=j.BuildingType)||void 0===d?void 0:d.message)&&l.createElement(t.CardLabelError,{style:K},null==j||null===(s=j.BuildingType)||void 0===s?void 0:s.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_TOT_LAND_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"floorarea",control:H,defaultValue:null==D?void 0:D.floorarea,rules:{required:_("REQUIRED_FIELD"),validate:e=>!!/^([0-9]){0,8}$/i.test(e)||_("PT_TOT_LAND_AREA_ERROR_MESSAGE")},key:null==h?void 0:h.key,render:e=>l.createElement(t.TextInput,{t:_,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totLandArea",value:null==e?void 0:e.value,autoFocus:"floorarea"===I,onChange:t=>{null==e||e.onChange(t.target.value),N({...D,floorarea:t.target.value}),O("floorarea")},onBlur:null==e?void 0:e.onBlur})}))),(null==W?void 0:W.floorarea)&&(null==j||null===(v=j.floorarea)||void 0===v?void 0:v.message)&&l.createElement(t.CardLabelError,{style:K},null==j||null===(p=j.floorarea)||void 0===p?void 0:p.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_TOT_CONSTRUCTION_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"constructionArea",control:H,defaultValue:null==D?void 0:D.constructionArea,key:null==h?void 0:h.key,rules:{required:_("REQUIRED_FIELD"),validate:e=>!!(/^([0-9]){0,8}$/i.test(e)&&null!=D&&D.floorarea&&parseInt(e)<parseInt(null==D?void 0:D.floorarea))||_("PT_TOT_CONSTRUCTION_AREA_ERROR_MESSAGE")},render:e=>l.createElement(t.TextInput,{t:_,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totConstructionArea",value:null==e?void 0:e.value,autoFocus:"constructionArea"===I,onChange:t=>{null==e||e.onChange(t.target.value),O("constructionArea"),N({...D,constructionArea:t.target.value})},onBlur:null==e?void 0:e.onBlur})}))),(null==W?void 0:W.constructionArea)&&(null==j||null===(m=j.constructionArea)||void 0===m?void 0:m.message)&&l.createElement(t.CardLabelError,{style:L?{...K,marginLeft:"0px"}:{...K}},null==j||null===(f=j.constructionArea)||void 0===f?void 0:f.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_ASSESMENT_INFO_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"usageCategoryMajor",defaultValue:null==D?void 0:D.usageCategoryMajor,rules:{required:_("REQUIRED_FIELD")},control:H,key:null==h?void 0:h.key,render:e=>{var n;return l.createElement(t.Dropdown,{selected:null==e?void 0:e.value,disable:1===(null===(n=B(k))||void 0===n?void 0:n.length),option:B(k),autoFocus:"usageCategoryMajor"===I,select:t=>{null==e||e.onChange(t),O("usageCategoryMajor"),N({...D,usageCategoryMajor:t})},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:_})}}))),(null==W?void 0:W.usageCategoryMajor)&&(null==j||null===(y=j.usageCategoryMajor)||void 0===y?void 0:y.message)&&l.createElement(t.CardLabelError,{style:K},null==j||null===(g=j.usageCategoryMajor)||void 0===g?void 0:g.message))},CPTPropertyLocationDetails:e=>{var i;let{address:r,isEdit:a,onSelect:u,config:d,hideZRO:s,formData:c,...v}=e;const{t:p}=o.useTranslation(),[m,f]=n.useState(null),[E,y]=n.useState({addressType:(null==r?void 0:r.addressType)||"",pincode:(null==r?void 0:r.pinCode)||"",city:(null==r?void 0:r.city)||"",locality:(null==r?void 0:r.locality)||"",streetName:(null==r?void 0:r.streetName)||"",houseNo:(null==r?void 0:r.houseNumber)||"",houseName:(null==r?void 0:r.houseName)||"",landmark:(null==r?void 0:r.landmark)||"",addressLine1:(null==r?void 0:r.address)||"",addressLine2:(null==r?void 0:r.address2)||"",latitude:(null==r?void 0:r.latitude)||"",longitude:(null==r?void 0:r.longitude)||"",assembly:(null==r?void 0:r.assembly)||"",block:(null==r?void 0:r.block)||"",zone:(null==r?void 0:r.zone)||"",zroLocation:(null==r?void 0:r.zroLocation)||"",subLocality:(null==r?void 0:r.subLocality)||"",actualAssembly:(null==r?void 0:r.actualAssembly)||"",actualWard:(null==r?void 0:r.actualWard)||"",actualZone:(null==r?void 0:r.actualZone)||""}),g=window.location.href.includes("ws/old-application");return n.useEffect(()=>{v.register&&(v.register({name:"cpt"}),v.register({name:"cptId"}))},[v.register]),n.useEffect(()=>{var e;if(null!=c&&null!==(e=c.cpt)&&void 0!==e&&e.details){var t,n,l,o,i,r,a,s,v,p,m,f,E,g,_,h,S,b,T,C;const e=c.cpt.details,u=e.address||{},d=e.additionalDetails||{},A=(null===(t=u.locality)||void 0===t?void 0:t.code)||u.locality||"",D=null!==(n=u.geoLocation)&&void 0!==n&&n.latitude&&0!==(null===(l=u.geoLocation)||void 0===l?void 0:l.latitude)?u.geoLocation.latitude:(null===(o=u.locality)||void 0===o?void 0:o.latitude)||u.latitude||"",N=null!==(i=u.geoLocation)&&void 0!==i&&i.longitude&&0!==(null===(r=u.geoLocation)||void 0===r?void 0:r.longitude)?u.geoLocation.longitude:(null===(a=u.locality)||void 0===a?void 0:a.longitude)||u.longitude||"",I=u.zroLocation||d.zroLocation||(null===(s=u.additionalDetails)||void 0===s?void 0:s.zroLocation)||"",O=I?{code:I,name:I,i18nKey:I}:"";y({pincode:u.pincode||"",city:u.city||"",locality:A,streetName:u.street||"",houseNo:u.houseNo||"",landmark:u.landmark||"",latitude:D,longitude:N,assembly:d.assembly||(null===(v=u.additionalDetails)||void 0===v?void 0:v.assembly)||"",block:d.block||(null===(p=u.additionalDetails)||void 0===p?void 0:p.block)||"",zone:d.zone||(null===(m=u.additionalDetails)||void 0===m?void 0:m.zone)||"",zroLocation:I,zro:O,subLocality:u.subLocality||"",actualAssembly:u.actualAssembly||d.actualAssembly||(null===(f=u.additionalDetails)||void 0===f?void 0:f.actualAssembly)||"",actualWard:u.actualWard||d.actualWard||(null===(E=u.additionalDetails)||void 0===E?void 0:E.actualWard)||"",actualZone:u.actualZone||d.actualZone||(null===(g=u.additionalDetails)||void 0===g?void 0:g.actualZone)||"",address:{...u,city:u.city||"",pincode:u.pincode||"",locality:A,streetName:u.street||"",houseNo:u.houseNo||"",addressLine1:u.street||"",latitude:D,longitude:N,zroLocation:I,zro:O,assembly:d.assembly||(null===(_=u.additionalDetails)||void 0===_?void 0:_.assembly)||"",block:d.block||(null===(h=u.additionalDetails)||void 0===h?void 0:h.block)||"",zone:d.zone||(null===(S=u.additionalDetails)||void 0===S?void 0:S.zone)||"",subLocality:u.subLocality||"",actualWard:u.actualWard||d.actualWard||(null===(b=u.additionalDetails)||void 0===b?void 0:b.actualWard)||"",actualZone:u.actualZone||d.actualZone||(null===(T=u.additionalDetails)||void 0===T?void 0:T.actualZone)||"",actualAssembly:u.actualAssembly||d.actualAssembly||(null===(C=u.additionalDetails)||void 0===C?void 0:C.actualAssembly)||""}})}else if(null===(null==c?void 0:c.cpt)){const e={addressType:"",pincode:"",city:"",locality:"",streetName:"",houseNo:"",houseName:"",landmark:"",addressLine1:"",addressLine2:"",latitude:"",longitude:"",assembly:"",block:"",zone:"",zroLocation:"",subLocality:"",actualWard:"",actualZone:"",actualAssembly:"",zro:"",address:{}};y(e),u((null==d?void 0:d.key)||"address",e)}},[null==c||null===(i=c.cpt)||void 0===i?void 0:i.details,null==c?void 0:c.cpt]),n.useEffect(()=>{if(m){const e=setTimeout(()=>{f(null)},1e3);return()=>clearTimeout(e)}},[m]),l.createElement(t.CollapsibleCardPage,{title:p("PT_LOCATION_DETAILS"),defaultOpen:!0},l.createElement("div",{style:{boxShadow:"none",...v.style}},l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.AddressDetails,{t:p,formData:E,onSelect:(e,t)=>{y(e=>({...e,...t})),u(e,t)},config:{isCollapsible:!1,...d},isEdit:a,showZRO:!s,showMapActualLocation:!0,disable:g,hideNextButton:!0}))))},CPTPropertyOwnerDetails:e=>{var o,r,u,d,s,v,p,m,f,E,y,g,_,h,S;let{t:b,config:T,onSelect:C,formData:A,formState:D,setError:N,clearErrors:I,...O}=e;const{pathname:P}=i.useLocation(),w=P.includes("/modify-application/"),R=(P.includes("/property-mutation/"),window.Digit.Utils.browser.isMobile()),[L,x]=l.useState((null==A?void 0:A.ownershipCategory)||""),[M,F]=l.useState([{...A.owners&&A.owners[0],name:A.owners&&A.owners[0]&&A.owners[0].name||(null==A||null===(o=A.owners)||void 0===o?void 0:o.name)||"",gender:A.owners&&A.owners[0]&&A.owners[0].gender||(null==A||null===(r=A.owners)||void 0===r?void 0:r.gender),mobileNumber:A.owners&&A.owners[0]&&A.owners[0].mobileNumber||(null==A||null===(u=A.owners)||void 0===u?void 0:u.mobileNumber)||"",fatherOrHusbandName:A.owners&&A.owners[0]&&A.owners[0].fatherOrHusbandName||(null==A||null===(d=A.owners)||void 0===d?void 0:d.fatherOrHusbandName)||"",relationship:A.owners&&A.owners[0]&&A.owners[0].relationship||(null==A||null===(s=A.owners)||void 0===s?void 0:s.relationship),ownershipCategory:L,ownerType:A.owners&&A.owners[0]&&(null===(v=A.owners[0])||void 0===v?void 0:v.ownerType)||(null===(p=A.owners)||void 0===p?void 0:p.ownerType),permanentAddress:A.owners&&A.owners[0]&&A.owners[0].permanentAddress||(null==A||null===(m=A.owners)||void 0===m?void 0:m.permanentAddress)||"",email:A.owners&&A.owners[0]&&A.owners[0].email||(null==A||null===(f=A.owners)||void 0===f?void 0:f.emailId)||"",isCoresAddr:!1}]),[k,U]=n.useState(!1),[B,H]=l.useState(!1),j=(null==A?void 0:A.isUpdateProperty)||!1;let W=(null==A?void 0:A.isEditProperty)||!1;const z=Digit.ULBService.getStateId(),V=Digit.ULBService.getCurrentTenantId(),{data:$}=Digit.Hooks.pt.useGenderMDMS(z,"common-masters","GenderType");let Y=[];$&&$.map(e=>{Y.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const{data:K}=Digit.Hooks.pt.usePropertyMDMS(V,"PropertyTax","OwnerType"),q=(null==K||null===(E=K.PropertyTax)||void 0===E?void 0:E.OwnerType)||(Array.isArray(K)?K:[]),{data:G}=Digit.Hooks.pt.usePropertyMDMS(V,"PropertyTax",["OwnerShipCategory"]),[Z,X]=n.useState(null==A||null===(y=A.owners)||void 0===y?void 0:y.isCorrespondenceAddress),J=[{name:"HUSBAND",code:"HUSBAND",i18nKey:"PT_RELATION_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"PT_RELATION_FATHER"}],{control:Q,formState:{errors:ee,touched:te},trigger:ne,watch:le,clearErrors:oe}=a.useForm(),ie=le();n.useEffect(()=>{let e=!1;const t={};M.map(n=>{Object.keys(n).forEach(e=>{t[e]=null==ie?void 0:ie[e]}),c.isEqual(t,n)||Object.keys(n).forEach(t=>{n[t]?(e=!1,oe(t)):e=!0})}),e?N(null==T?void 0:T.key,{type:ee}):I(null==T?void 0:T.key),ne(),U(e),C(null==T?void 0:T.key,M.map(e=>({...e,ownershipCategory:L})))},[M]),n.useEffect(()=>{var e;Object.keys(ee).length&&!c.isEqual((null===(e=D.errors[T.key])||void 0===e?void 0:e.type)||{},ee)?N(T.key,{type:ee}):!Object.keys(ee).length&&D.errors[T.key]&&k&&I(T.key)},[ee]);const re=function(e,t,n){void 0===e&&(e="name"),void 0===t&&(t=0),void 0===n&&(n=""),F(M.map((l,o)=>(o===t&&(l[e]=n),{...l})))},ae=(n.useMemo(()=>{var e,t,n;return null==G||null===(e=G.PropertyTax)||void 0===e||null===(t=e.OwnerShipCategory)||void 0===t||null===(n=t.filter(e=>"INDIVIDUAL.SINGLEOWNER"===e.code||"INDIVIDUAL.MULTIPLEOWNERS"===e.code||1===e.code.split(".").length&&e.code.includes("INSTITUTIONAL")))||void 0===n?void 0:n.map(e=>({...e,i18nKey:"PT_OWNERSHIP_CATEGORY_"+e.code.replaceAll(".","_")}))},[G]),n.useMemo(()=>{var e,t;const n=null==L?void 0:L.code,l=null==G||null===(e=G.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;return(null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1])&&{...e,i18nKey:"PT_OWNERSHIP_CATEGORY_"+(null===(l=e.code)||void 0===l?void 0:l.replaceAll(".","_"))}})},[G,null==L?void 0:L.code]),{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}),ue=!(null==L||null===(g=L.code)||void 0===g||!g.includes("MULTIPLEOWNERS"));return null==L||null===(_=L.code)||void 0===_||_.includes("INSTITUTIONAL"),l.createElement(t.CollapsibleCardPage,{title:b("PT_OWNER_DETAILS"),defaultOpen:!0,style:O.style},null==M?void 0:M.map((e,n)=>{var o,i,r,u,d,s,c,v,p,m,f,E,y,g;return l.createElement("div",{key:n},R&&ue&&M.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!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}})),l.createElement(l.Fragment,null,l.createElement("div",{className:"formcomposer-section-grid"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"mobileNumber"+n,name:"mobileNumber"+n,defaultValue:e.mobileNumber,control:Q,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),re("mobileNumber",n,e)},disable:j||W,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}})),!R&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",width:"20%",alignSelf:"flex-start"}},ue&&l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"0px"},fill:1!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}}))),(null==te?void 0:te["mobileNumber"+n])&&(null==ee||null===(o=ee["mobileNumber"+n])||void 0===o?void 0:o.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(i=ee["mobileNumber"+n])||void 0===i?void 0:i.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_OWNER_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"name"+n,name:"name"+n,defaultValue:null==e?void 0:e.name,control:Q,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),re("name",n,e.target.value)},disable:j||W,onBlur:r})}}))),(null==te?void 0:te["name"+n])&&(null==ee||null===(r=ee["name"+n])||void 0===r?void 0:r.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(u=ee["name"+n])||void 0===u?void 0:u.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GENDER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"gender"+n,name:"gender"+n,defaultValue:null==e?void 0:e.gender,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"gender"+n,options:Y,selectedOption:o,optionKey:"code",onSelect:e=>{i(e),re("gender",n,e)},t:b,disabled:j||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),(null==te?void 0:te["gender"+n])&&(null==ee||null===(d=ee["gender"+n])||void 0===d?void 0:d.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(s=ee["gender"+n])||void 0===s?void 0:s.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GUARDIAN_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"fatherOrHusbandName"+n,name:"fatherOrHusbandName"+n,defaultValue:null==e?void 0:e.fatherOrHusbandName,control:Q,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),re("fatherOrHusbandName",n,e.target.value)},disable:j||W,onBlur:r})}}))),(null==te?void 0:te["fatherOrHusbandName"+n])&&(null==ee||null===(c=ee["fatherOrHusbandName"+n])||void 0===c?void 0:c.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(v=ee["fatherOrHusbandName"+n])||void 0===v?void 0:v.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_RELATIONSHIP")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"relationship"+n,name:"relationship"+n,defaultValue:null==e?void 0:e.relationship,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"relationship"+n,options:J,selectedOption:o,optionKey:"i18nKey",onSelect:e=>{i(e),re("relationship",n,e)},t:b,disabled:j||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),(null==te?void 0:te["relationship"+n])&&(null==ee||null===(p=ee["relationship"+n])||void 0===p?void 0:p.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(m=ee["relationship"+n])||void 0===m?void 0:m.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},b("PT_SPECIAL_APPLICANT_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"ownerType"+n,name:"ownerType"+n,defaultValue:null==e?void 0:e.ownerType,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.Dropdown,{selected:1===(null==q?void 0:q.length)?q[0]:o,disable:1===(null==q?void 0:q.length)||w,option:q?q.sort((e,t)=>e.name.localeCompare(t.name)):[],select:e=>{i(e),re("ownerType",n,e)},optionKey:"i18nKey",t:b,onBlur:r})}}))),(null==te?void 0:te["ownerType"+n])&&(null==ee||null===(f=ee["ownerType"+n])||void 0===f?void 0:f.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(E=ee["ownerType"+n])||void 0===E?void 0:E.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==M||null===(y=M[n])||void 0===y?void 0:y.isCoresAddr),name:"address"+n,onChange:e=>{var t;!0!==(null==M||null===(t=M[n])||void 0===t?void 0:t.isCoresAddr)&&re("permanentAddress",n,e.target.value)},value:null==M||null===(g=M[n])||void 0===g?void 0:g.permanentAddress}))))))}),ue?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>F(e=>[...e,{name:"",gender:"",mobileNumber:"",fatherOrHusbandName:"",relationship:"",ownershipCategory:L,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=D.errors)||void 0===h||null===(S=h.mulipleOwnerError)||void 0===S?void 0:S.message)||""))):null)},PropertyWaterConnection:e=>{var o,i,r,u,d,s,v,p,m,f,E,y;let{t:g,config:_,onSelect:h,formData:S,setError:b,clearErrors:T,...C}=e;const{control:A,register:D,formState:{errors:N},watch:I,setValue:O}=a.useForm({defaultValues:(null==S?void 0:S[_.key])||{useDetails:{propertyCategory:null,propertyType:null,WaterConnectionUsageType:null,noOfFloors:null,plotArea:"",builtUpArea:"",SelectYearofConstruction:null,NumberofDwellingUnits:"",NumberofRooms:"",hospitalBeds:""}}}),P=Digit.ULBService.getCurrentTenantId(),{data:w}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax",["PropertyCategory","PropertyType","NoOfFloors","PropertyNewUsageType"]),{data:R}=Digit.Hooks.ws.useMDMS(P,"ws-services-masters",["WsCategoryType"]),[L,x]=n.useState([]);n.useEffect(()=>{var e;const t=(null==R||null===(e=R["ws-services-masters"])||void 0===e?void 0:e.WsCategoryType)||[];t.forEach(e=>e.i18nKey=e.i18nKey||"WS_CATEGORY_"+e.code),x(t)},[R]);const M=window.location.href.includes("ws/old-application");n.useEffect(()=>{C.register&&C.register({name:"cpt"})},[C.register]);const F=I(),k=I("useDetails.categoryType"),U=I("useDetails.propertyType"),B=I("useDetails.propertyCategory"),H="HOSPITAL_NURSING_HOME"===(null==U?void 0:U.code)||"HospitalNursingHome"===(null==U?void 0:U.code),j="HOTEL_OR_RESTAURANT"===(null==U?void 0:U.code)||"HotelOrRestaurant"===(null==U?void 0:U.code),W=n.useMemo(()=>{const e=(new Date).getFullYear(),t=[];for(let n=e;n>=e-100;n--)t.push({value:n.toString(),name:n.toString()});return t},[]),z=n.useMemo(()=>{var e,t;let n=(null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.PropertyCategory)||void 0===t?void 0:t.filter(e=>e.active))||[];return null!=k&&k.code&&(n=n.filter(e=>e.type===k.code)),n.map(e=>({code:e.code,name:e.name}))},[w,k]);n.useEffect(()=>{k&&B&&(z.some(e=>e.code===B.code)||O("useDetails.propertyCategory",null))},[k,z,O,B]);const V=n.useMemo(()=>{var e,t;let n=(null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.PropertyType)||void 0===t?void 0:t.filter(e=>e.active))||[];var l;return null!=B&&B.code&&"MIXED"!==(null==B||null===(l=B.code)||void 0===l?void 0:l.toUpperCase())&&(n=n.filter(e=>{var t,n;return(null===(t=e.type)||void 0===t?void 0:t.toUpperCase())===(null===(n=B.code)||void 0===n?void 0:n.toUpperCase())})),n.map(e=>({code:e.code,name:e.name}))},[w,B]);n.useEffect(()=>{B&&U&&(V.some(e=>e.code===U.code)||O("useDetails.propertyType",null))},[B,V,O,U]);const $=n.useMemo(()=>{var e,t;return null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.PropertyNewUsageType)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name}))},[w]),Y=n.useMemo(()=>{var e,t;return null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.NoOfFloors)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name}))},[w]),K=l.useRef(null);n.useEffect(()=>{c.isEqual(K.current,F)||(K.current=c.cloneDeep(F),h(_.key,F))},[F,_.key,h]),n.useEffect(()=>{var e;if(null!=S&&null!==(e=S.cpt)&&void 0!==e&&e.details){var t,n,l;const e=S.cpt.details,o=(null==e?void 0:e.additionalDetails)||{},i=o.categoryType||(null!==(t=e.usageCategory)&&void 0!==t&&t.includes("RESIDENTIAL")?"DOMESTIC":"NON_DOMESTIC");O("useDetails.categoryType",(null==L?void 0:L.find(e=>e.code===i))||null),O("useDetails.propertyCategory",(null==z?void 0:z.find(t=>t.code===(o.propertyCategory||e.usageCategory)))||null),O("useDetails.propertyType",(null==V?void 0:V.find(t=>t.code===(o.propertyType||e.propertyType)))||null),O("useDetails.WaterConnectionUsageType",(null==$?void 0:$.find(e=>e.code===o.waterConnectionUsageType))||null),O("useDetails.noOfFloors",(null==Y?void 0:Y.find(t=>{var n;const l=o.numberOfFloors,i=o.noOfFloors,r=null===(n=e.noOfFloors)||void 0===n?void 0:n.toString();return t.code===l||t.code===i||t.code===r||r&&t.code===r+"_FLOOR"}))||null),O("useDetails.plotArea",o.plotArea||(null==e||null===(n=e.landArea)||void 0===n?void 0:n.toString())||""),O("useDetails.builtUpArea",o.builtUpArea||(null==e||null===(l=e.superBuiltUpArea)||void 0===l?void 0:l.toString())||""),O("useDetails.SelectYearofConstruction",(null==W?void 0:W.find(e=>e.value===o.yearOfConstruction))||null),O("useDetails.NumberofDwellingUnits",o.numberOfDwellingUnits||o.noOfDwellingUnits||(null==e?void 0:e.noOfDwellingUnits)||""),O("useDetails.NumberofRooms",o.numberOfRooms||o.noOfRooms||(null==e?void 0:e.noOfRooms)||"")}else null===(null==S?void 0:S.cpt)&&(O("useDetails.categoryType",null),O("useDetails.propertyCategory",null),O("useDetails.propertyType",null),O("useDetails.WaterConnectionUsageType",null),O("useDetails.noOfFloors",null),O("useDetails.plotArea",""),O("useDetails.builtUpArea",""),O("useDetails.SelectYearofConstruction",null),O("useDetails.NumberofDwellingUnits",""),O("useDetails.NumberofRooms",""),O("useDetails.hospitalBeds",""))},[null==S||null===(o=S.cpt)||void 0===o?void 0:o.details,null==S?void 0:S.cpt,z,V,$,Y,W,L,O]);const q=l.useRef(null);n.useEffect(()=>{const e=Object.keys(N).length>0;q.current!==e&&(q.current=e,e?b(_.key,{type:"custom",message:"Validation failed"}):T(_.key))},[N,_.key,b,T]);const G={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(t.CollapsibleCardPage,{title:g("WS_PROPERTY_AND_WATER_CONNECTION_USE_DETAILS"),defaultOpen:!0,style:C.style},l.createElement("div",{className:"formcomposer-section-grid"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_CATEGORY_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.categoryType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:L,optionKey:"i18nKey",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(i=N.useDetails)||void 0===i?void 0:i.categoryType)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.categoryType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_PROPERTY_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.propertyCategory",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:z,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(r=N.useDetails)||void 0===r?void 0:r.propertyCategory)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.propertyCategory.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_PROPERTY_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.propertyType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:V,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(u=N.useDetails)||void 0===u?void 0:u.propertyType)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.propertyType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_WATER_CONNECTION_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.WaterConnectionUsageType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:$,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(d=N.useDetails)||void 0===d?void 0:d.WaterConnectionUsageType)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.WaterConnectionUsageType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_NUMBER_OF_FLOORS")),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.noOfFloors",render:e=>l.createElement(t.Dropdown,{option:Y,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(s=N.useDetails)||void 0===s?void 0:s.noOfFloors)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.noOfFloors.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_PLOT_AREA")),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:fo,message:g("ERR_INVALID_DECIMAL")}}),name:"useDetails.plotArea",disabled:M}))),(null==N||null===(v=N.useDetails)||void 0===v?void 0:v.plotArea)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.plotArea.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_BUILT_UP_AREA")),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:fo,message:g("ERR_INVALID_DECIMAL")}}),name:"useDetails.builtUpArea",disabled:M}))),(null==N||null===(p=N.useDetails)||void 0===p?void 0:p.builtUpArea)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.builtUpArea.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_SELECT_YEAR_OF_CONSTRUCTION")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.SelectYearofConstruction",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:W,optionKey:"value",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(m=N.useDetails)||void 0===m?void 0:m.SelectYearofConstruction)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.SelectYearofConstruction.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_NUMBER_OF_DWELLING_UNITS")),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:mo,message:g("ERR_INVALID_NUMBER")}}),name:"useDetails.NumberofDwellingUnits",disabled:M}))),(null==N||null===(f=N.useDetails)||void 0===f?void 0:f.NumberofDwellingUnits)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.NumberofDwellingUnits.message),j?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_ROOMS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:mo,message:g("ERR_INVALID_NUMBER")},required:!!j&&g("REQUIRED_FIELD")}),name:"useDetails.NumberofRooms",disabled:M}))):null,j&&(null==N||null===(E=N.useDetails)||void 0===E?void 0:E.NumberofRooms)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.NumberofRooms.message),H?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_BEDS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:mo,message:g("ERR_INVALID_NUMBER")},required:!!H&&g("REQUIRED_FIELD")}),name:"useDetails.hospitalBeds",disabled:M}))):null,H&&(null==N||null===(y=N.useDetails)||void 0===y?void 0:y.hospitalBeds)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.hospitalBeds.message)))},CPTKnowYourProperty:e=>{var o,i;let{t:r,config:a,onSelect:u,formData:d}=e;const[s,c]=n.useState(null===(o=d)||void 0===o||null===(i=o.PropDetails)||void 0===i?void 0:i.KnowProperty);if(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/")){let e=JSON.parse(sessionStorage.getItem("EditFormData"));d={...d,...e}}return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(_o,null):null,l.createElement(t.FormStep,{t:r,config:a,onSelect:function(){sessionStorage.setItem("KnowProperty",s.i18nKey),u(a.key,{KnowProperty:s})},onSkip:()=>u(),isDisabled:!s},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:s,onSelect:function(e){c(e)}})))},CPTPropertyDetails:e=>{var n,o,r,a,u,d,s,c,v,p,m,f,E,y,g,h,S,b,T,C,A,D,N,I,O,P,w,R,L,x,M,F,k,U,B,H,j,W,z,V,$,Y,K,q,G,Z,X,J,Q,ee,te,ne,le,oe,ie,re,ae,ue,de,se,ce,ve,pe,me,fe;let{t:Ee,config:ye,onSelect:ge,formData:_e}=e;const he=("YES"===(null===(n=_e)||void 0===n||null===(o=n.knowyourproperty)||void 0===o||null===(r=o.KnowProperty)||void 0===r?void 0:r.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(a=_e)||void 0===a||null===(u=a.cptSearchQuery)||void 0===u?void 0:u.city:null===(d=_e)||void 0===d||null===(s=d.cpt)||void 0===s||null===(c=s.details)||void 0===c?void 0:c.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"));_e={..._e,...e}}const{isLoading:Se,data:be}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null!==(v=_e)&&void 0!==v&&null!==(p=v.cptId)&&void 0!==p&&p.id||null!==(m=_e)&&void 0!==m&&null!==(f=m.cpt)&&void 0!==f&&null!==(E=f.details)&&void 0!==E&&E.propertyId?"YES"===(null===(y=_e)||void 0===y||null===(g=y.knowyourproperty)||void 0===g||null===(h=g.KnowProperty)||void 0===h?void 0:h.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(S=_e)||void 0===S||null===(b=S.cptId)||void 0===b?void 0:b.id:null===(T=_e)||void 0===T||null===(C=T.cpt)||void 0===C||null===(A=C.details)||void 0===A?void 0:A.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(D=_e)||void 0===D||null===(N=D.tradeLicenseDetail)||void 0===N||null===(I=N.additionalDetail)||void 0===I?void 0:I.propertyId:(null===(O=_e)||void 0===O||null===(P=O.cptId)||void 0===P?void 0:P.id)||(null===(w=_e)||void 0===w||null===(R=w.cpt)||void 0===R||null===(L=R.details)||void 0===L?void 0:L.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()},{filters:{propertyIds:null!==(x=_e)&&void 0!==x&&null!==(M=x.cptId)&&void 0!==M&&M.id||null!==(F=_e)&&void 0!==F&&null!==(k=F.cpt)&&void 0!==k&&null!==(U=k.details)&&void 0!==U&&U.propertyId?"YES"===(null===(B=_e)||void 0===B||null===(H=B.knowyourproperty)||void 0===H||null===(j=H.KnowProperty)||void 0===j?void 0:j.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(W=_e)||void 0===W||null===(z=W.cptId)||void 0===z?void 0:z.id:null===(V=_e)||void 0===V||null===($=V.cpt)||void 0===$||null===(Y=$.details)||void 0===Y?void 0:Y.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(K=_e)||void 0===K||null===(q=K.tradeLicenseDetail)||void 0===q||null===(G=q.additionalDetail)||void 0===G?void 0:G.propertyId:(null===(Z=_e)||void 0===Z||null===(X=Z.cptId)||void 0===X?void 0:X.id)||(null===(J=_e)||void 0===J||null===(Q=J.cpt)||void 0===Q||null===(ee=Q.details)||void 0===ee?void 0:ee.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()}),Te=()=>{sessionStorage.setItem("cpt",null==be?void 0:be.Properties[0]),ge("cpt",{details:null==be?void 0:be.Properties[0]})},Ce=Array.isArray(null==be||null===(te=be.Properties)||void 0===te||null===(ne=te[0])||void 0===ne?void 0:ne.owners)?null==be||null===(le=be.Properties)||void 0===le||null===(oe=le[0])||void 0===oe?void 0:oe.owners.slice().reverse():[];let Ae=[];var De,Ne,Ie,Oe,Pe,we,Re,Le,xe,Me,Fe,ke,Ue,Be,He,je,We,ze,Ve,$e,Ye,Ke,qe,Ge,Ze,Xe,Je,Qe,et,tt,nt,lt,ot,it,rt;return be&&null!=be&&be.Properties.length&&(null!=be&&null!==(De=be.Properties[0])&&void 0!==De&&null!==(Ne=De.address)&&void 0!==Ne&&Ne.doorNo&&Ae.push(null==be||null===(He=be.Properties[0])||void 0===He||null===(je=He.address)||void 0===je?void 0:je.doorNo),(null!=be&&null!==(Ie=be.Properties[0])&&void 0!==Ie&&null!==(Oe=Ie.address)&&void 0!==Oe&&Oe.street||null!=be&&null!==(Pe=be.Properties[0])&&void 0!==Pe&&null!==(we=Pe.address)&&void 0!==we&&we.buildingName)&&Ae.push((null==be||null===(We=be.Properties[0])||void 0===We||null===(ze=We.address)||void 0===ze?void 0:ze.street)||(null==be||null===(Ve=be.Properties[0])||void 0===Ve||null===($e=Ve.address)||void 0===$e?void 0:$e.buildingName)),null!=be&&null!==(Re=be.Properties[0])&&void 0!==Re&&null!==(Le=Re.address)&&void 0!==Le&&Le.landmark&&Ae.push(null==be||null===(Ye=be.Properties[0])||void 0===Ye||null===(Ke=Ye.address)||void 0===Ke?void 0:Ke.landmark),null!=be&&null!==(xe=be.Properties[0])&&void 0!==xe&&null!==(Me=xe.address)&&void 0!==Me&&null!==(Fe=Me.locality)&&void 0!==Fe&&Fe.code&&Ae.push(Ee(Digit.Utils.pt.getMohallaLocale(null==be||null===(qe=be.Properties[0])||void 0===qe||null===(Ge=qe.address)||void 0===Ge||null===(Ze=Ge.locality)||void 0===Ze?void 0:Ze.code,null==be||null===(Xe=be.Properties[0])||void 0===Xe?void 0:Xe.tenantId))),null!=be&&null!==(ke=be.Properties[0])&&void 0!==ke&&ke.tenantId&&Ae.push(Ee(Digit.Utils.pt.getCityLocale(null==be||null===(Je=be.Properties[0])||void 0===Je?void 0:Je.tenantId))),null!=be&&null!==(Ue=be.Properties[0])&&void 0!==Ue&&null!==(Be=Ue.address)&&void 0!==Be&&Be.pincode&&Ae.push(null==be||null===(Qe=be.Properties[0])||void 0===Qe||null===(et=Qe.address)||void 0===et?void 0:et.pincode)),Se?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(_o,{currentStep:window.location.href.includes("/ws/")?1:2,flow:window.location.href.includes("/ws/")?"WS":"",businessService:"WS"}):null,l.createElement(t.FormStep,{t:Ee,config:ye,onSelect:Te,onSkip:()=>ge()},be&&(null==be?void 0:be.Properties.length)&&l.createElement(l.Fragment,null,l.createElement(t.CardHeader,null,Ee("PT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:Ee("PROPERTY_ID"),text:null==be||null===(ie=be.Properties[0])||void 0===ie?void 0:ie.propertyId}),l.createElement(t.Row,{className:"border-none",label:Ee("OWNER_NAME"),text:null==Ce||null===(re=Ce[0])||void 0===re?void 0:re.name}),l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:Ee("PROPERTY_ADDRESS"),text:Ae.join(", "),privacy:{uuid:null==be||null===(ae=be.Properties)||void 0===ae||null===(ue=ae[0])||void 0===ue||null===(de=ue.owners)||void 0===de||null===(se=de[0])||void 0===se?void 0:se.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==be||null===(ce=be.Properties[0])||void 0===ce?void 0:ce.tenantId,propertyIds:null==be||null===(ve=be.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:Ee("PT_MUTATION_STATUS"),text:Ee(null==be||null===(pe=be.Properties[0])||void 0===pe?void 0:pe.status)}),l.createElement("div",{style:{textAlign:"left"}},l.createElement(i.Link,{to:`/digit-ui/citizen/commonpt/view-property?propertyId=${null==be||null===(me=be.Properties[0])||void 0===me?void 0:me.propertyId}&tenantId=${null==be||null===(fe=be.Properties[0])||void 0===fe?void 0:fe.tenantId}`},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_VIEW_MORE_DETAILS")})),l.createElement(i.Link,{to:window.location.href.includes("/ws/modify-connection/")?`/digit-ui/citizen/ws/modify-connection/${null===(tt=_e)||void 0===tt?void 0:tt.tenantId}/search-property`:window.location.href.includes("/ws/edit-application/")?`/digit-ui/citizen/ws/edit-application/${null===(nt=_e)||void 0===nt?void 0:nt.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===(lt=_e)||void 0===lt?void 0:lt.applicationNumber}/${null===(ot=_e)||void 0===ot?void 0:ot.tenantId}/know-your-property`:window.location.href.includes("/edit-application/")?`/digit-ui/citizen/tl/tradelicence/edit-application/${null===(it=_e)||void 0===it?void 0:it.applicationNumber}/${null===(rt=_e)||void 0===rt?void 0:rt.tenantId}/know-your-property`:"/digit-ui/citizen/tl/tradelicence/new-application/know-your-property"},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_CHANGE_PROPERTY"),onClick:()=>{sessionStorage.setItem("changePropertySelected","yes"),sessionStorage.setItem("EditFormData",JSON.stringify(_e))}})))),l.createElement(t.SubmitBar,{style:{marginTop:"10px"},onSubmit:Te,label:Ee("CS_COMMON_NEXT")}))))},CPTPropertySearchNSummary:e=>{var r,a,u,d,s,v,p,m,f,E,y,g,_,h,S,b;let{config:T,onSelect:C,userType:A,formData:D}=e;const{t:N}=o.useTranslation(),I=i.useHistory();let{pathname:O,state:P}=i.useLocation();P=P&&("string"==typeof P||P instanceof String)?JSON.parse(P):P;const w=O.includes("/modify-application/"),R=Digit.ULBService.getCurrentTenantId(),L=window.location.href.includes("/employee/tl/new-application"),x=window.location.href.includes("/employee/tl/renew-application-details")||window.location.href.includes("/employee/tl/edit-application-details"),M=i.useLocation().search,F=new URLSearchParams(M).get("propertyId"),[k,U]=n.useState((null==D||null===(r=D.cptId)||void 0===r?void 0:r.id)||("null"!==F?F:"")||""),[B,H]=n.useState("null"!==F?F:""),[j,W]=n.useState(""),[z,V]=n.useState(""),[$,Y]=n.useState(null),K=window.Digit.Utils.browser.isMobile(),q=null===(a=Digit.UserService.getUser())||void 0===a||null===(u=a.info)||void 0===u?void 0:u.mobileNumber,G="CITIZEN"===(null===(d=Digit.UserService.getUser())||void 0===d||null===(s=d.info)||void 0===s?void 0:s.type),Z=window.location.href.includes("/ws/"),[X,J]=n.useState((null==D||null===(v=D.cpt)||void 0===v?void 0:v.details)||null),Q=G&&Z?{mobileNumber:q}:z?{mobileNumber:z}:{propertyIds:B},{isLoading:ee,error:te,data:ne}=Digit.Hooks.pt.usePropertySearch({filters:Q,tenantId:R},{filters:Q,tenantId:R,enabled:!!(G&&Z&&q||!G&&(B||z)||G&&!Z&&(B||z)),privacy:Digit.Utils.getPrivacyObject()});if(n.useEffect(()=>{k&&(window.location.href.includes("/renew-application-details/")||window.location.href.includes("/edit-application-details/"))&&H(k)},[k]),n.useEffect(()=>{0==ee&&te&&1==te&&Y({error:!0,label:"PT_ENTER_VALID_PROPERTY_ID"})},[te,ne]),n.useEffect(()=>{var e,t,n;const l=null==D||null===(e=D.cpt)||void 0===e||null===(t=e.details)||void 0===t?void 0:t.propertyId;if((null==ne||null===(n=ne.Properties)||void 0===n?void 0:n.length)>0&&1===ne.Properties.length&&!X){const e=ne.Properties[0].propertyId;J(ne.Properties[0]),l!==e&&(C("cpt",{details:ne.Properties[0]}),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(ne.Properties[0])),localStorage.setItem("pgrProperty",JSON.stringify(ne.Properties[0])))}},[ne,O,G,Z,null==D||null===(p=D.cpt)||void 0===p||null===(m=p.details)||void 0===m?void 0:m.propertyId]),w)return l.createElement(l.Fragment,null);let le="";const oe=X||(1===(null==ne||null===(f=ne.Properties)||void 0===f?void 0:f.length)?null==ne?void 0:ne.Properties[0]:null);oe&&(le=((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==oe?void 0:oe.address,N)),window.location.href.includes("/ws/");const ie=e=>{J(e),C("cpt",{details:e}),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(e)),localStorage.setItem("pgrProperty",JSON.stringify(e))};return l.createElement(l.Fragment,null,l.createElement(t.CollapsibleCardPage,{title:N("PT_PROPERTY_SEARCH"),defaultOpen:!0},(!window.location.href.includes("/tl/")||!("MOVABLE"===(null==D||null===(E=D.tradedetils)||void 0===E||null===(y=E[0])||void 0===y||null===(g=y.structureType)||void 0===g?void 0:g.code))&&(L||x))&&l.createElement(l.Fragment,null,G&&Z?l.createElement("div",{className:"formcomposer-section-grid",style:{}},l.createElement("div",{style:{marginBottom:"16px"}},l.createElement(t.LabelFieldPair,null,l.createElement(t.Label,{style:window.location.href.includes("/ws/")?{fontWeight:"700"}:{}},""+N("PROPERTY_ID")),l.createElement("div",{style:{display:"flex",gap:"12px",width:"100%",flexDirection:"column"}},ee?l.createElement("div",null,N("CS_COMMON_LOADING")):null!=ne&&ne.Properties&&(null==ne||null===(_=ne.Properties)||void 0===_?void 0:_.length)>0?l.createElement(t.Dropdown,{option:null==ne?void 0:ne.Properties,optionKey:"propertyId",id:"propertyId",selected:X,select:ie,t:N,placeholder:N("PT_SELECT_PROPERTY")}):l.createElement("span",{onClick:()=>I.push(`/digit-ui/${A}/${O.split("/")[3]}/create-application/create-property?redirectToUrl=${window.location.pathname}`,{...P,...D})},l.createElement("button",{className:"submit-bar",type:"button",style:{color:"white"}},N("CPT_CREATE_PROPERTY"))))))):l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexDirection:K?"column":"row",gap:"16px",width:"100%",alignItems:"flex-end",marginBottom:"16px"}},l.createElement("div",{style:{flex:1}},l.createElement(t.Label,null,""+N("CORE_COMMON_MOBILE_NUMBER")),l.createElement(t.TextInput,{value:j,onChange:e=>{const t=e.target.value;t.length<=10&&(W(t),10===t.length&&V(t))},style:{width:"100%"},placeholder:""+N("PT_ENTER_MOBILE_NUMBER"),maxLength:10})),l.createElement("div",{style:{flex:1}},l.createElement(t.Label,null,""+N("PROPERTY_ID")),ee?l.createElement("div",null,N("CS_COMMON_LOADING")):l.createElement(t.Dropdown,{option:(null==ne?void 0:ne.Properties)||[],optionKey:"propertyId",id:"propertyId",selected:X,select:ie,t:N,placeholder:N("PT_SELECT_PROPERTY")})),l.createElement("div",{style:{flex:1}},l.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",width:"100%",margin:0},onClick:()=>{U(""),H(""),W(""),V(""),J(null),C(null==T?void 0:T.key,{id:""}),C("cpt",null)}},""+N("CLEAR"))),l.createElement("div",{style:{flex:1}},z&&0===(null==ne||null===(h=ne.Properties)||void 0===h?void 0:h.length)&&l.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px"}},l.createElement("span",{style:{color:"#d60505",fontWeight:"bold",fontSize:"12px",lineHeight:"1"}},"No property created this number"),l.createElement("span",{onClick:()=>I.push(`/digit-ui/${A}/${O.split("/")[3]}/create-application/create-property?redirectToUrl=${window.location.pathname}`,{...P,...D})},l.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",width:"100%",margin:0}},N("CPT_CREATE_PROPERTY"))))))),oe?l.createElement(l.Fragment,null,l.createElement(t.Card,{className:"card-with-background",style:{margin:"16px 0px",padding:"20px",boxShadow:"none"}},l.createElement(t.StatusTable,{style:{padding:"0",margin:"0"}},l.createElement("div",{className:"formcomposer-section-grid",style:{}},l.createElement(t.Row,{className:"border-none",labelStyle:K?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{color:"#000"},label:N("PROPERTY_ID"),text:null==oe?void 0:oe.propertyId}),l.createElement(t.Row,{className:"border-none",labelStyle:K?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{color:"#000"},label:N("OWNER_NAME"),text:(e=>{var t,n,l;const o=null==e||null===(t=e.owners)||void 0===t?void 0:t.filter(e=>null==e?void 0:e.active);return(null==o||null===(n=o.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===n||null===(l=n.map(e=>null==e?void 0:e.name))||void 0===l?void 0:l.join(","))||N("NA")})(oe)}),l.createElement(t.Row,{className:"border-none",labelStyle:K?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{wordBreak:"break-word",color:"#000"},label:N("PROPERTY_ADDRESS"),text:le,privacy:{uuid:null==oe||null===(S=oe.owners)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==oe?void 0:oe.tenantId,propertyIds:null==oe?void 0:oe.propertyId},jsonPath:"Properties[0].address.street",d:e=>(c.get(e,"Properties[0].address.doorNo")?c.get(e,"Properties[0].address.doorNo")+", ":"")+(c.get(e,"Properties[0].address.street")?c.get(e,"Properties[0].address.street")+", ":"")+(c.get(e,"Properties[0].address.landmark")?""+c.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}))))):null,$&&l.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:$.error,warning:$.warning,label:N($.label),onClose:()=>{Y(null)}}))))},CPTSearchResults:Se,CPTCreateProperty:y,CPTAcknowledgement:b};exports.CommonPTComponents={CommonPTCard:ho,CommonPTModule:So,CommonPTLinks:bo},exports.CommonPTLinks=bo,exports.CommonPTModule=So,exports.initCommonPTComponents=()=>{Object.entries(To).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
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"),i=require("react-router-dom"),r=require("react-query"),a=require("react-hook-form");function u(){return(u=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)}const d=[{head:"PT_LOCATION_DETAILS",body:[{type:"component",route:"property-type",isMandatory:!0,component:"CPTPropertyLocationDetails",texts:{headerCaption:"",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},nextStep:{COMMON_PROPTYPE_BUILTUP_INDEPENDENTPROPERTY:"landarea",COMMON_PROPTYPE_BUILTUP_SHAREDPROPERTY:"PtUnits",COMMON_PROPTYPE_VACANT:"area"},key:"locationDet",withoutLabel:!0,colSpan:"span 2"}]},{head:"PT_PROPERTY_WATER_CONNECTION",body:[{type:"component",route:"property-type",isMandatory:!1,component:"PropertyWaterConnection",texts:{headerCaption:"",header:"PT_PROPERTY_WATER_CONNECTION",cardText:"",submitBarLabel:"PT_COMMONS_NEXT"},key:"waterConnection",withoutLabel:!0,colSpan:"span 2"}]}];var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e,t){return e(t={exports:{}},t.exports),t.exports}var v=c(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]",c="[object Function]",v="[object GeneratorFunction]",p="[object Map]",m="[object Number]",f="[object Object]",E="[object RegExp]",y="[object Set]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",I="[object Uint8Array]",O="[object Uint16Array]",P="[object Uint32Array]",w=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(x.source),k=RegExp(M.source),U=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,$=RegExp(V.source),Y=/^\s+/,K=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\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",ve="["+ce+"]",pe="["+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]",ge="[^\\ud800-\\udfff]",_e="(?:\\ud83c[\\udde6-\\uddff]){2}",he="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ce="(?:"+pe+"|"+ye+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,_e,he].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",_e,he].join("|")+")"+Ae,Ne="(?:"+[ge+pe+"?",pe,_e,he,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Oe=RegExp(pe,"g"),Pe=RegExp(ye+"(?="+ye+")|"+Ne+Ae,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,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,De].join("|"),"g"),Le=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,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[D]=Fe[N]=Fe[I]=Fe["[object Uint8ClampedArray]"]=Fe[O]=Fe[P]=!0,Fe[i]=Fe[r]=Fe[S]=Fe[a]=Fe[b]=Fe[u]=Fe[d]=Fe[c]=Fe[p]=Fe[m]=Fe[f]=Fe[E]=Fe[y]=Fe[g]=Fe[h]=!1;var ke={};ke[i]=ke[r]=ke[S]=ke[b]=ke[a]=ke[u]=ke[T]=ke[C]=ke[A]=ke[D]=ke[N]=ke[p]=ke[m]=ke[f]=ke[E]=ke[y]=ke[g]=ke[_]=ke[I]=ke["[object Uint8ClampedArray]"]=ke[O]=ke[P]=!0,ke[d]=ke[c]=ke[h]=!1;var Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Be=parseFloat,je=parseInt,He="object"==typeof s&&s&&s.Object===Object&&s,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),Ve=t&&!t.nodeType&&t,$e=Ve&&e&&!e.nodeType&&e,Ye=$e&&$e.exports===Ve,Ke=Ye&&He.process,qe=function(){try{return $e&&$e.require&&$e.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),Ge=qe&&qe.isArrayBuffer,Ze=qe&&qe.isDate,Xe=qe&&qe.isMap,Je=qe&&qe.isRegExp,Qe=qe&&qe.isSet,et=qe&&qe.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 vt(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 pt(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,_t,n)}function gt(e,t,n,l){for(var o=n-1,i=e.length;++o<i;)if(l(e[o],t))return o;return-1}function _t(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 Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):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 Pt(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 Lt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Rt=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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Ue[e]}function Ft(e){return Le.test(e)}function kt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Ut(e,t){return function(n){return e(t(n))}}function Bt(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=Pe.lastIndex=0;Pe.test(e);)++t;return t}(e):mt(e)}function zt(e){return Ft(e)?function(e){return e.match(Pe)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var $t=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var s,K=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,se=t.Date,ce=t.Error,ve=t.Function,pe=t.Math,me=t.Object,fe=t.RegExp,Ee=t.String,ye=t.TypeError,ge=K.prototype,_e=me.prototype,he=t["__core-js_shared__"],Se=ve.prototype.toString,be=_e.hasOwnProperty,Te=0,Ce=(s=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",Ae=_e.toString,De=Se.call(me),Ne=ze._,Pe=fe("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ye?t.Buffer:void 0,Ue=t.Symbol,He=t.Uint8Array,We=Le?Le.allocUnsafe:void 0,Ve=Ut(me.getPrototypeOf,me),$e=me.create,Ke=_e.propertyIsEnumerable,qe=ge.splice,mt=Ue?Ue.isConcatSpreadable:void 0,bt=Ue?Ue.iterator:void 0,Kt=Ue?Ue.toStringTag:void 0,qt=function(){try{var e=Qo(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Zt=se&&se.now!==ze.Date.now&&se.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=pe.ceil,Qt=pe.floor,en=me.getOwnPropertySymbols,tn=Le?Le.isBuffer:void 0,nn=t.isFinite,ln=ge.join,on=Ut(me.keys,me),rn=pe.max,an=pe.min,un=se.now,dn=t.parseInt,sn=pe.random,cn=ge.reverse,vn=Qo(t,"DataView"),pn=Qo(t,"Map"),mn=Qo(t,"Promise"),fn=Qo(t,"Set"),En=Qo(t,"WeakMap"),yn=Qo(me,"create"),gn=En&&new En,_n={},hn=Ii(vn),Sn=Ii(pn),bn=Ii(mn),Tn=Ii(fn),Cn=Ii(En),An=Ue?Ue.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function In(e){if($r(e)&&!xr(e)&&!(e instanceof Ln)){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(!Vr(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Pn(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ln(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rn(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 Un(e,t){var n=xr(e),l=!n&&Rr(e),o=!n&&!l&&Ur(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 Bn(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function jn(e,t){return Ti(yo(e),Gn(t,0,e.length))}function Hn(e){return Ti(yo(e))}function Wn(e,t,n){(void 0!==n&&!Pr(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&Pr(l,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(Pr(e[n][0],t))return n;return-1}function $n(e,t,n,l){return el(e,function(e,o,i){t(l,e,n(e),i)}),l}function Yn(e,t){return e&&go(t,Sa(t),e)}function Kn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,o=K(l),i=null==e;++n<l;)o[n]=i?void 0:Ea(e,t[n]);return o}function Gn(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,s=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(!Vr(e))return e;var L=xr(e);if(L){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),!s)return yo(e,d)}else{var R=ni(e),x=R==c||R==v;if(Ur(e))return co(e,s);if(R==f||R==i||x&&!o){if(d=h||x?{}:oi(e),!s)return h?function(e,t){return go(e,ti(e),t)}(e,function(e,t){return e&&go(t,ba(t),e)}(d,e)):function(e,t){return go(e,ei(e),t)}(e,Yn(d,e))}else{if(!ke[R])return o?e:{};d=function(e,t,n){var l=e.constructor;switch(t){case S:return vo(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?vo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case C:case A:case D:case N:case I:case"[object Uint8ClampedArray]":case O:case P:return po(e,n);case p:return new l;case m:case g: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 _:return Dn?me(Dn.call(e)):{}}}(e,R,s)}}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))}):Yr(e)&&e.forEach(function(l,o){d.set(o,Zn(l,t,n,o,e,r))});var F=L?void 0:(w?h?Yo:$o:h?ba:Sa)(e);return lt(F||e,function(l,o){F&&(l=e[o=l]),zn(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 _i(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 v=d;v--;)if(t[v]===c)continue e;u.push(s)}else i(t,c,l)||u.push(s)}return u}In.templateSettings={escape:U,evaluate:B,interpolate:j,variable:"",imports:{_:In}},(In.prototype=Pn.prototype).constructor=In,(wn.prototype=On(Pn.prototype)).constructor=wn,(Ln.prototype=On(Pn.prototype)).constructor=Ln,Rn.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},Rn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Rn.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},Rn.prototype.has=function(e){var t=this.__data__;return yn?void 0!==t[e]:be.call(t,e)},Rn.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=Vn(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return Vn(this.__data__,e)>-1},xn.prototype.set=function(e,t){var n=this.__data__,l=Vn(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 Rn,map:new(pn||xn),string:new Rn}},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(!pn||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 vl(e,t,n){var l=t(e);return xr(e)?l:st(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in me(e)?function(e){var t=be.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var l=!0}catch(e){}var o=Ae.call(e);return l&&(t?e[Kt]=n:delete e[Kt]),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=K(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,v=a[0];e:for(;++c<o&&d.length<u;){var p=s[c],m=t?t(p):p;if(p=n||0!==p?p:0,!(v?Ot(v,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}v&&v.push(m),d.push(p)}}return d}function gl(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 _l(e){return $r(e)&&pl(e)==i}function hl(e,t,n,l,o){return e===t||(null==e||null==t||!$r(e)&&!$r(t)?e!=e&&t!=t:function(e,t,n,l,o,s){var c=xr(e),v=xr(t),h=c?r:ni(e),T=v?r:ni(t),C=(h=h==i?f:h)==f,A=(T=T==i?f:T)==f,D=h==T;if(D&&Ur(e)){if(!Ur(t))return!1;c=!0,C=!1}if(D&&!C)return s||(s=new kn),c||Qr(e)?zo(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 Pr(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case p: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 v=zo(s(e),s(t),l,o,i,r);return r.delete(e),v;case _:if(Dn)return Dn.call(e)==Dn.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,P=I?t.value():t;return s||(s=new kn),o(O,P,n,l,s)}}return!!D&&(s||(s=new kn),function(e,t,n,l,o,i){var r=1&n,a=$o(e),u=a.length;if(u!=$o(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),v=i.get(t);if(c&&v)return c==t&&v==e;var p=!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)){p=!1;break}m||(m="constructor"==s)}if(p&&!m){var g=e.constructor,_=t.constructor;g==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof _&&_ instanceof _||(p=!1)}return i.delete(e),i.delete(t),p}(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 v=l(d,s,u,e,t,c);if(!(void 0===v?hl(s,d,3,l,c):v))return!1}}return!0}function bl(e){return!(!Vr(e)||(t=e,Ce&&Ce in t))&&(Hr(e)?Pe:oe).test(Ii(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ka:"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 Dl(e,t){var n=-1,l=Fr(e)?K(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]?pi(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Il(e,t){return ui(e)&&vi(t)?pi(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),Vr(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 v=xr(u),p=!v&&Ur(u),m=!v&&!p&&Qr(u);s=u,v||p||m?xr(a)?s=a:kr(a)?s=yo(a):p?(c=!1,s=co(u,!0)):m?(c=!1,s=po(u,!0)):s=[]:qr(u)||Rr(u)?(s=a,Rr(a)?s=aa(a):Vr(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 Pl(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}):[Ka];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}(Dl(e,function(e,n,o){return{criteria:dt(t,function(t){return t(e)}),index:++l,value:e}}))}function Ll(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 Rl(e,t,n,l){var o=l?gt: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&&qe.call(a,u,1),qe.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)?qe.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,Ka),e+"")}function Ul(e){return Bn(Pa(e))}function Bl(e,t){var n=Pa(e);return Ti(n,Gn(t,0,n.length))}function jl(e,t,n,l){if(!Vr(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=Vr(s)?s:ri(t[o+1])?[]:{})}zn(a,u,d),a=a[u]}return e}var Hl=gn?function(e,t){return gn.set(e,t),e}:Ka,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:Va(t),writable:!0})}:Ka;function zl(e){return Ti(Pa(e))}function Vl(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=K(o);++l<o;)i[l]=e[l+t];return i}function $l(e,t){var n;return el(e,function(e,l,o){return!(n=t(e,l,o))}),!!n}function Yl(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 Kl(e,t,Ka,n)}function Kl(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]),v=void 0!==c,p=null===c,m=c==c,f=Jr(c);if(r)var E=l||m;else E=d?m&&(l||v):a?m&&v&&(l||!p):u?m&&v&&!p&&(l||!f):!p&&!f&&(l?c<=t:c<t);E?o=s+1:i=s}return an(i,4294967294)}function ql(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||!Pr(a,u)){var u=a;i[o++]=0===r?0:r}}return i}function Gl(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 v=u.length;v--;)if(u[v]===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?Vl(e,l?0:i,l?i+1:o):Vl(e,l?i+1:0,l?o:i)}function to(e,t){var n=e;return n instanceof Ln&&(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=K(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:Ka}function ro(e,t){return xr(e)?e:ui(e,t)?[e]:Di(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:Vl(e,t,n)}var so=Gt||function(e){return ze.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 vo(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function po(e,t){var n=t?vo(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=K(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=K(s+d),v=!l;++o<s;)c[o]=e[o];for(var p=o;++u<d;)c[p+u]=t[u];for(;++r<a;)(v||o<i)&&(c[p+n[r]]=e[o++]);return c}function yo(e,t){var n=-1,l=e.length;for(t||(t=K(l));++n<l;)t[n]=e[n];return t}function go(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?Kn(n,a,u):zn(n,a,u)}return n}function _o(e,t){return function(n,l){var o=xr(n)?nt:$n,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))?zt(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(Ra(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 Vr(l)?l:n}}function Do(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 Vo(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"==qo(r))var a=new wn([],!0)}for(o=a?o:l;++o<l;){var u=qo(r=t[o]),d="wrapper"==u?Ko(r):void 0;a=d&&di(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?a[qo(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,v=2&t,p=24&t,m=512&t,f=v?void 0:Ao(e);return function E(){for(var y=arguments.length,g=K(y),_=y;_--;)g[_]=arguments[_];if(p)var h=Go(E),S=Lt(g,h);if(l&&(g=fo(g,l,o,p)),i&&(g=Eo(g,i,r,p)),y-=S,p&&y<d){var b=Bt(g,h);return Mo(e,t,Io,E.placeholder,n,g,b,a,u,d-y)}var T=c?n:this,C=v?T[e]:e;return y=g.length,a?g=Ei(g,a):m&&y>1&&g.reverse(),s&&u<y&&(g.length=u),this&&this!==ze&&this instanceof E&&(C=f||Ao(C)),C.apply(T,g)}}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 Po(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=Gl(n),l=Gl(l)),o=e(n,l)}return o}}function wo(e){return Vo(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 Lo(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(zt(l),0,e).join(""):l.slice(0,e)}function Ro(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=K(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],v=n.apply(void 0,c);return di(e)&&gi(v,c),v.placeholder=l,Si(v,e,t)}function Fo(e){var t=pe[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 Uo(e){return function(t){var n=ni(t);return n==p?kt(t):n==y?Ht(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bo(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 v=i,p=r;i=r=void 0}var m=s?void 0:Ko(e),f=[e,t,o,i,r,v,p,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?Bt(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?Eo(a,r,t[6]):r,e[6]=a?Bt(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=K(i),a=i,u=Go(o);a--;)r[a]=arguments[a];var d=i<3&&r[0]!==u&&r[i-1]!==u?[]:Bt(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!==ze&&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=K(d+a),c=this&&this!==ze&&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!==ze&&this instanceof t?o:e;return i.apply(l?n:this,arguments)}}(e,t,o);return Si((m?Hl:gi)(E,f),e,t)}function jo(e,t,n,l){return void 0===e||Pr(e,_e[n])&&!be.call(l,n)?t:e}function Ho(e,t,n,l,o,i){return Vr(e)&&Vr(t)&&(i.set(t,e),Ol(e,t,void 0,Ho,i),i.delete(t)),e}function Wo(e){return qr(e)?void 0:e}function zo(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,v=!0,p=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;v=!1;break}if(p){if(!pt(t,function(e,t){if(!Ot(p,t)&&(m===e||o(m,e,n,l,i)))return p.push(t)})){v=!1;break}}else if(m!==f&&!o(m,f,n,l,i)){v=!1;break}}return i.delete(e),i.delete(t),v}function Vo(e){return hi(mi(e,void 0,Mi),e+"")}function $o(e){return vl(e,Sa,ei)}function Yo(e){return vl(e,ba,ti)}var Ko=gn?function(e){return gn.get(e)}:Ja;function qo(e){for(var t=e.name+"",n=_n[t],l=be.call(_n,t)?n.length:0;l--;){var o=n[l],i=o.func;if(null==i||i==e)return o.name}return t}function Go(e){return(be.call(In,"placeholder")?In:e).placeholder}function Zo(){var e=In.iteratee||qa;return e=e===qa?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,vi(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 Ke.call(e,t)}))}:iu,ti=en?function(e){for(var t=[];e;)st(t,ei(e)),e=Ve(e);return t}:iu,ni=pl;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)&&zr(o)&&ri(r,o)&&(xr(e)||Rr(e))}function oi(e){return"function"!=typeof e.constructor||ci(e)?{}:On(Ve(e))}function ii(e){return xr(e)||Rr(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(!Vr(n))return!1;var l=typeof t;return!!("number"==l?Fr(n)&&ri(t,n.length):"string"==l&&t in n)&&Pr(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=qo(e),n=In[t];if("function"!=typeof n||!(t in Ln.prototype))return!1;if(e===n)return!0;var l=Ko(n);return!!l&&e===l[0]}(vn&&ni(new vn(new ArrayBuffer(1)))!=b||pn&&ni(new pn)!=p||mn&&"[object Promise]"!=ni(mn.resolve())||fn&&ni(new fn)!=y||En&&ni(new En)!=h)&&(ni=function(e){var t=pl(e),n=t==f?e.constructor:void 0,l=n?Ii(n):"";if(l)switch(l){case hn:return b;case Sn:return p;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||_e)}function vi(e){return e==e&&!Vr(e)}function pi(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=K(i);++o<i;)r[o]=l[t+o];o=-1;for(var a=K(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,Vl(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 gi=bi(Hl),_i=Xt||function(e,t){return ze.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(q,"{\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(G);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,Di=(Ci=Cr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,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 Ln)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 Pi=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)):[]}),Li=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 Ri(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):[]}),Ui=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)):[]}),Bi=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?Rl(e,t):e}var zi=Vo(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return xl(e,dt(t,function(e){return ri(e,n)?+e:e}).sort(mo)),l});function Vi(e){return null==e?e:cn.call(e)}var $i=kl(function(e){return Xl(il(e,1,kr,!0))}),Yi=kl(function(e){var t=ji(e);return kr(t)&&(t=void 0),Xl(il(e,1,kr,!0),Zo(t,2))}),Ki=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 qi(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 Gi(e,t){if(!e||!e.length)return[];var n=qi(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(qi),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,Gi(e,n)});function nr(e){var t=In(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var or=Vo(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,o=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Ln&&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=_o(function(e,t,n){be.call(e,n)?++e[n]:Kn(e,n,1)}),rr=Do(Ri),ar=Do(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=_o(function(e,t,n){be.call(e,n)?e[n].push(t):Kn(e,n,[t])}),cr=kl(function(e,t,n){var l=-1,o="function"==typeof t,i=Fr(e)?K(e.length):[];return el(e,function(e){i[++l]=o?tt(t,e,n):gl(e,t,n)}),i}),vr=_o(function(e,t,n){Kn(e,n,t)});function pr(e,t){return(xr(e)?dt:Dl)(e,Zo(t,3))}var mr=_o(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 ze.Date.now()};function yr(e,t,n){return t=n?void 0:t,Bo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function gr(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 _r=kl(function(e,t,n){var l=1;if(n.length){var o=Bt(n,Go(_r));l|=32}return Bo(e,l,t,n,o)}),hr=kl(function(e,t,n){var l=3;if(n.length){var o=Bt(n,Go(hr));l|=32}return Bo(t,l,e,n,o)});function Sr(e,t,l){var o,i,r,a,u,d,s=0,c=!1,v=!1,p=!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=_i(y,t),c?m(e):a}function E(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-s>=r}function y(){var e=Er();if(E(e))return g(e);u=_i(y,function(e){var n=t-(e-d);return v?an(n,r-(e-s)):n}(e))}function g(e){return u=void 0,p&&o?m(e):(o=i=void 0,a)}function _(){var e=Er(),n=E(e);if(o=arguments,i=this,d=e,n){if(void 0===u)return f(d);if(v)return so(u),u=_i(y,t),m(d)}return void 0===u&&(u=_i(y,t)),a}return t=ra(t)||0,Vr(l)&&(c=!!l.leading,r=(v="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,p="trailing"in l?!!l.trailing:p),_.cancel=function(){void 0!==u&&so(u),s=0,o=d=i=u=void 0},_.flush=function(){return void 0===u?a:g(Er())},_}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 Dr=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 Bo(e,32,void 0,t,Bt(t,Go(Nr)))}),Ir=kl(function(e,t){return Bo(e,64,void 0,t,Bt(t,Go(Ir)))}),Or=Vo(function(e,t){return Bo(e,256,void 0,void 0,void 0,t)});function Pr(e,t){return e===t||e!=e&&t!=t}var wr=xo(ml),Lr=xo(function(e,t){return e>=t}),Rr=_l(function(){return arguments}())?_l:function(e){return $r(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},xr=K.isArray,Mr=Ge?Nt(Ge):function(e){return $r(e)&&pl(e)==S};function Fr(e){return null!=e&&zr(e.length)&&!Hr(e)}function kr(e){return $r(e)&&Fr(e)}var Ur=tn||ru,Br=Ze?Nt(Ze):function(e){return $r(e)&&pl(e)==u};function jr(e){if(!$r(e))return!1;var t=pl(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qr(e)}function Hr(e){if(!Vr(e))return!1;var t=pl(e);return t==c||t==v||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==oa(e)}function zr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Vr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function $r(e){return null!=e&&"object"==typeof e}var Yr=Xe?Nt(Xe):function(e){return $r(e)&&ni(e)==p};function Kr(e){return"number"==typeof e||$r(e)&&pl(e)==m}function qr(e){if(!$r(e)||pl(e)!=f)return!1;var t=Ve(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Gr=Je?Nt(Je):function(e){return $r(e)&&pl(e)==E},Zr=Qe?Nt(Qe):function(e){return $r(e)&&ni(e)==y};function Xr(e){return"string"==typeof e||!xr(e)&&$r(e)&&pl(e)==g}function Jr(e){return"symbol"==typeof e||$r(e)&&pl(e)==_}var Qr=et?Nt(et):function(e){return $r(e)&&zr(e.length)&&!!Fe[pl(e)]},ea=xo(Al),ta=xo(function(e,t){return e<=t});function na(e){if(!e)return[];if(Fr(e))return Xr(e)?zt(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==p?kt:t==y?jt:Pa)(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?Gn(oa(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if(Vr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vr(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(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 go(e,ba(e))}function ua(e){return null==e?"":Zl(e)}var da=ho(function(e,t){if(ci(t)||Fr(t))go(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),sa=ho(function(e,t){go(t,ba(t),e)}),ca=ho(function(e,t,n,l){go(t,ba(t),e,l)}),va=ho(function(e,t,n,l){go(t,Sa(t),e,l)}),pa=Vo(qn),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||Pr(s,_e[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 ga=Oo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Va(Ka)),_a=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(gl);function Sa(e){return Fr(e)?Un(e):Cl(e)}function ba(e){return Fr(e)?Un(e,!0):function(e){if(!Vr(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=Vo(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}),go(e,Yo(e),n),l&&(n=Zn(n,7,Wo));for(var o=t.length;o--;)Jl(n,t[o]);return n}),Da=Vo(function(e,t){return null==e?{}:function(e,t){return Ll(e,t,function(t,n){return ya(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=dt(Yo(e),function(e){return[e]});return t=Zo(t),Ll(e,n,function(e,n){return t(e,n[0])})}var Ia=Uo(Sa),Oa=Uo(ba);function Pa(e){return null==e?[]:It(e,Sa(e))}var wa=Co(function(e,t,n){return t=t.toLowerCase(),e+(n?La(t):t)});function La(e){return ja(ua(e).toLowerCase())}function Ra(e){return(e=ua(e))&&e.replace(ae,Rt).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()}),Ua=Co(function(e,t,n){return e+(n?" ":"")+ja(t)}),Ba=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 Re.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)}}),za=Vo(function(e,t){return lt(t,function(t){t=Ni(t),Kn(e,t,_r(e[t],e))}),e});function Va(e){return function(){return e}}var $a=No(),Ya=No(!0);function Ka(e){return e}function qa(e){return Tl("function"==typeof e?e:Zn(e,1))}var Ga=kl(function(e,t){return function(n){return gl(n,e,t)}}),Za=kl(function(e,t){return function(n){return gl(e,n,t)}});function Xa(e,t,n){var l=Sa(t),o=sl(t,l);null!=n||Vr(t)&&(o.length||!l.length)||(n=t,t=e,e=this,o=sl(t,Sa(t)));var i=!(Vr(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(pt);function nu(e){return ui(e)?St(Ni(e)):function(e){return function(t){return cl(t,e)}}(e)}var lu=Ro(),ou=Ro(!0);function iu(){return[]}function ru(){return!1}var au,uu=Po(function(e,t){return e+t},0),du=Fo("ceil"),su=Po(function(e,t){return e/t},1),cu=Fo("floor"),vu=Po(function(e,t){return e*t},1),pu=Fo("round"),mu=Po(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=va,In.at=pa,In.before=gr,In.bind=_r,In.bindAll=za,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=K(Jt(l/t));o<l;)r[i++]=Vl(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=K(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=Va,In.countBy=ir,In.create=function(e,t){var n=On(e);return null==t?n:Yn(n,t)},In.curry=function e(t,n,l){var o=Bo(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=Bo(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=Pi,In.differenceBy=wi,In.differenceWith=Li,In.drop=function(e,t,n){var l=null==e?0:e.length;return l?Vl(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?Vl(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(pr(e,t),1)},In.flatMapDeep=function(e,t){return il(pr(e,t),1/0)},In.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),il(pr(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 Bo(e,512)},In.flow=$a,In.flowRight=Ya,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?Vl(e,0,-1):[]},In.intersection=ki,In.intersectionBy=Ui,In.intersectionWith=Bi,In.invert=ga,In.invertBy=_a,In.invokeMap=cr,In.iteratee=qa,In.keyBy=vr,In.keys=Sa,In.keysIn=ba,In.map=pr,In.mapKeys=function(e,t){var n={};return t=Zo(t,3),ul(e,function(e,l,o){Kn(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){Kn(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=Ga,In.methodOf=Za,In.mixin=Xa,In.negate=Ar,In.nthArg=function(e){return e=oa(e),kl(function(t){return Pl(t,e)})},In.omit=Aa,In.omitBy=function(e,t){return Na(e,Ar(Zo(t)))},In.once=function(e){return gr(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=Dr,In.overEvery=eu,In.overSome=tu,In.partial=Nr,In.partialRight=Ir,In.partition=mr,In.pick=Da,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?Rl(e,t,Zo(n,2)):e},In.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Rl(e,t,void 0,n):e},In.pullAt=zi,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=Vi,In.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),(xr(e)?jn:Bl)(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:zl)(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)),Vl(e,t,n)):[]},In.sortBy=fr,In.sortedUniq=function(e){return e&&e.length?ql(e):[]},In.sortedUniqBy=function(e,t){return e&&e.length?ql(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&&!Gr(t))&&!(t=Zl(t))&&Ft(e)?uo(zt(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?Vl(e,1,t):[]},In.take=function(e,t,n){return e&&e.length?Vl(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?Vl(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 Vr(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(Di(ua(e)))},In.toPlainObject=aa,In.transform=function(e,t,n){var l=xr(e),o=l||Ur(e)||Qr(e);if(t=Zo(t,4),null==n){var i=e&&e.constructor;n=o?l?new i:[]:Vr(e)&&Hr(i)?On(Ve(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=$i,In.unionBy=Yi,In.unionWith=Ki,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=qi,In.unzipWith=Gi,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=Pa,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||[],zn)},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=La,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),Gn(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=Ra,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:Gn(oa(n),0,l);return(n-=t.length)>=0&&e.slice(n,o)==t},In.eq=Pr,In.escape=function(e){return(e=ua(e))&&k.test(e)?e.replace(M,xt):e},In.escapeRegExp=function(e){return(e=ua(e))&&$.test(e)?e.replace(V,"\\$&"):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=Ri,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=Lr,In.has=function(e,t){return null!=e&&li(e,t,fl)},In.hasIn=ya,In.head=Fi,In.identity=Ka,In.includes=function(e,t,n,l){e=Fr(e)?e:Pa(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=Rr,In.isArray=xr,In.isArrayBuffer=Mr,In.isArrayLike=Fr,In.isArrayLikeObject=kr,In.isBoolean=function(e){return!0===e||!1===e||$r(e)&&pl(e)==a},In.isBuffer=Ur,In.isDate=Br,In.isElement=function(e){return $r(e)&&1===e.nodeType&&!qr(e)},In.isEmpty=function(e){if(null==e)return!0;if(Fr(e)&&(xr(e)||"string"==typeof e||"function"==typeof e.splice||Ur(e)||Qr(e)||Rr(e)))return!e.length;var t=ni(e);if(t==p||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=zr,In.isMap=Yr,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 Kr(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=Kr,In.isObject=Vr,In.isObjectLike=$r,In.isPlainObject=qr,In.isRegExp=Gr,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 $r(e)&&ni(e)==h},In.isWeakSet=function(e){return $r(e)&&"[object WeakSet]"==pl(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,_t,o,!0)},In.lowerCase=Ma,In.lowerFirst=Fa,In.lt=ea,In.lte=ta,In.max=function(e){return e&&e.length?ll(e,Ka,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,Ka)},In.meanBy=function(e,t){return ht(e,Zo(t,2))},In.min=function(e){return e&&e.length?ll(e,Ka,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=vu,In.nth=function(e,t){return e&&e.length?Pl(e,oa(t)):void 0},In.noConflict=function(){return ze._===this&&(ze._=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 Lo(Qt(o),n)+e+Lo(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+Lo(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?Lo(t-l,n)+e:e},In.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),dn(ua(e).replace(Y,""),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+Be("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)?vt: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=pu,In.runInContext=e,In.sample=function(e){return(xr(e)?Bn:Ul)(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==p||t==y?e.size:Cl(e).length},In.snakeCase=ka,In.some=function(e,t,n){var l=xr(e)?pt:$l;return n&&ai(e,t,n)&&(t=void 0),l(e,Zo(t,3))},In.sortedIndex=function(e,t){return Yl(e,t)},In.sortedIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2))},In.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Pr(e[l],t))return l}return-1},In.sortedLastIndex=function(e,t){return Yl(e,t,!0)},In.sortedLastIndexBy=function(e,t,n){return Kl(e,t,Zo(n,2),!0)},In.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Pr(e[n],t))return n}return-1},In.startCase=Ua,In.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Gn(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,Ka):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 += '",v=fe((t.escape||ue).source+"|"+s.source+"|"+(s===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(v,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(L,"$1").replace(R,"$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 ve(a,p+"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?Gn(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 Dt(e);if(!e||!(t=Zl(t)))return e;var l=zt(e),o=zt(t);return uo(l,Pt(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,Vt(e)+1);if(!e||!(t=Zl(t)))return e;var l=zt(e);return uo(l,0,wt(l,zt(t))+1).join("")},In.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=Zl(t)))return e;var l=zt(e);return uo(l,Pt(l,zt(t))).join("")},In.truncate=function(e,t){var n=30,l="...";if(Vr(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=zt(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),Gr(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 v=u.lastIndexOf(o);v>-1&&(u=u.slice(0,v))}return u+l},In.unescape=function(e){return(e=ua(e))&&F.test(e)?e.replace(x,$t):e},In.uniqueId=function(e){var t=++Te;return ua(e)+t},In.upperCase=Ba,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){Ln.prototype[e]=function(n){n=void 0===n?1:rn(oa(n),0);var l=this.__filtered__&&!t?new Ln(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},Ln.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;Ln.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":"");Ln.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Ln.prototype[e]=function(){return this.__filtered__?new Ln(this):this[n](1)}}),Ln.prototype.compact=function(){return this.filter(Ka)},Ln.prototype.find=function(e){return this.filter(e).head()},Ln.prototype.findLast=function(e){return this.reverse().find(e)},Ln.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new Ln(this):this.map(function(n){return gl(n,e,t)})}),Ln.prototype.reject=function(e){return this.filter(Ar(Zo(e)))},Ln.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Ln(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)},Ln.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ln.prototype.toArray=function(){return this.take(4294967295)},ul(Ln.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 Ln,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__,v=!!this.__actions__.length,p=i&&!c,m=a&&!v;if(!i&&d){t=m?t:new Ln(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[s],thisArg:void 0}),new wn(f,c)}return p&&m?e.apply(this,r):(f=this.thru(s),p?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[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(Ln.prototype,function(e,t){var n=In[t];if(n){var l=n.name+"";be.call(_n,l)||(_n[l]=[]),_n[l].push({name:t,func:n})}}),_n[Io(void 0,2).name]=[{name:"wrapper",func:void 0}],Ln.prototype.clone=function(){var e=new Ln(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},Ln.prototype.reverse=function(){if(this.__filtered__){var e=new Ln(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ln.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,v=0,p=an(u,this.__takeCount__);if(!n||!l&&o==u&&p==u)return to(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var f=-1,E=e[d+=t];++f<c;){var y=s[f],g=y.type,_=(0,y.iteratee)(E);if(2==g)E=_;else if(!_){if(1==g)continue e;break e}}m[v++]=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 Pn;){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 Ln){var t=e;return this.__actions__.length&&(t=new Ln(this)),(t=t.reverse()).__actions__.push({func:lr,args:[Vi],thisArg:void 0}),new wn(t,this.__chain__)}return this.thru(Vi)},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}();$e?(($e.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(s)});const p=e=>{var t,n,l,o,i,r,a,u,d,s,c,v;let{locationDet:p,propertyAddress:m}=e,f=(Array.isArray(p)?p[0]:p)||(Array.isArray(m)?m[0]:m);if(console.log(f,"address_debug"),!f)return e;let E={city:(null==f||null===(t=f.city)||void 0===t?void 0:t.code)||(null==f||null===(n=f.city)||void 0===n?void 0:n.name)||(null==f?void 0:f.city),houseNo:(null==f?void 0:f.houseNo)||(null==f?void 0:f.houseDoorNo)||(null==f?void 0:f.doorNo),street:(null==f?void 0:f.street)||(null==f?void 0:f.buildingColonyName)||(null==f?void 0:f.streetName),landmark:(null==f?void 0:f.landmark)||(null==f?void 0:f.landmarkName),pincode:(null==f?void 0:f.pincode)||(null==f?void 0:f.pinCode),latitude:(null==f?void 0:f.latitude)||(null==f?void 0:f.Latitude),longitude:(null==f?void 0:f.longitude)||(null==f?void 0:f.Longitude),locality:{code:(null==f||null===(l=f.locality)||void 0===l?void 0:l.code)||(null==f||null===(o=f.locality)||void 0===o?void 0:o.name)||(null==f?void 0:f.locality),latitude:null==f||null===(i=f.locality)||void 0===i?void 0:i.latitude,longitude:null==f||null===(r=f.locality)||void 0===r?void 0:r.longitude},addressLine1:null==f?void 0:f.addressLine1,addressLine2:null==f?void 0:f.addressLine2,assembly:(null==f?void 0:f.assembly)||(null==f?void 0:f.Assembly),block:null==f?void 0:f.block,zone:null==f?void 0:f.zone,zroLocation:(null==f||null===(a=f.zro)||void 0===a?void 0:a.code)||(null==f?void 0:f.zro),addressType:(null==f||null===(u=f.addressType)||void 0===u?void 0:u.code)||(null==f?void 0:f.addressType),subLocality:(null==f?void 0:f.subLocality)||(null==f||null===(d=f.subLocality)||void 0===d?void 0:d.name)||(null==f?void 0:f.subLocality),actualWard:(null==f?void 0:f.actualWard)||(null==f||null===(s=f.actualWard)||void 0===s?void 0:s.name)||(null==f?void 0:f.actualWard),actualAssembly:(null==f?void 0:f.actualAssembly)||(null==f||null===(c=f.actualAssembly)||void 0===c?void 0:c.name)||(null==f?void 0:f.actualAssembly),actualZone:(null==f?void 0:f.actualZone)||(null==f||null===(v=f.actualZone)||void 0===v?void 0:v.name)||(null==f?void 0:f.actualZone)};return e.address=E,e},m=e=>{var t,n,l;const{locationDet:o,owners:i}=e;let r={},a=[],u=[];e.ownershipCategory=(null==e||null===(t=e.owners)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.ownershipCategory)||"INDIVIDUAL.SINGLEOWNER";const d="string"==typeof e.ownershipCategory?e.ownershipCategory:null===(l=e.ownershipCategory)||void 0===l?void 0:l.code;var s,c,v,p,m,f,E,y,g,_,h,S,b,T,C;if(null!=d&&d.includes("INSTITUTIONALPRIVATE")||null!=d&&d.includes("INSTITUTIONALGOVERNMENT"))r.designation=null==i||null===(s=i[0])||void 0===s?void 0:s.designation,r.name=null==i||null===(c=i[0])||void 0===c?void 0:c.institutionName,r.type=null==i||null===(v=i[0])||void 0===v||null===(p=v.institutionType)||void 0===p||null===(m=p.code)||void 0===m||null===(f=m.split("."))||void 0===f?void 0:f[1],r.landlineNumber=null==i||null===(E=i[0])||void 0===E?void 0:E.altContactNumber,r.tenantId=(null==o||null===(y=o.city)||void 0===y?void 0:y.code)||(null==o?void 0:o.city),a.push({altContactNumber:null==i||null===(g=i[0])||void 0===g?void 0:g.altContactNumber,permanentAddress:null==i||null===(_=i[0])||void 0===_?void 0:_.permanentAddress,correspondenceAddress:null==i||null===(h=i[0])||void 0===h?void 0:h.permanentAddress,sameAsPropertyAddress:(null==i||null===(S=i[0])||void 0===S?void 0:S.isCorrespondenceAddress)||(null==i||null===(b=i[0])||void 0===b?void 0:b.isCoresAddr),mobileNumber:null==i||null===(T=i[0])||void 0===T?void 0:T.mobileNumber,name:null==i||null===(C=i[0])||void 0===C?void 0:C.name,ownerType:"NONE",status:"ACTIVE",documents:u}),e.institution=r,e.owners=a;else if(i&&i.length>0)i.map(e=>{var t,n,l,o;a.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.code)||(null==e||null===(n=e.gender)||void 0===n?void 0:n.value)||(null==e?void 0:e.gender),sameAsPropertyAddress:(null==e?void 0:e.isCorrespondenceAddress)||(null==e?void 0:e.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)||(null==e?void 0:e.ownerType)||"NONE",permanentAddress:null==e?void 0:e.permanentAddress,relationship:(null==e||null===(o=e.relationship)||void 0===o?void 0:o.code)||(null==e?void 0:e.relationship),documents:(null==e?void 0:e.documents)||u})}),e.owners=a;else if(null!=e&&e.applicant&&null!=e&&e.contact){var A;const{applicant:t,contact:n,useDetails:l}=e;a.push({name:`${t.firstName}${t.middleName?" "+t.middleName:""}${t.lastName?" "+t.lastName:""}`,mobileNumber:n.mobileNumber,gender:(null==l||null===(A=l.gender)||void 0===A?void 0:A.code)||(null==l?void 0:l.gender)||"MALE",fatherOrHusbandName:t.ParentorSpouse||"NA",relationship:"FATHER",ownerType:"NONE",status:"ACTIVE"}),e.owners=a}return e},f=e=>{var t,n,l,o,i,r,a,u,d;let s={};const{waterConnection:c,useDetails:v}=e,p=(null==c?void 0:c.useDetails)||v;return s={propertyType:(null==p||null===(t=p.propertyType)||void 0===t?void 0:t.code)||(null==p?void 0:p.propertyType),usageCategory:(null==p||null===(n=p.propertyCategory)||void 0===n?void 0:n.code)||(null==p?void 0:p.propertyCategory),landArea:parseFloat(null==p?void 0:p.plotArea),superBuiltUpArea:parseFloat(null==p?void 0:p.builtUpArea),noOfFloors:"BASEMENT"===(null==p||null===(l=p.noOfFloors)||void 0===l?void 0:l.code)?0:parseInt((null==p||null===(o=p.noOfFloors)||void 0===o||null===(i=o.code)||void 0===i||null===(r=i.split("_"))||void 0===r?void 0:r[0])||(null==p||null===(a=p.noOfFloors)||void 0===a||null===(u=a.split)||void 0===u||null===(d=u.call(a,"_"))||void 0===d?void 0:d[0]))||1},e.propertyDetails=s,e},E=function(e){var t,n,l,o,i,r,a,u,d,s,c,v,E,y,g,_,h,S,b,T,C,A,D,N,I,O,P,w,L,R,x,M,F,k,U,B,j,H,W,z,V,$;void 0===e&&(e={}),e=m(e),e=p(e);let Y=null===(t=(e=f(e)).propertyDetails)||void 0===t?void 0:t.propertyType,K=(null===(n=e.propertyDetails)||void 0===n?void 0:n.noOfFloors)||1,q=null===(l=e)||void 0===l||null===(o=l.owners)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.ownershipCategory;const G={Property:{tenantId:e.tenantId,address:e.address,propertyType:Y,...e.propertyDetails,ownershipCategory:"INDIVIDUAL.SINGLEOWNER",usageCategory:null===(r=e.propertyDetails)||void 0===r?void 0:r.usageCategory,owners:[...(e.owners||[]).map((e,t)=>{var n,l,o,i,r;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:e.documents?Array.isArray(e.documents)?e.documents:Object.keys(e.documents).map(t=>{var n;const l=e.documents[t];return{documentType:(null==l||null===(n=l.documentType)||void 0===n?void 0:n.code)||(null==l?void 0:l.documentType)||"",fileStoreId:(null==l?void 0:l.fileStoreId)||""}}):[],gender:"string"==typeof e.gender?e.gender:(null===(n=e.gender)||void 0===n?void 0:n.code)||(null===(l=e.gender)||void 0===l?void 0:l.value),ownerType:(null===(o=e.ownerType)||void 0===o?void 0:o.code)||e.ownerType||"NONE",relationship:(null===(i=e.relationship)||void 0===i?void 0:i.code)||e.relationship,inistitutetype:null==e||null===(r=e.inistitutetype)||void 0===r?void 0:r.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})],noOfFloors:K,additionalDetails:{isRainwaterHarvesting:!1,propertyType:Y,propertyCategory:null===(a=e.propertyDetails)||void 0===a?void 0:a.usageCategory,categoryType:(null===(u=e.waterConnection)||void 0===u||null===(d=u.useDetails)||void 0===d||null===(s=d.categoryType)||void 0===s?void 0:s.code)||(null===(c=e.useDetails)||void 0===c||null===(v=c.categoryType)||void 0===v?void 0:v.code),waterConnectionUsageType:(null===(E=e.waterConnection)||void 0===E||null===(y=E.useDetails)||void 0===y||null===(g=y.WaterConnectionUsageType)||void 0===g?void 0:g.code)||(null===(_=e.useDetails)||void 0===_||null===(h=_.WaterConnectionUsageType)||void 0===h?void 0:h.code),yearOfConstruction:(null===(S=e.waterConnection)||void 0===S||null===(b=S.useDetails)||void 0===b||null===(T=b.SelectYearofConstruction)||void 0===T?void 0:T.value)||(null===(C=e.useDetails)||void 0===C||null===(A=C.SelectYearofConstruction)||void 0===A?void 0:A.value),numberOfDwellingUnits:(null===(D=e.waterConnection)||void 0===D||null===(N=D.useDetails)||void 0===N?void 0:N.NumberofDwellingUnits)||(null===(I=e.useDetails)||void 0===I?void 0:I.NumberofDwellingUnits),numberOfRooms:(null===(O=e.waterConnection)||void 0===O||null===(P=O.useDetails)||void 0===P?void 0:P.NumberofRooms)||(null===(w=e.useDetails)||void 0===w?void 0:w.NumberofRooms),numberOfFloors:(null===(L=e.waterConnection)||void 0===L||null===(R=L.useDetails)||void 0===R||null===(x=R.noOfFloors)||void 0===x?void 0:x.code)||(null===(M=e.useDetails)||void 0===M||null===(F=M.noOfFloors)||void 0===F?void 0:F.code)||1,plotArea:(null===(k=e.waterConnection)||void 0===k||null===(U=k.useDetails)||void 0===U?void 0:U.plotArea)||(null===(B=e.useDetails)||void 0===B?void 0:B.plotArea),builtUpArea:(null===(j=e.waterConnection)||void 0===j||null===(H=j.useDetails)||void 0===H?void 0:H.builtUpArea)||(null===(W=e.useDetails)||void 0===W?void 0:W.builtUpArea),numberOfBeds:(null===(z=e.waterConnection)||void 0===z||null===(V=z.useDetails)||void 0===V?void 0:V.hospitalBeds)||(null===($=e.useDetails)||void 0===$?void 0:$.hospitalBeds),owners:[...(e.owners||[]).map((e,t)=>{var n,l,o,i,r;return{...e,additionalDetails:{ownerSequence:t,ownerName:null==e?void 0:e.name},documents:e.documents?Array.isArray(e.documents)?e.documents:Object.keys(e.documents).map(t=>{var n;const l=e.documents[t];return{documentType:(null==l||null===(n=l.documentType)||void 0===n?void 0:n.code)||(null==l?void 0:l.documentType)||"",fileStoreId:(null==l?void 0:l.fileStoreId)||""}}):[],gender:"string"==typeof e.gender?e.gender:(null===(n=e.gender)||void 0===n?void 0:n.code)||(null===(l=e.gender)||void 0===l?void 0:l.value),ownerType:(null===(o=e.ownerType)||void 0===o?void 0:o.code)||e.ownerType||"NONE",relationship:(null===(i=e.relationship)||void 0===i?void 0:i.code)||e.relationship,inistitutetype:null==e||null===(r=e.inistitutetype)||void 0===r?void 0:r.value,landlineNumber:null==e?void 0:e.altContactNumber,status:"ACTIVE"}})]},creationReason:"CREATE",source:"MUNICIPAL_RECORDS",channel:"SYSTEM"}},Z="string"==typeof q?q:null==q?void 0:q.code;var X;return(null!=Z&&Z.includes("INSTITUTIONALPRIVATE")||null!=Z&&Z.includes("INSTITUTIONALGOVERNMENT"))&&(G.Property.institution=null===(X=e)||void 0===X?void 0:X.institution),G},y=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},g=e=>{var r;let{config:a,onSelect:u,value:s,userType:c}=e;const[p,m]=n.useState(null),f=Digit.ULBService.getCurrentTenantId(),{t:y}=(Digit.Hooks.pt.useTenants(),o.useTranslation()),g=i.useLocation(),[_,h]=n.useState(!0),S=l.useMemo(()=>({...s}),[]);i.useHistory(),i.useRouteMatch(),sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!0);const b=window.Digit.Utils.browser.isMobile();let T=null===(r=Digit.Hooks.pt.useTenants())||void 0===r?void 0:r.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")&&(T=Digit.SessionStorage.get("OBPS_TENANTS")),window.location.href.includes("fsm")&&(T=Digit.SessionStorage.get("FSM_TENANTS"));const[C,A]=n.useState(""),[D,N]=n.useState([]);n.useEffect(()=>{if(null!=g&&g.state&&(!D||0===D.length)){var e,t,n,l;const o=null===(e=g.state)||void 0===e?void 0:e.applicant,i=null===(t=g.state)||void 0===t?void 0:t.contact,r=null===(n=g.state)||void 0===n?void 0:n.useDetails,a=null===(l=g.state)||void 0===l?void 0:l.propertyAddress;o&&i&&N([{name:`${o.firstName}${o.middleName?" "+o.middleName:""}${o.lastName?" "+o.lastName:""}`,mobileNumber:i.mobileNumber,gender:(null==r?void 0:r.gender)||{code:"MALE",name:"Male"},fatherOrHusbandName:o.ParentorSpouse||"NA",relationship:{code:"FATHER",name:"Father"},ownerType:{code:"NONE",name:"None"},ownershipCategory:"INDIVIDUAL.SINGLEOWNER"}]),(a||r)&&A({locationDet:{cityCode:(null==a?void 0:a.cityCode)||(null==a?void 0:a.city),locality:null==a?void 0:a.locality,houseDoorNo:(null==a?void 0:a.houseNo)||(null==a?void 0:a.houseDoorNo),buildingColonyName:(null==a?void 0:a.street)||(null==a?void 0:a.buildingColonyName),landmarkName:(null==a?void 0:a.landmark)||(null==a?void 0:a.landmarkName)},waterConnection:{useDetails:r}})}},[null==g?void 0:g.state]);const[I,O]=n.useState("");let P="employee"!=c&&((null==a?void 0:a.isSkipEnabled)||sessionStorage.getItem("skipenabled"));const[w,L,R]=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"),U=Digit.Hooks.pt.usePropertyAPI(f,!0);return n.useEffect(()=>{L(!1),F()},[]),k?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"employee-form-section-wrapper"},l.createElement(t.VerticalTimeline,{config:[{timeLine:[{actions:(()=>{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")})(),currentStep:1}]}],showFinalStep:!1}),l.createElement(t.FormComposer,{onSkip:()=>{u("isSkip",!0)},showSkip:P,skipStyle:b?{}:{textAlign:"right",marginRight:"55px"},onSubmit:function(){try{var e,t,n,l,o,i,r;let d=D&&D.length>0?D:null==C?void 0:C.owners;if(!d||0===d.length){var a;const e=null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info;d=[{name:(null==e?void 0:e.name)||"Citizen",mobileNumber:null==e?void 0:e.mobileNumber,gender:{code:(null==e?void 0:e.gender)||"MALE",name:(null==e?void 0:e.gender)||"Male"},fatherOrHusbandName:"NA",relationship:{code:"FATHER",name:"Father"},ownerType:{code:"NONE",name:"None"},ownershipCategory:"INDIVIDUAL.SINGLEOWNER"}]}if((null!=C&&null!==(e=C.owners)&&void 0!==e&&null!==(t=e.ownershipCategory)&&void 0!==t&&t.includes("MULTIPLEOWNERS")||null!=C&&null!==(n=C.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==C||null===(r=C.owners)||void 0===r?void 0:r.length))m({key:!0,label:"PT_COMMON_ONE_MORE_OWNER_INFROMATION_REQUIRED"});else{const e=E({...C,owners:d});e.Property.tenantId=f,U.mutate(e,{onSuccess:e=>{var t,n,l,o;null!=e&&e.Errors&&(null==e?void 0:e.Errors.length)>0?m({key:!0,label:(null==e||null===(l=e.Errors[0])||void 0===l?void 0:l.message)||y("PT_COMMON_FAILED_TO_CREATE_PROPERTY")}):(m({key:!1,label:`${y("CS_NEW_PROPERTY_APPLICATION_CREATED_SUCCESS")} - ${null==e||null===(t=e.Properties)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.propertyId}`}),u&&u("cptNewProperty",{property:null==e||null===(o=e.Properties)||void 0===o?void 0:o[0]}))},onError:e=>{var t,n,l,o;m({key:!0,label:(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.Errors)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.message)||y("PT_COMMON_FAILED_TO_CREATE_PROPERTY")})}})}return Promise.resolve()}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,config:d,label:y("SUBMIT"),isDisabled:!_,defaultValues:S,onFormValueChange:(e,t,n)=>{v.isEqual(t,C)||A(t),h(!0)},noBreakLine:!0,noCard:!0})),p&&l.createElement(t.Toast,{error:p.key,label:p.label,onClose:()=>{m(null)}}))},h=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")},S={padding:"4px 0px",justifyContent:"space-between"},b=e=>{var n,o,i;return l.createElement(t.Banner,{message:h(e),applicationNumber:null===(n=e.data)||void 0===n||null===(o=n.Properties)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.acknowldgementNumber,info:e.isSuccess?e.t("PT_APPLICATION_NO"):"",successful:e.isSuccess})},T=e=>{var r,a,u,d,s,c,v,y,g,_,h,T,C,A;let{onSuccess:D,onSelect:N,formData:I,redirectUrl:O,userType:P}=e;const{t:w}=o.useTranslation(),L=i.useLocation(),R=Digit.ULBService.getStateId(),x=Digit.ULBService.getCurrentTenantId(),M=i.useHistory();let F=null==L||null===(r=L.state)||void 0===r?void 0:r.data;var k;N&&(F=null==I||null===(k=I.cptNewProperty)||void 0===k?void 0:k.property);const U=(null==L||null===(a=L.state)||void 0===a?void 0:a.property)||(N&&null!=I&&null!==(u=I.cptNewProperty)&&void 0!==u&&u.property?null==I||null===(d=I.cptNewProperty)||void 0===d?void 0:d.property:null);let B=!1,{data:j}=Digit.Hooks.pt.useMDMS(R,"PropertyTax","PTWorkflow");((null==j||null===(s=j.PropertyTax)||void 0===s?void 0:s.PTWorkfow)||[]).forEach(e=>{e.enable&&e.businessService.includes("WNS")&&(B=!0)});const H=Digit.Hooks.pt.usePropertyAPI(null!==(c=F)&&void 0!==c&&null!==(v=c.locationDet)&&void 0!==v&&v.city?null===(y=F.locationDet)||void 0===y||null===(g=y.city)||void 0===g?void 0:g.code:x,!0),W=Digit.Hooks.pt.usePropertyAPI(null!==(_=F)&&void 0!==_&&null!==(h=_.locationDet)&&void 0!==h&&h.city?null===(T=F.locationDet)||void 0===T||null===(C=T.city)||void 0===C?void 0:C.code:x,!1);Digit.Hooks.useStore.getInitData(),n.useEffect(()=>{if(!U)try{var e,t,n,l;let o="employee"===P?x:null===(e=F)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;F.tenantId=o;let i=E(F);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,H.mutate(i,{onSuccess:D})}catch(e){}},[]),n.useEffect(()=>{new URLSearchParams(L.search).get("redirectToUrl")},[H]),n.useEffect(()=>{if(H.isSuccess&&B)try{var e,t,n,l;let o="employee"===P?x:null===(e=F)||void 0===e||null===(t=e.locationDet)||void 0===t||null===(n=t.city)||void 0===n?void 0:n.code;F.tenantId=o;let i=function(e){var t,n,l,o,i,r,a,u,d,s,c,v,E,y,g,_,h,S,b,T,C,A,D,N,I,O,P,w,L,R,x,M,F,k,U,B,j,H,W,z;void 0===e&&(e={}),e=m(e),e=p(e);let V=null===(t=(e=f(e)).propertyDetails)||void 0===t?void 0:t.propertyType,$=(null===(n=e.propertyDetails)||void 0===n?void 0:n.noOfFloors)||1;const Y={Property:{id:e.id,accountId:e.accountId,acknowldgementNumber:e.acknowldgementNumber,propertyId:e.propertyId,status:e.status||"INWORKFLOW",tenantId:e.tenantId,address:e.address,propertyType:V,ownershipCategory:"INDIVIDUAL.SINGLEOWNER",owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...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:$,additionalDetails:{isRainwaterHarvesting:!1,categoryType:(null===(l=e.waterConnection)||void 0===l||null===(o=l.useDetails)||void 0===o||null===(i=o.categoryType)||void 0===i?void 0:i.code)||(null===(r=e.useDetails)||void 0===r||null===(a=r.categoryType)||void 0===a?void 0:a.code),waterConnectionUsageType:(null===(u=e.waterConnection)||void 0===u||null===(d=u.useDetails)||void 0===d||null===(s=d.WaterConnectionUsageType)||void 0===s?void 0:s.code)||(null===(c=e.useDetails)||void 0===c||null===(v=c.WaterConnectionUsageType)||void 0===v?void 0:v.code),yearOfConstruction:(null===(E=e.waterConnection)||void 0===E||null===(y=E.useDetails)||void 0===y||null===(g=y.SelectYearofConstruction)||void 0===g?void 0:g.value)||(null===(_=e.useDetails)||void 0===_||null===(h=_.SelectYearofConstruction)||void 0===h?void 0:h.value),numberOfDwellingUnits:(null===(S=e.waterConnection)||void 0===S||null===(b=S.useDetails)||void 0===b?void 0:b.NumberofDwellingUnits)||(null===(T=e.useDetails)||void 0===T?void 0:T.NumberofDwellingUnits),numberOfRooms:(null===(C=e.waterConnection)||void 0===C||null===(A=C.useDetails)||void 0===A?void 0:A.NumberofRooms)||(null===(D=e.useDetails)||void 0===D?void 0:D.NumberofRooms),numberOfFloors:(null===(N=e.waterConnection)||void 0===N||null===(I=N.useDetails)||void 0===I||null===(O=I.noOfFloors)||void 0===O?void 0:O.code)||(null===(P=e.useDetails)||void 0===P||null===(w=P.noOfFloors)||void 0===w?void 0:w.code)||1,plotArea:(null===(L=e.waterConnection)||void 0===L||null===(R=L.useDetails)||void 0===R?void 0:R.plotArea)||(null===(x=e.useDetails)||void 0===x?void 0:x.plotArea),builtUpArea:(null===(M=e.waterConnection)||void 0===M||null===(F=M.useDetails)||void 0===F?void 0:F.builtUpArea)||(null===(k=e.useDetails)||void 0===k?void 0:k.builtUpArea),hospitalBeds:(null===(U=e.waterConnection)||void 0===U||null===(B=U.useDetails)||void 0===B?void 0:B.hospitalBeds)||(null===(j=e.useDetails)||void 0===j?void 0:j.hospitalBeds),owners:[...e.owners.map((e,t)=>{var n,l,o,i;return{...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 K=JSON.parse(sessionStorage.getItem("propertyInitialObject"));if(checkArrayLength(null==K?void 0:K.units)&&checkIsAnArray(null===(H=Y.Property)||void 0===H?void 0:H.units)&&null!==(W=e)&&void 0!==W&&W.isEditProperty){var q;K.units=K.units.filter(e=>e.active);let e=K.units.map(e=>({...e,active:!1}));null===(q=Y.Property)||void 0===q||q.units.push(...e)}return checkArrayLength(null==K?void 0:K.owners)&&checkIsAnArray(null===(z=Y.Property)||void 0===z?void 0:z.owners)&&(Y.Property.owners=[...K.owners]),null!=K&&K.auditDetails&&(Y.Property.auditDetails={...K.auditDetails}),Y}(F);i.Property.tenantId=(null==i||null===(l=i.Property)||void 0===l?void 0:l.tenantId)||o,W.mutate(i,{onSuccess:D})}catch(e){}},[H.isSuccess]);const z=!U&&(H.isLoading||H.isIdle),V=!!U||H.isSuccess,$=U?{Properties:[U]}:H.data;return z?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(b,{t:w,data:$,isSuccess:V,isLoading:z}),V&&l.createElement(t.CardText,null,window.location.href.includes("employee")?w("CS_CREATE_PROPERTY_SUCCESS_EMP_RESPONSE"):w("CS_CREATE_PROPERTY_SUCCESS_CITIZEN_RESPONSE")),!V&&l.createElement(t.CardText,null,w("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(t.StatusTable,null,V&&l.createElement(t.Row,{rowContainerStyle:S,last:!0,label:w("PT_COMMON_TABLE_COL_PT_ID"),text:null==$||null===(A=$.Properties[0])||void 0===A?void 0:A.propertyId,textStyle:{whiteSpace:"pre",width:"200%"}})),V&&(window.location.href.includes("/citizen/")||window.location.href.includes("/employee/"))&&l.createElement(t.SubmitBar,N?{label:w("CS_COMMON_PROCEED"),onSubmit:()=>{if(V){var e,t;sessionStorage.setItem("Digit_OBPS_PT",JSON.stringify(null==$||null===(e=$.Properties)||void 0===e?void 0:e[0])),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(null==$||null===(t=$.Properties)||void 0===t?void 0:t[0]));const r=new URLSearchParams(L.search).get("redirectToUrl"),a=O&&"undefined"!==O?O:r&&"undefined"!==r?r:null;var n,l,o,i;if(a)return void M.push(`${a}?propertyId=${null==$||null===(n=$.Properties[0])||void 0===n?void 0:n.propertyId}&tenantId=${null==$||null===(l=$.Properties[0])||void 0===l?void 0:l.tenantId}`,{...null==L||null===(o=L.state)||void 0===o?void 0:o.prevState});N&&N("cpt",{details:null==$||null===(i=$.Properties)||void 0===i?void 0:i[0]})}}}:{label:w("CS_COMMON_PROCEED"),onSubmit:()=>{const e=new URLSearchParams(L.search).get("redirectToUrl"),t=O&&"undefined"!==O?O:e&&"undefined"!==e?e:null;var n,l,o;t?M.push(`${t}?propertyId=${null==$||null===(n=$.Properties[0])||void 0===n?void 0:n.propertyId}&tenantId=${null==$||null===(l=$.Properties[0])||void 0===l?void 0:l.tenantId}`,{...null==L||null===(o=L.state)||void 0===o?void 0:o.prevState}):M.push(window.location.href.includes("/employee/")?"/digit-ui/employee":"/digit-ui/citizen")}}))},C=e=>{const n=r.useQueryClient(),a=i.useRouteMatch(),u=(o.useTranslation(),i.useLocation(),i.useHistory()),d=Digit.ULBService.getStateId(),[s,c,v]=Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{});let{isLoading:p}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=i.useLocation().search,f=new URLSearchParams(m).get("redirectUrl");return p?l.createElement(t.Loader,null):l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:""+a.path},l.createElement(t.LayoutWrapper,{layoutClass:"action"},l.createElement(g,{onSelect:function(e,t){try{return u.push({pathname:a.path+"/save-property",search:m,state:{property:null==t?void 0:t.property}}),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"citizen"}))),l.createElement(i.Route,{exact:!0,path:a.path+"/save-property"},l.createElement(T,{data:s,onSuccess:()=>{v(),n.invalidateQueries("PT_CREATE_PROPERTY")},redirectUrl:f,userType:"citizen"})))},A=[{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"}]}];var D="function"==typeof Symbol&&Symbol.for,N=D?Symbol.for("react.element"):60103,I=D?Symbol.for("react.portal"):60106,O=D?Symbol.for("react.fragment"):60107,P=D?Symbol.for("react.strict_mode"):60108,w=D?Symbol.for("react.profiler"):60114,L=D?Symbol.for("react.provider"):60109,R=D?Symbol.for("react.context"):60110,x=D?Symbol.for("react.async_mode"):60111,M=D?Symbol.for("react.concurrent_mode"):60111,F=D?Symbol.for("react.forward_ref"):60112,k=D?Symbol.for("react.suspense"):60113,U=D?Symbol.for("react.suspense_list"):60120,B=D?Symbol.for("react.memo"):60115,j=D?Symbol.for("react.lazy"):60116,H=D?Symbol.for("react.block"):60121,W=D?Symbol.for("react.fundamental"):60117,z=D?Symbol.for("react.responder"):60118,V=D?Symbol.for("react.scope"):60119;function $(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case N:switch(e=e.type){case x:case M:case O:case w:case P:case k:return e;default:switch(e=e&&e.$$typeof){case R:case F:case j:case B:case L:return e;default:return t}}case I:return t}}}function Y(e){return $(e)===M}var K={AsyncMode:x,ConcurrentMode:M,ContextConsumer:R,ContextProvider:L,Element:N,ForwardRef:F,Fragment:O,Lazy:j,Memo:B,Portal:I,Profiler:w,StrictMode:P,Suspense:k,isAsyncMode:function(e){return Y(e)||$(e)===x},isConcurrentMode:Y,isContextConsumer:function(e){return $(e)===R},isContextProvider:function(e){return $(e)===L},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===N},isForwardRef:function(e){return $(e)===F},isFragment:function(e){return $(e)===O},isLazy:function(e){return $(e)===j},isMemo:function(e){return $(e)===B},isPortal:function(e){return $(e)===I},isProfiler:function(e){return $(e)===w},isStrictMode:function(e){return $(e)===P},isSuspense:function(e){return $(e)===k},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===O||e===M||e===w||e===P||e===k||e===U||"object"==typeof e&&null!==e&&(e.$$typeof===j||e.$$typeof===B||e.$$typeof===L||e.$$typeof===R||e.$$typeof===F||e.$$typeof===W||e.$$typeof===z||e.$$typeof===V||e.$$typeof===H)},typeOf:$},q=c(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,v=e?Symbol.for("react.suspense"):60113,p=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,g=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case d:case s:case o:case r:case i:case v:return p;default:var E=p&&p.$$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,D=o,N=f,I=m,O=l,P=r,w=i,L=v,R=!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=D,t.Lazy=N,t.Memo=I,t.Portal=O,t.Profiler=P,t.StrictMode=w,t.Suspense=L,t.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),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)===v},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===s||e===r||e===i||e===v||e===p||"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===g||e.$$typeof===_||e.$$typeof===E)},t.typeOf=h}()}),G=c(function(e){e.exports="production"===process.env.NODE_ENV?K:q}),Z=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;function Q(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ee=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=Q(e),i=1;i<arguments.length;i++){for(var r in n=Object(arguments[i]))X.call(n,r)&&(o[r]=n[r]);if(Z){l=Z(n);for(var a=0;a<l.length;a++)J.call(n,l[a])&&(o[l[a]]=n[l[a]])}}return o},te="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ne=Function.call.bind(Object.prototype.hasOwnProperty),le=function(){};if("production"!==process.env.NODE_ENV){var oe=te,ie={},re=ne;le=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function ae(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(re(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,oe)}catch(e){r=e}if(!r||r instanceof Error||le((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 ie)){ie[r.message]=!0;var u=o?o():"";le("Failed "+n+" type: "+r.message+(null!=u?u:""))}}}ae.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ie={})};var ue=ae,de=function(){};function se(){return null}function ce(){}function ve(){}"production"!==process.env.NODE_ENV&&(de=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),ve.resetWarningCache=ce;var pe=c(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(se),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+"]",te);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 G.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(ne(a,d)){var c=e(a,d,l,o,r+"."+d,te);if(c instanceof Error)return c}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&de(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),se;function t(t,n,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&&de("Invalid argument supplied to oneOfType, expected an instance of array."),se;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return de("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+v(n)+" at index "+t+"."),se}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,te);if(null==d)return null;d.data&&ne(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 v in e){var p=e[v];if("function"!=typeof p)return u(l,o,r,v,c(p));var m=p(a,v,l,o,r+"."+v,te);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 v=ee({},t[n],e);for(var p in v){var m=e[p];if(ne(e,p)&&"function"!=typeof m)return u(l,o,r,p,c(m));if(!m)return new i("Invalid "+o+" `"+r+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=m(a,p,l,o,r+"."+p,te);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!==te){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 v(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=ue,l.resetWarningCache=ue.resetWarningCache,l.PropTypes=l,l}(G.isElement):function(){function e(e,t,n,l,o,i){if(i!==te){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:ve,resetWarningCache:ce};return n.PropTypes=n,n}()});function me(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 fe={type:"login"},Ee=e=>{var r,a,u,d,s,c,p;let{template:m,header:f,actionButtonLabel:E,onSelect:y,clearParams:g=(()=>{}),stateCode:_,redirectToUrl:h,searchQuery:S}=e;const{t:b}=o.useTranslation(),T=n.useRef(),{mobileNumber:C,propertyIds:A,oldPropertyIds:D,locality:N,city:I,tenantId:O,doorNo:P,name:w,PToffset:L}=Digit.Hooks.useQueryParams(),R={},[x,M]=n.useState(!1),F=Digit.ComponentRegistryService.getComponent("WSInfoLabel");let k,U,B=L;isNaN(parseInt(B))?k=5:(U=B,k=parseInt(B)+5);let j=isNaN(parseInt(B))?{sortOrder:"ASC",sortBy:"createdTime",offset:"0"}:{sortOrder:"ASC",sortBy:"createdTime",offset:U};Digit.Hooks.useClickOutside(T,()=>{M(!1)},x);const H=(null==S?void 0:S.mobileNumber)||(null==S?void 0:S.mobileNo),W=(null==S?void 0:S.propertyIds)||(null==S?void 0:S.propertyId),z=(null==S?void 0:S.oldPropertyIds)||(null==S?void 0:S.oldPropertyId),V=e=>e&&"undefined"!==e?e:null,$=V(C)||V(H);$&&(R.mobileNumber=$);const Y=V(A)||V(W);Y&&(R.propertyIds=Y);const K=V(D)||V(z);K&&(R.oldPropertyIds=K);const q=V(N)||V(null==S?void 0:S.locality);q&&(R.locality=q);const G=V(P)||V(null==S?void 0:S.doorNo);G&&(R.doorNo=G);const Z=V(w)||V(null==S?void 0:S.name);Z&&(R.name=Z),R.limit=j.limit,R.sortOrder=j.sortOrder,R.sortBy=j.sortBy,R.offset=j.offset,R.status||(R.status="ACTIVE,INWORKFLOW");const[X,J,Q]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS",null),[ee,te,ne]=Digit.Hooks.useSessionStorage("PT_MUTATE_MULTIPLE_OWNERS_LAST_PATH",null),le=(i.useRouteMatch(),Digit.Hooks.useQueryParams());n.useEffect(()=>{J([]),g(),te("")},[]);const oe=Digit.ULBService.getCurrentTenantId(),ie=I||O||(null==S?void 0:S.city)||oe,re=Digit.Hooks.pt.usePropertySearch(ie?{tenantId:ie,filters:R,auth:!1}:{filters:R,auth:!1},{privacy:Digit.Utils.getPrivacyObject()}),ae=(null==re||null===(r=re.data)||void 0===r?void 0:r.Properties)||(null==re||null===(a=re.data)||void 0===a?void 0:a.properties)||(Array.isArray(null==re?void 0:re.data)?null==re?void 0:re.data:[]),ue=null==ae||null===(u=ae.map)||void 0===u?void 0:u.call(ae,e=>e.propertyId||e.id).filter(e=>e).join(",");!re.isSuccess||ae&&0!==ae.length||console.warn("Property Search: No properties found in result.data",re.data);const de=Digit.Hooks.useFetchBillsForBuissnessService({businessService:"PT",...C?{mobileNumber:C,consumerCode:ue}:{consumerCode:ue},tenantId:ie},{enabled:!(!ue||!ie),retry:!1}),se=i.useHistory();if(de.isLoading||re.isLoading)return l.createElement(t.Loader,null);if(re.error||re.isSuccess&&(!ae||0===ae.length))return l.createElement("div",{style:{height:"150px"}},l.createElement(t.Card,{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"}},b("CS_PT_NO_PROPERTIES_FOUND")));const ce={};null==de||null===(d=de.data)||void 0===d||null===(s=d.Bill)||void 0===s||s.forEach(e=>{null!=e&&e.consumerCode&&(ce[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 ve=null===(c=ae||[])||void 0===c?void 0:c.map(e=>{var t,n,l,o,i,r,a,u,d,s,c,p,m;let f=(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)||0)-((null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)||0)}))||void 0===t||null===(n=t[0])||void 0===n?void 0:n.name,property_address:[f.doorNo||"",f.buildingName||"",f.street||"",b("TENANTS_MOHALLA_"+(null===(l=f.locality)||void 0===l?void 0:l.code))!=="TENANTS_MOHALLA_"+(null===(o=f.locality)||void 0===o?void 0:o.code)?b("TENANTS_MOHALLA_"+(null===(i=f.locality)||void 0===i?void 0:i.code)):(null===(r=f.locality)||void 0===r?void 0:r.name)||""].filter(e=>e).join(", "),zroLocation:(null==e||null===(a=e.address)||void 0===a?void 0:a.zroLocation)||(null==e||null===(u=e.address)||void 0===u?void 0:u.zroLocation),total_due:(null===(d=ce[null==e?void 0:e.propertyId])||void 0===d?void 0:d.total_due)||0,bil_due__date:(null===(s=ce[null==e?void 0:e.propertyId])||void 0===s?void 0:s.bil_due__date)||b("N/A"),status:b(e.status),owner_mobile:null===(c=((null==e?void 0:e.owners)||[])[0])||void 0===c?void 0:c.mobileNumber,address:null==e?void 0:e.address,owners:e.owners,propertyDetails:e,privacy:{property_address:{uuid:null==e||null===(p=e.owners)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.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=>(v.get(e,"Properties[0].address.doorNo")?v.get(e,"Properties[0].address.doorNo")+", ":"")+(v.get(e,"Properties[0].address.street")?v.get(e,"Properties[0].address.street")+", ":"")+(v.get(e,"Properties[0].address.landmark")?""+v.get(e,"Properties[0].address.landmark"):"")}}}}}),pe=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||"/digit-ui/citizen";return l.createElement("div",{style:{marginTop:"16px"}},l.createElement("div",null,f&&l.createElement(t.Header,{style:{marginLeft:"8px"}},b(f)," (",null==ve?void 0:ve.length,")"),F&&l.createElement(F,{t:b}),window.Digit.Utils.browser.isMobile()?l.createElement(t.ResponseComposer,{data:ve,template:m,actionButtonLabel:E,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(!y){const t={mobileNumber:null==e?void 0:e.owner_mobile,tenantId:_,userType:Digit.UserService.getType()};return Promise.resolve(function(e){return Promise.resolve(me(function(){return Promise.resolve(Digit.UserService.sendOtp(e,_)).then(function(e){return[e,null]})},function(e){return[null,e]}))}({otp:{...t,...fe}})).then(function(n){let[l,o]=n;if(o)se.push("/digit-ui/citizen/",{from:pe(location.state,le),data:t});else{let t="/digit-ui/citizen/commonPt/property/link-success/"+e.property_id;h&&(t=h+"?propertyId="+e.property_id+"&tenantId="+oe),se.replace("/digit-ui/citizen/commonPt/property/citizen-otp",{from:pe(location.state,le),mobileNumber:e.owner_mobile,redirectBackTo:t})}})}y("cptId",{id:e.property_id})}())}catch(e){return Promise.reject(e)}}}):l.createElement(t.Table,{t:b,data:ve,totalCount:null==ve?void 0:ve.length,totalRecords:null==ve?void 0:ve.length,manualPagination:!1,disableSort:!0,columns:[{Header:b("PT_PROPERTY_PTUID"),disableSortBy:!0,accessor:"property_id",Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:`/digit-ui/citizen/commonpt/view-property?propertyId=${t.original.property_id}&tenantId=${oe}`},t.original.property_id)))}},{Header:b("PT_OWNER_NAME"),disableSortBy:!0,accessor:"owner_name"},{Header:b("PT_PROPERTY_ADDRESS_SUB_HEADER"),disableSortBy:!0,accessor:"property_address"},{Header:b("zroLocation"),disableSortBy:!0,accessor:"zroLocation"}]})),x?l.createElement(t.Modal,{hideSubmit:!0,isDisabled:!1,popupStyles:{width:"319px",height:"250px",margin:"auto"},formId:"modal-action"},l.createElement("div",{ref:T},l.createElement(t.KeyNote,{keyValue:b("PT_AMOUNT_DUE"),note:"₹ "+(null==x||null===(p=x.total_due)||void 0===p?void 0:p.toLocaleString("en-IN")),noteStyle:{fontSize:"24px",fontWeight:"bold"}}),l.createElement("p",null,b("PT_YOU_HAVE")+" ₹ "+(null==x?void 0:x.total_due.toLocaleString("en-IN"))+" "+b("PT_PENDING_AMOUNT")+" "+b("PT_INORDER_TO_TRANSFER")),l.createElement(t.SubmitBar,{submit:!1,onSubmit:()=>{se.push("/digit-ui/citizen/payment/my-bills/PT/"+x.property_id,{tenantId:oe})},style:{marginTop:"14px",width:"100%"},label:b("PT_PROCEED_PAYMENT")}))):null,0===(null==ve?void 0:ve.length)&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_NO_PROP_FOUND_MSG")),0!==(null==ve?void 0:ve.length)&&(5==(null==ve?void 0:ve.length)||50==(null==ve?void 0:ve.length))&&(N||S&&S.locality)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},b("PT_LOAD_MORE_MSG")," ",l.createElement("span",{className:"link"},l.createElement(i.Link,{to:`/digit-ui/citizen/pt/property/search-results?mobileNumber=${C||S.mobileNumber?C||(null==S?void 0:S.mobileNumber):""}&propertyIds=${A||null!=S&&S.propertyIds?A||(null==S?void 0:S.propertyIds):""}&oldPropertyIds=${D||null!=S&&S.oldPropertyIds?D||(null==S?void 0:S.oldPropertyIds):""}&doorNo=${P||null!=S&&S.doorNo?P||(null==S?void 0:S.doorNo):""}&name=${w||null!=S&&S.name?w||(null==S?void 0:S.name):""}&city=${I||""}&locality=${N||null!=S&&S.locality?N||(null==S?void 0:S.locality):""}&PToffset=${k}`},b("PT_COMMON_CLICK_HERE"))))))};Ee.propTypes={template:pe.any,header:pe.string,actionButtonLabel:pe.string},Ee.defaultProps={template:[],header:null,actionButtonLabel:null};const ye=e=>{var r,a,d,s,c,p,m,f,E,y,g,_,h;let{config:S,onSelect:b,redirectToUrl:T}=e;const{t:C}=o.useTranslation(),A=i.useHistory(),{action:D=0}=Digit.Hooks.useQueryParams(),[N,I]=n.useState(()=>{var e,t;const n=null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber,l=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getStateId()||"dl";return n&&window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")?{filters:{mobileNumber:n},city:l}:{}}),[O,P]=n.useState(null);sessionStorage.setItem("VisitedCommonPTSearch",!0),sessionStorage.setItem("VisitedLightCreate",!1);let w=null===(r=Digit.Hooks.pt.useTenants())||void 0===r?void 0:r.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)});w=w||(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")?w=Digit.SessionStorage.get("OBPS_TENANTS"):window.location.href.includes("fsm")&&(w=[{i18nKey:"TENANT_TENANTS_PG_CITYA",code:Digit.ULBService.getCurrentTenantId(),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:Digit.ULBService.getCurrentTenantId(),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",w);const[L,R]=n.useState(),[x,M]=n.useState(),[F,k]=n.useState(!1);window.Digit.Utils.browser.isMobile();const{data:U,isLoading:B,error:j}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:null==N?void 0:N.city,filters:null==N?void 0:N.filters,auth:!1,configs:{enabled:Object.keys(N).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}});n.useEffect(()=>{var e,t,n;(null==N||null===(e=N.filters)||void 0===e||!e.mobileNumber||1!=(null===(t=Object.values(null==N?void 0:N.filters))||void 0===t||null===(n=t.filter(e=>void 0!==e))||void 0===n?void 0:n.length))&&(null==U?void 0:U.Properties.length)>0&&null!=H&&H.maxResultValidation&&(null==U?void 0:U.Properties.length)>(null==H?void 0:H.maxPropertyResult)&&!F&&P({error:!0,warning:!0,label:"ERR_PLEASE_REFINED_UR_SEARCH"})},[U]),n.useEffect(()=>{O&&"ERR_PLEASE_REFINED_UR_SEARCH"!==(null==O?void 0:O.label)&&"NO_PROPERTIES_FOUND"!==(null==O?void 0:O.label)&&P(null)},[D,B]),n.useEffect(()=>{var e;!B&&U&&N&&(null==U||null===(e=U.Properties)||void 0===e?void 0:e.length)<=0&&P({error:!0,warning:!0,label:"NO_PROPERTIES_FOUND"})},[null==U||null===(d=U.Properties)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.propertyId,B]),n.useLayoutEffect(()=>{const e=()=>{let t=document.querySelector("div.action-bar-wrap"),n=document.querySelector(".primary-label-btn");t&&n?(t.style.position="static",t.style.padding="8px 0",t.style.boxShadow="none",t.style.marginBottom="16px",t.style.display="flex",t.style.justifyContent="flex-end",t.style.alignItems="center",t.style.zIndex="0",n.style.margin="0",n.style.marginRight="24px",n.style.marginLeft="auto",n.parentElement!==t&&t.insertBefore(n,t.firstChild)):setTimeout(()=>{e()},100)};e()},[D]);const{data:H,isLoading:W}=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}}),[z,V,$,Y,K]=S.inputs,q=[{body:[{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:(null===(c=w)||void 0===c?void 0:c.find(e=>"dl.djb"===e.code||"dl"===e.code))||(null===(p=w)||void 0===p?void 0:p[0])||null,rules:{required:!0},customProps:{t:C,isMandatory:!0,option:[...w],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,u({},n,{disable:!0,selected:e.value,select:t=>{Digit.ULBService.getCurrentTenantId(),t.code!==L&&e.setValue("locality",null),e.onChange(t)}}))}},{label:z.label,type:z.type,populators:{defaultValue:(null===(m=Digit.UserService.getUser())||void 0===m||null===(f=m.info)||void 0===f?void 0:f.mobileNumber)||"",name:z.name,validation:null==z?void 0:z.validation},isMandatory:!1},{label:"",labelChildren:l.createElement("div",{className:"tooltip"},l.createElement("div",{style:{display:"flex",gap:"0 4px"}},l.createElement("h2",null,C(V.label)),l.createElement(t.InfoBannerIcon,{fill:"#0b0c0c"}),l.createElement("span",{className:"tooltiptext",style:{position:"absolute",width:"72%",marginLeft:"50%",fontSize:"medium"}},C(V.description)+" PG-PT-xxxx-xxxxxx"))),type:V.type,populators:{name:V.name,defaultValue:"",validation:null==V?void 0:V.validation},isMandatory:!1,isInsideBox:!0,placementinbox:1}],body1:[{label:"PT_SELECT_CITY",isMandatory:!0,type:"custom",populators:{name:"city",defaultValue:(null===(E=w)||void 0===E?void 0:E.find(e=>"dl.djb"===e.code||"dl"===e.code))||(null===(y=w)||void 0===y?void 0:y[0])||null,rules:{required:!0},customProps:{t:C,isMandatory:!0,option:[...w],optionKey:"i18nKey"},component:(e,n)=>l.createElement(t.Dropdown,u({},n,{disable:!0,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!==L&&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:L,boundaryType:"revenue",keepNull:!1,optionCardStyles:{height:"600px",overflow:"auto",zIndex:"10",maxHeight:"300px"},selected:null==x?void 0:x.locality,disable:!L,disableLoader:!0})}},{label:K.label,type:K.type,populators:{defaultValue:"",name:K.name,validation:null==K?void 0:K.validation},isMandatory:!1},{label:Y.label,type:Y.type,populators:{defaultValue:"",name:Y.name,validation:null==Y?void 0:Y.validation},isMandatory:!1}]}];if(W)return l.createElement(t.Loader,null);let G=!(null!=H&&H.maxResultValidation&&(null==N||null===(g=N.filters)||void 0===g||!g.mobileNumber||1!=(null===(_=Object.values(null==N?void 0:N.filters))||void 0===_||null===(h=_.filter(e=>void 0!==e))||void 0===h?void 0:h.length)))||(null==U?void 0:U.Properties.length)<(null==H?void 0:H.maxPropertyResult)&&(null==O||null!==O&&!(null!=O&&O.error));if(U&&!B&&!j&&G){var Z,X,J,Q,ee;let e={};if(e={...N.filters,city:N.city},(null==N||null===(Z=N.filters)||void 0===Z||!Z.mobileNumber||1!=(null===(X=Object.values(null==N?void 0:N.filters))||void 0===X||null===(J=X.filter(e=>void 0!==e))||void 0===J?void 0:J.length))&&null!=H&&H.ptSearchCount&&null!=N&&null!==(Q=N.filters)&&void 0!==Q&&Q.locality&&B&&null!=B&&null!==(ee=B.Properties)&&void 0!==ee&&ee.length&&B.Properties.length>(null==H?void 0:H.ptSearchCount))!O&&P({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"});else if("MUTATION"===S.action)b(S.key,e,null,null,null,{queryParams:{...e}});else if(T&&!window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search"))A.push(`/digit-ui/citizen/commonPt/property/search-results?${Object.keys(e).filter(t=>void 0!==e[t]&&""!==e[t]).map(t=>`${t}=${e[t]}`).join("&")}${T?"&redirectToUrl="+T:""}`);else if(!window.location.href.includes("digit-ui/citizen/commonpt/property/citizen-search")){var te,ne,le,oe,ie,re,ae,ue,de,se;let t={};t=0==D?{city:null===(te=e)||void 0===te?void 0:te.city,mobileNumber:(null===(ne=e)||void 0===ne?void 0:ne.mobileNumber)||"",propertyIds:(null===(le=e)||void 0===le?void 0:le.propertyIds)||"",oldPropertyIds:(null===(oe=e)||void 0===oe?void 0:oe.oldPropertyIds)||"",locality:"",doorNo:"",name:""}:{city:null===(ie=e)||void 0===ie?void 0:ie.city,locality:(null===(re=e)||void 0===re?void 0:re.locality)||"",doorNo:(null===(ae=e)||void 0===ae?void 0:ae.doorNumber)||(null===(ue=e)||void 0===ue?void 0:ue.doorNo)||"",name:(null===(de=e)||void 0===de?void 0:de.name)||"",mobileNumber:"",propertyIds:"",oldPropertyIds:""},!B&&(null==U||null===(se=U.Properties)||void 0===se?void 0:se.length)>0&&b("cptSearchQuery",t,null,null,null,{queryParams:{...t}})}}var ce,ve,pe,me;return j&&!O&&P({error:!0,label:(null==j||null===(ce=j.response)||void 0===ce||null===(ve=ce.data)||void 0===ve||null===(pe=ve.Errors)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.code)||j}),1==D&&(q[0].body=[...q[0].body1]),l.createElement("div",null,l.createElement("div",{className:"search-tabs-container",style:{marginBottom:"16px",display:"flex",gap:"24px",justifyContent:"flex-start",borderBottom:"1px solid #ccc"}},l.createElement("div",{className:"search-tab "+(0==D?"active":""),style:{padding:"8px 16px",cursor:"pointer",borderBottom:0==D?"2px solid #f47738":"2px solid transparent",color:0==D?"#f47738":"#0b0c0c",fontWeight:0==D?"bold":"normal"},onClick:()=>{var e,t;A.replace(A.location.pathname+"?action=0");const n=null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber,l=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getStateId()||"dl";I(n?{filters:{mobileNumber:n},city:l}:{})}},C("PT_KNOW_PTID")),l.createElement("div",{className:"search-tab "+(1==D?"active":""),style:{padding:"8px 16px",cursor:"pointer",borderBottom:1==D?"2px solid #f47738":"2px solid transparent",color:1==D?"#f47738":"#0b0c0c",fontWeight:1==D?"bold":"normal"},onClick:()=>{var e,t;A.replace(A.location.pathname+"?action=1");const n=null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber,l=Digit.ULBService.getCurrentTenantId()||Digit.ULBService.getStateId()||"dl";I(n?{filters:{mobileNumber:n},city:l}:{})}},C("PT_SEARCH_DOOR_NO")),l.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center"}},window.location.href.includes("/obps/bpa/")?l.createElement(i.Link,{to:"/digit-ui/citizen/obps/bpa/building_plan_scrutiny/new_construction/location",style:{padding:"8px 24px",textDecoration:"none",borderRadius:"2px"}},C("CORE_COMMON_SKIP_CONTINUE")):l.createElement(i.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",style:{padding:"8px 24px",textDecoration:"none",borderRadius:"2px"}},C("CPT_REG_NEW_PROPERTY")))),l.createElement(t.FormComposer,{key:D,onSubmit:function(e){try{var t,n;if(null!=H&&H.maxResultValidation&&(null==U?void 0:U.Properties.length)>0&&(null==U?void 0:U.Properties.length)>(null==H?void 0:H.maxPropertyResult)&&F)return k(!0),Promise.resolve();if(null==e||null===(t=e.city)||void 0===t||!t.code)return P({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(0==D){var l,o,i,r,a,u,d,s,c,v,p,m,f,E,y;if(!(null!=e&&e.mobileNumber||null!=e&&e.propertyIds||null!=e&&e.oldPropertyId))return P({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==z||null===(o=z.validation)||void 0===o||null===(i=o.pattern)||void 0===i?void 0:i.value)))return P({error:!0,label:null==z||null===(v=z.validation)||void 0===v||null===(p=v.pattern)||void 0===p?void 0:p.message}),Promise.resolve();if(null!=e&&e.propertyIds&&(null===(r=e.propertyIds)||void 0===r||!r.match(null==V||null===(a=V.validation)||void 0===a||null===(u=a.pattern)||void 0===u?void 0:u.value)))return P({error:!0,label:null==V||null===(m=V.validation)||void 0===m||null===(f=m.pattern)||void 0===f?void 0:f.message}),Promise.resolve();if(null!=e&&e.oldPropertyId&&(null===(d=e.oldPropertyId)||void 0===d||!d.match(null==$||null===(s=$.validation)||void 0===s||null===(c=s.pattern)||void 0===c?void 0:c.value)))return P({error:!0,label:null==$||null===(E=$.validation)||void 0===E||null===(y=E.pattern)||void 0===y?void 0:y.message}),Promise.resolve()}else{var g,_,h,S,b,T,C,A,N,w,L;if(null==e||null===(g=e.locality)||void 0===g||!g.code)return P({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(!(null!=e&&e.doorNumber||null!=e&&e.name))return P({error:!0,label:"ERR_PT_FILL_VALID_FIELDS"}),Promise.resolve();if(null!=e&&e.name&&(null===(_=e.name)||void 0===_||!_.match(null==Y||null===(h=Y.validation)||void 0===h||null===(S=h.pattern)||void 0===S?void 0:S.value)))return P({error:!0,label:null==Y||null===(A=Y.validation)||void 0===A||null===(N=A.pattern)||void 0===N?void 0:N.message}),Promise.resolve();if(null!=e&&e.doorNumber&&(null===(b=e.doorNumber)||void 0===b||!b.match(null==K||null===(T=K.validation)||void 0===T||null===(C=T.pattern)||void 0===C?void 0:C.value)))return P({error:!0,label:null==K||null===(w=K.validation)||void 0===w||null===(L=w.pattern)||void 0===L?void 0:L.message}),Promise.resolve()}"ERR_PLEASE_REFINED_UR_SEARCH"===(null==O?void 0:O.label)&&"NO_PROPERTIES_FOUND"===(null==O?void 0:O.label)||P(null),null!=e&&e.doorNumber&&""!==(null==e?void 0:e.doorNumber)&&""!==(null==e?void 0:e.propertyIds)&&(e.propertyIds="");let G=Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{}),Z=G.city;var R,x,M;if(G.doorNo=G.doorNumber||(null===(n=G)||void 0===n?void 0:n.doorNo),delete G.addParam,delete G.addParam1,delete G.city,"0"===D)G={oldPropertyId:null===(R=G)||void 0===R?void 0:R.oldPropertyId,mobileNumber:null===(x=G)||void 0===x?void 0:x.mobileNumber,propertyIds:null===(M=G)||void 0===M?void 0:M.propertyIds};else if("1"===D){var B,j,W,q;G={name:null===(B=G)||void 0===B?void 0:B.name,doorNo:(null===(j=G)||void 0===j?void 0:j.doorNumber)||(null===(W=G)||void 0===W?void 0:W.doorNo),locality:null===(q=G)||void 0===q?void 0:q.locality}}return I({city:Z,filters:G}),Promise.resolve()}catch(e){return Promise.reject(e)}},config:q,label:S.texts.submitButtonLabel,secondaryActionLabel:C("ES_COMMON_CLEAR_SEARCH"),onSecondayActionClick:()=>{I({}),A.replace(A.location.pathname+"?action=0")},text:C(S.texts.text),onFormValueChange:(e,t,n)=>{const l=(null==t?void 0:t.city)||w[0];console.log("citycity",l),R(l.code),(null==l?void 0:l.code)!==L&&R(null==l?void 0:l.code),v.isEqual(t,x)||M(t)}}),Object.keys(N).length>0&&l.createElement(Ee,{searchQuery:{...N.filters,city:N.city},city:N.city,stateCode:Digit.ULBService.getStateId(),onSelect:b,config:S}),O&&l.createElement(t.Toast,{isDleteBtn:!0,error:O.error,warning:O.warning,label:C(O.label),onClose:()=>{P(null)}}))};ye.propTypes={loginParams:pe.any},ye.defaultProps={loginParams:null};const ge=e=>{let{onSelect:t}=e;const{t:r}=o.useTranslation(),{path:a}=i.useRouteMatch(),u=i.useLocation().search,d=new URLSearchParams(u).get("redirectToUrl"),s=n.useMemo(()=>A.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[A]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+a,exact:!0},l.createElement(ye,{config:s[0],onSelect:t,redirectToUrl:d})))},_e=[{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"}]}],he=[{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}}]}],Se=e=>{const{config:t,onSelect:r,clearParams:a,formData:u,stateCode:d}=e,{t:s}=o.useTranslation(),{path:c}=i.useRouteMatch(),v=i.useLocation().search,p=new URLSearchParams(v).get("redirectToUrl");let m=_e;const f=n.useMemo(()=>{var e;return null==m||null===(e=m.map)||void 0===e?void 0:e.call(m,e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}})},[m]);return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+c,exact:!0},l.createElement(Ee,{template:f[0].labels,header:f[0].texts.header,actionButtonLabel:f[0].texts.actionButtonLabel,t:s,isMutation:"MUTATION"===(null==t?void 0:t.action),onSelect:r,config:t,clearParams:a,stateCode:d,redirectToUrl:p,searchQuery:null==u?void 0:u.cptSearchQuery})))},be=e=>{let{onSelect:r}=e;const{t:a}=o.useTranslation(),{propertyIds:u}=i.useParams(),d=i.useHistory(),{data:s}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:u}},{filters:{propertyIds:u}}),[c,v]=n.useState(()=>(null==s?void 0:s.Properties[0])||" ");return n.useEffect(()=>{s&&v(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,r?{submit:!1,label:a("CS_COMMONS_NEXT"),onSubmit:()=>{r&&r("propertyId",u)}}:{submit:!1,label:a("PT_PROPERTY_CREATE"),onSubmit:()=>d.push("/digit-ui/citizen/commonPt/property/new-application")}))))},Te=e=>{let{config:o,otp:i,onOtpChange:r,onResend:a,onSelect:u,t:d,error:s,userType:c="citizen"}=e;const[v,p]=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])}(()=>{p(v-1)},v>0?1e3:null);const m=()=>{a(),p(2)};return"employee"===c?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:i}),v>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${v} ${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}),v>0?l.createElement(t.CardText,null,`${d("CS_RESEND_ANOTHER_OTP")} ${v} ${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")))},Ce=e=>{const{t:t}=o.useTranslation(),r=(i.useRouteMatch(),i.useLocation()),a=i.useHistory(),[u,d]=n.useState({mobileNumber:r.state.mobileNumber,otp:""}),[s,c]=n.useState(!0),v=()=>Digit.UserService.getType(),p=n.useMemo(()=>he.map(e=>{const n={};for(const l in e.texts)n[l]=t(e.texts[l]);return{...e,texts:n}},[he]));return l.createElement(Te,{config:{...p[1],texts:{...p[1].texts,cardText:`${p[1].texts.cardText} ${u.mobileNumber||""}`}},onOtpChange:e=>{d({...u,otp:e})},onResend:function(){try{const{mobileNumber:t}=u,n={mobileNumber:t,tenantId:e.stateCode,userType:v()};return Promise.resolve(sendOtp({otp:{...n,...TYPE_LOGIN}})).then(function(){})}catch(e){return Promise.reject(e)}},onSelect:function(){try{const t=me(function(){c(!0);const{mobileNumber:t,otp:n}=u,l={username:t,password:n,tenantId:e.stateCode,userType:v()};return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){var t;let{...n}=e;var l,o;null!==(t=r.state)&&void 0!==t&&t.redirectBackTo?a.replace(null===(l=r.state)||void 0===l?void 0:l.redirectBackTo,{data:null===(o=r.state)||void 0===o?void 0:o.redirectData}):a.replace("digit-ui/citizen/")})},function(){c(!1)});return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},otp:u.otp,error:s,t:t})},Ae=e=>l.createElement("h1",{className:"heading-m"},e.label),De=()=>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"})),Ne=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(De,null)),Ie=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=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)}),{isLoading:E,data:y}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,_]=n.useState({}),[h,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState(null),[D,N]=n.useState(null),[I,O]=n.useState(null),[P,w]=n.useState(null),[L,R]=n.useState([]),[x,M]=n.useState(null),[F,k]=n.useState(!1);function U(e){N(e.target.files[0])}return n.useEffect(()=>{var e;y&&y["egf-master"]&&R(null===(e=y["egf-master"])||void 0===e?void 0:e.FinancialYear)},[y]),n.useEffect(()=>{var e;T(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{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,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)}}()},[D]),n.useEffect(()=>{a&&_(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:x,setSelectedFinancialYear:M}):(e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${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(v||"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:b,selectedApprover:C,setSelectedApprover:A,selectFile:U,uploadedFile:I,setUploadedFile:O,businessService:v}))},[a,b,L,x,I]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ae,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Ne,{onClick:d}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!x:f||(null==a?void 0:a.docUploadRequired)&&!I,formId:"modal-action"},E?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"};c.creationReason="STATUS",s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:{...c,workflow:t}})}else if(null!=a&&a.showFinancialYearsModal)s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==x?void 0:x.name,propertyId:null==c?void 0:c.propertyId,tenantId:u,source:null==c?void 0:c.source,channel:null==c?void 0:c.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=a&&a.isTerminateState||!C?[]:[C],I&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:I}]),s({Property:{...c,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Oe=e=>l.createElement("h1",{className:"heading-m"},e.label),Pe=()=>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"})),we=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pe,null)),Le=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const{data:p}=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:m,data:f}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,y]=n.useState({}),[g,_]=n.useState({}),[h,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,N]=n.useState(null),[I,O]=n.useState(null),[P,w]=n.useState([]),[L,R]=n.useState(null);function x(e){A(e.target.files[0])}return n.useEffect(()=>{var e;f&&f["egf-master"]&&w(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]),n.useEffect(()=>{var e;S(null==p||null===(e=p.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}}))},[p]),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=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(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_NEWTL_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("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:h,selectedApprover:b,setSelectedApprover:T,selectFile:x,uploadedFile:D,setUploadedFile:N,businessService:v}))},[a,h,P,L,D]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Oe,{label:r(E.label.heading)}),headerBarEnd:l.createElement(we,{onClick:d}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,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:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null},s({Licenses:[c]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Re=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),xe=()=>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"})),Me=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(xe,null)),Fe=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v}=e;const{data:p,isLoading: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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState({}),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function P(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(null==p||null===(e=p.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}}))},[p]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))I(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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)}}()},[T]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:o,approvers:i,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(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_BPAREG_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("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:v})}]}]}})({t:r,action:a,approvers:_,selectedApprover:S,setSelectedApprover:b,selectFile:P,uploadedFile:A,setUploadedFile:D,businessService:v,error:N}))},[a,_,A,N]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Re,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Me,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){c={...c,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:A?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]:null},s({Licenses:[c]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},ke=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"})),Be=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ue,null)),je=e=>{var o,i,a,u,d,s,c,v,p,m,f,E;let{t:y,action:g,tenantId:_,closeModal:h,submitAction:S,applicationDetails:b,applicationData:T,businessService:C,workflowDetails:A}=e;Digit.Hooks.obps.useObpsAPI(null!==(o=T)&&void 0!==o&&null!==(i=o.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(u=T)||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:_,!1);const{data:D,isLoading:N}=Digit.Hooks.useEmployeeSearch(_,{roles:null==A||null===(c=A.data)||void 0===c||null===(v=c.initialActionState)||void 0===v||null===(p=v.nextActions)||void 0===p||null===(m=p.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===m||null===(f=m[0])||void 0===f||null===(E=f.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[I,O]=(r.useQueryClient(),n.useState({})),[P,w]=n.useState({}),[L,R]=n.useState([]),[x,M]=n.useState({}),[F,k]=n.useState(null),[U,B]=n.useState(null),[j,H]=n.useState(null),[W,z]=n.useState(null),V=!!Digit.Utils.browser.isMobile();function $(e){k(e.target.files[0])}n.useEffect(()=>{var e;R(null==D||null===(e=D.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}}))},[D]),n.useEffect(()=>{!function(){try{H(null);const e=function(){if(F){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(F.size>=5242880)H(y("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=F&&F.type&&!e.test(null==F?void 0:F.type))H(y("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",F,Digit.ULBService.getStateId()||(null==_?void 0:_.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?B(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):H(y("CS_FILE_UPLOAD_ERROR"))})},function(){H(y("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)}}()},[F]);const Y=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},K=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},q=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:Y(e.Documents),date:e.InspectionDate,questions:K(e),time:null==e?void 0:e.InspectionTime})}),o=o.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},G=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},Z=()=>{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&&O((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,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_${p}_${null==i?void 0:i.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:i.isTerminateState||f?null:o(v||"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:y,action:g,approvers:L,selectedApprover:x,setSelectedApprover:M,selectFile:$,uploadedFile:U,setUploadedFile:B,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:j}))},[g,L,W,U,j]),g&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ke,{label:y(I.label.heading)}),headerBarEnd:l.createElement(Be,{onClick:h}),actionCancelLabel:y(I.label.cancel),actionCancelOnSubmit:h,actionSaveLabel:y(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:V?{width:"720px"}:{},style:V?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:V?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.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;T={...T,documents:G(),additionalDetails:{...null===(t=T)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:q(T),pendingapproval:Z()},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!=x&&x.uuid?[null==x?void 0:x.uuid]:null,assignes:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,varificationDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=x&&x.uuid?[null==x?void 0:x.uuid]:null,wfDocuments:U?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==F?void 0:F.name,fileStoreId:U}]:null};const a=null==b||null===(o=b.nocData)||void 0===o?void 0:o.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...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(_,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,v,p,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===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.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)}),S({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:P,formId:"modal-action"})):l.createElement(t.Loader,null)},He=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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"})),ze=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(We,null)),Ve=e=>{var o,a;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:v,applicationData:p,businessService:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.assigneeRoles)||void 0===o||null===(a=o.map)||void 0===a?void 0:a.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[y,g]=(r.useQueryClient(),n.useState({})),[_,h]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function L(e){D(e.target.files[0])}return i.useHistory(),n.useEffect(()=>{var e;b(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{P(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)P(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))P(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",A,Digit.ULBService.getStateId()||(null==s?void 0:s.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?I(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):P(u("CS_FILE_UPLOAD_ERROR"))})},function(){P(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)}}()},[A]),n.useEffect(()=>{d&&g((e=>{var n;let{t:o,action:i,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,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_${p}_${null==i?void 0:i.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||E?null:o(v||"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:d,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:I,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[d,S,N,O]),d&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(He,{label:u(y.label.heading)}),headerBarEnd:l.createElement(ze,{onClick:c}),actionCancelLabel:u(y.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:y.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=p)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=p)||void 0===l?void 0:l.documents]:[];o.map((e,t)=>{i.push(e)}),p={...p,workflow:{action:null==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:N?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null},documents:i},v({Noc:p},!1,{isNoc:!0})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)};var $e=function(e,t){return e===t||e!=e&&t!=t},Ye=function(e,t){for(var n=e.length;n--;)if($e(e[n][0],t))return n;return-1},Ke=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=Ye(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},qe.prototype.get=function(e){var t=this.__data__,n=Ye(t,e);return n<0?void 0:t[n][1]},qe.prototype.has=function(e){return Ye(this.__data__,e)>-1},qe.prototype.set=function(e,t){var n=this.__data__,l=Ye(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Ge,Ze=qe,Xe="object"==typeof s&&s&&s.Object===Object&&s,Je="object"==typeof self&&self&&self.Object===Object&&self,Qe=Xe||Je||Function("return this")(),et=Qe.Symbol,tt=Object.prototype,nt=tt.hasOwnProperty,lt=tt.toString,ot=et?et.toStringTag:void 0,it=Object.prototype.toString,rt=et?et.toStringTag:void 0,at=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":rt&&rt in Object(e)?function(e){var t=nt.call(e,ot),n=e[ot];try{e[ot]=void 0;var l=!0}catch(e){}var o=lt.call(e);return l&&(t?e[ot]=n:delete e[ot]),o}(e):function(e){return it.call(e)}(e)},ut=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},dt=function(e){if(!ut(e))return!1;var t=at(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},st=Qe["__core-js_shared__"],ct=(Ge=/[^.]+$/.exec(st&&st.keys&&st.keys.IE_PROTO||""))?"Symbol(src)_1."+Ge:"",vt=Function.prototype.toString,pt=function(e){if(null!=e){try{return vt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},mt=/^\[object .+?Constructor\]$/,ft=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Et=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ut(e)||(t=e,ct&&ct in t))&&(dt(e)?ft:mt).test(pt(e));var t}(n)?n:void 0},yt=Et(Qe,"Map"),gt=Et(Object,"create"),_t=Object.prototype.hasOwnProperty,ht=Object.prototype.hasOwnProperty;function St(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])}}St.prototype.clear=function(){this.__data__=gt?gt(null):{},this.size=0},St.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},St.prototype.get=function(e){var t=this.__data__;if(gt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return _t.call(t,e)?t[e]:void 0},St.prototype.has=function(e){var t=this.__data__;return gt?void 0!==t[e]:ht.call(t,e)},St.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gt&&void 0===t?"__lodash_hash_undefined__":t,this};var bt=St,Tt=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 Ct(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])}}Ct.prototype.clear=function(){this.size=0,this.__data__={hash:new bt,map:new(yt||Ze),string:new bt}},Ct.prototype.delete=function(e){var t=Tt(this,e).delete(e);return this.size-=t?1:0,t},Ct.prototype.get=function(e){return Tt(this,e).get(e)},Ct.prototype.has=function(e){return Tt(this,e).has(e)},Ct.prototype.set=function(e,t){var n=Tt(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var At=Ct;function Dt(e){var t=this.__data__=new Ze(e);this.size=t.size}Dt.prototype.clear=function(){this.__data__=new Ze,this.size=0},Dt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Dt.prototype.get=function(e){return this.__data__.get(e)},Dt.prototype.has=function(e){return this.__data__.has(e)},Dt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ze){var l=n.__data__;if(!yt||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new At(l)}return n.set(e,t),this.size=n.size,this};var Nt=Dt,It=function(){try{var e=Et(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ot=function(e,t,n){"__proto__"==t&&It?It(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Pt=Object.prototype.hasOwnProperty,wt=function(e,t,n){var l=e[t];Pt.call(e,t)&&$e(l,n)&&(void 0!==n||t in e)||Ot(e,t,n)},Lt=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?Ot(n,a,u):wt(n,a,u)}return n},Rt=function(e){return null!=e&&"object"==typeof e},xt=function(e){return Rt(e)&&"[object Arguments]"==at(e)},Mt=Object.prototype,Ft=Mt.hasOwnProperty,kt=Mt.propertyIsEnumerable,Ut=xt(function(){return arguments}())?xt:function(e){return Rt(e)&&Ft.call(e,"callee")&&!kt.call(e,"callee")},Bt=Array.isArray,jt=function(){return!1},Ht=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?Qe.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||jt}),Wt=/^(?:0|[1-9]\d*)$/,zt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Wt.test(e))&&e>-1&&e%1==0&&e<t},Vt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},$t={};$t["[object Float32Array]"]=$t["[object Float64Array]"]=$t["[object Int8Array]"]=$t["[object Int16Array]"]=$t["[object Int32Array]"]=$t["[object Uint8Array]"]=$t["[object Uint8ClampedArray]"]=$t["[object Uint16Array]"]=$t["[object Uint32Array]"]=!0,$t["[object Arguments]"]=$t["[object Array]"]=$t["[object ArrayBuffer]"]=$t["[object Boolean]"]=$t["[object DataView]"]=$t["[object Date]"]=$t["[object Error]"]=$t["[object Function]"]=$t["[object Map]"]=$t["[object Number]"]=$t["[object Object]"]=$t["[object RegExp]"]=$t["[object Set]"]=$t["[object String]"]=$t["[object WeakMap]"]=!1;var Yt=function(e){return function(t){return e(t)}},Kt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n&&Xe.process,i=function(){try{return l&&l.require&&l.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),qt=Kt&&Kt.isTypedArray,Gt=qt?Yt(qt):function(e){return Rt(e)&&Vt(e.length)&&!!$t[at(e)]},Zt=Object.prototype.hasOwnProperty,Xt=function(e,t){var n=Bt(e),l=!n&&Ut(e),o=!n&&!l&&Ht(e),i=!n&&!l&&!o&&Gt(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&&!Zt.call(e,d)||r&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||zt(d,u))||a.push(d);return a},Jt=Object.prototype,Qt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Jt)},en=function(e,t){return function(n){return e(t(n))}},tn=en(Object.keys,Object),nn=Object.prototype.hasOwnProperty,ln=function(e){return null!=e&&Vt(e.length)&&!dt(e)},on=function(e){return ln(e)?Xt(e):function(e){if(!Qt(e))return tn(e);var t=[];for(var n in Object(e))nn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},rn=Object.prototype.hasOwnProperty,an=function(e){return ln(e)?Xt(e,!0):function(e){if(!ut(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Qt(e),n=[];for(var l in e)("constructor"!=l||!t&&rn.call(e,l))&&n.push(l);return n}(e)},un=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,o=l&&l.exports===n?Qe.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}}),dn=function(){return[]},sn=Object.prototype.propertyIsEnumerable,cn=Object.getOwnPropertySymbols,vn=cn?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];sn.call(e,a)&&(r[i++]=a)}return r}(cn(e)))}:dn,pn=function(e,t){for(var n=-1,l=t.length,o=e.length;++n<l;)e[o+n]=t[n];return e},mn=en(Object.getPrototypeOf,Object),fn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)pn(t,vn(e)),e=mn(e);return t}:dn,En=function(e,t,n){var l=t(e);return Bt(e)?l:pn(l,n(e))},yn=function(e){return En(e,on,vn)},gn=function(e){return En(e,an,fn)},_n=Et(Qe,"DataView"),hn=Et(Qe,"Promise"),Sn=Et(Qe,"Set"),bn=Et(Qe,"WeakMap"),Tn=pt(_n),Cn=pt(yt),An=pt(hn),Dn=pt(Sn),Nn=pt(bn),In=at;(_n&&"[object DataView]"!=In(new _n(new ArrayBuffer(1)))||yt&&"[object Map]"!=In(new yt)||hn&&"[object Promise]"!=In(hn.resolve())||Sn&&"[object Set]"!=In(new Sn)||bn&&"[object WeakMap]"!=In(new bn))&&(In=function(e){var t=at(e),n="[object Object]"==t?e.constructor:void 0,l=n?pt(n):"";if(l)switch(l){case Tn:return"[object DataView]";case Cn:return"[object Map]";case An:return"[object Promise]";case Dn:return"[object Set]";case Nn:return"[object WeakMap]"}return t});var On=In,Pn=Object.prototype.hasOwnProperty,wn=Qe.Uint8Array,Ln=function(e){var t=new e.constructor(e.byteLength);return new wn(t).set(new wn(e)),t},Rn=/\w*$/,xn=et?et.prototype:void 0,Mn=xn?xn.valueOf:void 0,Fn=Object.create,kn=function(){function e(){}return function(t){if(!ut(t))return{};if(Fn)return Fn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Un=Kt&&Kt.isMap,Bn=Un?Yt(Un):function(e){return Rt(e)&&"[object Map]"==On(e)},jn=Kt&&Kt.isSet,Hn=jn?Yt(jn):function(e){return Rt(e)&&"[object Set]"==On(e)},Wn={};Wn["[object Arguments]"]=Wn["[object Array]"]=Wn["[object ArrayBuffer]"]=Wn["[object DataView]"]=Wn["[object Boolean]"]=Wn["[object Date]"]=Wn["[object Float32Array]"]=Wn["[object Float64Array]"]=Wn["[object Int8Array]"]=Wn["[object Int16Array]"]=Wn["[object Int32Array]"]=Wn["[object Map]"]=Wn["[object Number]"]=Wn["[object Object]"]=Wn["[object RegExp]"]=Wn["[object Set]"]=Wn["[object String]"]=Wn["[object Symbol]"]=Wn["[object Uint8Array]"]=Wn["[object Uint8ClampedArray]"]=Wn["[object Uint16Array]"]=Wn["[object Uint32Array]"]=!0,Wn["[object Error]"]=Wn["[object Function]"]=Wn["[object WeakMap]"]=!1;var zn=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(!ut(t))return t;var c=Bt(t);if(c){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Pn.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 v=On(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(Ht(t))return un(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!i){if(a=d||p?{}:function(e){return"function"!=typeof e.constructor||Qt(e)?{}:kn(mn(e))}(t),!u)return d?function(e,t){return Lt(e,fn(e),t)}(t,function(e,t){return e&&Lt(t,an(t),e)}(a,t)):function(e,t){return Lt(e,vn(e),t)}(t,function(e,t){return e&&Lt(t,on(t),e)}(a,t))}else{if(!Wn[v])return i?t:{};a=function(e,t,n){var l,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return Ln(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?Ln(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?Ln(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,Rn.exec(l))).lastIndex=l.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return Mn?Object(Mn.call(e)):{}}}(t,v,u)}}r||(r=new Nt);var m=r.get(t);if(m)return m;r.set(t,a),Hn(t)?t.forEach(function(o){a.add(e(o,n,l,o,t,r))}):Bn(t)&&t.forEach(function(o,i){a.set(i,e(o,n,l,i,t,r))});var f=c?void 0:(s?d?gn:yn:d?an:on)(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]),wt(a,i,e(o,n,l,i,t,r))}),a},Vn=function(e){return zn(e,5)};const $n=e=>l.createElement("h1",{className:"heading-m"},e.label),Yn=()=>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"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yn,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}},Gn=e=>{var o,i;let{t:r,action:a,tenantId:d,closeModal:s,submitAction:c,applicationData:v,businessService:p,cardClassName:m,cardFormWrapperClassName:f,cardFormClassName:E,formClassName:y}=e;const{data:g,isLoading:_}=Digit.Hooks.useEmployeeSearch(d,{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)}),[h,S]=n.useState({}),[b,T]=n.useState({}),[C,A]=n.useState([]),[D,N]=n.useState({}),[I,O]=n.useState(null),[P,w]=n.useState(null),[L,R]=n.useState(null),x=window.Digit.Utils.browser.isMobile(),M=window.location.href.includes("/employee");function F(e){O(e.target.files[0])}return n.useEffect(()=>{var e;A(null==g||null===(e=g.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}}))},[g]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(I){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(I.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=I&&I.type&&!e.test(null==I?void 0:I.type))R(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",I,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?w(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(e){console.error("Modal -> err ",e),R(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)}}()},[I]),n.useEffect(()=>{var e,n,o,i;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(o=v)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?a&&S((e=>{var n;let{t:o,action:i,selectFile:r,uploadedFile:a,setUploadedFile:d,businessService:s,error:c}=e,v=!1;return null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK"),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(v=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==s?void 0:s.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[v&&{label:o("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!v,type:"custom",populators:v?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({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:r,onDelete:()=>{d(null)},message:a?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:c,iserror:c,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:C,selectedApprover:D,setSelectedApprover:N,selectFile:F,uploadedFile:P,setUploadedFile:w,businessService:p,error:L})):a&&S((e=>{var n;let{t:o,action:i,selectFile:r,uploadedFile:a,setUploadedFile:u,businessService:d,error:s}=e;return null!=i&&null!==(n=i.action)&&void 0!==n&&n.includes("SEND_BACK"),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==d?void 0:d.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{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:r,onDelete:()=>{u(null)},message:a?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:s,iserror:s,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:C,selectedApprover:D,setSelectedApprover:N,selectFile:F,uploadedFile:P,setUploadedFile:w,businessService:p,error:L}))},[a,C,P,L]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement($n,{label:r(h.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:x&&M?{width:"100%",height:"auto"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,o,i,r,u,s,p,m;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var f,E,y,g,_,h,S,b,T;const t={...null===(f=v)||void 0===f||null===(E=f.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(y=v)||void 0===y?void 0:y.billAmendmentDetails,workflow:{businessId:null===(g=v)||void 0===g||null===(_=g.billAmendmentDetails)||void 0===_?void 0:_.amendmentId,action:null==a?void 0:a.action,tenantId:d,businessService:null!==(h=v)&&void 0!==h&&null!==(S=h.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=v)&&void 0!==b&&null!==(T=b.applicationType)&&void 0!==T&&T.includes("WATER")?"WS":"SW",assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]}};c({AmendmentUpdate:n})}else{if(v={...v,action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:[],assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:null,processInstance:{...null===(n=v)||void 0===n?void 0:n.processInstance,action:null==a?void 0:a.action,assignes:null!=D&&D.uuid?[{uuid:null==D?void 0:D.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:P}]:[]}},null!=e&&e.date&&null!==(l=v)&&void 0!==l&&null!==(o=l.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=Vn(null==e?void 0:e.date);v.disconnectionExecutionDate=qn(t)}else if(null!=e&&e.date){const t=Vn(null==e?void 0:e.date);v.connectionExecutionDate=qn(t)}var C;if("DisconnectWSConnection"==(null===(i=v)||void 0===i||null===(r=i.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(u=v)||void 0===u||null===(s=u.processInstance)||void 0===s?void 0:s.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(C=v)||void 0===C?void 0:C.serviceType)?c({WaterConnection:v,disconnectRequest:!0}):c({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=v)||void 0===p?void 0:p.applicationType))c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=v)||void 0===m?void 0:m.applicationType))c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var A,N,O,w,L,R,x,M,F,k,U,B,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(A=t.value)&&void 0!==A&&A.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(N=t.value)||void 0===N?void 0:N.adhocPenalty)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateReason)||""),"WATER"==(null===(j=v)||void 0===j?void 0:j.serviceType)?c({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):c({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:b,formId:"modal-action",cardFormClassName:E,cardFormWrapperClassName:f,cardClassName:m,formClassName:y})):l.createElement(t.Loader,null)},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=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;console.log("applicationData",c);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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(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{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,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):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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)}}()},[T]),n.useEffect(()=>{a&&E((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:_,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:v}))},[a,_,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Zn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:A}]),s({PetRegistrationApplications:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},el=e=>l.createElement("h1",{className:"heading-m"},e.label),tl=()=>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"})),nl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tl,null)),ll=e=>{var o,r,a;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:v,applicationData:p,businessService:m,moduleCode:f,cardClassName:E,cardFormWrapperClassName:y,cardFormClassName:g,formClassName:_}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(r=o[0])||void 0===r||null===(a=r.map)||void 0===a?void 0:a.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),S=i.useHistory(),[b,T]=n.useState({}),[C,A]=n.useState({}),[D,N]=n.useState([]),[I,O]=n.useState(null),[P,w]=n.useState(null);return n.useEffect(()=>{var e;N(null==h||null===(e=h.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}}))},[h]),n.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?S.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):T((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:d,approvers:D,selectedApprover:I,setSelectedApprover:O,uploadedFile:P,setUploadedFile:w,businessService:m}))},[d,D,P]),d&&b.form?l.createElement(t.Modal,{headerBarMain:l.createElement(el,{label:u(b.label.heading)}),headerBarEnd:l.createElement(nl,{onClick:c}),actionCancelLabel:u(b.label.cancel),actionCancelOnSubmit:c,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==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:f};P&&(t.documents=[]),v({Asset:{...p,workflow:t}})},defaultValues:C,formId:"modal-action",cardFormClassName:g,cardFormWrapperClassName:y,cardClassName:E,formClassName:_})):l.createElement(t.Loader,null)},ol=e=>l.createElement("h1",{className:"heading-m"},e.label),il=()=>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"})),rl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(il,null)),al=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;h(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{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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)}}()},[T]),n.useEffect(()=>{a&&E((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:_,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:v}))},[a,_,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ol,{label:r(f.label.heading)}),headerBarEnd:l.createElement(rl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p};A&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({hallsBookingApplication:{...c,workflow:t}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},ul=e=>l.createElement("h1",{className:"heading-m"},e.label),dl=()=>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"})),sl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(dl,null)),cl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=e;console.log("snjdskbjdfbjskfjkbs",a);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)}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(null),[w,L]=n.useState(!1);function R(e){D(e.target.files[0])}return n.useEffect(()=>{var e;h(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{P(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)P(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",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):P(r("CS_FILE_UPLOAD_ERROR"))})},function(){P(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((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:_,selectedApprover:S,setSelectedApprover:b,selectFile:R,uploadedFile:N,setUploadedFile:I,businessService:v}))},[a,_,N]),console.log("conggg",f),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ul,{label:r(f.label.heading)}),headerBarEnd:l.createElement(sl,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p};console.log("applicationData",e),N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:N},{}]),c.pickUpDate=null==e?void 0:e.date,c.transactionId=null==e?void 0:e.transactionId,c.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...c,workflow:t}]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},vl=e=>l.createElement("h1",{className:"heading-m"},e.label),pl=()=>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"})),ml=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pl,null)),fl=e=>{var o,i;let{t:r,action:a,tenantId:u,closeModal:d,submitAction:s,applicationData:c,businessService:v,moduleCode:p}=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?void 0:a.isTerminateState}),[f,E]=n.useState({}),[y,g]=n.useState({}),[_,h]=n.useState([]),[S,b]=n.useState(null),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,I]=n.useState(null),[O,P]=n.useState(!1);function w(e){P(!0),C(e.target.files[0])}return n.useEffect(()=>{var e;h(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{I(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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(P(!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)}}()},[T]),console.log("actyhdesh,jhfsefsef",a,c),n.useEffect(()=>{E((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const v=()=>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(v,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:_,selectedApprover:S,setSelectedApprover:b,selectFile:w,uploadedFile:A,setUploadedFile:D,businessService:v,isUploading:O}))},[a,_,A]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vl,{label:r(f.label.heading)}),headerBarEnd:l.createElement(ml,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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:p,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==c||null===(t=c.auditDetails)||void 0===t?void 0:t.createdBy]:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null};A&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:A}]),s({streetVendingDetail:{...c,workflow:n}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},El=e=>l.createElement("h1",{className:"heading-m"},e.label),yl=()=>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(yl,null)),_l=e=>{var o,i,r,a,u;let{t:d,action:s,tenantId:c,closeModal:v,submitAction:p,applicationData:m,businessService:f,moduleCode:E,cardClassName:y,cardFormWrapperClassName:g,cardFormClassName:_,formClassName:h}=e;const{data:S}=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:b}=Digit.Hooks.fsm.useVendorSearch({tenantId:c,config:{enabled:"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let T=[];null==b||null===(r=b.vendor)||void 0===r||r.forEach(e=>{var t,n;if("WT"===(null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.description)||"WT"===(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.serviceType)){var l;const t=`${null==e?void 0:e.name} (${null==e||null===(l=e.owner)||void 0===l?void 0:l.mobileNumber})`;T.push({code:null==e?void 0:e.name,name:t,i18nKey:t,vendorId:null==e?void 0:e.id})}});const{data:C}=Digit.Hooks.fsm.useVehiclesSearch({tenantId:c,filters:{vendorId:null==m?void 0:m.vendorId},config:{enabled:"DELIVERY_PENDING"===(null==s?void 0:s.state)||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)}});let A=[];null==C||null===(a=C.vehicle)||void 0===a||null===(u=a.filter(e=>{var t,n,l;return(null==e||null===(t=e.driverData)||void 0===t?void 0:t.id)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.id)||(null==e||null===(l=e.owner)||void 0===l?void 0:l.id)}))||void 0===u||u.map(e=>{var t,n,l;A.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,driverId:(null==e||null===(t=e.driverData)||void 0===t?void 0:t.ownerId)||(null==e||null===(n=e.driver)||void 0===n?void 0:n.ownerId)||(null==e?void 0:e.ownerId)||(null==e||null===(l=e.owner)||void 0===l?void 0:l.uuid)})});const[D,N]=n.useState({}),[I,O]=n.useState({}),[P,w]=n.useState([]),[L,R]=n.useState(null),[x,M]=n.useState(null),[F,k]=n.useState(null),[U,B]=n.useState(null),[j,H]=n.useState(null);function W(e){R(e.target.files[0])}return n.useEffect(()=>{var e;w(null==S||null===(e=S.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}}))},[S]),n.useEffect(()=>{!function(){try{k(null);const e=function(){if(L){const e=function(){if(L.size>=5242880)k(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=me(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WT",L,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?M(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):k(d("CS_FILE_UPLOAD_ERROR"))})},function(){k(d("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)}}()},[L]),n.useEffect(()=>{s&&N((e=>{let{t:n,action:o,selectFile:i,uploadedFile:r,setUploadedFile:a,selectedVendor:u,setSelectedVendor:d,vendorDescription:s,vehicleDescription:c,selectVehicle:v,setSelectVehicle:p}=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)&&"ASSIGN_VEHICLE_DRIVER"!==(null==o?void 0:o.action)?{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)||"ASSIGN_VEHICLE_DRIVER"===(null==o?void 0:o.action)?{label:n("RS_REGISTRATION_NUMBER"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:c,t:n,optionKey:"i18nKey",select:p,selected:v})}:"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:d,action:s,selectFile:W,uploadedFile:x,setUploadedFile:M,selectedVendor:U,setSelectedVendor:B,vendorDescription:b?T:void 0,vehicleDescription:C||"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)?A:void 0,selectVehicle:j,setSelectVehicle:H}))},[s,P,x,b,j,C]),s&&D.form?l.createElement(t.Modal,{headerBarMain:l.createElement(El,{label:d(D.label.heading)}),headerBarEnd:l.createElement(gl,{onClick:v}),actionCancelLabel:d(D.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:d(D.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:D.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};x&&(t.documents=[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==L?void 0:L.name,fileStoreId:x}]),"PENDING_FOR_VEHICLE_DRIVER_ASSIGN"===(null==s?void 0:s.state)&&(m.vendorId=null==U?void 0:U.vendorId),"DELIVERY_PENDING"===(null==s?void 0:s.state)&&(m.vehicleId=null==j?void 0:j.vehicleId),"ASSIGN_VEHICLE_DRIVER"===(null==s?void 0:s.action)&&(m.vehicleId=null==j?void 0:j.vehicleId,m.driverId=null==j?void 0:j.driverId),"watertanker-fixedpoint"===f&&(t.moduleName="request-service.water_tanker",t.businessService="watertanker-fixedpoint");let n="watertanker"===f||"watertanker-fixedpoint"===f?{waterTankerBookingDetail:{...m,workflow:t}}:{mobileToiletBookingDetail:{...m,workflow:t}};p(n)},defaultValues:I,formId:"modal-action",cardFormClassName:_,cardFormWrapperClassName:g,cardClassName:y,formClassName:h})):l.createElement(t.Loader,null)},hl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ie,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Qn,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(Le,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Fe,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(je,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Ve,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Gn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(ll,e):null!=e&&e.businessService.includes("ewst")?l.createElement(cl,e):null!=e&&e.businessService.includes("booking-refund")?l.createElement(al,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(fl,e):null!=e&&e.businessService.includes("watertanker")||null!=e&&e.businessService.includes("mobileToilet")?l.createElement(_l,e):void 0;function Sl(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 bl=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)||[],v=Digit.ULBService.getStateId(),[p,m]=n.useState((null==r||null===(o=r.documents)||void 0===o?void 0:o.documents)||[]),[f,E]=n.useState(null),[y,g]=n.useState([]),[_,h]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,data:D}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:N,data:I}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let o=[];var i,r;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==D||null===(i=D.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)),g(d)},[!A,!N]),n.useEffect(()=>{let e=0;y.map(t=>{let n=!1;p.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||!(p.length>0))},[p,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(Tl,{key:t,index:t,document:e,t:i,error:f,setError:E,setDocuments:m,documents:p,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:y,checkEnablingDocs:T}))))};function Tl(e){var o,i;let{t:r,document:a,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:v}=e;const p=null==d?void 0:d.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],m=Digit.ULBService.getStateId(),[f,E]=n.useState(p?{...p,active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}:1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{}),[y,g]=n.useState(null),[_,h]=n.useState(()=>(null==p?void 0:p.fileStoreId)||null),[S,b]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==_?void 0:_.length)||null===_?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==f?void 0:f.code,fileStoreId:_,documentUid:_,fileName:(null==y?void 0:y.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[_,f]),n.useEffect(()=>{try{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],S.map(e=>{var t,n,l;null!=f&&f.code&&a.newUploadedDocs.push({documentType:null==f?void 0:f.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})}),c[s]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[S,f]),n.useEffect(()=>{},[y]),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(Sl,{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:f,optionKey:"i18nKey",select:e=>E(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:m,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);0!==Object.keys(n).length&&b(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 Cl(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(Sl,{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 Al(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,v]=n.useState(),[p,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==p?void 0:p.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(p){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(p.size>=5242880)a(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=p&&p.type&&!e.test(null==p?void 0:p.type))a(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=me(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",p,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)}}()},[p]),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 Dl=e=>{var o;let{t:i,noc:r,docs:a,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(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(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:y}=Digit.Hooks.obps.useMDMS(v,"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,[]),[D,N]=n.useState(null),I=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;_(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 v=[];o&&o.length>0&&(o.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),v.push(e)}),S(v))},[f,g]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===p&&(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:"#2E9E8F"}:{color:"#D83A2F"}}:{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(Sl,{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(Al,{key:t,document:e,t:i,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},Nl=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}))),[d,s,c]=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?{...e,checked:l}:e))})(e,0,n),isLabelFirst:!0,index:n})),null==d?void 0:d.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.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=[...d];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Il(e){let{documents:i,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=o.useTranslation(),[d,s]=n.useState(()=>[]),[c,v]=(Digit.ULBService.getCurrentTenantId(),n.useState({})),[p,m]=n.useState(null);n.useEffect(()=>{var e;let t=[];null==i||i.forEach(e=>{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=>{v(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[d]);const f=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),E=window.location.href.includes("employee/ws"),y=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},(()=>{if(!p)return null;const e=p.toLowerCase().includes(".pdf")||p.toLowerCase().includes("pdf");return l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},"Document Preview"),headerBarEnd:l.createElement("div",{onClick:()=>m(null),style:{cursor:"pointer",padding:"5px",marginTop:"-5px"}},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#000000",width:"24px",height:"24px"},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"}))),hideSubmit:!0,popupStyles:{maxWidth:"80vw",width:"100%"},popupModuleMianStyles:{display:"flex",justifyContent:"center",alignItems:"center",padding:"0",overflowY:"hidden"}},e?l.createElement("iframe",{src:p,title:"Document Preview",style:{width:"100%",height:"80vh",border:"none",display:"block"}}):l.createElement("img",{src:p,alt:"Document Preview",style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block"}}))})(),!y&&(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:f?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,E?l.createElement("div",{style:{marginTop:"8px"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?e.values.map((e,n)=>((e,n)=>{var o,i,r,a;const d=null===(o=c[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],s=(e=>{if(!e)return"";const t=e.split(".");return(t[t.length-1]||"").replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())})(null==e?void 0:e.documentType),v=(null==e?void 0:e.documentUid)||"",p=null==e?void 0:e.isPhoto;let f="",E="",y="";return"WS_IDENTITY_PROOF"===e.title?(f="Identity Proof*",E="Identity Proof Document Number",y="Upload Identity Proof Document*"):"WS_OWNERSHIP_PROOF"===e.title?(f="Ownership Proof*",E="Ownership Proof Document Number",y="Upload Ownership Proof*"):"WS_OTHER_DOCUMENTS"===e.title?(f="Other Documents*",E="Other Document Number",y="Upload Other Documents*"):"WS_APPLICANT_PHOTO"===e.title?y="Upload Applicant Photo*":(f=((null==e?void 0:e.categoryLabel)||"Document")+"*",E="Document Number",y="Upload Document*"),l.createElement("div",{key:n,style:{marginBottom:"24px"}},l.createElement(t.StatusTable,null,!p&&l.createElement(l.Fragment,null,l.createElement(t.Row,{label:f,text:s||u("NA")}),l.createElement(t.Row,{label:E,text:v||u("NA")})),l.createElement(t.Row,{label:y,text:l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"16px"}},p?d?l.createElement("div",{style:{position:"relative"}},l.createElement("img",{src:d,alt:"Applicant Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"4px",border:"1px solid #ccc"}})):l.createElement("div",{style:{fontSize:"14px",color:"#505A5F"}},u("NA")):l.createElement("div",{onClick:()=>{d&&m(d)},disabled:!d,style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null)),!p&&l.createElement("label",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",color:"#0B0C0C",margin:0}},l.createElement("input",{key:`chk-${null==e||null===(i=e.originalDoc)||void 0===i?void 0:i.id}-${null==e||null===(r=e.originalDoc)||void 0===r?void 0:r.isVerified}`,type:"checkbox",style:{width:"18px",height:"18px",accentColor:"#F47738"},defaultChecked:null==e||null===(a=e.originalDoc)||void 0===a?void 0:a.isVerified,onChange:t=>{null!=e&&e.originalDoc&&(e.originalDoc.isVerified=t.target.checked)}}),"Check Verified"))})))})(e,n)):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))):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:f?{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")))))})),y&&(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 Ol(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 Pl(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"})}))))}))}))}const wl=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:"#2E9E8F"}},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))))))))},Ll=e=>{var i,r,a,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:v}=o.useTranslation(),p=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:v(""+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:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(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:v("BPA_FLOOR_NAME_"+e.number)})}),n}function g(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?""+v("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"}},v(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+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"}},v("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:y(e),columns:E,getCellProps:e=>({style:{}})})))})))},Rl=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))},xl=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(Rl,{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,t)=>l.createElement("div",{className:"TLComments",key:t},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 Ml(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 Fl(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 kl=e=>{var n;let{wsAdditionalDetails:i}=e;const{t:r}=o.useTranslation();(a=location.search)&&(/^[?#]/.test(a)?a.slice(1):a).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{});var a,{connectionDetails:u}=(null==i?void 0:i.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(l.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==i||null===(n=i.additionalDetails)||void 0===n?void 0:n.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},r("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==u?void 0:u.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+r(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""}))))))))},Ul=[{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"}],Bl=[{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"}],jl=e=>{var i,r,a,d;let{wsAdditionalDetails:s}=e;const{t:c}=o.useTranslation(),[v,p,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(v||{}),[C,A]=n.useState(null),[D,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[I,O]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),P=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(P,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const o={...null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var i,r,a,u,d,c,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(i=v.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==v||null===(a=v.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==v||null===(d=v.billDetails)||void 0===d||null===(c=d[0])||void 0===c?void 0:c.taxAmount)}];O(e),N(null==v||null===(m=v.billDetails)||void 0===m?void 0:m[0])}else p(o),T(o)},[]);let w={};const L=e=>l.createElement("h1",{className:"heading-m"},e.label),R=()=>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(R,null)),M=function(e,t,n){void 0===t&&(t=!1);let l={...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:"100%",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==D?void 0:D.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:"#2E9E8F"}:{color:"#D83A2F"}}))),null!=s&&null!==(r=s.additionalDetails)&&void 0!==r&&r.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{className:"add-details-link hover-button",style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,h&&l.createElement(t.Modal,{headerBarMain:l.createElement(L,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{T(v),S(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{T(v),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,d,v,m,f,y,g;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={...null==s||null===(d=s.additionalDetails)||void 0===d||null===(v=d.appDetails)||void 0===v?void 0:v.additionalDetails,...b};s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(m=s.additionalDetails)||void 0===m||null===(f=m.appDetails)||void 0===f?void 0:f.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===(y=s.additionalDetails)||void 0===y||null===(g=y.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,o).then((e,t)=>{var n,l,o,i,r,a,u,d,s,c,v,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===(v=c[0])||void 0===v?void 0:v.taxAmount}];E(Vn(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,p(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",background:"#f0f3f7"}},l.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},l.createElement(t.Card,null,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.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Ul,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(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({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.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({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,null,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.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Bl,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===(d=b.adhocRebateReason_data)||void 0===d?void 0:d.title)&&l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_REASON")),l.createElement(t.TextInput,u({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.LabelFieldPair,null,l.createElement(t.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({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})))},Hl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...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"})))},Wl=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(Hl,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},zl=e=>{var i,r,a,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:p}=o.useTranslation(),[m,f]=n.useState(!1),[E,y]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),_=()=>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(_,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.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",{className:"add-details-link hover-button"},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(g,{label:p("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"}},p("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:""+p(""+(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:""+p("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"}},p("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:""+p(""+(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:""+p("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:""+p(""+(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:""+p("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"}})))))},Vl={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:{}},$l=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:Vl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Vl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Vl.cell,...Vl.cellLeft,...Vl.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...Vl.cell,...n.length==t+1?Vl.cellRight:{},...Vl.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(i).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Vl.cell,...Vl.cellLeft},component:"th",scope:"row"},Object.keys(i)[t]),n.map((t,o)=>l.createElement("td",{style:{...Vl.cell,textAlign:"left",...n.length==o+1?Vl.cellRight:{},whiteSpace:"pre"},key:o,numeric:!0},o>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Vl.cell,...Vl.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...Vl.cell,...Vl.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:{...Vl.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Vl.cell,key:t,numeric:!0})))))))},Yl={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))"}},Kl=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 v="₹ "+((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 p={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{p[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[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:Yl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement($l,{headers:[...m],values:d,arrears:v}),!f&&l.createElement("div",{style:Yl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Yl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},ql=()=>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(ql,null)),Zl=e=>{let{t:n,closeModal:o}=e;console.log(" ----- Renew POP coming "),Digit.Hooks.sv.useCreateDemand();const r=i.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(Gl,{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:()=>{r.push("renew-application/info")}}),l.createElement(t.SubmitBar,{label:n("SV_NO_PROCEED_PAYEMNT"),onSubmit:()=>{console.log(" testing coming compilter"),r.push("renew-application/check/makePayment")}})))))},Xl=()=>{const{t:e}=o.useTranslation(),[i,r]=n.useState(""),[a,u]=n.useState([]),d=n.useMemo(()=>[{Header:e("K No."),accessor:"kno"},{Header:e("Full Name"),accessor:"fullName"},{Header:e("Full Address"),accessor:"fullAddress"},{Header:e("Due Amount"),accessor:"dueAmount"},{Header:e("Total Amount"),accessor:"totalAmount"}],[e]);return l.createElement("div",{style:{marginBottom:"20px"}},l.createElement("h2",{style:{fontSize:"24px",fontWeight:"bold",color:"#4f6cfc",marginBottom:"16px"}},e("Due Verification")),l.createElement("div",{style:{display:"flex",alignItems:"flex-end",gap:"20px",marginBottom:"20px"}},l.createElement("div",{style:{flex:1}},l.createElement("span",{style:{fontSize:"16px",color:"#0B0C0C",marginBottom:"8px",display:"inline-block"}},e("K No.(Existing KNo of same property)")," ",l.createElement("span",{style:{color:"red"}},"*")),l.createElement(t.TextInput,{type:"number",value:i,onChange:e=>r(e.target.value),style:{width:"100%",marginBottom:"0"}})),l.createElement("div",{style:{flex:1,paddingBottom:"2px"}},l.createElement("button",{type:"button",onClick:()=>{if(i){const e={kno:i,fullName:"John Doe",fullAddress:"123 Main St, New Delhi, Delhi 110001",dueAmount:"1500",totalAmount:"1500"};u([...a,e]),r("")}},style:{backgroundColor:"#4f6cfc",color:"white",padding:"8px 24px",borderRadius:"4px",border:"none",cursor:"pointer"}},e("Add")))),a.length>0&&l.createElement("div",{style:{marginTop:"30px",overflowX:"auto"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:e,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,data:a,columns:d,getCellProps:e=>({style:{padding:"12px"}})})))};function Jl(e){var r,a,u,d,s,c,v,p,m,f,E,y,g,h;let{applicationDetails:S,workflowDetails:b,isDataLoading:T,applicationData:C,timelineStatusPrefix:A,showTimeLine:D=!0,statusAttribute:N="status",paymentsList:I,oldValue:O,isInfoLabel:P=!1}=e;const{t:w}=o.useTranslation(),[L,R]=n.useState(!1);let{id:x}=i.useParams();function M(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const[F,k]=n.useState({}),[U,B]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!==(null==C?void 0:C.status)||U.loading||U.loaded||U.canLoad||B({loading:!1,loaded:!1,canLoad:!0}),null==U||!U.canLoad||U.loading||U.loaded||(B({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==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,k,B));const j=e=>{if(null==e||void 0===e||""===e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},H=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:j(null==C||null===(o=C.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(xl,{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,v,p,m,f,E,y,g,h,b,T,A;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==S?void 0:S.tenantId,businessIds:null==S?void 0:S.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}}},D=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==C||null===(s=C.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=C&&null!==(f=C.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(y=E[0])&&void 0!==y&&y.mobileNumber?null==C||null===(g=C.processInstance)||void 0===g||null===(h=g.assignes)||void 0===h||null===(b=h[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(A=T[0])||void 0===A?void 0:A.mobileNumber,comment:w(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(xl,{data:N,OpenImage:M,privacy:o})}{var D,N,I,O,P;const t={date:j(null==C||null===(D=C.auditDetails)||void 0===D?void 0:D.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===(P=O[0])||void 0===P?void 0:P.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(xl,{data:t,OpenImage:M})}},W=(e,t)=>e?t?e:w(e):w("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/obps"),Y=()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{},K=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${w(null==e?void 0:e.isUnit)}`:w("N/A"):null!=e&&e.value?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):w("N/A"),[q,G]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},P?l.createElement(Wl,{t:w,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==S||null===(r=S.applicationDetails)||void 0===r?void 0:r.map((e,n)=>{var o,r,a,u,d,s,c,v,p,m,f,E,y,g,_,h,T,A,D,N,P,L,M,k,U,B,j,H,W,q,G,Z,X,J,Q,ee,te,ne;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")||z?{lineHeight:"19px",maxWidth:"100%",minWidth:"280px"}:{}},(null==e||null===(o=e.title)||void 0===o?void 0:o.trim())&&(0!==n||e.asSectionHeader?l.createElement(t.CardSectionHeader,{style:0===n&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},w(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},w(e.title))),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse",border:"1px solid black"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map((e,t)=>l.createElement("th",{style:{padding:"10px",paddingLeft:"5px",border:"1px solid black"},key:t},w(e)))),null==e?void 0:e.tableRows.map((n,o)=>l.createElement("tr",{key:o},n.map((n,r)=>Array.isArray(n)&&n.length>1&&!0===e.isMaintenance?l.createElement("td",{style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"},key:r},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;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:r,style:{paddingTop:"20px",textAlign:"left",border:"1px solid black",verticalAlign:"middle"}},n&&!0===n.editButton?l.createElement("span",{style:{display:"inline-flex",gap:"10px",alignItems:"center"}},l.createElement(i.Link,{to:{pathname:"/digit-ui/employee/asset/assetservice/maintenance-edit/"+x,state:{data:n.data}}},l.createElement("button",null," ",l.createElement(t.EditIcon,null)," ")),l.createElement("div",{key:o,onClick:()=>{R(!0)},style:{cursor:"pointer"}},l.createElement(t.ViewsIcon,null))):w(n)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(r=e.values)||void 0===r?void 0:r.map((n,o)=>{var r,a,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:w(n.title),label:w(n.title),text:l.createElement("img",{src:w(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):!0===(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:w(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},w(null==n?void 0:n.title)))):V||$?""+w(n.title):w(n.title),text:l.createElement("div",null,l.createElement(i.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:Y(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",{key:o},window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+w(""+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:w(n.title),label:w(n.title),text:K(n),last:o===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:Y(),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(Kl,{bill:null===(a=F.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(wl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:I}),(null==S||null===(u=S.applicationData)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.fiReport)&&l.createElement(Cl,{fiReport:null==S||null===(v=S.applicationData)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(Pl,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.units)&&l.createElement(Fl,{units:null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.accessories)&&l.createElement(Ml,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.accessories}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.permissions)&&(null==b||null===(T=b.data)||void 0===T||null===(A=T.nextActions)||void 0===A?void 0:A.length)>0&&l.createElement(Nl,{applicationData:null==S?void 0:S.applicationData,t:w,permissions:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.permissions}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.obpsDocuments)&&l.createElement(bl,{t:w,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.noc)&&l.createElement(Dl,{t:w,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(L=e.additionalDetails)||void 0===L?void 0:L.data,bpaActionsDetails:b}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.scruntinyDetails)&&l.createElement(wl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.buildingExtractionDetails)&&l.createElement(wl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(Ll,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(Sl,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documents)&&l.createElement(Il,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation)&&l.createElement(Ol,{taxHeadEstimatesCalculation:null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(kl,{wsAdditionalDetails:e,oldValue:O}),(null==e?void 0:e.isDueVerification)&&"PENDING_FOR_FIELD_INSPECTION"===(null==C?void 0:C.applicationStatus)&&l.createElement(Xl,null),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&l.createElement(i.Link,{to:null==e||null===(X=e.additionalDetails)||void 0===X||null===(J=X.redirectUrl)||void 0===J?void 0:J.url},l.createElement("span",{className:"add-details-link hover-button"},null==e||null===(Q=e.additionalDetails)||void 0===Q||null===(ee=Q.redirectUrl)||void 0===ee?void 0:ee.title)),(null==e||null===(te=e.additionalDetails)||void 0===te?void 0:te.estimationDetails)&&l.createElement(jl,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(zl,{wsAdditionalDetails:e,workflowDetails:b}))}),D&&(null==b||null===(a=b.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==b?void 0:b.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=b&&b.isLoading)&&!T&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},w("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=b&&null!==(d=b.data)&&void 0!==d&&d.timeline&&1===(null==b||null===(s=b.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:w(`${A}${null==b||null===(v=b.data)||void 0===v||null===(p=v.timeline[0])||void 0===p?void 0:p.state}`),customChild:H(null==b||null===(m=b.data)||void 0===m?void 0:m.timeline[0],null==b||null===(f=b.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)&&(null==b||null===(y=b.data)||void 0===y?void 0:y.timeline.slice(0,q?null==b?void 0:b.data.timeline.length:2).map((e,n,o)=>{var i;let r="";var a,u,d,s,c,v;return window.location.href.includes("/obps/")&&(r=null!=b&&null!==(a=b.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!=b&&null!==(s=b.data)&&void 0!==s&&null!==(c=s.timeline[n-1])&&void 0!==c&&null!==(v=c.state)&&void 0!==v&&v.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:w(`${A}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[N]}${r}`),customChild:H(e,n,null==b||null===(i=b.data)||void 0===i?void 0:i.timeline)}))}))),(null==b||null===(g=b.data)||void 0===g||null===(h=g.timeline)||void 0===h?void 0:h.length)>2&&l.createElement(t.LinkButton,{label:w(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{G(e=>!e)}})))),l.createElement("div",null,L&&l.createElement(Zl,{t:w,closeModal:()=>setRnewButton(!1),actionCancelOnSubmit:()=>setRnewButton(!1),application:application})))}function Ql(e){var n,o,i,r,a,u,d,s,c,v,p,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 D;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===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.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===(p=b.error)||void 0===p?void 0:p.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===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.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 eo(e){var i,r,a,u,d,s,c,v,p,m,f,E,y,g,_,h,S,b,T;let{workflowDetails:C,displayMenu:A,onActionSelect:D,setDisplayMenu:N,businessService:I,forcedActionPrefix:O,ActionBarStyle:P={},MenuStyle:w={},isAction:L,applicationDetails:R}=e;const{t:x}=o.useTranslation();let M=Digit.UserService.getUser();const F=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):{};M=null==t?void 0:t.value}const k=null===(i=M)||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,B=!1,j=(null==C||null===(u=C.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(c=C.data)||void 0===c||null===(v=c.nextActions)||void 0===v?void 0:v.filter(e=>(null==k?void 0:k.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(F,()=>{N(!1)},A),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==j?void 0:j.length)||null!=j&&null!==(p=j[0])&&void 0!==p&&null!==(m=p.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==j?void 0:j.length)?(B=!1,U=!0):(null==j?void 0:j.length)>0&&(B=!0,U=!1);const H=Digit.SessionStorage.get("User"),W=null==H||null===(f=H.info)||void 0===f?void 0:f.uuid,z=null==R||null===(E=R.applicationData)||void 0===E||null===(y=E.auditDetails)||void 0===y?void 0:y.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&B&&!U&&!L&&l.createElement(t.ActionBar,{style:{...P}},A&&(null!=C&&null!==(g=C.data)&&void 0!==g&&null!==(_=g.actionState)&&void 0!==_&&_.nextActions||null!=C&&null!==(h=C.data)&&void 0!==h&&h.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==I?void 0:I.toUpperCase()),options:j,optionKey:"action",t:x,onSelect:D,style:w}):null,"ewst"===I?z===W||null==z?l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>N(!A)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+x("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:F,label:x("WF_TAKE_ACTION"),onSubmit:()=>N(!A)})),!(null!=C&&C.isLoading)&&!B&&U&&!L&&l.createElement(t.ActionBar,{style:{...P}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==j||null===(S=j[0])||void 0===S?void 0:S.action,value:null==j||null===(b=j[0])||void 0===b?void 0:b.action,onClick:e=>{D((null==j?void 0:j[0])||{})}},x(`${O||"WF_EMPLOYEE_"+(null==I?void 0:I.toUpperCase())}_${null==j||null===(T=j[0])||void 0===T?void 0:T.action}`))))}const to=()=>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"})),no=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(to,null));function lo(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(no,{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 oo=e=>{var a;const u=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{t:s}=o.useTranslation(),c=i.useHistory();let{id:v}=i.useParams();const[p,m]=n.useState(!1),[f,E]=n.useState(null),[y,g]=n.useState(!1),[_,h]=n.useState(!1),[S,b]=n.useState(!1),{applicationDetails:T,showToast:C,setShowToast:A,isLoading:D,isDataLoading:N,applicationData:I,mutate:O,nocMutation:P,workflowDetails:w,id:L,businessService:R,closeToast:x,moduleCode:M,timelineStatusPrefix:F,forcedActionPrefix:k,statusAttribute:U,ActionBarStyle:B,MenuStyle:j,paymentsList:H,showTimeLine:W=!0,oldValue:z,isInfoLabel:V=!1,clearDataDetails:$,isAction:Y=!1}=e;n.useEffect(()=>{C&&w.revalidate()},[C]);const K=r.useQueryClient(),q=()=>{E(null),g(!1)};return D||_?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,D?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Jl,{applicationDetails:T,id:L,workflowDetails:w,isDataLoading:N,applicationData:I,businessService:R,timelineStatusPrefix:F,statusAttribute:U,paymentsList:H,showTimeLine:W,oldValue:z,isInfoLabel:V}),y?l.createElement(hl,{t:s,action:f,tenantId:u,state:d,id:v,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:q,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,d,v,p,m,E,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===(d=u.comment)||void 0===d?void 0:d.length)&&0!=(null==e||null===(v=e.WaterConnection)||void 0===v||null===(p=v.comment)||void 0===p?void 0:p.length)&&0!=(null==e||null===(m=e.SewerageConnection)||void 0===m||null===(E=m.comment)||void 0===E?void 0:E.length)&&0!=(null==e||null===(y=e.BPA)||void 0===y||null===(g=y.comment)||void 0===g?void 0:g.length)){function _(t){if(l)return t;O&&(h(!0),O(e,{onError:(e,t)=>{h(!1),A({key:"error",error:e}),setTimeout(x,5e3)},onSuccess:(e,t)=>{var l,o,i,r,a,u,d,v,p,m,E,y;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),h(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=f,c.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=n)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=f,c.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=n)&&void 0!==i&&i.isNoc&&c.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")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(v=d.workflow)&&void 0!==v&&v.action.includes("RE-SUBMIT")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(p=t.AmendmentUpdate)&&void 0!==p&&null!==(m=p.workflow)&&void 0!==m&&m.action.includes("APPROVE")?A({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(y=E.workflow)&&void 0!==y&&y.action.includes("REJECT")&&A({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(A({key:"success",action:f}),$&&setTimeout($,3e3),setTimeout(x,5e3),K.clear(),K.refetchQueries("APPLICATION_SEARCH"))}})),q()}h(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const o=function(){if(!1!==t&&P){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==P?void 0:P.mutateAsync(e)),o=me(function(){return h(!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,c,v,p,m;h(!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?s(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===(c=e.response)||void 0===c||null===(v=c.data)||void 0===v||null===(p=v.Errors)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.message)||e;q(),A({key:"error",error:{message:f}}),setTimeout(x,5e3),l=!0});if(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(_):_(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==w||null===(a=w.data)||void 0===a?void 0:a.timeline,businessService:R,workflowDetails:w,moduleCode:M,cardFormWrapperClassName:"modal-form"}):null,S?l.createElement(lo,{action:f,workflowDetails:w,businessService:R,isWarningPop:S,closeWarningPopup:()=>{b(!1)}}):null,l.createElement(Ql,{t:s,showToast:C,closeToast:x,businessService:R}),l.createElement(eo,{isAction:Y,workflowDetails:w,displayMenu:p,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)A({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(x,5e3);else if(null!=e&&e.isWarningPopUp)b(!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))c.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;c.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 d,s;c.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else g(!0);E(e),m(!1)},setDisplayMenu:m,businessService:R,forcedActionPrefix:k,ActionBarStyle:B,MenuStyle:j,applicationDetails:T})))},io=()=>{var e;const{t:r}=o.useTranslation(),{propertyId:a,tenantId:u,redirectToUrl:d}=Digit.Hooks.useQueryParams(),{isLoading:s,data:c}=Digit.Hooks.pt.useGenericViewProperty(r,u,a,{}),{state:v}=i.useLocation(),p=i.useHistory();return n.useEffect(()=>{"true"===sessionStorage.getItem("isCreateEnabledEmployee")?(sessionStorage.removeItem("isCreateEnabledEmployee"),p.replace("/digit-ui/employee")):sessionStorage.removeItem("isCreateEnabledEmployee")}),l.createElement("div",null,l.createElement(oo,{applicationDetails:c,isLoading:s,isDataLoading:s,workflowDetails:{},applicationData:null==c?void 0:c.applicationData,moduleCode:"PT"}),window.location.href.includes("redirectToUrl")&&"INACTIVE"!==(null==c||null===(e=c.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:r("PT_ADD_PROPERTY_TO_APP"),onSubmit:()=>(()=>{var e,t,n,l,o,i,r;const s=null!=d&&d.includes("employee/tl")?1600:300;return setTimeout(()=>window.scrollTo(0,s),400),p.push(`${d}?propertyId=${a}&tenantId=${(null==c?void 0:c.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}`:""}`,{...v})})()}))))},ro=e=>{let{stateCode:n}=e;const{t:r}=o.useTranslation(),{path:a,...d}=i.useRouteMatch(),s=[{icon:t.HomeIcon,path:"/digit-ui/employee"},{label:r((()=>{const e=location.pathname;return e.includes("/commonpt/search")?"SEARCH_PROPERTY":e.includes("/view-property")?"PT_PROPERTY_INFORMATION":e.includes("/property/new-application")?"PT_CREATE_PROPERTY":"ES_COMMON_INBOX"})())}];return l.createElement(t.AppContainer,null,l.createElement("div",{className:"ground-container employee-app-container form-container"},l.createElement(t.ModuleHeader,{leftContent:l.createElement(l.Fragment,null,l.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:s}),l.createElement("div",{className:"employee-form"},l.createElement("div",{className:"employee-form-content"},l.createElement("span",{className:"pt-citizen",style:{width:"100%"}},l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{path:a+"/search",component:ge}),l.createElement(t.PrivateRoute,{path:a+"/property/citizen-search",component:ge}),l.createElement(t.PrivateRoute,{path:a+"/property/search-results",component:e=>l.createElement(Se,u({},e,{stateCode:n}))}),l.createElement(i.Route,{path:a+"/property/citizen-otp"},l.createElement(Ce,{stateCode:n})),l.createElement(t.PrivateRoute,{path:a+"/property/link-success/:propertyIds",component:be}),l.createElement(t.PrivateRoute,{path:a+"/property/new-application",component:C}),l.createElement(t.PrivateRoute,{path:a+"/view-property",component:io})))))))},ao=e=>{o.useTranslation();const n=r.useQueryClient(),a=i.useRouteMatch(),u=(i.useLocation(),i.useHistory()),d=Digit.ULBService.getStateId(),[s,c,v]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("PT_CREATE_PROPERTY",{}));let{isLoading:p}=Digit.Hooks.pt.useMDMS(d,"PropertyTax","CommonFieldsConfig");const m=i.useLocation().search;return new URLSearchParams(m).get("redirectToUrl"),p?l.createElement(t.Loader,null):l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:""+a.path},l.createElement(g,{onSelect:function(e,t){try{return u.push({pathname:a.path+"/save-property",search:m,state:{property:null==t?void 0:t.property}}),Promise.resolve()}catch(e){return Promise.reject(e)}},value:s,userType:"employee"})),l.createElement(i.Route,{exact:!0,path:a.path+"/save-property"},l.createElement(T,{data:s,onSuccess:()=>{v(),n.invalidateQueries("PT_CREATE_PROPERTY")},userType:"employee"})))},uo={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"}}}}},so={propertyIds:"",mobileNumber:"",oldPropertyId:"",locality:"",name:"",doorNo:""},co=e=>{const{t:r}=o.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,d]=n.useState({}),[s,c]=n.useState(so),[v,p]=n.useState("searchId"),[m,f]=n.useState(null),E=i.useLocation().search,y=new URLSearchParams(E).get("redirectToUrl"),g=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchForm")),_=n.memo(Digit.ComponentRegistryService.getComponent("CPTPropertySearchResults")),{data:h,isLoading:S}=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&&p("searchDetail")},[v]);const b=n.useCallback(()=>{c(so),d({}),f(null)}),T=n.useCallback(e=>{c(e),Object.keys(e).filter(t=>e[t]&&"object"!=typeof e[t]).length>0?(d(Object.keys(e).filter(t=>e[t]).reduce((t,n)=>({...t,[n]:"object"==typeof e[n]?e[n].code:e[n]}),{})),f(null)):f({warning:!0,label:"ERR_PT_FILL_VALID_FIELDS"})});return S?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(g,{t:r,payload:s,searchBy:v,setSearchBy:p,PTSearchFields:uo,tenantId:a,onSubmit:T,onReset:b})),Object.keys(u).length>0&&l.createElement(_,{t:r,showToast:m,setShowToast:f,tenantId:a,payload:u,ptSearchConfig:{...h},redirectToUrl:y}),m&&l.createElement(t.Toast,{error:m.error,warning:m.warning,label:r(m.label),onClose:()=>{f(null)}}))},vo=e=>{let{path:n,userType:r}=e;const{t:a}=o.useTranslation(),u=i.useLocation(),d=(new URLSearchParams(i.useLocation().search).get("propertyId"),new URLSearchParams(i.useLocation().search).get("tenantId"),[{icon:t.HomeIcon,path:"/digit-ui/employee"},{label:a((()=>{const e=u.pathname;return e.includes("/commonpt/search")?"SEARCH_PROPERTY":e.includes("/view-property")?"PT_PROPERTY_INFORMATION":"ES_COMMON_INBOX"})())}]);return l.createElement(t.AppContainer,null,l.createElement("div",{className:"ground-container employee-app-container form-container"},l.createElement(t.ModuleHeader,{leftContent:l.createElement(l.Fragment,null,l.createElement(t.ArrowLeft,{className:"icon"}),"Back"),onLeftClick:()=>window.history.back(),breadcrumbs:d}),l.createElement("div",{className:"employee-form"},l.createElement("div",{className:"employee-form-content"},l.createElement(i.Switch,null,l.createElement(t.PrivateRoute,{exact:!0,path:n+"/",component:()=>l.createElement(So,{matchPath:n,userType:r})}),l.createElement(t.PrivateRoute,{path:n+"/new-application",component:ao}),l.createElement(t.PrivateRoute,{path:n+"/search",component:co}),l.createElement(t.PrivateRoute,{path:n+"/view-property",component:io}))))))},po=/^\d+$/,mo=/^\d+(\.\d{1,2})?$/,fo=e=>l.createElement("div",{className:"search-tabs-container PropertySearchFormSwitcher",style:{marginBottom:"16px",display:"flex",gap:"24px",justifyContent:"flex-start",borderBottom:"1px solid #ccc"}},e.keys.map(t=>{const n=e.searchBy===t;return l.createElement("div",{key:t,className:"search-tab "+(n?"active":""),style:{padding:"8px 16px",cursor:"pointer",borderBottom:n?"2px solid #f47738":"2px solid transparent",color:n?"#f47738":"#0b0c0c",fontWeight:n?"bold":"normal"},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())))})),Eo=e=>l.createElement("span",{className:"cell-text"},e);let yo=[];const go=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":yo=[];break;case"WS":yo=["WS_COMMON_CONNECTION_DETAIL","WS_COMMON_DOCUMENT_DETAILS","WS_COMMON_SUMMARY"];break;case"TL":yo=["TL_COMMON_TR_DETAILS","TL_LOCATION_AND_OWNER_DETAILS","TL_DOCUMENT_DETAIL","TL_COMMON_SUMMARY"];default:yo=[]}})(i),l.createElement("div",{className:"timeline-container",style:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},yo.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")}))))},_o=()=>{var e;const{t:n}=o.useTranslation(),i={Icon:l.createElement(t.PropertyHouse,null),moduleName:n("ACTION_TEST_COMMON_PROPERTY_TAX"),kpis:[{label:n("PT_TOTAL_APPLICATIONS"),value:0}],links:[{label:n("PT_SEARCH"),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)},ho=e=>{let{userType:t,tenants:o}=e;const{path:r,url:a}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({moduleCode:["PT","ws"],language:u}),Digit.SessionStorage.set("PT_TENANTS",o),n.useEffect(()=>"employee"===t&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===t?l.createElement(vo,{path:r,url:a,userType:t,tenants:o}):l.createElement(ro,null)},So=e=>{let{matchPath:n}=e;const{t:i}=o.useTranslation(),r=[{link:n+"/property/citizen-search",i18nKey:i("PT_SEARCH_AND_PAY")},{link:n+"/property/new-application",i18nKey:i("PT_CREATE_PROPERTY")}];return l.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_COMMON_PROPERTY_TAX"),links:r,Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})},bo={CommonPTModule:ho,CommonPTCard:_o,CommonPTLinks:So,CPTPropertySearchForm:e=>{let{tenantId:o,t:i,onSubmit:r,onReset:d,searchBy:s,PTSearchFields:c,setSearchBy:v,payload:p}=e;const{register:m,control:f,handleSubmit:E,watch:y,getValues:g,formState:_}=a.useForm({defaultValues:{...p}}),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(fo,{keys:Object.keys(c||{}),searchBy:s,onReset:d,t:i,onSwitch:v}),l.createElement("div",{className:"formcomposer-section-grid"},S&&Object.keys(S).map(e=>{var n,r,d;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(a.Controller,{name:e,defaultValue:null==h?void 0:h[e],rules:s.validation,control:f,render:(t,n)=>l.createElement(s.customComponent,u({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({value:g(e),shouldUnregister:!0,...c})})),l.createElement(t.CardLabelError,null,i(null==_||null===(r=_.errors)||void 0===r||null===(d=r[e])||void 0===d?void 0:d.message)))})),l.createElement("div",{className:"formcomposer-section-button",style:{marginTop:"16px",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}},l.createElement("div",{className:"pt-search-action-reset generic-button clear-search",style:{margin:0}},l.createElement("p",{onClick:()=>{d({})}},i("ES_COMMON_CLEAR_SEARCH"))),l.createElement("div",{className:"pt-search-action-submit submit-bar generic-button",style:{margin:0}},l.createElement(t.SubmitBar,{label:i("ES_COMMON_SEARCH"),submit:!0})))))},CPTPropertySearchResults:e=>{var o,r;let{tenantId:a,t:u,payload:d,showToast:s,setShowToast:c,ptSearchConfig:v,redirectToUrl:p}=e;const m=i.useHistory(),{state:f}=i.useLocation(),E=i.useLocation().search,y=new URLSearchParams(E).get("propertyId");let g=window.location.href.includes("&")?window.location.href.substring(window.location.href.indexOf("&")+1,window.location.href.length):"";const[_,h]=n.useState({...d}),{data:S,isLoading:b,error:T}=Digit.Hooks.pt.usePropertySearchWithDue({tenantId:a,filters:_,configs:{enabled:Object.keys(d).length>0,retry:!1,retryOnMount:!1,staleTime:Infinity}}),C=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:()=>{const e=window.location.href.includes("/citizen/")?"citizen":"employee";m.push(`/digit-ui/${e}/commonpt/view-property?propertyId=${t.original.propertyId}&tenantId=${a}&redirectToUrl=${p}`,{...f})}},t.original.propertyId)))}},{Header:u("PT_COMMON_TABLE_COL_OWNER_NAME"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return Eo(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 Eo(u(t.original.locality)||"")}},{Header:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),Cell:e=>{var t;let{row:n}=e;return Eo(u((null==n||null===(t=n.original)||void 0===t?void 0:t.status)||"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"},p?l.createElement("span",{onClick:()=>{m.push(g?`${p}?${null==g?void 0:g.replace(y,n.original.propertyId)}`:`${p}?propertyId=${n.original.propertyId}&tenantId=${a}`,{...f});const e=null!=p&&p.includes("employee/tl")?1600:300;setTimeout(()=>window.scrollTo(0,e),400)}},u("CPT_SELECT_PROPERTY")):null):u("PT_NA"))}}],[]);let A=window.Digit.Utils.browser.isMobile();if(b)return s&&c(null),l.createElement(t.Loader,null);var D,N,I,O;if(T)return!s&&c({error:!0,label:(null==T||null===(D=T.response)||void 0===D||null===(N=D.data)||void 0===N||null===(I=N.Errors)||void 0===I||null===(O=I[0])||void 0===O?void 0:O.code)||T}),null;const P=n.memo(Digit.ComponentRegistryService.getComponent("PTEmptyResultInbox")),w=Object.values((null==S?void 0:S.FormattedData)||{})||[];return null!=v&&v.ptSearchCount&&d.locality&&w&&w.length>(null==v?void 0:v.ptSearchCount)?(!s&&c({error:!0,label:"PT_MODIFY_SEARCH_CRITERIA"}),null):l.createElement(l.Fragment,null,0===(null==S||null===(o=S.Properties)||void 0===o?void 0:o.length)?l.createElement(P,{data:!0}):A?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 C.forEach(n=>{n.Cell&&(t[n.Header]=n.Cell({row:{original:e}}))}),t})}(w),t:u}):l.createElement(t.Table,{t:u,data:w,totalRecords:null==S||null===(r=S.Properties)||void 0===r?void 0:r.length,columns:C,getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),manualPagination:!1,disableSort:!0}))},CPTSearchProperty:ge,CPTPropertyAssemblyDetails:e=>{var o,i,r,u,d,s,c,p,m,f,E,g;let{t:_,config:h,onSelect:S,formData:b,formState:T,setError:C,clearErrors:A}=e;const[D,N]=l.useState({...b.assemblyDet,BuildingType:null==b?void 0:b.PropertyType,floorarea:null==b?void 0:b.landArea,constructionArea:null==b?void 0:b.constructionArea,usageCategoryMajor:null!=b&&b.usageCategoryMajor&&"NONRESIDENTIAL.OTHERS"===(null==b||null===(o=b.usageCategoryMajor)||void 0===o?void 0:o.code)?{code:""+(null==b||null===(i=b.usageCategoryMajor)||void 0===i?void 0:i.code),i18nKey:"PROPERTYTAX_BILLING_SLAB_OTHERS"}:null==b?void 0:b.usageCategoryMajor}),[I,O]=l.useState("");let P=Digit.ULBService.getCurrentTenantId();const[w,L]=n.useState(!1),R=window.Digit.Utils.browser.isMobile();let x=[];console.log("Calling usePropertyMDMS with tenantId:",P);const{data:M=[]}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","PTPropertyType")||{};x=(null==M||null===(r=M.PropertyTax)||void 0===r?void 0:r.PropertyType)||(Array.isArray(M)?M:[]);const{data:F=[]}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax","UsageCategory")||{};console.log("UsageCategory Menu Data (transformed):",F);let k=(null==F||null===(u=F.PropertyTax)||void 0===u?void 0:u.UsageCategory)||(Array.isArray(F)?F:[]);function U(e){let t=[];if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++)1!=n&&4!=n&&t.push({i18nKey:"COMMON_PROPTYPE_"+y(e[n].code,".","_"),code:e[n].code});return t.sort((e,t)=>e.i18nKey.split("_").pop().localeCompare(t.i18nKey.split("_").pop())),t}function B(e){let t=[];for(let u=0;u<e.length;u++){var n,l,o,i,r,a;Array.isArray(e)&&e.length>0&&"NONRESIDENTIAL"==(null===(n=e[u])||void 0===n||null===(l=n.code)||void 0===l||null===(o=l.split)||void 0===o?void 0:o.call(l,".")[0])&&2==(null===(i=e[u])||void 0===i||null===(r=i.code)||void 0===r||null===(a=r.split)||void 0===a?void 0:a.call(r,".").length)&&t.push({i18nKey:"PROPERTYTAX_BILLING_SLAB_"+e[u].code.split(".")[1],code:e[u].code})}return t}const{control:j,formState:{errors:H,touched:W},trigger:z,watch:V,clearErrors:$}=a.useForm(),Y=V(),K={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.useEffect(()=>{let e=!1;const t={};Object.keys(D).forEach(e=>{t[e]=null==Y?void 0:Y[e]}),v.isEqual(t,D)||Object.keys(D).forEach(t=>{D[t]?(e=!1,$(t)):e=!0}),e?C(null==h?void 0:h.key,{type:H}):A(null==h?void 0:h.key),z(),L(e),S(null==h?void 0:h.key,D)},[D]),l.useEffect(()=>{var e;Object.keys(H).length&&!v.isEqual((null===(e=T.errors[h.key])||void 0===e?void 0:e.type)||{},H)?C(h.key,{type:H}):!Object.keys(H).length&&T.errors[h.key]&&w&&A(h.key)},[H]),l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_PROP_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"BuildingType",control:j,defaultValue:null==D?void 0:D.BuildingType,rules:{required:_("REQUIRED_FIELD")},key:null==h?void 0:h.key,render:e=>{var n,o;return l.createElement(t.Dropdown,{selected:1===(null===(n=U(x))||void 0===n?void 0:n.length)?U(x)[0]:null==D?void 0:D.BuildingType,disable:1===(null===(o=U(x))||void 0===o?void 0:o.length),option:U(x),autoFocus:"BuildingType"===I,select:t=>{e.onChange(t),N({...D,BuildingType:t}),O("BuildingType")},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:_})}}))),(null==W?void 0:W.BuildingType)&&(null==H||null===(d=H.BuildingType)||void 0===d?void 0:d.message)&&l.createElement(t.CardLabelError,{style:K},null==H||null===(s=H.BuildingType)||void 0===s?void 0:s.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_TOT_LAND_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"floorarea",control:j,defaultValue:null==D?void 0:D.floorarea,rules:{required:_("REQUIRED_FIELD"),validate:e=>!!/^([0-9]){0,8}$/i.test(e)||_("PT_TOT_LAND_AREA_ERROR_MESSAGE")},key:null==h?void 0:h.key,render:e=>l.createElement(t.TextInput,{t:_,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totLandArea",value:null==e?void 0:e.value,autoFocus:"floorarea"===I,onChange:t=>{null==e||e.onChange(t.target.value),N({...D,floorarea:t.target.value}),O("floorarea")},onBlur:null==e?void 0:e.onBlur})}))),(null==W?void 0:W.floorarea)&&(null==H||null===(c=H.floorarea)||void 0===c?void 0:c.message)&&l.createElement(t.CardLabelError,{style:K},null==H||null===(p=H.floorarea)||void 0===p?void 0:p.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_TOT_CONSTRUCTION_AREA")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"constructionArea",control:j,defaultValue:null==D?void 0:D.constructionArea,key:null==h?void 0:h.key,rules:{required:_("REQUIRED_FIELD"),validate:e=>!!(/^([0-9]){0,8}$/i.test(e)&&null!=D&&D.floorarea&&parseInt(e)<parseInt(null==D?void 0:D.floorarea))||_("PT_TOT_CONSTRUCTION_AREA_ERROR_MESSAGE")},render:e=>l.createElement(t.TextInput,{t:_,type:"number",isMandatory:!1,optionKey:"i18nKey",name:"totConstructionArea",value:null==e?void 0:e.value,autoFocus:"constructionArea"===I,onChange:t=>{null==e||e.onChange(t.target.value),O("constructionArea"),N({...D,constructionArea:t.target.value})},onBlur:null==e?void 0:e.onBlur})}))),(null==W?void 0:W.constructionArea)&&(null==H||null===(m=H.constructionArea)||void 0===m?void 0:m.message)&&l.createElement(t.CardLabelError,{style:R?{...K,marginLeft:"0px"}:{...K}},null==H||null===(f=H.constructionArea)||void 0===f?void 0:f.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,_("PT_ASSESMENT_INFO_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{name:"usageCategoryMajor",defaultValue:null==D?void 0:D.usageCategoryMajor,rules:{required:_("REQUIRED_FIELD")},control:j,key:null==h?void 0:h.key,render:e=>{var n;return l.createElement(t.Dropdown,{selected:null==e?void 0:e.value,disable:1===(null===(n=B(k))||void 0===n?void 0:n.length),option:B(k),autoFocus:"usageCategoryMajor"===I,select:t=>{null==e||e.onChange(t),O("usageCategoryMajor"),N({...D,usageCategoryMajor:t})},optionKey:"i18nKey",onBlur:null==e?void 0:e.onBlur,t:_})}}))),(null==W?void 0:W.usageCategoryMajor)&&(null==H||null===(E=H.usageCategoryMajor)||void 0===E?void 0:E.message)&&l.createElement(t.CardLabelError,{style:K},null==H||null===(g=H.usageCategoryMajor)||void 0===g?void 0:g.message))},CPTPropertyLocationDetails:e=>{var i;let{address:r,isEdit:a,onSelect:u,config:d,hideZRO:s,formData:c,...v}=e;const{t:p}=o.useTranslation(),[m,f]=n.useState(null),[E,y]=n.useState({addressType:(null==r?void 0:r.addressType)||"",pincode:(null==r?void 0:r.pinCode)||"",city:(null==r?void 0:r.city)||"",locality:(null==r?void 0:r.locality)||"",streetName:(null==r?void 0:r.streetName)||"",houseNo:(null==r?void 0:r.houseNumber)||"",houseName:(null==r?void 0:r.houseName)||"",landmark:(null==r?void 0:r.landmark)||"",addressLine1:(null==r?void 0:r.address)||"",addressLine2:(null==r?void 0:r.address2)||"",latitude:(null==r?void 0:r.latitude)||"",longitude:(null==r?void 0:r.longitude)||"",assembly:(null==r?void 0:r.assembly)||"",block:(null==r?void 0:r.block)||"",zone:(null==r?void 0:r.zone)||"",zroLocation:(null==r?void 0:r.zroLocation)||"",subLocality:(null==r?void 0:r.subLocality)||"",actualAssembly:(null==r?void 0:r.actualAssembly)||"",actualWard:(null==r?void 0:r.actualWard)||"",actualZone:(null==r?void 0:r.actualZone)||""}),g=window.location.href.includes("ws/old-application");return n.useEffect(()=>{v.register&&(v.register({name:"cpt"}),v.register({name:"cptId"}))},[v.register]),n.useEffect(()=>{var e;if(null!=c&&null!==(e=c.cpt)&&void 0!==e&&e.details){var t,n,l,o,i,r,a,s,v,p,m,f,E,g,_,h,S,b,T,C;const e=c.cpt.details,u=e.address||{},d=e.additionalDetails||{},A=(null===(t=u.locality)||void 0===t?void 0:t.code)||u.locality||"",D=null!==(n=u.geoLocation)&&void 0!==n&&n.latitude&&0!==(null===(l=u.geoLocation)||void 0===l?void 0:l.latitude)?u.geoLocation.latitude:(null===(o=u.locality)||void 0===o?void 0:o.latitude)||u.latitude||"",N=null!==(i=u.geoLocation)&&void 0!==i&&i.longitude&&0!==(null===(r=u.geoLocation)||void 0===r?void 0:r.longitude)?u.geoLocation.longitude:(null===(a=u.locality)||void 0===a?void 0:a.longitude)||u.longitude||"",I=u.zroLocation||d.zroLocation||(null===(s=u.additionalDetails)||void 0===s?void 0:s.zroLocation)||"",O=I?{code:I,name:I,i18nKey:I}:"";y({pincode:u.pincode||"",city:u.city||"",locality:A,streetName:u.street||"",houseNo:u.houseNo||"",landmark:u.landmark||"",latitude:D,longitude:N,assembly:d.assembly||(null===(v=u.additionalDetails)||void 0===v?void 0:v.assembly)||"",block:d.block||(null===(p=u.additionalDetails)||void 0===p?void 0:p.block)||"",zone:d.zone||(null===(m=u.additionalDetails)||void 0===m?void 0:m.zone)||"",zroLocation:I,zro:O,subLocality:u.subLocality||"",actualAssembly:u.actualAssembly||d.actualAssembly||(null===(f=u.additionalDetails)||void 0===f?void 0:f.actualAssembly)||"",actualWard:u.actualWard||d.actualWard||(null===(E=u.additionalDetails)||void 0===E?void 0:E.actualWard)||"",actualZone:u.actualZone||d.actualZone||(null===(g=u.additionalDetails)||void 0===g?void 0:g.actualZone)||"",address:{...u,city:u.city||"",pincode:u.pincode||"",locality:A,streetName:u.street||"",houseNo:u.houseNo||"",addressLine1:u.street||"",latitude:D,longitude:N,zroLocation:I,zro:O,assembly:d.assembly||(null===(_=u.additionalDetails)||void 0===_?void 0:_.assembly)||"",block:d.block||(null===(h=u.additionalDetails)||void 0===h?void 0:h.block)||"",zone:d.zone||(null===(S=u.additionalDetails)||void 0===S?void 0:S.zone)||"",subLocality:u.subLocality||"",actualWard:u.actualWard||d.actualWard||(null===(b=u.additionalDetails)||void 0===b?void 0:b.actualWard)||"",actualZone:u.actualZone||d.actualZone||(null===(T=u.additionalDetails)||void 0===T?void 0:T.actualZone)||"",actualAssembly:u.actualAssembly||d.actualAssembly||(null===(C=u.additionalDetails)||void 0===C?void 0:C.actualAssembly)||""}})}else if(null===(null==c?void 0:c.cpt)){const e={addressType:"",pincode:"",city:"",locality:"",streetName:"",houseNo:"",houseName:"",landmark:"",addressLine1:"",addressLine2:"",latitude:"",longitude:"",assembly:"",block:"",zone:"",zroLocation:"",subLocality:"",actualWard:"",actualZone:"",actualAssembly:"",zro:"",address:{}};y(e),u((null==d?void 0:d.key)||"address",e)}},[null==c||null===(i=c.cpt)||void 0===i?void 0:i.details,null==c?void 0:c.cpt]),n.useEffect(()=>{if(m){const e=setTimeout(()=>{f(null)},1e3);return()=>clearTimeout(e)}},[m]),l.createElement(t.CollapsibleCardPage,{title:p("PT_LOCATION_DETAILS")+(null!=d&&d.isAutomaticFill?" (Automatic Fill by Property )":""),defaultOpen:null==d||!d.isAutomaticFill},l.createElement("div",{style:{boxShadow:"none",...v.style}},l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.AddressDetails,{t:p,formData:E,onSelect:(e,t)=>{y(e=>({...e,...t})),u(e,t)},config:{isCollapsible:!1,...d},isEdit:a,showZRO:!s,showMapActualLocation:!0,disable:g,hideNextButton:!0}))))},CPTPropertyOwnerDetails:e=>{var o,r,u,d,s,c,p,m,f,E,y,g,_,h,S;let{t:b,config:T,onSelect:C,formData:A,formState:D,setError:N,clearErrors:I,...O}=e;const{pathname:P}=i.useLocation(),w=P.includes("/modify-application/"),L=(P.includes("/property-mutation/"),window.Digit.Utils.browser.isMobile()),[R,x]=l.useState((null==A?void 0:A.ownershipCategory)||""),[M,F]=l.useState([{...A.owners&&A.owners[0],name:A.owners&&A.owners[0]&&A.owners[0].name||(null==A||null===(o=A.owners)||void 0===o?void 0:o.name)||"",gender:A.owners&&A.owners[0]&&A.owners[0].gender||(null==A||null===(r=A.owners)||void 0===r?void 0:r.gender),mobileNumber:A.owners&&A.owners[0]&&A.owners[0].mobileNumber||(null==A||null===(u=A.owners)||void 0===u?void 0:u.mobileNumber)||"",fatherOrHusbandName:A.owners&&A.owners[0]&&A.owners[0].fatherOrHusbandName||(null==A||null===(d=A.owners)||void 0===d?void 0:d.fatherOrHusbandName)||"",relationship:A.owners&&A.owners[0]&&A.owners[0].relationship||(null==A||null===(s=A.owners)||void 0===s?void 0:s.relationship),ownershipCategory:R,ownerType:A.owners&&A.owners[0]&&(null===(c=A.owners[0])||void 0===c?void 0:c.ownerType)||(null===(p=A.owners)||void 0===p?void 0:p.ownerType),permanentAddress:A.owners&&A.owners[0]&&A.owners[0].permanentAddress||(null==A||null===(m=A.owners)||void 0===m?void 0:m.permanentAddress)||"",email:A.owners&&A.owners[0]&&A.owners[0].email||(null==A||null===(f=A.owners)||void 0===f?void 0:f.emailId)||"",isCoresAddr:!1}]),[k,U]=n.useState(!1),[B,j]=l.useState(!1),H=(null==A?void 0:A.isUpdateProperty)||!1;let W=(null==A?void 0:A.isEditProperty)||!1;const z=Digit.ULBService.getStateId(),V=Digit.ULBService.getCurrentTenantId(),{data:$}=Digit.Hooks.pt.useGenderMDMS(z,"common-masters","GenderType");let Y=[];$&&$.map(e=>{Y.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const{data:K}=Digit.Hooks.pt.usePropertyMDMS(V,"PropertyTax","OwnerType"),q=(null==K||null===(E=K.PropertyTax)||void 0===E?void 0:E.OwnerType)||(Array.isArray(K)?K:[]),{data:G}=Digit.Hooks.pt.usePropertyMDMS(V,"PropertyTax",["OwnerShipCategory"]),[Z,X]=n.useState(null==A||null===(y=A.owners)||void 0===y?void 0:y.isCorrespondenceAddress),J=[{name:"HUSBAND",code:"HUSBAND",i18nKey:"PT_RELATION_HUSBAND"},{name:"Father",code:"FATHER",i18nKey:"PT_RELATION_FATHER"}],{control:Q,formState:{errors:ee,touched:te},trigger:ne,watch:le,clearErrors:oe}=a.useForm(),ie=le();n.useEffect(()=>{let e=!1;const t={};M.map(n=>{Object.keys(n).forEach(e=>{t[e]=null==ie?void 0:ie[e]}),v.isEqual(t,n)||Object.keys(n).forEach(t=>{n[t]?(e=!1,oe(t)):e=!0})}),e?N(null==T?void 0:T.key,{type:ee}):I(null==T?void 0:T.key),ne(),U(e),C(null==T?void 0:T.key,M.map(e=>({...e,ownershipCategory:R})))},[M]),n.useEffect(()=>{var e;Object.keys(ee).length&&!v.isEqual((null===(e=D.errors[T.key])||void 0===e?void 0:e.type)||{},ee)?N(T.key,{type:ee}):!Object.keys(ee).length&&D.errors[T.key]&&k&&I(T.key)},[ee]);const re=function(e,t,n){void 0===e&&(e="name"),void 0===t&&(t=0),void 0===n&&(n=""),F(M.map((l,o)=>(o===t&&(l[e]=n),{...l})))},ae=(n.useMemo(()=>{var e,t,n;return null==G||null===(e=G.PropertyTax)||void 0===e||null===(t=e.OwnerShipCategory)||void 0===t||null===(n=t.filter(e=>"INDIVIDUAL.SINGLEOWNER"===e.code||"INDIVIDUAL.MULTIPLEOWNERS"===e.code||1===e.code.split(".").length&&e.code.includes("INSTITUTIONAL")))||void 0===n?void 0:n.map(e=>({...e,i18nKey:"PT_OWNERSHIP_CATEGORY_"+e.code.replaceAll(".","_")}))},[G]),n.useMemo(()=>{var e,t;const n=null==R?void 0:R.code,l=null==G||null===(e=G.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;return(null===(t=e.code)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[1])&&{...e,i18nKey:"PT_OWNERSHIP_CATEGORY_"+(null===(l=e.code)||void 0===l?void 0:l.replaceAll(".","_"))}})},[G,null==R?void 0:R.code]),{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}),ue=!(null==R||null===(g=R.code)||void 0===g||!g.includes("MULTIPLEOWNERS"));return null==R||null===(_=R.code)||void 0===_||_.includes("INSTITUTIONAL"),l.createElement(t.CollapsibleCardPage,{title:b("PT_OWNER_DETAILS"),defaultOpen:!0,style:O.style},null==M?void 0:M.map((e,n)=>{var o,i,r,u,d,s,c,v,p,m,f,E,y,g;return l.createElement("div",{key:n},L&&ue&&M.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!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}})),l.createElement(l.Fragment,null,l.createElement("div",{className:"formcomposer-section-grid"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_MOBILE_NUMBER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"mobileNumber"+n,name:"mobileNumber"+n,defaultValue:e.mobileNumber,control:Q,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),re("mobileNumber",n,e)},disable:H||W,labelStyle:{border:"1px solid #000",borderRight:"none"},onBlur:r})}})),!L&&l.createElement("div",{style:{display:"flex",justifyContent:"flex-end",width:"20%",alignSelf:"flex-start"}},ue&&l.createElement(t.LinkButton,{label:l.createElement(t.DeleteIcon,{style:{bottom:"0px"},fill:1!=M.length?"#494848":"#FAFAFA"}),style:{margin:"0px"},onClick:e=>{F([...M.filter((e,t)=>t!=n)])}}))),(null==te?void 0:te["mobileNumber"+n])&&(null==ee||null===(o=ee["mobileNumber"+n])||void 0===o?void 0:o.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(i=ee["mobileNumber"+n])||void 0===i?void 0:i.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_OWNER_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"name"+n,name:"name"+n,defaultValue:null==e?void 0:e.name,control:Q,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),re("name",n,e.target.value)},disable:H||W,onBlur:r})}}))),(null==te?void 0:te["name"+n])&&(null==ee||null===(r=ee["name"+n])||void 0===r?void 0:r.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(u=ee["name"+n])||void 0===u?void 0:u.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GENDER")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"gender"+n,name:"gender"+n,defaultValue:null==e?void 0:e.gender,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"gender"+n,options:Y,selectedOption:o,optionKey:"code",onSelect:e=>{i(e),re("gender",n,e)},t:b,disabled:H||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),(null==te?void 0:te["gender"+n])&&(null==ee||null===(d=ee["gender"+n])||void 0===d?void 0:d.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(s=ee["gender"+n])||void 0===s?void 0:s.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_GUARDIAN_NAME")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"fatherOrHusbandName"+n,name:"fatherOrHusbandName"+n,defaultValue:null==e?void 0:e.fatherOrHusbandName,control:Q,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),re("fatherOrHusbandName",n,e.target.value)},disable:H||W,onBlur:r})}}))),(null==te?void 0:te["fatherOrHusbandName"+n])&&(null==ee||null===(c=ee["fatherOrHusbandName"+n])||void 0===c?void 0:c.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(v=ee["fatherOrHusbandName"+n])||void 0===v?void 0:v.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,b("PT_FORM3_RELATIONSHIP")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"relationship"+n,name:"relationship"+n,defaultValue:null==e?void 0:e.relationship,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.RadioOrSelect,{name:"relationship"+n,options:J,selectedOption:o,optionKey:"i18nKey",onSelect:e=>{i(e),re("relationship",n,e)},t:b,disabled:H||W,isDropDown:!!window.location.href.includes("/employee"),onBlur:r})}}))),(null==te?void 0:te["relationship"+n])&&(null==ee||null===(p=ee["relationship"+n])||void 0===p?void 0:p.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(m=ee["relationship"+n])||void 0===m?void 0:m.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:""},b("PT_SPECIAL_APPLICANT_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{key:"ownerType"+n,name:"ownerType"+n,defaultValue:null==e?void 0:e.ownerType,control:Q,rules:{required:b("REQUIRED_FIELD")},render:e=>{let{value:o,onChange:i,onBlur:r}=e;return l.createElement(t.Dropdown,{selected:1===(null==q?void 0:q.length)?q[0]:o,disable:1===(null==q?void 0:q.length)||w,option:q?q.sort((e,t)=>e.name.localeCompare(t.name)):[],select:e=>{i(e),re("ownerType",n,e)},optionKey:"i18nKey",t:b,onBlur:r})}}))),(null==te?void 0:te["ownerType"+n])&&(null==ee||null===(f=ee["ownerType"+n])||void 0===f?void 0:f.message)&&l.createElement(t.CardLabelError,{style:ae},null==ee||null===(E=ee["ownerType"+n])||void 0===E?void 0:E.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==M||null===(y=M[n])||void 0===y?void 0:y.isCoresAddr),name:"address"+n,onChange:e=>{var t;!0!==(null==M||null===(t=M[n])||void 0===t?void 0:t.isCoresAddr)&&re("permanentAddress",n,e.target.value)},value:null==M||null===(g=M[n])||void 0===g?void 0:g.permanentAddress}))))))}),ue?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>F(e=>[...e,{name:"",gender:"",mobileNumber:"",fatherOrHusbandName:"",relationship:"",ownershipCategory:R,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=D.errors)||void 0===h||null===(S=h.mulipleOwnerError)||void 0===S?void 0:S.message)||""))):null)},PropertyWaterConnection:e=>{var o,i,r,u,d,s,c,p,m,f,E,y;let{t:g,config:_,onSelect:h,formData:S,setError:b,clearErrors:T,...C}=e;const{control:A,register:D,formState:{errors:N},watch:I,setValue:O}=a.useForm({defaultValues:(null==S?void 0:S[_.key])||{useDetails:{propertyCategory:null,propertyType:null,WaterConnectionUsageType:null,noOfFloors:null,plotArea:"",builtUpArea:"",SelectYearofConstruction:null,NumberofDwellingUnits:"",NumberofRooms:"",hospitalBeds:""}}}),P=Digit.ULBService.getCurrentTenantId(),{data:w}=Digit.Hooks.pt.usePropertyMDMS(P,"PropertyTax",["PropertyCategory","PropertyType","NoOfFloors","PropertyNewUsageType"]),{data:L}=Digit.Hooks.ws.useMDMS(P,"ws-services-masters",["WsCategoryType"]),[R,x]=n.useState([]);n.useEffect(()=>{var e;const t=(null==L||null===(e=L["ws-services-masters"])||void 0===e?void 0:e.WsCategoryType)||[];t.forEach(e=>e.i18nKey=e.i18nKey||"WS_CATEGORY_"+e.code),x(t)},[L]);const M=window.location.href.includes("ws/old-application");n.useEffect(()=>{C.register&&C.register({name:"cpt"})},[C.register]);const F=I(),k=I("useDetails.categoryType"),U=I("useDetails.propertyType"),B=I("useDetails.propertyCategory"),j="HOSPITAL_NURSING_HOME"===(null==U?void 0:U.code)||"HospitalNursingHome"===(null==U?void 0:U.code),H="HOTEL_OR_RESTAURANT"===(null==U?void 0:U.code)||"HotelOrRestaurant"===(null==U?void 0:U.code),W=n.useMemo(()=>{const e=(new Date).getFullYear(),t=[];for(let n=e;n>=e-100;n--)t.push({value:n.toString(),name:n.toString()});return t},[]),z=n.useMemo(()=>{var e,t;let n=(null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.PropertyCategory)||void 0===t?void 0:t.filter(e=>e.active))||[];return null!=k&&k.code&&(n=n.filter(e=>e.type===k.code)),n.map(e=>({code:e.code,name:e.name}))},[w,k]);n.useEffect(()=>{k&&B&&(z.some(e=>e.code===B.code)||O("useDetails.propertyCategory",null))},[k,z,O,B]);const V=n.useMemo(()=>{var e,t;let n=(null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.PropertyType)||void 0===t?void 0:t.filter(e=>e.active))||[];var l;return null!=B&&B.code&&"MIXED"!==(null==B||null===(l=B.code)||void 0===l?void 0:l.toUpperCase())&&(n=n.filter(e=>{var t,n;return(null===(t=e.type)||void 0===t?void 0:t.toUpperCase())===(null===(n=B.code)||void 0===n?void 0:n.toUpperCase())})),n.map(e=>({code:e.code,name:e.name}))},[w,B]);n.useEffect(()=>{B&&U&&(V.some(e=>e.code===U.code)||O("useDetails.propertyType",null))},[B,V,O,U]);const $=n.useMemo(()=>{var e,t;return null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.PropertyNewUsageType)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name}))},[w]),Y=n.useMemo(()=>{var e,t;return null==w||null===(e=w.PropertyTax)||void 0===e||null===(t=e.NoOfFloors)||void 0===t?void 0:t.filter(e=>e.active).map(e=>({code:e.code,name:e.name}))},[w]),K=l.useRef(null);n.useEffect(()=>{v.isEqual(K.current,F)||(K.current=v.cloneDeep(F),h(_.key,F))},[F,_.key,h]),n.useEffect(()=>{var e;if(null!=S&&null!==(e=S.cpt)&&void 0!==e&&e.details){var t,n,l;const e=S.cpt.details,o=(null==e?void 0:e.additionalDetails)||{},i=o.categoryType||(null!==(t=e.usageCategory)&&void 0!==t&&t.includes("RESIDENTIAL")?"DOMESTIC":"NON_DOMESTIC");O("useDetails.categoryType",(null==R?void 0:R.find(e=>e.code===i))||null),O("useDetails.propertyCategory",(null==z?void 0:z.find(t=>t.code===(o.propertyCategory||e.usageCategory)))||null),O("useDetails.propertyType",(null==V?void 0:V.find(t=>t.code===(o.propertyType||e.propertyType)))||null),O("useDetails.WaterConnectionUsageType",(null==$?void 0:$.find(e=>e.code===o.waterConnectionUsageType))||null),O("useDetails.noOfFloors",(null==Y?void 0:Y.find(t=>{var n;const l=o.numberOfFloors,i=o.noOfFloors,r=null===(n=e.noOfFloors)||void 0===n?void 0:n.toString();return t.code===l||t.code===i||t.code===r||r&&t.code===r+"_FLOOR"}))||null),O("useDetails.plotArea",o.plotArea||(null==e||null===(n=e.landArea)||void 0===n?void 0:n.toString())||""),O("useDetails.builtUpArea",o.builtUpArea||(null==e||null===(l=e.superBuiltUpArea)||void 0===l?void 0:l.toString())||""),O("useDetails.SelectYearofConstruction",(null==W?void 0:W.find(e=>e.value===o.yearOfConstruction))||null),O("useDetails.NumberofDwellingUnits",o.numberOfDwellingUnits||o.noOfDwellingUnits||(null==e?void 0:e.noOfDwellingUnits)||""),O("useDetails.NumberofRooms",o.numberOfRooms||o.noOfRooms||(null==e?void 0:e.noOfRooms)||"")}else null===(null==S?void 0:S.cpt)&&(O("useDetails.categoryType",null),O("useDetails.propertyCategory",null),O("useDetails.propertyType",null),O("useDetails.WaterConnectionUsageType",null),O("useDetails.noOfFloors",null),O("useDetails.plotArea",""),O("useDetails.builtUpArea",""),O("useDetails.SelectYearofConstruction",null),O("useDetails.NumberofDwellingUnits",""),O("useDetails.NumberofRooms",""),O("useDetails.hospitalBeds",""))},[null==S||null===(o=S.cpt)||void 0===o?void 0:o.details,null==S?void 0:S.cpt,z,V,$,Y,W,R,O]);const q=l.useRef(null);n.useEffect(()=>{const e=Object.keys(N).length>0;q.current!==e&&(q.current=e,e?b(_.key,{type:"custom",message:"Validation failed"}):T(_.key))},[N,_.key,b,T]);const G={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(t.CollapsibleCardPage,{title:g("WS_PROPERTY_AND_WATER_CONNECTION_USE_DETAILS")+(null!=_&&_.isAutomaticFill?" (Automatic Fill by Property )":""),defaultOpen:null==_||!_.isAutomaticFill,style:C.style},l.createElement("div",{className:"formcomposer-section-grid"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_CATEGORY_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.categoryType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:R,optionKey:"i18nKey",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(i=N.useDetails)||void 0===i?void 0:i.categoryType)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.categoryType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_PROPERTY_CATEGORY")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.propertyCategory",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:z,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(r=N.useDetails)||void 0===r?void 0:r.propertyCategory)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.propertyCategory.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_PROPERTY_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.propertyType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:V,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(u=N.useDetails)||void 0===u?void 0:u.propertyType)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.propertyType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_WATER_CONNECTION_USAGE_TYPE")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.WaterConnectionUsageType",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:$,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(d=N.useDetails)||void 0===d?void 0:d.WaterConnectionUsageType)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.WaterConnectionUsageType.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_NUMBER_OF_FLOORS")),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.noOfFloors",render:e=>l.createElement(t.Dropdown,{option:Y,optionKey:"name",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(s=N.useDetails)||void 0===s?void 0:s.noOfFloors)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.noOfFloors.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_PLOT_AREA")),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:mo,message:g("ERR_INVALID_DECIMAL")}}),name:"useDetails.plotArea",disabled:M}))),(null==N||null===(c=N.useDetails)||void 0===c?void 0:c.plotArea)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.plotArea.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_BUILT_UP_AREA")),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:mo,message:g("ERR_INVALID_DECIMAL")}}),name:"useDetails.builtUpArea",disabled:M}))),(null==N||null===(p=N.useDetails)||void 0===p?void 0:p.builtUpArea)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.builtUpArea.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_SELECT_YEAR_OF_CONSTRUCTION")+"*"),l.createElement("div",{className:"form-field"},l.createElement(a.Controller,{control:A,name:"useDetails.SelectYearofConstruction",rules:{required:g("REQUIRED_FIELD")},render:e=>l.createElement(t.Dropdown,{option:W,optionKey:"value",selected:e.value,select:e.onChange,t:g,onBlur:e.onBlur,disable:M})}))),(null==N||null===(m=N.useDetails)||void 0===m?void 0:m.SelectYearofConstruction)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.SelectYearofConstruction.message),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,""+g("WS_NUMBER_OF_DWELLING_UNITS")),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:po,message:g("ERR_INVALID_NUMBER")}}),name:"useDetails.NumberofDwellingUnits",disabled:M}))),(null==N||null===(f=N.useDetails)||void 0===f?void 0:f.NumberofDwellingUnits)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.NumberofDwellingUnits.message),H?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_ROOMS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:po,message:g("ERR_INVALID_NUMBER")},required:!!H&&g("REQUIRED_FIELD")}),name:"useDetails.NumberofRooms",disabled:M}))):null,H&&(null==N||null===(E=N.useDetails)||void 0===E?void 0:E.NumberofRooms)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.NumberofRooms.message),j?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,g("WS_NUMBER_OF_BEDS")+"*"),l.createElement("div",{className:"form-field"},l.createElement(t.TextInput,{t:g,inputRef:D({pattern:{value:po,message:g("ERR_INVALID_NUMBER")},required:!!j&&g("REQUIRED_FIELD")}),name:"useDetails.hospitalBeds",disabled:M}))):null,j&&(null==N||null===(y=N.useDetails)||void 0===y?void 0:y.hospitalBeds)&&l.createElement(t.CardLabelError,{style:G},N.useDetails.hospitalBeds.message)))},CPTKnowYourProperty:e=>{var o,i;let{t:r,config:a,onSelect:u,formData:d}=e;const[s,c]=n.useState(null===(o=d)||void 0===o||null===(i=o.PropDetails)||void 0===i?void 0:i.KnowProperty);if(window.location.href.includes("/tl/tradelicence/edit-application/")||window.location.href.includes("/renew-trade/")){let e=JSON.parse(sessionStorage.getItem("EditFormData"));d={...d,...e}}return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(go,null):null,l.createElement(t.FormStep,{t:r,config:a,onSelect:function(){sessionStorage.setItem("KnowProperty",s.i18nKey),u(a.key,{KnowProperty:s})},onSkip:()=>u(),isDisabled:!s},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:s,onSelect:function(e){c(e)}})))},CPTPropertyDetails:e=>{var n,o,r,a,u,d,s,c,v,p,m,f,E,y,g,h,S,b,T,C,A,D,N,I,O,P,w,L,R,x,M,F,k,U,B,j,H,W,z,V,$,Y,K,q,G,Z,X,J,Q,ee,te,ne,le,oe,ie,re,ae,ue,de,se,ce,ve,pe,me,fe;let{t:Ee,config:ye,onSelect:ge,formData:_e}=e;const he=("YES"===(null===(n=_e)||void 0===n||null===(o=n.knowyourproperty)||void 0===o||null===(r=o.KnowProperty)||void 0===r?void 0:r.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(a=_e)||void 0===a||null===(u=a.cptSearchQuery)||void 0===u?void 0:u.city:null===(d=_e)||void 0===d||null===(s=d.cpt)||void 0===s||null===(c=s.details)||void 0===c?void 0:c.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"));_e={..._e,...e}}const{isLoading:Se,data:be}=Digit.Hooks.pt.usePropertySearch({filters:{propertyIds:null!==(v=_e)&&void 0!==v&&null!==(p=v.cptId)&&void 0!==p&&p.id||null!==(m=_e)&&void 0!==m&&null!==(f=m.cpt)&&void 0!==f&&null!==(E=f.details)&&void 0!==E&&E.propertyId?"YES"===(null===(y=_e)||void 0===y||null===(g=y.knowyourproperty)||void 0===g||null===(h=g.KnowProperty)||void 0===h?void 0:h.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(S=_e)||void 0===S||null===(b=S.cptId)||void 0===b?void 0:b.id:null===(T=_e)||void 0===T||null===(C=T.cpt)||void 0===C||null===(A=C.details)||void 0===A?void 0:A.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(D=_e)||void 0===D||null===(N=D.tradeLicenseDetail)||void 0===N||null===(I=N.additionalDetail)||void 0===I?void 0:I.propertyId:(null===(O=_e)||void 0===O||null===(P=O.cptId)||void 0===P?void 0:P.id)||(null===(w=_e)||void 0===w||null===(L=w.cpt)||void 0===L||null===(R=L.details)||void 0===R?void 0:R.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()},{filters:{propertyIds:null!==(x=_e)&&void 0!==x&&null!==(M=x.cptId)&&void 0!==M&&M.id||null!==(F=_e)&&void 0!==F&&null!==(k=F.cpt)&&void 0!==k&&null!==(U=k.details)&&void 0!==U&&U.propertyId?"YES"===(null===(B=_e)||void 0===B||null===(j=B.knowyourproperty)||void 0===j||null===(H=j.KnowProperty)||void 0===H?void 0:H.code)||"false"===sessionStorage.getItem("VisitedLightCreate")?null===(W=_e)||void 0===W||null===(z=W.cptId)||void 0===z?void 0:z.id:null===(V=_e)||void 0===V||null===($=V.cpt)||void 0===$||null===(Y=$.details)||void 0===Y?void 0:Y.propertyId:window.location.href.includes("/tl/tradelicence/edit-application")||window.location.href.includes("/renew-trade/")?null===(K=_e)||void 0===K||null===(q=K.tradeLicenseDetail)||void 0===q||null===(G=q.additionalDetail)||void 0===G?void 0:G.propertyId:(null===(Z=_e)||void 0===Z||null===(X=Z.cptId)||void 0===X?void 0:X.id)||(null===(J=_e)||void 0===J||null===(Q=J.cpt)||void 0===Q||null===(ee=Q.details)||void 0===ee?void 0:ee.propertyId)},tenantId:he,privacy:Digit.Utils.getPrivacyObject()}),Te=()=>{sessionStorage.setItem("cpt",null==be?void 0:be.Properties[0]),ge("cpt",{details:null==be?void 0:be.Properties[0]})},Ce=Array.isArray(null==be||null===(te=be.Properties)||void 0===te||null===(ne=te[0])||void 0===ne?void 0:ne.owners)?null==be||null===(le=be.Properties)||void 0===le||null===(oe=le[0])||void 0===oe?void 0:oe.owners.slice().reverse():[];let Ae=[];var De,Ne,Ie,Oe,Pe,we,Le,Re,xe,Me,Fe,ke,Ue,Be,je,He,We,ze,Ve,$e,Ye,Ke,qe,Ge,Ze,Xe,Je,Qe,et,tt,nt,lt,ot,it,rt;return be&&null!=be&&be.Properties.length&&(null!=be&&null!==(De=be.Properties[0])&&void 0!==De&&null!==(Ne=De.address)&&void 0!==Ne&&Ne.doorNo&&Ae.push(null==be||null===(je=be.Properties[0])||void 0===je||null===(He=je.address)||void 0===He?void 0:He.doorNo),(null!=be&&null!==(Ie=be.Properties[0])&&void 0!==Ie&&null!==(Oe=Ie.address)&&void 0!==Oe&&Oe.street||null!=be&&null!==(Pe=be.Properties[0])&&void 0!==Pe&&null!==(we=Pe.address)&&void 0!==we&&we.buildingName)&&Ae.push((null==be||null===(We=be.Properties[0])||void 0===We||null===(ze=We.address)||void 0===ze?void 0:ze.street)||(null==be||null===(Ve=be.Properties[0])||void 0===Ve||null===($e=Ve.address)||void 0===$e?void 0:$e.buildingName)),null!=be&&null!==(Le=be.Properties[0])&&void 0!==Le&&null!==(Re=Le.address)&&void 0!==Re&&Re.landmark&&Ae.push(null==be||null===(Ye=be.Properties[0])||void 0===Ye||null===(Ke=Ye.address)||void 0===Ke?void 0:Ke.landmark),null!=be&&null!==(xe=be.Properties[0])&&void 0!==xe&&null!==(Me=xe.address)&&void 0!==Me&&null!==(Fe=Me.locality)&&void 0!==Fe&&Fe.code&&Ae.push(Ee(Digit.Utils.pt.getMohallaLocale(null==be||null===(qe=be.Properties[0])||void 0===qe||null===(Ge=qe.address)||void 0===Ge||null===(Ze=Ge.locality)||void 0===Ze?void 0:Ze.code,null==be||null===(Xe=be.Properties[0])||void 0===Xe?void 0:Xe.tenantId))),null!=be&&null!==(ke=be.Properties[0])&&void 0!==ke&&ke.tenantId&&Ae.push(Ee(Digit.Utils.pt.getCityLocale(null==be||null===(Je=be.Properties[0])||void 0===Je?void 0:Je.tenantId))),null!=be&&null!==(Ue=be.Properties[0])&&void 0!==Ue&&null!==(Be=Ue.address)&&void 0!==Be&&Be.pincode&&Ae.push(null==be||null===(Qe=be.Properties[0])||void 0===Qe||null===(et=Qe.address)||void 0===et?void 0:et.pincode)),Se?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(go,{currentStep:window.location.href.includes("/ws/")?1:2,flow:window.location.href.includes("/ws/")?"WS":"",businessService:"WS"}):null,l.createElement(t.FormStep,{t:Ee,config:ye,onSelect:Te,onSkip:()=>ge()},be&&(null==be?void 0:be.Properties.length)&&l.createElement(l.Fragment,null,l.createElement(t.CardHeader,null,Ee("PT_DETAILS")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:Ee("PROPERTY_ID"),text:null==be||null===(ie=be.Properties[0])||void 0===ie?void 0:ie.propertyId}),l.createElement(t.Row,{className:"border-none",label:Ee("OWNER_NAME"),text:null==Ce||null===(re=Ce[0])||void 0===re?void 0:re.name}),l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:Ee("PROPERTY_ADDRESS"),text:Ae.join(", "),privacy:{uuid:null==be||null===(ae=be.Properties)||void 0===ae||null===(ue=ae[0])||void 0===ue||null===(de=ue.owners)||void 0===de||null===(se=de[0])||void 0===se?void 0:se.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==be||null===(ce=be.Properties[0])||void 0===ce?void 0:ce.tenantId,propertyIds:null==be||null===(ve=be.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:Ee("PT_MUTATION_STATUS"),text:Ee(null==be||null===(pe=be.Properties[0])||void 0===pe?void 0:pe.status)}),l.createElement("div",{style:{textAlign:"left"}},l.createElement(i.Link,{to:`/digit-ui/citizen/commonpt/view-property?propertyId=${null==be||null===(me=be.Properties[0])||void 0===me?void 0:me.propertyId}&tenantId=${null==be||null===(fe=be.Properties[0])||void 0===fe?void 0:fe.tenantId}`},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_VIEW_MORE_DETAILS")})),l.createElement(i.Link,{to:window.location.href.includes("/ws/modify-connection/")?`/digit-ui/citizen/ws/modify-connection/${null===(tt=_e)||void 0===tt?void 0:tt.tenantId}/search-property`:window.location.href.includes("/ws/edit-application/")?`/digit-ui/citizen/ws/edit-application/${null===(nt=_e)||void 0===nt?void 0:nt.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===(lt=_e)||void 0===lt?void 0:lt.applicationNumber}/${null===(ot=_e)||void 0===ot?void 0:ot.tenantId}/know-your-property`:window.location.href.includes("/edit-application/")?`/digit-ui/citizen/tl/tradelicence/edit-application/${null===(it=_e)||void 0===it?void 0:it.applicationNumber}/${null===(rt=_e)||void 0===rt?void 0:rt.tenantId}/know-your-property`:"/digit-ui/citizen/tl/tradelicence/new-application/know-your-property"},l.createElement(t.LinkButton,{style:{textAlign:"left"},label:Ee("PT_CHANGE_PROPERTY"),onClick:()=>{sessionStorage.setItem("changePropertySelected","yes"),sessionStorage.setItem("EditFormData",JSON.stringify(_e))}})))),l.createElement(t.SubmitBar,{style:{marginTop:"10px"},onSubmit:Te,label:Ee("CS_COMMON_NEXT")}))))},CPTPropertySearchNSummary:e=>{var r,a,u,d,s,c,p,m,f,E,y,g,_,h;let{onSelect:S,formData:b}=e;const{t:T}=o.useTranslation();i.useHistory();let{pathname:C,state:A}=i.useLocation();A=A&&("string"==typeof A||A instanceof String)?JSON.parse(A):A;const D=C.includes("/modify-application/"),N=Digit.ULBService.getCurrentTenantId(),I=window.location.href.includes("/employee/tl/new-application"),O=window.location.href.includes("/employee/tl/renew-application-details")||window.location.href.includes("/employee/tl/edit-application-details"),P=i.useLocation().search,w=new URLSearchParams(P).get("propertyId"),[L,R]=n.useState((null==b||null===(r=b.cptId)||void 0===r?void 0:r.id)||("null"!==w?w:"")||""),[x,M]=n.useState("null"!==w?w:""),[F,k]=n.useState(""),[U,B]=n.useState(""),[j,H]=n.useState(null),W=window.Digit.Utils.browser.isMobile(),z=null===(a=Digit.UserService.getUser())||void 0===a||null===(u=a.info)||void 0===u?void 0:u.mobileNumber,V="CITIZEN"===(null===(d=Digit.UserService.getUser())||void 0===d||null===(s=d.info)||void 0===s?void 0:s.type),$=window.location.href.includes("/ws/"),[Y,K]=n.useState((null==b||null===(c=b.cpt)||void 0===c?void 0:c.details)||null),q=V&&$?{mobileNumber:z}:U?{mobileNumber:U}:{propertyIds:x},{isLoading:G,error:Z,data:X}=Digit.Hooks.pt.usePropertySearch({filters:q,tenantId:N},{filters:q,tenantId:N,enabled:!!(V&&$&&z||!V&&(x||U)||V&&!$&&(x||U)),privacy:Digit.Utils.getPrivacyObject()});if(n.useEffect(()=>{L&&(window.location.href.includes("/renew-application-details/")||window.location.href.includes("/edit-application-details/"))&&M(L)},[L]),n.useEffect(()=>{0==G&&Z&&1==Z&&H({error:!0,label:"PT_ENTER_VALID_PROPERTY_ID"})},[Z,X]),n.useEffect(()=>{var e,t,n;const l=null==b||null===(e=b.cpt)||void 0===e||null===(t=e.details)||void 0===t?void 0:t.propertyId;if((null==X||null===(n=X.Properties)||void 0===n?void 0:n.length)>0){if(w&&(!Y||Y.propertyId!==w)){const e=X.Properties.find(e=>e.propertyId===w);if(e)return K(e),void(l!==w&&(S("cpt",{details:e}),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(e)),localStorage.setItem("pgrProperty",JSON.stringify(e))))}if(1===X.Properties.length&&!Y){const e=X.Properties[0].propertyId;K(X.Properties[0]),l!==e&&(S("cpt",{details:X.Properties[0]}),sessionStorage.setItem("Digit_FSM_PT",JSON.stringify(X.Properties[0])),localStorage.setItem("pgrProperty",JSON.stringify(X.Properties[0])))}}},[X,C,V,$,null==b||null===(p=b.cpt)||void 0===p||null===(m=p.details)||void 0===m?void 0:m.propertyId,w,Y]),D)return l.createElement(l.Fragment,null);let J="";const Q=Y||(1===(null==X||null===(f=X.Properties)||void 0===f?void 0:f.length)?null==X?void 0:X.Properties[0]:null);return Q&&(J=((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==Q?void 0:Q.address,T)),window.location.href.includes("/ws/"),l.createElement(l.Fragment,null,l.createElement(t.CollapsibleCardPage,{title:T("PT_PROPERTY_SEARCH"),defaultOpen:!0},(!window.location.href.includes("/tl/")||!("MOVABLE"===(null==b||null===(E=b.tradedetils)||void 0===E||null===(y=E[0])||void 0===y||null===(g=y.structureType)||void 0===g?void 0:g.code))&&(I||O))&&l.createElement(l.Fragment,null,Q?l.createElement(l.Fragment,null,l.createElement(t.Card,{className:"card-with-background",style:{boxShadow:"none"}},l.createElement(t.StatusTable,{style:{padding:"0",margin:"0"}},l.createElement("div",{className:"formcomposer-section-grid",style:{}},l.createElement(t.Row,{className:"border-none",labelStyle:W?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{color:"#000"},label:T("PROPERTY_ID"),text:null==Q?void 0:Q.propertyId}),l.createElement(t.Row,{className:"border-none",labelStyle:W?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{color:"#000"},label:T("OWNER_NAME"),text:(e=>{var t,n,l;const o=null==e||null===(t=e.owners)||void 0===t?void 0:t.filter(e=>null==e?void 0:e.active);return(null==o||null===(n=o.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===n||null===(l=n.map(e=>null==e?void 0:e.name))||void 0===l?void 0:l.join(","))||T("NA")})(Q)}),l.createElement(t.Row,{className:"border-none",labelStyle:W?{width:"40%"}:{width:"30%",color:"#505a5f",fontWeight:"600"},textStyle:{wordBreak:"break-word",color:"#000"},label:T("PROPERTY_ADDRESS"),text:J,privacy:{uuid:null==Q||null===(_=Q.owners)||void 0===_||null===(h=_[0])||void 0===h?void 0:h.uuid,fieldName:["doorNo","street","landmark"],model:"Property",showValue:!0,loadData:{serviceName:"/property-services/property/_search",requestBody:{},requestParam:{tenantId:null==Q?void 0:Q.tenantId,propertyIds:null==Q?void 0:Q.propertyId},jsonPath:"Properties[0].address.street",d:e=>(v.get(e,"Properties[0].address.doorNo")?v.get(e,"Properties[0].address.doorNo")+", ":"")+(v.get(e,"Properties[0].address.street")?v.get(e,"Properties[0].address.street")+", ":"")+(v.get(e,"Properties[0].address.landmark")?""+v.get(e,"Properties[0].address.landmark"):""),isArray:!1}}}))))):null,j&&l.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:j.error,warning:j.warning,label:T(j.label),onClose:()=>{H(null)}}))))},CPTSearchResults:Se,CPTCreateProperty:g,CPTAcknowledgement:T};exports.CommonPTComponents={CommonPTCard:_o,CommonPTModule:ho,CommonPTLinks:So},exports.CommonPTLinks=So,exports.CommonPTModule=ho,exports.initCommonPTComponents=()=>{Object.entries(bo).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};