@mseva/digit-ui-module-noc 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@mseva/digit-ui-react-components"),l=require("react"),n=e(l),i=require("react-router-dom"),o=require("react-i18next"),a=require("react-hook-form"),r=require("react-query"),u=require("redux"),d=require("react-redux"),s=e(require("exif-js"));function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}function m(e,t){if(null==e)return{};var l={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;l[n]=e[n]}return l}const v=e=>{if(e){const t=new Date(e);let l=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,n+"/"+l+"/"+i}return null},p=function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e},E=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const l=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],n=[],i=Digit.UserService.getUser().info.roles;return l.map((t,o)=>{let{roles:a}=t;a.map(t=>{i.map(i=>{var a;i.code===t&&n.push(e?null==l||null===(a=l[o])||void 0===a?void 0:a.code:null==l?void 0:l[o])})})}),n},f=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",i=(null==n?void 0:n.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o};var g=function(e,t){return e===t||e!=e&&t!=t},h=function(e,t){for(var l=e.length;l--;)if(g(e[l][0],t))return l;return-1},A=Array.prototype.splice;function S(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}S.prototype.clear=function(){this.__data__=[],this.size=0},S.prototype.delete=function(e){var t=this.__data__,l=h(t,e);return!(l<0||(l==t.length-1?t.pop():A.call(t,l,1),--this.size,0))},S.prototype.get=function(e){var t=this.__data__,l=h(t,e);return l<0?void 0:t[l][1]},S.prototype.has=function(e){return h(this.__data__,e)>-1},S.prototype.set=function(e,t){var l=this.__data__,n=h(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var N=S,b="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 y,D="object"==typeof b&&b&&b.Object===Object&&b,O="object"==typeof self&&self&&self.Object===Object&&self,L=D||O||Function("return this")(),T=L.Symbol,I=Object.prototype,w=I.hasOwnProperty,P=I.toString,R=T?T.toStringTag:void 0,x=Object.prototype.toString,F=T?T.toStringTag:void 0,B=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=w.call(e,R),l=e[R];try{e[R]=void 0;var n=!0}catch(e){}var i=P.call(e);return n&&(t?e[R]=l:delete e[R]),i}(e):function(e){return x.call(e)}(e)},M=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!M(e))return!1;var t=B(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},U=L["__core-js_shared__"],H=(y=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",W=Function.prototype.toString,j=function(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""},z=/^\[object .+?Constructor\]$/,V=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!M(e)||(t=e,H&&H in t))&&(k(e)?V:z).test(j(e));var t}(l)?l:void 0},q=G(L,"Map"),Y=G(Object,"create"),K=Object.prototype.hasOwnProperty,X=Object.prototype.hasOwnProperty;function Q(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}Q.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(Y){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return K.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:X.call(t,e)},Q.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this};var J=Q,Z=function(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map};function $(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}$.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(q||N),string:new J}},$.prototype.delete=function(e){var t=Z(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return Z(this,e).get(e)},$.prototype.has=function(e){return Z(this,e).has(e)},$.prototype.set=function(e,t){var l=Z(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var ee=$;function te(e){var t=this.__data__=new N(e);this.size=t.size}te.prototype.clear=function(){this.__data__=new N,this.size=0},te.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},te.prototype.get=function(e){return this.__data__.get(e)},te.prototype.has=function(e){return this.__data__.has(e)},te.prototype.set=function(e,t){var l=this.__data__;if(l instanceof N){var n=l.__data__;if(!q||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new ee(n)}return l.set(e,t),this.size=l.size,this};var le=te,ne=function(){try{var e=G(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ie=function(e,t,l){"__proto__"==t&&ne?ne(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},oe=Object.prototype.hasOwnProperty,ae=function(e,t,l){var n=e[t];oe.call(e,t)&&g(n,l)&&(void 0!==l||t in e)||ie(e,t,l)},re=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?ie(l,r,u):ae(l,r,u)}return l},ue=function(e){return null!=e&&"object"==typeof e},de=function(e){return ue(e)&&"[object Arguments]"==B(e)},se=Object.prototype,ce=se.hasOwnProperty,me=se.propertyIsEnumerable,ve=de(function(){return arguments}())?de:function(e){return ue(e)&&ce.call(e,"callee")&&!me.call(e,"callee")},pe=Array.isArray,Ee=function(){return!1},fe=C(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?L.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Ee}),_e=/^(?:0|[1-9]\d*)$/,ge=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&_e.test(e))&&e>-1&&e%1==0&&e<t},he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;var Se=function(e){return function(t){return e(t)}},Ne=C(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&D.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),be=Ne&&Ne.isTypedArray,Ce=be?Se(be):function(e){return ue(e)&&he(e.length)&&!!Ae[B(e)]},ye=Object.prototype.hasOwnProperty,De=function(e,t){var l=pe(e),n=!l&&ve(e),i=!l&&!n&&fe(e),o=!l&&!n&&!i&&Ce(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!ye.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ge(d,u))||r.push(d);return r},Oe=Object.prototype,Le=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)},Te=function(e,t){return function(l){return e(t(l))}},Ie=Te(Object.keys,Object),we=Object.prototype.hasOwnProperty,Pe=function(e){return null!=e&&he(e.length)&&!k(e)},Re=function(e){return Pe(e)?De(e):function(e){if(!Le(e))return Ie(e);var t=[];for(var l in Object(e))we.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},xe=Object.prototype.hasOwnProperty,Fe=function(e){return Pe(e)?De(e,!0):function(e){if(!M(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Le(e),l=[];for(var n in e)("constructor"!=n||!t&&xe.call(e,n))&&l.push(n);return l}(e)},Be=C(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?L.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Me=function(){return[]},ke=Object.prototype.propertyIsEnumerable,Ue=Object.getOwnPropertySymbols,He=Ue?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];ke.call(e,r)&&(a[o++]=r)}return a}(Ue(e)))}:Me,We=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},je=Te(Object.getPrototypeOf,Object),ze=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)We(t,He(e)),e=je(e);return t}:Me,Ve=function(e,t,l){var n=t(e);return pe(e)?n:We(n,l(e))},Ge=function(e){return Ve(e,Re,He)},qe=function(e){return Ve(e,Fe,ze)},Ye=G(L,"DataView"),Ke=G(L,"Promise"),Xe=G(L,"Set"),Qe=G(L,"WeakMap"),Je=j(Ye),Ze=j(q),$e=j(Ke),et=j(Xe),tt=j(Qe),lt=B;(Ye&&"[object DataView]"!=lt(new Ye(new ArrayBuffer(1)))||q&&"[object Map]"!=lt(new q)||Ke&&"[object Promise]"!=lt(Ke.resolve())||Xe&&"[object Set]"!=lt(new Xe)||Qe&&"[object WeakMap]"!=lt(new Qe))&&(lt=function(e){var t=B(e),l="[object Object]"==t?e.constructor:void 0,n=l?j(l):"";if(n)switch(n){case Je:return"[object DataView]";case Ze:return"[object Map]";case $e:return"[object Promise]";case et:return"[object Set]";case tt:return"[object WeakMap]"}return t});var nt=lt,it=Object.prototype.hasOwnProperty,ot=L.Uint8Array,at=function(e){var t=new e.constructor(e.byteLength);return new ot(t).set(new ot(e)),t},rt=/\w*$/,ut=T?T.prototype:void 0,dt=ut?ut.valueOf:void 0,st=Object.create,ct=function(){function e(){}return function(t){if(!M(t))return{};if(st)return st(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),mt=Ne&&Ne.isMap,vt=mt?Se(mt):function(e){return ue(e)&&"[object Map]"==nt(e)},pt=Ne&&Ne.isSet,Et=pt?Se(pt):function(e){return ue(e)&&"[object Set]"==nt(e)},ft={};ft["[object Arguments]"]=ft["[object Array]"]=ft["[object ArrayBuffer]"]=ft["[object DataView]"]=ft["[object Boolean]"]=ft["[object Date]"]=ft["[object Float32Array]"]=ft["[object Float64Array]"]=ft["[object Int8Array]"]=ft["[object Int16Array]"]=ft["[object Int32Array]"]=ft["[object Map]"]=ft["[object Number]"]=ft["[object Object]"]=ft["[object RegExp]"]=ft["[object Set]"]=ft["[object String]"]=ft["[object Symbol]"]=ft["[object Uint8Array]"]=ft["[object Uint8ClampedArray]"]=ft["[object Uint16Array]"]=ft["[object Uint32Array]"]=!0,ft["[object Error]"]=ft["[object Function]"]=ft["[object WeakMap]"]=!1;var _t=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!M(t))return t;var c=pe(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&it.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!u)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var m=nt(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(fe(t))return Be(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!o){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||Le(e)?{}:ct(je(e))}(t),!u)return d?function(e,t){return re(e,ze(e),t)}(t,function(e,t){return e&&re(t,Fe(t),e)}(r,t)):function(e,t){return re(e,He(e),t)}(t,function(e,t){return e&&re(t,Re(t),e)}(r,t))}else{if(!ft[m])return o?t:{};r=function(e,t,l){var n,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return at(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var l=t?at(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);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 l=t?at(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(n=e).constructor(n.source,rt.exec(n))).lastIndex=n.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return dt?Object(dt.call(e)):{}}}(t,m,u)}}a||(a=new le);var p=a.get(t);if(p)return p;a.set(t,r),Et(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):vt(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?qe:Ge:d?Fe:Re)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),ae(r,o,e(i,l,n,o,t,a))}),r},gt=function(e){return _t(e,5)},ht=C(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",E="[object RegExp]",f="[object Set]",_="[object String]",g="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",C="[object Float64Array]",y="[object Int8Array]",D="[object Int16Array]",O="[object Int32Array]",L="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,P=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,B=RegExp(x.source),M=RegExp(F.source),k=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),q=/^\s+/,Y=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,$=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\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",me="["+ce+"]",ve="["+se+"]",pe="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",fe="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ne="(?:"+Ee+"|"+fe+")",be="(?:"+Se+"|"+fe+")",Ce="(?:"+ve+"|"+_e+")?",ye="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+ye,Oe="(?:"+[ge+ve+"?",ve,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Le=RegExp("['’]","g"),Te=RegExp(ve,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Oe+ye,"g"),we=RegExp([Se+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,Se,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,Se+Ne,"$"].join("|")+")",Se+"?"+Ne+"+(?:['’](?: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_])",pe,De].join("|"),"g"),Pe=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"],Fe=-1,Be={};Be[N]=Be[C]=Be[y]=Be[D]=Be[O]=Be[L]=Be["[object Uint8ClampedArray]"]=Be[T]=Be[I]=!0,Be[o]=Be[a]=Be[A]=Be[r]=Be[S]=Be[u]=Be[d]=Be[s]=Be[m]=Be[v]=Be[p]=Be[E]=Be[f]=Be[_]=Be[h]=!1;var Me={};Me[o]=Me[a]=Me[A]=Me[S]=Me[r]=Me[u]=Me[N]=Me[C]=Me[y]=Me[D]=Me[O]=Me[m]=Me[v]=Me[p]=Me[E]=Me[f]=Me[_]=Me[g]=Me[L]=Me["[object Uint8ClampedArray]"]=Me[T]=Me[I]=!0,Me[d]=Me[s]=Me[h]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,We="object"==typeof b&&b&&b.Object===Object&&b,je="object"==typeof self&&self&&self.Object===Object&&self,ze=We||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,qe=Ge&&Ge.exports===Ve,Ye=qe&&We.process,Ke=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,Qe=Ke&&Ke.isDate,Je=Ke&&Ke.isMap,Ze=Ke&&Ke.isRegExp,$e=Ke&&Ke.isSet,et=Ke&&Ke.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function mt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function vt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var pt=St("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,ht,l)}function gt(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function ht(e){return e!=e}function At(e,t){var l=null==e?0:e.length;return l?Ct(e,t)/l:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Nt(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Ct(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function yt(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(q,""):e}function Ot(e){return function(t){return e(t)}}function Lt(e,t){return dt(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function It(e,t){for(var l=-1,n=e.length;++l<n&&_t(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length;l--&&_t(t,e[l],0)>-1;);return l}function Pt(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Rt=Nt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xt=Nt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ft(e){return"\\"+ke[e]}function Bt(e){return Pe.test(e)}function Mt(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function kt(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Bt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Bt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var Gt=Nt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),qt=function e(t){var b=(t=null==t?ze:qt.defaults(ze.Object(),t,qt.pick(ze,xe))).Array,Y=t.Date,se=t.Error,ce=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,_e=b.prototype,ge=ve.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Se=ge.hasOwnProperty,Ne=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,ye=Ae.call(ve),De=ze._,Oe=pe("^"+Ae.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=qe?t.Buffer:void 0,Pe=t.Symbol,ke=t.Uint8Array,We=Ie?Ie.allocUnsafe:void 0,je=kt(ve.getPrototypeOf,ve),Ve=ve.create,Ge=ge.propertyIsEnumerable,Ye=_e.splice,Ke=Pe?Pe.isConcatSpreadable:void 0,pt=Pe?Pe.iterator:void 0,Nt=Pe?Pe.toStringTag:void 0,Yt=function(){try{var e=Ji(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=Y&&Y.now!==ze.Date.now&&Y.now,Qt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=me.ceil,Zt=me.floor,$t=ve.getOwnPropertySymbols,el=Ie?Ie.isBuffer:void 0,tl=t.isFinite,ll=_e.join,nl=kt(ve.keys,ve),il=me.max,ol=me.min,al=Y.now,rl=t.parseInt,ul=me.random,dl=_e.reverse,sl=Ji(t,"DataView"),cl=Ji(t,"Map"),ml=Ji(t,"Promise"),vl=Ji(t,"Set"),pl=Ji(t,"WeakMap"),El=Ji(ve,"create"),fl=pl&&new pl,_l={},gl=Oo(sl),hl=Oo(cl),Al=Oo(ml),Sl=Oo(vl),Nl=Oo(pl),bl=Pe?Pe.prototype:void 0,Cl=bl?bl.valueOf:void 0,yl=bl?bl.toString:void 0;function Dl(e){if(Va(e)&&!Ra(e)&&!(e instanceof Il)){if(e instanceof Tl)return e;if(Se.call(e,"__wrapped__"))return Lo(e)}return new Tl(e)}var Ol=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Ll(){}function Tl(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Il(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function wl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Pl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function xl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Rl;++t<l;)this.add(e[t])}function Fl(e){var t=this.__data__=new Pl(e);this.size=t.size}function Bl(e,t){var l=Ra(e),n=!l&&Pa(e),i=!l&&!n&&Ma(e),o=!l&&!n&&!i&&Za(e),a=l||n||i||o,r=a?yt(e.length,Ee):[],u=r.length;for(var d in e)!t&&!Se.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function Ml(e){var t=e.length;return t?e[xn(0,t-1)]:void 0}function kl(e,t){return No(Ei(e),Yl(t,0,e.length))}function Ul(e){return No(Ei(e))}function Hl(e,t,l){(void 0!==l&&!Ta(e[t],l)||void 0===l&&!(t in e))&&Gl(e,t,l)}function Wl(e,t,l){var n=e[t];Se.call(e,t)&&Ta(n,l)&&(void 0!==l||t in e)||Gl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ta(e[l][0],t))return l;return-1}function zl(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function Vl(e,t){return e&&fi(t,Ar(t),e)}function Gl(e,t,l){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function ql(e,t){for(var l=-1,n=t.length,i=b(n),o=null==e;++l<n;)i[l]=o?void 0:Er(e,t[l]);return i}function Yl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function Kl(e,t,l,n,i,a){var d,h=1&t,b=2&t,w=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!za(e))return e;var P=Ra(e);if(P){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return Ei(e,d)}else{var R=eo(e),x=R==s||R==c;if(Ma(e))return di(e,h);if(R==p||R==o||x&&!i){if(d=b||x?{}:lo(e),!h)return b?function(e,t){return fi(e,$i(e),t)}(e,function(e,t){return e&&fi(t,Sr(t),e)}(d,e)):function(e,t){return fi(e,Zi(e),t)}(e,Vl(d,e))}else{if(!Me[R])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case A:return si(e);case r:case u:return new n(+e);case S:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case N:case C:case y:case D:case O:case L:case"[object Uint8ClampedArray]":case T:case I:return ci(e,l);case m:return new n;case v:case _:return new n(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case f:return new n;case g:return Cl?ve(Cl.call(e)):{}}}(e,R,h)}}a||(a=new Fl);var F=a.get(e);if(F)return F;a.set(e,d),Xa(e)?e.forEach(function(n){d.add(Kl(n,t,l,n,e,a))}):Ga(e)&&e.forEach(function(n,i){d.set(i,Kl(n,t,l,i,e,a))});var B=P?void 0:(w?b?Vi:zi:b?Sr:Ar)(e);return nt(B||e,function(n,i){B&&(n=e[i=n]),Wl(d,i,Kl(n,t,l,i,e,a))}),d}function Xl(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Ql(e,t,n){if("function"!=typeof e)throw new fe(l);return go(function(){e.apply(void 0,n)},t)}function Jl(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Ot(l))),n?(o=ut,a=!1):t.length>=200&&(o=Tt,a=!1,t=new xl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var m=d;m--;)if(t[m]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Dl.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Dl}},(Dl.prototype=Ll.prototype).constructor=Dl,(Tl.prototype=Ol(Ll.prototype)).constructor=Tl,(Il.prototype=Ol(Ll.prototype)).constructor=Il,wl.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},wl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wl.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return Se.call(t,e)?t[e]:void 0},wl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:Se.call(t,e)},wl.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=El&&void 0===t?"__lodash_hash_undefined__":t,this},Pl.prototype.clear=function(){this.__data__=[],this.size=0},Pl.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():Ye.call(t,l,1),--this.size,0))},Pl.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},Pl.prototype.has=function(e){return jl(this.__data__,e)>-1},Pl.prototype.set=function(e,t){var l=this.__data__,n=jl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Rl.prototype.clear=function(){this.size=0,this.__data__={hash:new wl,map:new(cl||Pl),string:new wl}},Rl.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return Xi(this,e).get(e)},Rl.prototype.has=function(e){return Xi(this,e).has(e)},Rl.prototype.set=function(e,t){var l=Xi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},xl.prototype.add=xl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},xl.prototype.has=function(e){return this.__data__.has(e)},Fl.prototype.clear=function(){this.__data__=new Pl,this.size=0},Fl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},Fl.prototype.get=function(e){return this.__data__.get(e)},Fl.prototype.has=function(e){return this.__data__.has(e)},Fl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Pl){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Rl(n)}return l.set(e,t),this.size=l.size,this};var Zl=hi(rn),$l=hi(un,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Ai(),an=Ai(!0);function rn(e,t){return e&&on(e,t,Ar)}function un(e,t){return e&&an(e,t,Ar)}function dn(e,t){return at(t,function(t){return Ha(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[Do(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return Ra(e)?n:st(n,l(e))}function mn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Nt&&Nt in ve(e)?function(e){var t=Se.call(e,Nt),l=e[Nt];try{e[Nt]=void 0;var n=!0}catch(e){}var i=Ce.call(e);return n&&(t?e[Nt]=l:delete e[Nt]),i}(e):function(e){return Ce.call(e)}(e)}function vn(e,t){return e>t}function pn(e,t){return null!=e&&Se.call(e,t)}function En(e,t){return null!=e&&t in ve(e)}function fn(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=b(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Ot(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new xl(a&&s):void 0}s=e[0];var c=-1,m=r[0];e:for(;++c<i&&d.length<u;){var v=s[c],p=t?t(v):v;if(v=l||0!==v?v:0,!(m?Tt(m,p):n(d,p,l))){for(a=o;--a;){var E=r[a];if(!(E?Tt(E,p):n(e[a],p,l)))continue e}m&&m.push(p),d.push(v)}}return d}function _n(e,t,l){var n=null==(e=po(e,t=oi(t,e)))?e:e[Do(Uo(t))];return null==n?void 0:tt(n,e,l)}function gn(e){return Va(e)&&mn(e)==o}function hn(e,t,l,n,i){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=Ra(e),h=Ra(t),N=c?a:eo(e),b=h?a:eo(t),C=(N=N==o?p:N)==p,y=(b=b==o?p:b)==p,D=N==b;if(D&&Ma(e)){if(!Ma(t))return!1;c=!0,C=!1}if(D&&!C)return s||(s=new Fl),c||Za(e)?Wi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new ke(e),new ke(t)));case r:case u:case v:return Ta(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case _:return e==t+"";case m:var s=Mt;case f:if(s||(s=Ht),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var p=Wi(s(e),s(t),n,i,o,a);return a.delete(e),p;case g:if(Cl)return Cl.call(e)==Cl.call(t)}return!1}(e,t,N,l,n,i,s);if(!(1&l)){var O=C&&Se.call(e,"__wrapped__"),L=y&&Se.call(t,"__wrapped__");if(O||L){var T=O?e.value():e,I=L?t.value():t;return s||(s=new Fl),i(T,I,l,n,s)}}return!!D&&(s||(s=new Fl),function(e,t,l,n,i,o){var a=1&l,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Se.call(t,s)))return!1}var c=o.get(e),m=o.get(t);if(c&&m)return c==t&&m==e;var v=!0;o.set(e,t),o.set(t,e);for(var p=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var _=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===_?E===f||i(E,f,l,n,o):_)){v=!1;break}p||(p="constructor"==s)}if(v&&!p){var g=e.constructor,h=t.constructor;g==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof h&&h instanceof h||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,s))}(e,t,l,n,hn,i))}function An(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=ve(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Fl;if(n)var m=n(d,s,u,e,t,c);if(!(void 0===m?hn(s,d,3,n,c):m))return!1}}return!0}function Sn(e){return!(!za(e)||(t=e,be&&be in t))&&(Ha(e)?Oe:ie).test(Oo(e));var t}function Nn(e){return"function"==typeof e?e:null==e?qr:"object"==typeof e?Ra(e)?On(e[0],e[1]):Dn(e):tu(e)}function bn(e){if(!so(e))return nl(e);var t=[];for(var l in ve(e))Se.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Cn(e,t){return e<t}function yn(e,t){var l=-1,n=Fa(e)?b(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Dn(e){var t=Qi(e);return 1==t.length&&t[0][2]?mo(t[0][0],t[0][1]):function(l){return l===e||An(l,e,t)}}function On(e,t){return ao(e)&&co(t)?mo(Do(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?fr(l,e):hn(t,n,3)}}function Ln(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new Fl),za(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),u=fo(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var m=Ra(u),v=!m&&Ma(u),p=!m&&!v&&Za(u);s=u,m||v||p?Ra(r)?s=r:Ba(r)?s=Ei(r):v?(c=!1,s=di(u,!0)):p?(c=!1,s=ci(u,!0)):s=[]:Ya(u)||Pa(u)?(s=r,Pa(r)?s=ar(r):za(r)&&!Ha(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,Ln,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hl(e,a,r)}},Sr)}function Tn(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function In(e,t,l){t=t.length?dt(t,function(e){return Ra(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[qr];var n=-1;return t=dt(t,Ot(Ki())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=mi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(yn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function wn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function Pn(e,t,l,n){var i=n?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=dt(e,Ot(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&Ye.call(r,u,1),Ye.call(e,u,1);return e}function Rn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?Ye.call(e,i,1):Jn(e,i)}}return e}function xn(e,t){return e+Zt(ul()*(t-e+1))}function Fn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Bn(e,t){return ho(vo(e,t,qr),e+"")}function Mn(e){return Ml(Tr(e))}function kn(e,t){var l=Tr(e);return No(l,Yl(t,0,l.length))}function Un(e,t,l,n){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=za(s)?s:io(t[i+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=fl?function(e,t){return fl.set(e,t),e}:qr,Wn=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:qr;function jn(e){return No(Tr(e))}function zn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=b(i);++n<i;)o[n]=e[n+t];return o}function Vn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Gn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Ja(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return qn(e,t,qr,l)}function qn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Ja(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),m=void 0!==c,v=null===c,p=c==c,E=Ja(c);if(a)var f=n||p;else f=d?p&&(n||m):r?p&&m&&(n||!v):u?p&&m&&!v&&(n||!E):!v&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function Yn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ta(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Kn(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xn(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,Xn)+"";if(Ja(e))return yl?yl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Qn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:Fi(e);if(d)return Ht(d);a=!1,i=Tt,u=new xl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var m=u.length;m--;)if(u[m]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Jn(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[Do(Uo(t))]}function Zn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function $n(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?zn(e,n?0:o,n?o+1:i):zn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Il&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Qn(e[0]):[];for(var i=-1,o=b(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Jl(o[i]||a,e[r],t,l));return Qn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ba(e)?e:[]}function ii(e){return"function"==typeof e?e:qr}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:yo(rr(e))}var ai=Bn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:zn(e,t,l)}var ui=Kt||function(e){return ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=We?We(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function mi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,u=t==t,d=Ja(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function vi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=b(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function pi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=b(s+d),m=!n;++i<s;)c[i]=e[i];for(var v=i;++u<d;)c[v+u]=t[u];for(;++a<r;)(m||i<o)&&(c[v+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=b(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?Gl(l,r,u):Wl(l,r,u)}return l}function _i(e,t){return function(l,n){var i=Ra(l)?lt:zl,o=t?t():{};return i(l,e,Ki(n,2),o)}}function gi(e){return Bn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function hi(e,t){return function(l,n){if(null==l)return l;if(!Fa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=ve(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Ai(e){return function(t,l,n){for(var i=-1,o=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function Si(e){return function(t){var l=Bt(t=rr(t))?zt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function Ni(e){return function(t){return ct(Hr(Pr(t).replace(Le,"")),e,"")}}function bi(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 l=Ol(e.prototype),n=e.apply(l,t);return za(n)?n:l}}function Ci(e){return function(t,l,n){var i=ve(t);if(!Fa(t)){var o=Ki(l,3);t=Ar(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function yi(e){return ji(function(t){var n=t.length,i=n,o=Tl.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==qi(a))var r=new Tl([],!0)}for(i=r?i:n;++i<n;){var u=qi(a=t[i]),d="wrapper"==u?Gi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[qi(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&Ra(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Di(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,m=2&t,v=24&t,p=512&t,E=m?void 0:bi(e);return function f(){for(var _=arguments.length,g=b(_),h=_;h--;)g[h]=arguments[h];if(v)var A=Yi(f),S=Pt(g,A);if(n&&(g=vi(g,n,i,v)),o&&(g=pi(g,o,a,v)),_-=S,v&&_<d){var N=Ut(g,A);return Ri(e,t,Di,f.placeholder,l,g,N,r,u,d-_)}var C=c?l:this,y=m?C[e]:e;return _=g.length,r?g=Eo(g,r):p&&_>1&&g.reverse(),s&&u<_&&(g.length=u),this&&this!==ze&&this instanceof f&&(y=E||bi(y)),y.apply(C,g)}}function Oi(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Li(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=Xn(l),n=Xn(n)):(l=Kn(l),n=Kn(n)),i=e(l,n)}return i}}function Ti(e){return ji(function(t){return t=dt(t,Ot(Ki())),Bn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Ii(e,t){var l=(t=void 0===t?" ":Xn(t)).length;if(l<2)return l?Fn(t,e):t;var n=Fn(t,Jt(e/jt(t)));return Bt(t)?ri(zt(n),0,e).join(""):n.slice(0,e)}function wi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l,n){for(var i=-1,o=il(Jt((t-e)/(l||1)),0),a=b(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function Pi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=or(t),l=or(l)),e(t,l)}}function Ri(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],m=l.apply(void 0,c);return ro(e)&&_o(m,c),m.placeholder=n,Ao(m,e,t)}function xi(e){var t=me[e];return function(e,l){if(e=or(e),(l=null==l?0:ol(nr(l),292))&&tl(e)){var n=(rr(e)+"e").split("e");return+((n=(rr(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var Fi=vl&&1/Ht(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:Jr;function Bi(e){return function(t){var l=eo(t);return l==m?Mt(t):l==f?Wt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var m=o,v=a;o=a=void 0}var p=s?void 0:Gi(e),E=[e,t,i,o,a,m,v,r,u,d];if(p&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,p),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=bi(e);return function i(){for(var o=arguments.length,a=b(o),r=o,u=Yi(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Ri(e,t,Di,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==ze&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Di.apply(void 0,E):function(e,t,l,n){var i=1&t,o=bi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=b(d+r),c=this&&this!==ze&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var f=function(e,t,l){var n=1&t,i=bi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return Ao((p?Hn:_o)(f,E),e,t)}function ki(e,t,l,n){return void 0===e||Ta(e,ge[l])&&!Se.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return za(e)&&za(t)&&(o.set(t,e),Ln(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return Ya(e)?void 0:e}function Wi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,m=!0,v=2&l?new xl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],E=t[c];if(n)var f=a?n(E,p,c,t,e,o):n(p,E,c,e,t,o);if(void 0!==f){if(f)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Tt(v,t)&&(p===e||i(p,e,l,n,o)))return v.push(t)})){m=!1;break}}else if(p!==E&&!i(p,E,l,n,o)){m=!1;break}}return o.delete(e),o.delete(t),m}function ji(e){return ho(vo(e,void 0,xo),e+"")}function zi(e){return cn(e,Ar,Zi)}function Vi(e){return cn(e,Sr,$i)}var Gi=fl?function(e){return fl.get(e)}:Jr;function qi(e){for(var t=e.name+"",l=_l[t],n=Se.call(_l,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function Yi(e){return(Se.call(Dl,"placeholder")?Dl:e).placeholder}function Ki(){var e=Dl.iteratee||Yr;return e=e===Yr?Nn:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map}function Qi(e){for(var t=Ar(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Ji(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return Sn(l)?l:void 0}var Zi=$t?function(e){return null==e?[]:(e=ve(e),at($t(e),function(t){return Ge.call(e,t)}))}:iu,$i=$t?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:iu,eo=mn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=Do(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Ra(e)||Pa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Ol(je(e))}function no(e){return Ra(e)||Pa(e)||!!(Ke&&e&&e[Ke])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!za(l))return!1;var n=typeof t;return!!("number"==n?Fa(l)&&io(t,l.length):"string"==n&&t in l)&&Ta(l[t],e)}function ao(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Ja(e))||j.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ro(e){var t=qi(e),l=Dl[t];if("function"!=typeof l||!(t in Il.prototype))return!1;if(e===l)return!0;var n=Gi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=S||cl&&eo(new cl)!=m||ml&&"[object Promise]"!=eo(ml.resolve())||vl&&eo(new vl)!=f||pl&&eo(new pl)!=h)&&(eo=function(e){var t=mn(e),l=t==p?e.constructor:void 0,n=l?Oo(l):"";if(n)switch(n){case gl:return S;case hl:return m;case Al:return"[object Promise]";case Sl:return f;case Nl:return h}return t});var uo=he?Ha:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!za(e)}function mo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=b(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=b(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sn(e,zn(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=So(Hn),go=Qt||function(e,t){return ze.setTimeout(e,t)},ho=So(Wn);function Ao(e,t,l){var n=t+"";return ho(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Q):[]}(n),l)))}function So(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function No(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=xn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var bo,Co,yo=(bo=ba(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,l,n,i){t.push(n?i.replace($,"$1"):l||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=bo.cache,bo);function Do(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Oo(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Lo(e){if(e instanceof Il)return e.clone();var t=new Tl(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=Bn(function(e,t){return Ba(e)?Jl(e,nn(t,1,Ba,!0)):[]}),Io=Bn(function(e,t){var l=Uo(t);return Ba(l)&&(l=void 0),Ba(e)?Jl(e,nn(t,1,Ba,!0),Ki(l,2)):[]}),wo=Bn(function(e,t){var l=Uo(t);return Ba(l)&&(l=void 0),Ba(e)?Jl(e,nn(t,1,Ba,!0),void 0,l):[]});function Po(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),ft(e,Ki(t,3),i)}function Ro(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=nr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,Ki(t,3),i,!0)}function xo(e){return null!=e&&e.length?nn(e,1):[]}function Fo(e){return e&&e.length?e[0]:void 0}var Bo=Bn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),Mo=Bn(function(e){var t=Uo(e),l=dt(e,ni);return t===Uo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,Ki(t,2)):[]}),ko=Bn(function(e){var t=Uo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Bn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Pn(e,t):e}var jo=ji(function(e,t){var l=null==e?0:e.length,n=ql(e,t);return Rn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(mi)),n});function zo(e){return null==e?e:dl.call(e)}var Vo=Bn(function(e){return Qn(nn(e,1,Ba,!0))}),Go=Bn(function(e){var t=Uo(e);return Ba(t)&&(t=void 0),Qn(nn(e,1,Ba,!0),Ki(t,2))}),qo=Bn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Qn(nn(e,1,Ba,!0),void 0,t)});function Yo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=il(e.length,t),!0}),yt(t,function(t){return dt(e,St(t))})}function Ko(e,t){if(!e||!e.length)return[];var l=Yo(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var Xo=Bn(function(e,t){return Ba(e)?Jl(e,t):[]}),Qo=Bn(function(e){return ti(at(e,Ba))}),Jo=Bn(function(e){var t=Uo(e);return Ba(t)&&(t=void 0),ti(at(e,Ba),Ki(t,2))}),Zo=Bn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ba),void 0,t)}),$o=Bn(Yo),ea=Bn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Ko(e,l)});function ta(e){var t=Dl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return ql(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Il&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new Tl(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=_i(function(e,t,l){Se.call(e,l)?++e[l]:Gl(e,l,1)}),oa=Ci(Po),aa=Ci(Ro);function ra(e,t){return(Ra(e)?nt:Zl)(e,Ki(t,3))}function ua(e,t){return(Ra(e)?it:$l)(e,Ki(t,3))}var da=_i(function(e,t,l){Se.call(e,l)?e[l].push(t):Gl(e,l,[t])}),sa=Bn(function(e,t,l){var n=-1,i="function"==typeof t,o=Fa(e)?b(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):_n(e,t,l)}),o}),ca=_i(function(e,t,l){Gl(e,l,t)});function ma(e,t){return(Ra(e)?dt:yn)(e,Ki(t,3))}var va=_i(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),pa=Bn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),In(e,nn(t,1),[])}),Ea=Xt||function(){return ze.Date.now()};function fa(e,t,l){return t=l?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=nr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ga=Bn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,Yi(ga));n|=32}return Mi(e,n,t,l,i)}),ha=Bn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,Yi(ha));n|=32}return Mi(t,n,e,l,i)});function Aa(e,t,n){var i,o,a,r,u,d,s=0,c=!1,m=!1,v=!0;if("function"!=typeof e)throw new fe(l);function p(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=go(_,t),c?p(e):r}function f(e){var l=e-d;return void 0===d||l>=t||l<0||m&&e-s>=a}function _(){var e=Ea();if(f(e))return g(e);u=go(_,function(e){var l=t-(e-d);return m?ol(l,a-(e-s)):l}(e))}function g(e){return u=void 0,v&&i?p(e):(i=o=void 0,r)}function h(){var e=Ea(),l=f(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(m)return ui(u),u=go(_,t),p(d)}return void 0===u&&(u=go(_,t)),r}return t=or(t)||0,za(n)&&(c=!!n.leading,a=(m="maxWait"in n)?il(or(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),h.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},h.flush=function(){return void 0===u?r:g(Ea())},h}var Sa=Bn(function(e,t){return Ql(e,1,t)}),Na=Bn(function(e,t,l){return Ql(e,or(t)||0,l)});function ba(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(ba.Cache||Rl),n}function Ca(e){if("function"!=typeof e)throw new fe(l);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)}}ba.Cache=Rl;var ya=ai(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Ot(Ki())):dt(nn(t,1),Ot(Ki()))).length;return Bn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Da=Bn(function(e,t){return Mi(e,32,void 0,t,Ut(t,Yi(Da)))}),Oa=Bn(function(e,t){return Mi(e,64,void 0,t,Ut(t,Yi(Oa)))}),La=ji(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=Pi(vn),wa=Pi(function(e,t){return e>=t}),Pa=gn(function(){return arguments}())?gn:function(e){return Va(e)&&Se.call(e,"callee")&&!Ge.call(e,"callee")},Ra=b.isArray,xa=Xe?Ot(Xe):function(e){return Va(e)&&mn(e)==A};function Fa(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ba(e){return Va(e)&&Fa(e)}var Ma=el||ou,ka=Qe?Ot(Qe):function(e){return Va(e)&&mn(e)==u};function Ua(e){if(!Va(e))return!1;var t=mn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(e)}function Ha(e){if(!za(e))return!1;var t=mn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==nr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Je?Ot(Je):function(e){return Va(e)&&eo(e)==m};function qa(e){return"number"==typeof e||Va(e)&&mn(e)==v}function Ya(e){if(!Va(e)||mn(e)!=p)return!1;var t=je(e);if(null===t)return!0;var l=Se.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Ae.call(l)==ye}var Ka=Ze?Ot(Ze):function(e){return Va(e)&&mn(e)==E},Xa=$e?Ot($e):function(e){return Va(e)&&eo(e)==f};function Qa(e){return"string"==typeof e||!Ra(e)&&Va(e)&&mn(e)==_}function Ja(e){return"symbol"==typeof e||Va(e)&&mn(e)==g}var Za=et?Ot(et):function(e){return Va(e)&&ja(e.length)&&!!Be[mn(e)]},$a=Pi(Cn),er=Pi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Fa(e))return Qa(e)?zt(e):Ei(e);if(pt&&e[pt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[pt]());var t=eo(e);return(t==m?Mt:t==f?Ht:Tr)(e)}function lr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function nr(e){var t=lr(e),l=t%1;return t==t?l?t-l:t:0}function ir(e){return e?Yl(nr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var l=ne.test(e);return l||oe.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return fi(e,Sr(e))}function rr(e){return null==e?"":Xn(e)}var ur=gi(function(e,t){if(so(t)||Fa(t))fi(t,Ar(t),e);else for(var l in t)Se.call(t,l)&&Wl(e,l,t[l])}),dr=gi(function(e,t){fi(t,Sr(t),e)}),sr=gi(function(e,t,l,n){fi(t,Sr(t),e,n)}),cr=gi(function(e,t,l,n){fi(t,Ar(t),e,n)}),mr=ji(ql),vr=Bn(function(e,t){e=ve(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=Sr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ta(s,ge[d])&&!Se.call(e,d))&&(e[d]=o[d])}return e}),pr=Bn(function(e){return e.push(void 0,Ui),tt(br,void 0,e)});function Er(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function fr(e,t){return null!=e&&to(e,t,En)}var _r=Oi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=l},zr(qr)),gr=Oi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Se.call(e,t)?e[t].push(l):e[t]=[l]},Ki),hr=Bn(_n);function Ar(e){return Fa(e)?Bl(e):bn(e)}function Sr(e){return Fa(e)?Bl(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var l in ve(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&Se.call(e,n))&&l.push(n);return l}(e)}var Nr=gi(function(e,t,l){Ln(e,t,l)}),br=gi(function(e,t,l,n){Ln(e,t,l,n)}),Cr=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,Vi(e),l),n&&(l=Kl(l,7,Hi));for(var i=t.length;i--;)Jn(l,t[i]);return l}),yr=ji(function(e,t){return null==e?{}:function(e,t){return wn(e,t,function(t,l){return fr(e,l)})}(e,t)});function Dr(e,t){if(null==e)return{};var l=dt(Vi(e),function(e){return[e]});return t=Ki(t),wn(e,l,function(e,l){return t(e,l[0])})}var Or=Bi(Ar),Lr=Bi(Sr);function Tr(e){return null==e?[]:Lt(e,Ar(e))}var Ir=Ni(function(e,t,l){return t=t.toLowerCase(),e+(l?wr(t):t)});function wr(e){return Ur(rr(e).toLowerCase())}function Pr(e){return(e=rr(e))&&e.replace(re,Rt).replace(Te,"")}var Rr=Ni(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),xr=Ni(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Fr=Si("toLowerCase"),Br=Ni(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),Mr=Ni(function(e,t,l){return e+(l?" ":"")+Ur(t)}),kr=Ni(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=Si("toUpperCase");function Hr(e,t,l){return e=rr(e),void 0===(t=l?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(J)||[]}(e):e.match(t)||[]}var Wr=Bn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),jr=ji(function(e,t){return nt(t,function(t){t=Do(t),Gl(e,t,ga(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=yi(),Gr=yi(!0);function qr(e){return e}function Yr(e){return Nn("function"==typeof e?e:Kl(e,1))}var Kr=Bn(function(e,t){return function(l){return _n(l,e,t)}}),Xr=Bn(function(e,t){return function(l){return _n(e,l,t)}});function Qr(e,t,l){var n=Ar(t),i=dn(t,n);null!=l||za(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,Ar(t)));var o=!(za(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Zr=Ti(dt),$r=Ti(ot),eu=Ti(vt);function tu(e){return ao(e)?St(Do(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=wi(),nu=wi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Li(function(e,t){return e+t},0),uu=xi("ceil"),du=Li(function(e,t){return e/t},1),su=xi("floor"),cu=Li(function(e,t){return e*t},1),mu=xi("round"),vu=Li(function(e,t){return e-t},0);return Dl.after=function(e,t){if("function"!=typeof t)throw new fe(l);return e=nr(e),function(){if(--e<1)return t.apply(this,arguments)}},Dl.ary=fa,Dl.assign=ur,Dl.assignIn=dr,Dl.assignInWith=sr,Dl.assignWith=cr,Dl.at=mr,Dl.before=_a,Dl.bind=ga,Dl.bindAll=jr,Dl.bindKey=ha,Dl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Dl.chain=ta,Dl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=b(Jt(n/t));i<n;)a[o++]=zn(e,i,i+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=b(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?Ei(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=Ki();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Bn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=Ar(e);return function(l){return Xl(l,e,t)}}(Kl(e,1))},Dl.constant=zr,Dl.countBy=ia,Dl.create=function(e,t){var l=Ol(e);return null==t?l:Vl(l,t)},Dl.curry=function e(t,l,n){var i=Mi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.curryRight=function e(t,l,n){var i=Mi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.debounce=Aa,Dl.defaults=vr,Dl.defaultsDeep=pr,Dl.defer=Sa,Dl.delay=Na,Dl.difference=To,Dl.differenceBy=Io,Dl.differenceWith=wo,Dl.drop=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=l||void 0===t?1:nr(t))<0?0:t,n):[]},Dl.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,0,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t):[]},Dl.dropRightWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3),!0):[]},Dl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=nr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:nr(n))<0&&(n+=i),n=l>n?0:ir(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(Ra(e)?at:ln)(e,Ki(t,3))},Dl.flatMap=function(e,t){return nn(ma(e,t),1)},Dl.flatMapDeep=function(e,t){return nn(ma(e,t),1/0)},Dl.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(ma(e,t),l)},Dl.flatten=xo,Dl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Dl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Dl.flip=function(e){return Mi(e,512)},Dl.flow=Vr,Dl.flowRight=Gr,Dl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Dl.functions=function(e){return null==e?[]:dn(e,Ar(e))},Dl.functionsIn=function(e){return null==e?[]:dn(e,Sr(e))},Dl.groupBy=da,Dl.initial=function(e){return null!=e&&e.length?zn(e,0,-1):[]},Dl.intersection=Bo,Dl.intersectionBy=Mo,Dl.intersectionWith=ko,Dl.invert=_r,Dl.invertBy=gr,Dl.invokeMap=sa,Dl.iteratee=Yr,Dl.keyBy=ca,Dl.keys=Ar,Dl.keysIn=Sr,Dl.map=ma,Dl.mapKeys=function(e,t){var l={};return t=Ki(t,3),rn(e,function(e,n,i){Gl(l,t(e,n,i),e)}),l},Dl.mapValues=function(e,t){var l={};return t=Ki(t,3),rn(e,function(e,n,i){Gl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(Kl(e,1))},Dl.matchesProperty=function(e,t){return On(e,Kl(t,1))},Dl.memoize=ba,Dl.merge=Nr,Dl.mergeWith=br,Dl.method=Kr,Dl.methodOf=Xr,Dl.mixin=Qr,Dl.negate=Ca,Dl.nthArg=function(e){return e=nr(e),Bn(function(t){return Tn(t,e)})},Dl.omit=Cr,Dl.omitBy=function(e,t){return Dr(e,Ca(Ki(t)))},Dl.once=function(e){return _a(2,e)},Dl.orderBy=function(e,t,l,n){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(l=n?void 0:l)||(l=null==l?[]:[l]),In(e,t,l))},Dl.over=Zr,Dl.overArgs=ya,Dl.overEvery=$r,Dl.overSome=eu,Dl.partial=Da,Dl.partialRight=Oa,Dl.partition=va,Dl.pick=yr,Dl.pickBy=Dr,Dl.property=tu,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Ho,Dl.pullAll=Wo,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?Pn(e,t,Ki(l,2)):e},Dl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?Pn(e,t,void 0,l):e},Dl.pullAt=jo,Dl.range=lu,Dl.rangeRight=nu,Dl.rearg=La,Dl.reject=function(e,t){return(Ra(e)?at:ln)(e,Ca(Ki(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=Ki(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Rn(e,i),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Bn(e,t=void 0===t?t:nr(t))},Dl.reverse=zo,Dl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),(Ra(e)?kl:kn)(e,t)},Dl.set=function(e,t,l){return null==e?e:Un(e,t,l)},Dl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Dl.shuffle=function(e){return(Ra(e)?Ul:jn)(e)},Dl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:nr(t),l=void 0===l?n:nr(l)),zn(e,t,l)):[]},Dl.sortBy=pa,Dl.sortedUniq=function(e){return e&&e.length?Yn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?Yn(e,Ki(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=Xn(t))&&Bt(e)?ri(zt(e),0,l):e.split(t,l):[]},Dl.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(nr(t),0),Bn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Dl.tail=function(e){var t=null==e?0:e.length;return t?zn(e,1,t):[]},Dl.take=function(e,t,l){return e&&e.length?zn(e,0,(t=l||void 0===t?1:nr(t))<0?0:t):[]},Dl.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t,n):[]},Dl.takeRightWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return za(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Aa(e,t,{leading:i,maxWait:t,trailing:o})},Dl.thru=la,Dl.toArray=tr,Dl.toPairs=Or,Dl.toPairsIn=Lr,Dl.toPath=function(e){return Ra(e)?dt(e,Do):Ja(e)?[e]:Ei(yo(rr(e)))},Dl.toPlainObject=ar,Dl.transform=function(e,t,l){var n=Ra(e),i=n||Ma(e)||Za(e);if(t=Ki(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:za(e)&&Ha(o)?Ol(je(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Dl.unary=function(e){return fa(e,1)},Dl.union=Vo,Dl.unionBy=Go,Dl.unionWith=qo,Dl.uniq=function(e){return e&&e.length?Qn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Qn(e,Ki(t,2)):[]},Dl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qn(e,void 0,t):[]},Dl.unset=function(e,t){return null==e||Jn(e,t)},Dl.unzip=Yo,Dl.unzipWith=Ko,Dl.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Dl.values=Tr,Dl.valuesIn=function(e){return null==e?[]:Lt(e,Sr(e))},Dl.without=Xo,Dl.words=Hr,Dl.wrap=function(e,t){return Da(ii(t),e)},Dl.xor=Qo,Dl.xorBy=Jo,Dl.xorWith=Zo,Dl.zip=$o,Dl.zipObject=function(e,t){return li(e||[],t||[],Wl)},Dl.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Dl.zipWith=ea,Dl.entries=Or,Dl.entriesIn=Lr,Dl.extend=dr,Dl.extendWith=sr,Qr(Dl,Dl),Dl.add=ru,Dl.attempt=Wr,Dl.camelCase=Ir,Dl.capitalize=wr,Dl.ceil=uu,Dl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=or(l))==l?l:0),void 0!==t&&(t=(t=or(t))==t?t:0),Yl(or(e),t,l)},Dl.clone=function(e){return Kl(e,4)},Dl.cloneDeep=function(e){return Kl(e,5)},Dl.cloneDeepWith=function(e,t){return Kl(e,5,t="function"==typeof t?t:void 0)},Dl.cloneWith=function(e,t){return Kl(e,4,t="function"==typeof t?t:void 0)},Dl.conformsTo=function(e,t){return null==t||Xl(e,t,Ar(t))},Dl.deburr=Pr,Dl.defaultTo=function(e,t){return null==e||e!=e?t:e},Dl.divide=du,Dl.endsWith=function(e,t,l){e=rr(e),t=Xn(t);var n=e.length,i=l=void 0===l?n:Yl(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Dl.eq=Ta,Dl.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(F,xt):e},Dl.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Dl.every=function(e,t,l){var n=Ra(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,Ki(t,3))},Dl.find=oa,Dl.findIndex=Po,Dl.findKey=function(e,t){return Et(e,Ki(t,3),rn)},Dl.findLast=aa,Dl.findLastIndex=Ro,Dl.findLastKey=function(e,t){return Et(e,Ki(t,3),un)},Dl.floor=su,Dl.forEach=ra,Dl.forEachRight=ua,Dl.forIn=function(e,t){return null==e?e:on(e,Ki(t,3),Sr)},Dl.forInRight=function(e,t){return null==e?e:an(e,Ki(t,3),Sr)},Dl.forOwn=function(e,t){return e&&rn(e,Ki(t,3))},Dl.forOwnRight=function(e,t){return e&&un(e,Ki(t,3))},Dl.get=Er,Dl.gt=Ia,Dl.gte=wa,Dl.has=function(e,t){return null!=e&&to(e,t,pn)},Dl.hasIn=fr,Dl.head=Fo,Dl.identity=qr,Dl.includes=function(e,t,l,n){e=Fa(e)?e:Tr(e),l=l&&!n?nr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),Qa(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&_t(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),_t(e,t,i)},Dl.inRange=function(e,t,l){return t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=or(e),t,l)},Dl.invoke=hr,Dl.isArguments=Pa,Dl.isArray=Ra,Dl.isArrayBuffer=xa,Dl.isArrayLike=Fa,Dl.isArrayLikeObject=Ba,Dl.isBoolean=function(e){return!0===e||!1===e||Va(e)&&mn(e)==r},Dl.isBuffer=Ma,Dl.isDate=ka,Dl.isElement=function(e){return Va(e)&&1===e.nodeType&&!Ya(e)},Dl.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||Pa(e)))return!e.length;var t=eo(e);if(t==m||t==f)return!e.size;if(so(e))return!bn(e).length;for(var l in e)if(Se.call(e,l))return!1;return!0},Dl.isEqual=function(e,t){return hn(e,t)},Dl.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?hn(e,t,void 0,l):!!n},Dl.isError=Ua,Dl.isFinite=function(e){return"number"==typeof e&&tl(e)},Dl.isFunction=Ha,Dl.isInteger=Wa,Dl.isLength=ja,Dl.isMap=Ga,Dl.isMatch=function(e,t){return e===t||An(e,t,Qi(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,An(e,t,Qi(t),l)},Dl.isNaN=function(e){return qa(e)&&e!=+e},Dl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sn(e)},Dl.isNil=function(e){return null==e},Dl.isNull=function(e){return null===e},Dl.isNumber=qa,Dl.isObject=za,Dl.isObjectLike=Va,Dl.isPlainObject=Ya,Dl.isRegExp=Ka,Dl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Dl.isSet=Xa,Dl.isString=Qa,Dl.isSymbol=Ja,Dl.isTypedArray=Za,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return Va(e)&&eo(e)==h},Dl.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==mn(e)},Dl.join=function(e,t){return null==e?"":ll.call(e,t)},Dl.kebabCase=Rr,Dl.last=Uo,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=nr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,ht,i,!0)},Dl.lowerCase=xr,Dl.lowerFirst=Fr,Dl.lt=$a,Dl.lte=er,Dl.max=function(e){return e&&e.length?tn(e,qr,vn):void 0},Dl.maxBy=function(e,t){return e&&e.length?tn(e,Ki(t,2),vn):void 0},Dl.mean=function(e){return At(e,qr)},Dl.meanBy=function(e,t){return At(e,Ki(t,2))},Dl.min=function(e){return e&&e.length?tn(e,qr,Cn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,Ki(t,2),Cn):void 0},Dl.stubArray=iu,Dl.stubFalse=ou,Dl.stubObject=function(){return{}},Dl.stubString=function(){return""},Dl.stubTrue=function(){return!0},Dl.multiply=cu,Dl.nth=function(e,t){return e&&e.length?Tn(e,nr(t)):void 0},Dl.noConflict=function(){return ze._===this&&(ze._=De),this},Dl.noop=Jr,Dl.now=Ea,Dl.pad=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ii(Zt(i),l)+e+Ii(Jt(i),l)},Dl.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?e+Ii(t-n,l):e},Dl.padStart=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?Ii(t-n,l)+e:e},Dl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace(q,""),t||0)},Dl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return xn(e,t)},Dl.reduce=function(e,t,l){var n=Ra(e)?ct:bt,i=arguments.length<3;return n(e,Ki(t,4),l,i,Zl)},Dl.reduceRight=function(e,t,l){var n=Ra(e)?mt:bt,i=arguments.length<3;return n(e,Ki(t,4),l,i,$l)},Dl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),Fn(rr(e),t)},Dl.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[Do(t[n])];void 0===o&&(n=i,o=l),e=Ha(o)?o.call(e):o}return e},Dl.round=mu,Dl.runInContext=e,Dl.sample=function(e){return(Ra(e)?Ml:Mn)(e)},Dl.size=function(e){if(null==e)return 0;if(Fa(e))return Qa(e)?jt(e):e.length;var t=eo(e);return t==m||t==f?e.size:bn(e).length},Dl.snakeCase=Br,Dl.some=function(e,t,l){var n=Ra(e)?vt:Vn;return l&&oo(e,t,l)&&(t=void 0),n(e,Ki(t,3))},Dl.sortedIndex=function(e,t){return Gn(e,t)},Dl.sortedIndexBy=function(e,t,l){return qn(e,t,Ki(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Gn(e,t);if(n<l&&Ta(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return Gn(e,t,!0)},Dl.sortedLastIndexBy=function(e,t,l){return qn(e,t,Ki(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Gn(e,t,!0)-1;if(Ta(e[l],t))return l}return-1},Dl.startCase=Mr,Dl.startsWith=function(e,t,l){return e=rr(e),l=null==l?0:Yl(nr(l),0,e.length),t=Xn(t),e.slice(l,l+t.length)==t},Dl.subtract=vu,Dl.sum=function(e){return e&&e.length?Ct(e,qr):0},Dl.sumBy=function(e,t){return e&&e.length?Ct(e,Ki(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,ki);var i,o,a=sr({},t.imports,n.imports,ki),r=Ar(a),u=Lt(a,r),d=0,s=t.interpolate||ue,c="__p += '",m=pe((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(m,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,Ft),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Se.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(w,""):c).replace(P,"$1").replace(R,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(r,v+"return "+c).apply(void 0,u)});if(E.source=c,Ua(E))throw E;return E},Dl.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=yt(n,t=Ki(t));++l<e;)t(l);return i},Dl.toFinite=lr,Dl.toInteger=nr,Dl.toLength=ir,Dl.toLower=function(e){return rr(e).toLowerCase()},Dl.toNumber=or,Dl.toSafeInteger=function(e){return e?Yl(nr(e),-9007199254740991,9007199254740991):0===e?e:0},Dl.toString=rr,Dl.toUpper=function(e){return rr(e).toUpperCase()},Dl.trim=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return Dt(e);if(!e||!(t=Xn(t)))return e;var n=zt(e),i=zt(t);return ri(n,It(n,i),wt(n,i)+1).join("")},Dl.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xn(t)))return e;var n=zt(e);return ri(n,0,wt(n,zt(t))+1).join("")},Dl.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace(q,"");if(!e||!(t=Xn(t)))return e;var n=zt(e);return ri(n,It(n,zt(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if(za(t)){var i="separator"in t?t.separator:i;l="length"in t?nr(t.length):l,n="omission"in t?Xn(t.omission):n}var o=(e=rr(e)).length;if(Bt(e)){var a=zt(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),Ka(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=pe(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xn(i),r)!=r){var m=u.lastIndexOf(i);m>-1&&(u=u.slice(0,m))}return u+n},Dl.unescape=function(e){return(e=rr(e))&&B.test(e)?e.replace(x,Gt):e},Dl.uniqueId=function(e){var t=++Ne;return rr(e)+t},Dl.upperCase=kr,Dl.upperFirst=Ur,Dl.each=ra,Dl.eachRight=ua,Dl.first=Fo,Qr(Dl,(au={},rn(Dl,function(e,t){Se.call(Dl.prototype,t)||(au[t]=e)}),au),{chain:!1}),Dl.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dl[e].placeholder=Dl}),nt(["drop","take"],function(e,t){Il.prototype[e]=function(l){l=void 0===l?1:il(nr(l),0);var n=this.__filtered__&&!t?new Il(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Il.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Il.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ki(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Il.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Il.prototype[e]=function(){return this.__filtered__?new Il(this):this[l](1)}}),Il.prototype.compact=function(){return this.filter(qr)},Il.prototype.find=function(e){return this.filter(e).head()},Il.prototype.findLast=function(e){return this.reverse().find(e)},Il.prototype.invokeMap=Bn(function(e,t){return"function"==typeof e?new Il(this):this.map(function(l){return _n(l,e,t)})}),Il.prototype.reject=function(e){return this.filter(Ca(Ki(e)))},Il.prototype.slice=function(e,t){e=nr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Il(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=nr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Il.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Il.prototype.toArray=function(){return this.take(4294967295)},rn(Il.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Dl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Dl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Il,u=a[0],d=r||Ra(t),s=function(e){var t=i.apply(Dl,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,m=!!this.__actions__.length,v=o&&!c,p=r&&!m;if(!o&&d){t=p?t:new Il(this);var E=e.apply(t,a);return E.__actions__.push({func:la,args:[s],thisArg:void 0}),new Tl(E,c)}return v&&p?e.apply(this,a):(E=this.thru(s),v?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ra(i)?i:[],e)}return this[l](function(l){return t.apply(Ra(l)?l:[],e)})}}),rn(Il.prototype,function(e,t){var l=Dl[t];if(l){var n=l.name+"";Se.call(_l,n)||(_l[n]=[]),_l[n].push({name:t,func:l})}}),_l[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],Il.prototype.clone=function(){var e=new Il(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Il.prototype.reverse=function(){if(this.__filtered__){var e=new Il(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Il.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=Ra(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,m=0,v=ol(u,this.__takeCount__);if(!l||!n&&i==u&&v==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var E=-1,f=e[d+=t];++E<c;){var _=s[E],g=_.type,h=(0,_.iteratee)(f);if(2==g)f=h;else if(!h){if(1==g)continue e;break e}}p[m++]=f}return p},Dl.prototype.at=na,Dl.prototype.chain=function(){return ta(this)},Dl.prototype.commit=function(){return new Tl(this.value(),this.__chain__)},Dl.prototype.next=function(){void 0===this.__values__&&(this.__values__=tr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Dl.prototype.plant=function(e){for(var t,l=this;l instanceof Ll;){var n=Lo(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Dl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Il){var t=e;return this.__actions__.length&&(t=new Il(this)),(t=t.reverse()).__actions__.push({func:la,args:[zo],thisArg:void 0}),new Tl(t,this.__chain__)}return this.thru(zo)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dl.prototype.first=Dl.prototype.head,pt&&(Dl.prototype[pt]=function(){return this}),Dl}();Ge?((Ge.exports=qt)._=qt,Ve._=qt):ze._=qt}).call(b)});const At=e=>{var i,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=o.useTranslation(),p=Digit.UserService.getUser().info;return n.createElement(l.Fragment,null,n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),n.createElement(t.CardLabelError,null,null==m||null===(i=m.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),n.createElement(t.SearchField,{className:"submit"},n.createElement(t.SubmitBar,{label:v("ES_COMMON_SEARCH"),submit:!0}),n.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),d("offset",s("offset")-s("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},v("ES_COMMON_CLEAR_ALL"))))},St=["currentlyActiveMobileModal"],Nt=["currentlyActiveMobileModal"],bt=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:E}=o.useTranslation(),{handleSubmit:f}=a.useFormContext(),[_,g]=l.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{g({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),S=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,i=m(e,St);const{closeMobilePopupModal:o}=i;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,i,n.createElement(A,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,E("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),n.createElement(u,{onSubmit:p,handleSubmit:f,isMobileView:!0,closeMobilePopupModal:o}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,Nt)))},[_]);return s?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"searchBox"},n.createElement(t.SearchAction,{text:E("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"})})),_?n.createElement(t.PopUp,null,n.createElement(S,{onSubmit:e=>{g({type:"remove"}),p(e)},handleSubmit:f,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:_,closeMobilePopupModal:h})):null,null!=v&&null!==(i=v[0])&&void 0!==i&&i.display?n.createElement(t.Card,{style:{marginTop:20}},E(null==v||null===(r=v[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/inbox/application-overview/",serviceRequestIdKey:E("NOC_APPLICATION_NUMBER")}))},Ct=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:d,isLoading:s,Count:c}=e;const{handleSubmit:m,setValue:v,getValues:p}=a.useFormContext();null==p("offset")&&v("offset",0),null==p("limit")&&v("limit",10);const[E,f]=l.useState(Number(p("offset"))/Number(p("limit"))),{t:_}=o.useTranslation(),g=()=>{v("offset",c&&10*Math.ceil(c/10)-p("limit")),m(u)()},h=()=>{v("offset",0),m(u)()},A=l.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){v("limit",Number(e.target.value)),m(u)()}function N(){v("offset",Number(p("offset"))+Number(p("limit"))),m(u)()}function b(){v("offset",Number(p("offset"))-Number(p("limit"))),m(u)()}l.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&f(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return s?n.createElement(t.Loader,null):null!=d&&null!==(e=d[0])&&void 0!==e&&e.display?n.createElement(t.Card,{style:{marginTop:20}},_(null==d||null===(l=d[0])||void 0===l?void 0:l.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.Table,{t:_,data:d,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===_("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:E,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:g,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,l};return n.createElement(n.Fragment,null,n.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},n.createElement(r,{onSubmit:u,handleSubmit:m,isMobileView:!1})),n.createElement(C,null))},yt=e=>{let{t:t,onSubmit:r,data:u,error:d,isLoading:s,Count:c}=e;const[m,v]=l.useState(null),p=a.useForm();l.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const E=(()=>{const{t:e}=o.useTranslation();return l.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(i.Link,{to:"/digit-ui/employee/noc/inbox/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),f=window.Digit.Utils.browser.isMobile(),_=l.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return n.createElement(a.FormProvider,p,f?n.createElement(bt,{SearchFormFieldsComponent:At,propsMobileInboxCards:_,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(Ct,{columns:E,SearchFormFieldsComponent:At,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},Dt=e=>{const{t:i}=o.useTranslation(),a=Digit.UserService.getUser().info;let r;r=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const u={offset:0,limit:10,tenantId:r,mobileNumber:null==a?void 0:a.mobileNumber},[d,s]=l.useState(u),c=window.Digit.Utils.browser.isMobile(),[m,v]=l.useState([{display:"ES_COMMON_NO_DATA"}]),[p,E]=l.useState(0),{data:f,isLoading:_,error:g}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(d,r,{});return l.useEffect(()=>{var e;null==f?v([{display:"ES_COMMON_NO_DATA"}]):(null==f||null===(e=f.data)||void 0===e?void 0:e.length)>0&&(v(null==f?void 0:f.data),E(null==f?void 0:f.totalCount))},[f]),n.createElement("div",null,n.createElement(t.CardHeader,{styles:c?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},i("ACTION_TEST_SEARCH_NOC_APPLICATION")),n.createElement(yt,{t:i,tenantId:r,onSubmit:function(e,t){console.log("_data==>",e);let l=gt(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),s(l)},isLoading:_,Count:p,error:g,data:m}))};function Ot(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function Lt(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Tt=(e,t)=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const l=e%10,n=e%100;let i="th";return(n<11||n>13)&&(1===l?i="st":2===l?i="nd":3===l&&(i="rd")),""+e+i+" "+t("NOC_FLOOR_AREA_LABEL")},It=function(e,t,l,n,i){try{var o,a,r,u;const d=Digit.ULBService.getStateId(),s=e||{};let c=[],m="";const v=(null==s||null===(o=s.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.ownerPhotos)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.filestoreId)||"";return Promise.resolve(Digit.UploadServices.Filefetch([v],d)).then(function(e){var o,a,r,u,d;const v=null==e||null===(o=e.data)||void 0===o||null===(a=o.fileStoreIds)||void 0===a?void 0:a[0];m=(null==v?void 0:v.url)||"",null!=s&&null!==(r=s.nocDetails)&&void 0!==r&&null!==(u=r.additionalDetails)&&void 0!==u&&null!==(d=u.applicationDetails)&&void 0!==d&&d.professionalName&&c.push(((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,_,g,h;let A=[{title:t("NOC_PROFESSIONAL_NAME_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.applicationDetails)||void 0===i?void 0:i.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.applicationDetails)||void 0===s?void 0:s.professionalRegId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(m=c.additionalDetails)||void 0===m||null===(v=m.applicationDetails)||void 0===v?void 0:v.professionalRegIdValidity)||"N/A"},{title:t("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(E=p.additionalDetails)||void 0===E||null===(f=E.applicationDetails)||void 0===f?void 0:f.professionalMobileNumber)||"N/A"},{title:t("NOC_PROFESSIONAL_ADDRESS_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(g=_.additionalDetails)||void 0===g||null===(h=g.applicationDetails)||void 0===h?void 0:h.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:A}})(s,i));const p=(null==s?void 0:s.applicationNo)||"NA",E=i("LOCAL_GOVERNMENT_PUNJAB"),_=null==t?void 0:t.contactNumber,g=null==t?void 0:t.emailId,h=i("NOC_ACKNOWLEDGEMENT_TITLE"),A=null==t?void 0:t.code,S=((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v;let p=[{title:t("COMMON_LATITUDE1_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.coordinates)||void 0===i?void 0:i.Latitude1)||"N/A"},{title:t("COMMON_LONGITUDE1_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.coordinates)||void 0===r?void 0:r.Longitude1)||"N/A"},{title:t("COMMON_LATITUDE2_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.coordinates)||void 0===s?void 0:s.Latitude2)||"N/A"},{title:t("COMMON_LONGITUDE2_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(m=c.additionalDetails)||void 0===m||null===(v=m.coordinates)||void 0===v?void 0:v.Longitude2)||"N/A"}];return{title:t("NOC_SITE_COORDINATES_LABEL"),values:p}})(s,i),N=((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,P;let R=[{title:t("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.siteDetails)||void 0===i?void 0:i.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name)||(null==e||null===(d=e.nocDetails)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.siteDetails)||void 0===c?void 0:c.specificationBuildingCategory)||"N/A"},{title:t("NOC_NOC_TYPE_LABEL"),value:(null==e||null===(m=e.nocDetails)||void 0===m||null===(v=m.additionalDetails)||void 0===v||null===(p=v.siteDetails)||void 0===p||null===(E=p.specificationNocType)||void 0===E?void 0:E.name)||(null==e||null===(f=e.nocDetails)||void 0===f||null===(_=f.additionalDetails)||void 0===_||null===(g=_.siteDetails)||void 0===g?void 0:g.specificationNocType)||"N/A"},{title:t("NOC_RESTRICTED_AREA_LABEL"),value:(null==e||null===(h=e.nocDetails)||void 0===h||null===(A=h.additionalDetails)||void 0===A||null===(S=A.siteDetails)||void 0===S||null===(N=S.specificationRestrictedArea)||void 0===N?void 0:N.code)||(null==e||null===(b=e.nocDetails)||void 0===b||null===(C=b.additionalDetails)||void 0===C||null===(y=C.siteDetails)||void 0===y?void 0:y.specificationRestrictedArea)||"N/A"},{title:t("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),value:(null==e||null===(D=e.nocDetails)||void 0===D||null===(O=D.additionalDetails)||void 0===O||null===(L=O.siteDetails)||void 0===L||null===(T=L.specificationIsSiteUnderMasterPlan)||void 0===T?void 0:T.code)||(null==e||null===(I=e.nocDetails)||void 0===I||null===(w=I.additionalDetails)||void 0===w||null===(P=w.siteDetails)||void 0===P?void 0:P.specificationIsSiteUnderMasterPlan)||"N/A"}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:R}})(s,i),b=((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v,p,E,f,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,P,R,x,F,B,M,k,U,H,W,j,z,V,G,q,Y,K,X,Q,J,Z,$,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,_e,ge,he,Ae,Se,Ne,be,Ce,ye,De,Oe,Le,Te,Ie,we,Pe,Re,xe,Fe,Be,Me,ke,Ue,He;let We=[{title:t("NOC_PLOT_NO_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.siteDetails)||void 0===i?void 0:i.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress)||"N/A"},{title:t("NOC_ULB_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.siteDetails)||void 0===s||null===(c=s.ulbName)||void 0===c?void 0:c.name)||(null==e||null===(m=e.nocDetails)||void 0===m||null===(v=m.additionalDetails)||void 0===v||null===(p=v.siteDetails)||void 0===p?void 0:p.ulbName)||"N/A"},{title:t("NOC_ULB_TYPE_LABEL"),value:(null==e||null===(E=e.nocDetails)||void 0===E||null===(f=E.additionalDetails)||void 0===f||null===(_=f.siteDetails)||void 0===_?void 0:_.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(g=e.nocDetails)||void 0===g||null===(h=g.additionalDetails)||void 0===h||null===(A=h.siteDetails)||void 0===A?void 0:A.khasraNo)||"N/A"},{title:t("NOC_HADBAST_NO_LABEL"),value:(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.siteDetails)||void 0===b?void 0:b.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(y=C.additionalDetails)||void 0===y||null===(D=y.siteDetails)||void 0===D||null===(O=D.roadType)||void 0===O?void 0:O.name)||(null==e||null===(L=e.nocDetails)||void 0===L||null===(T=L.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.roadType)||"N/A"},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:(null==e||null===(w=e.nocDetails)||void 0===w||null===(P=w.additionalDetails)||void 0===P||null===(R=P.siteDetails)||void 0===R?void 0:R.areaLeftForRoadWidening)||"N/A"},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:(null==e||null===(x=e.nocDetails)||void 0===x||null===(F=x.additionalDetails)||void 0===F||null===(B=F.siteDetails)||void 0===B?void 0:B.netPlotAreaAfterWidening)||"N/A"},{title:t("NOC_NET_TOTAL_AREA_LABEL"),value:(null==e||null===(M=e.nocDetails)||void 0===M||null===(k=M.additionalDetails)||void 0===k||null===(U=k.siteDetails)||void 0===U?void 0:U.netTotalArea)||"N/A"},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:(null==e||null===(H=e.nocDetails)||void 0===H||null===(W=H.additionalDetails)||void 0===W||null===(j=W.siteDetails)||void 0===j?void 0:j.roadWidthAtSite)||"N/A"},{title:t("NOC_DISTRICT_LABEL"),value:(null==e||null===(z=e.nocDetails)||void 0===z||null===(V=z.additionalDetails)||void 0===V||null===(G=V.siteDetails)||void 0===G||null===(q=G.district)||void 0===q?void 0:q.name)||(null==e||null===(Y=e.nocDetails)||void 0===Y||null===(K=Y.additionalDetails)||void 0===K||null===(X=K.siteDetails)||void 0===X?void 0:X.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(Q=e.nocDetails)||void 0===Q||null===(J=Q.additionalDetails)||void 0===J||null===(Z=J.siteDetails)||void 0===Z||null===($=Z.zone)||void 0===$?void 0:$.name)||(null==e||null===(ee=e.nocDetails)||void 0===ee||null===(te=ee.additionalDetails)||void 0===te||null===(le=te.siteDetails)||void 0===le?void 0:le.zone)||"N/A"},{title:t("NOC_SITE_WARD_NO_LABEL"),value:(null==e||null===(ne=e.nocDetails)||void 0===ne||null===(ie=ne.additionalDetails)||void 0===ie||null===(oe=ie.siteDetails)||void 0===oe?void 0:oe.wardNo)||"N/A"},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue?void 0:ue.villageName)||"N/A"},{title:t("NOC_SITE_COLONY_NAME_LABEL"),value:(null==e||null===(de=e.nocDetails)||void 0===de||null===(se=de.additionalDetails)||void 0===se||null===(ce=se.siteDetails)||void 0===ce?void 0:ce.colonyName)||"N/A"},{title:t("NOC_SITE_VASIKA_NO_LABEL"),value:(null==e||null===(me=e.nocDetails)||void 0===me||null===(ve=me.additionalDetails)||void 0===ve||null===(pe=ve.siteDetails)||void 0===pe?void 0:pe.vasikaNumber)||"N/A"},{title:t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),value:(null==e||null===(Ee=e.nocDetails)||void 0===Ee||null===(fe=Ee.additionalDetails)||void 0===fe||null===(_e=fe.siteDetails)||void 0===_e?void 0:_e.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(ge=e.nocDetails)||void 0===ge||null===(he=ge.additionalDetails)||void 0===he||null===(Ae=he.siteDetails)||void 0===Ae||null===(Se=Ae.buildingStatus)||void 0===Se?void 0:Se.name)||(null==e||null===(Ne=e.nocDetails)||void 0===Ne||null===(be=Ne.additionalDetails)||void 0===be||null===(Ce=be.siteDetails)||void 0===Ce?void 0:Ce.buildingStatus)||"N/A"},{title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:(null==e||null===(ye=e.nocDetails)||void 0===ye||null===(De=ye.additionalDetails)||void 0===De||null===(Oe=De.siteDetails)||void 0===Oe||null===(Le=Oe.isBasementAreaAvailable)||void 0===Le?void 0:Le.code)||(null==e||null===(Te=e.nocDetails)||void 0===Te||null===(Ie=Te.additionalDetails)||void 0===Ie||null===(we=Ie.siteDetails)||void 0===we?void 0:we.isBasementAreaAvailable)||"N/A"}];var je,ze,Ve,Ge,qe,Ye,Ke,Xe,Qe,Je;return"Built Up"==(null==e||null===(Pe=e.nocDetails)||void 0===Pe||null===(Re=Pe.additionalDetails)||void 0===Re||null===(xe=Re.siteDetails)||void 0===xe?void 0:xe.buildingStatus)&&We.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:(null==e||null===(je=e.nocDetails)||void 0===je||null===(ze=je.additionalDetails)||void 0===ze||null===(Ve=ze.siteDetails)||void 0===Ve?void 0:Ve.basementArea)||"N/A"}),"Built UP"==(null==e||null===(Fe=e.nocDetails)||void 0===Fe||null===(Be=Fe.additionalDetails)||void 0===Be||null===(Me=Be.siteDetails)||void 0===Me?void 0:Me.buildingStatus)&&(null==e||null===(Ge=e.nocDetails)||void 0===Ge||null===(qe=Ge.additionalDetails)||void 0===qe||null===(Ye=qe.siteDetails)||void 0===Ye||null===(Ke=Ye.floorArea)||void 0===Ke||Ke.map((e,l)=>We.push({title:Tt(l,t),value:null==e?void 0:e.value}))),"Built Up"==(null==e||null===(ke=e.nocDetails)||void 0===ke||null===(Ue=ke.additionalDetails)||void 0===Ue||null===(He=Ue.siteDetails)||void 0===He?void 0:He.buildingStatus)&&We.push({title:t("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),value:(null==e||null===(Xe=e.nocDetails)||void 0===Xe||null===(Qe=Xe.additionalDetails)||void 0===Qe||null===(Je=Qe.siteDetails)||void 0===Je?void 0:Je.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:We}})(s,i),C=((e,t)=>{var l,n,i,o;return(null!=(l=null==e||null===(n=e.nocDetails)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.applicationDetails)||void 0===o?void 0:o.owners)?l:[]).map((e,l)=>{var n;return{title:0===l?"Primary Owner":"Owner "+(l+1)+" Details",values:[{title:t("NOC_FIRM_OWNER_NAME_LABEL"),value:(null==e?void 0:e.ownerOrFirmName)||"NA"},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:(null==e?void 0:e.emailId)||"NA"},{title:t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),value:(null==e?void 0:e.fatherOrHusbandName)||"NA"},{title:t("NOC_APPLICANT_MOBILE_NO_LABEL"),value:(null==e?void 0:e.mobileNumber)||"NA"},{title:t("NOC_APPLICANT_DOB_LABEL"),value:null!=e&&e.dateOfBirth?new Date(e.dateOfBirth).toLocaleDateString("en-GB"):"NA"},{title:t("NOC_APPLICANT_GENDER_LABEL"),value:(null==e||null===(n=e.gender)||void 0===n?void 0:n.code)||"NA"},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:(null==e?void 0:e.address)||"NA"},{title:t("NOC_APPLICANT_PROPERTY_ID_LABEL"),value:(null==e?void 0:e.propertyId)||"NA"}]}})})(s,i),y=((e,t)=>{var l;let n=[{title:t("CS_APPLICATION_NUMBER"),value:(null==e?void 0:e.applicationNo)||"N/A"},{title:t("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime,"dd/MM/yyyy")||"NA"}];return{title:t("CS_APPLICATION_DETAILS"),values:n}})(s,i);return Promise.resolve(function(e,t){try{var l;function n(l){var n;return{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e||null===(n=e.documents)||void 0===n?void 0:n.length)>0?e.documents.map((e,n)=>(f(null==l?void 0:l.data,null==e?void 0:e.uuid),{title:t(null==e?void 0:e.documentType.replace(/\./g,"_"))||t("CS_NA")})):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const i=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.uuid),o=(null==i?void 0:i.length)>0;return Promise.resolve(o?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(n):n(o))}catch(e){return Promise.reject(e)}}(s,i)).then(function(e){return{t:i,tenantId:A,name:h,email:g,phoneNumber:_,heading:E,applicationNumber:p,details:[y,...c,...C,b,N,S,e],imageURL:m,ulbType:l,ulbName:n}})})}catch(e){return Promise.reject(e)}},wt=e=>{var l,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),m=i.useHistory(),v=null==s||null===(l=s.data)||void 0===l||null===(a=l.Noc)||void 0===a?void 0:a[0];window.localStorage.getItem("Employee.tenant-id"),console.log("nocData in Response",v);const{data:E}=Digit.Hooks.useStore.getInitData(),{tenants:f}=E||{},_=d.split("/").pop();return n.createElement("div",null,n.createElement(t.Card,null,n.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==v||null===(r=v.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?n.createElement("div",null,n.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=Ot(function(){var e,t,l,n;const i=v,o=null==i||null===(e=i.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==o?void 0:o.ulbType,r=(null==o||null===(l=o.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==o?void 0:o.ulbName),u=f.find(e=>e.code===i.tenantId);return Promise.resolve(It(i,u,a,r,c)).then(function(e){Digit.Utils.pdf.generateFormatted(e)})},function(e){console.log("Eroor Occurred !!!",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})):null,n.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{m.push("/digit-ui/employee")}}),n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{m.push("/digit-ui/employee/noc/inbox")}}))))},Pt=e=>{let{location:l}=e;const{t:i}=o.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:i("ES_COMMON_INBOX"),show:!(!l.pathname.includes("noc/inbox")&&!l.pathname.includes("noc/new-application"))},{path:"/digit-ui/employee/noc/new-application",content:i("NOC_NEW_APPLICATION"),show:!!l.pathname.includes("noc/new-application")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:i("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!l.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:i("ES_COMMON_APPLICATION_SEARCH"),show:!!l.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!l.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return n.createElement(t.BreadCrumb,{crumbs:a})},Rt=e=>{var a,r,u,d,s,m,v,p,E,f;let{path:_}=e;const g=i.useLocation(),h=(o.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),A=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NOCInbox"),S=null===(s=Digit)||void 0===s||null===(m=s.ComponentRegistryService)||void 0===m?void 0:m.getComponent("NewNOCStepperForm"),N=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview"),b=null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f?void 0:f.getComponent("NewNOCEditApplication"),C=window.location.href.includes("/response"),y=window.Digit.Utils.browser.isMobile();return n.createElement(l.Fragment,null,C?null:n.createElement("div",{style:window.location.href.includes("application-overview")||y?{marginLeft:"10px"}:{}},n.createElement(Pt,{location:g})),n.createElement(i.Switch,null,n.createElement(t.PrivateRoute,{path:_+"/inbox/application-overview/:id",component:N}),n.createElement(t.PrivateRoute,{path:_+"/search/application-overview/:id",component:h}),n.createElement(t.PrivateRoute,{path:_+"/new-application",component:S}),n.createElement(t.PrivateRoute,{path:_+"/edit-application/:id",component:b}),n.createElement(t.PrivateRoute,{path:_+"/inbox",component:e=>n.createElement(A,c({},e,{parentRoute:_}))}),n.createElement(t.PrivateRoute,{path:_+"/search",component:e=>n.createElement(Dt,c({},e,{parentRoute:_}))}),n.createElement(t.PrivateRoute,{path:_+"/response/:id",component:wt})))},xt=e=>{const[t,i]=l.useState(e.selectedVal?e.selectedVal:"");return l.useEffect(()=>{e.keepNull?i(""):e.selectedVal?i(e.selectedVal):(i(""),e.setFilter(""))},[e.selectedVal,e.forceSet]),n.createElement("input",{ref:e.inputRef,className:"employee-select-wrap--elipses "+(e.disable&&"disabled"),type:"text",value:t,onChange:function(t){e.freeze||(i(t.target.value),e.setFilter(t.target.value))},onClick:e.onClick,onFocus:function(){e.disable||e.dropdownDisplay(!0)},onBlur:t=>{var l;e.dropdownDisplay(!1),null==e||null===(l=e.onBlur)||void 0===l||l.call(e,t),e.selectedVal!==e.filterVal&&setTimeout(()=>{e.setforceSet(e=>e+1)},1e3)},onKeyDown:t=>{var l,n,i,o,a,r,u,d,s,c,m,v,p;if("ArrowDown"==t.key)e.setOptionIndex(t=>t+1==e.addProps.length?0:t+1),e.addProps.currentIndex+1==e.addProps.length?null==t||null===(l=t.target)||void 0===l||null===(n=l.parentElement)||void 0===n||null===(i=n.parentElement)||void 0===i||null===(o=i.children)||void 0===o||null===(a=o.namedItem("jk-dropdown-unique"))||void 0===a||null===(r=a.scrollTo)||void 0===r||r.call(a,0,0):(null==e||null===(u=e.addProps)||void 0===u?void 0:u.currentIndex)>2&&(null==t||null===(d=t.target)||void 0===d||null===(s=d.parentElement)||void 0===s||null===(c=s.parentElement)||void 0===c||null===(m=c.children)||void 0===m||null===(v=m.namedItem("jk-dropdown-unique"))||void 0===v||null===(p=v.scrollBy)||void 0===p||p.call(v,0,45)),t.preventDefault();else if("ArrowUp"==t.key){var E,f,_,g,h,A,S,N,b,C,y,D,O;e.setOptionIndex(t=>0!==t?t-1:e.addProps.length-1),0==e.addProps.currentIndex?null==t||null===(E=t.target)||void 0===E||null===(f=E.parentElement)||void 0===f||null===(_=f.parentElement)||void 0===_||null===(g=_.children)||void 0===g||null===(h=g.namedItem("jk-dropdown-unique"))||void 0===h||null===(A=h.scrollTo)||void 0===A||A.call(h,1e5,1e5):(null==e||null===(S=e.addProps)||void 0===S?void 0:S.currentIndex)>2&&(null==t||null===(N=t.target)||void 0===N||null===(b=N.parentElement)||void 0===b||null===(C=b.parentElement)||void 0===C||null===(y=C.children)||void 0===y||null===(D=y.namedItem("jk-dropdown-unique"))||void 0===D||null===(O=D.scrollBy)||void 0===O||O.call(D,0,-45)),t.preventDefault()}else"Enter"==t.key&&e.addProps.selectOption(e.addProps.currentIndex)},readOnly:e.disable,autoFocus:e.autoFocus,placeholder:e.placeholder,autoComplete:"off",style:c({},e.style,{zIndex:"auto"})})},Ft=e=>e,Bt=e=>{var i,o,a;const r=Digit.SessionStorage.get("userType"),[u,d]=l.useState(!1),[s,m]=l.useState(e.selected?e.selected:null),[v,p]=l.useState(""),[E,f]=l.useState(0),[_,g]=l.useState(-1),h=l.useRef(null),A=!!e.customSelector,S=e.t||Ft;function N(){if(!e.disable){var t,l=u;l||document.addEventListener("mousedown",b,!1),d(!l),null==e||null===(t=e.onBlur)||void 0===t||t.call(e)}}function b(e){h.current&&h.current.contains(e.target)||(document.removeEventListener("mousedown",b,!1),d(!1))}function C(t){t!==s||e.allowMultiselect?(e.select(t),m(t),d(!1)):(m(t),f(E+1))}l.useEffect(()=>{m(e.selected)},[e.selected]),console.log("option",e.option);let y=e.option&&(null===(i=e.option)||void 0===i?void 0:i.filter(t=>{var l,n;return(null===(l=S(t[e.optionKey]))||void 0===l||null===(n=l.toUpperCase())||void 0===n?void 0:n.indexOf(null==v?void 0:v.toUpperCase()))>-1}))||[];var D,O;return"PropertyType"==(null==e||null===(o=e.option)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.label)&&(y=e.option),e.isBPAREG&&s&&((null===(D=e.option)||void 0===D||null===(O=D.filter(e=>(null==e?void 0:e.code)===(null==s?void 0:s.code)))||void 0===O?void 0:O.length)>0||m(null)),n.createElement("div",{className:("employee"===r?"employee-select-wrap":"select-wrap")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:c({},e.style)},A&&n.createElement("div",{className:e.showArrow?"cp flex-right column-gap-5":"cp",onClick:N},e.customSelector,e.showArrow&&n.createElement(t.ArrowDown,{onClick:N,className:e.disable&&"disabled"})),!A&&n.createElement("div",{className:(u?"select-active":"select")+" "+(e.disable&&"disabled"),style:e.errorStyle?{border:"1px solid red"}:{}},n.createElement(xt,{autoComplete:e.autoComplete,setFilter:function(e){p(e)},forceSet:E,setforceSet:f,setOptionIndex:g,keepNull:e.keepNull,selectedVal:s?e.t?e.isMultiSelectEmp?s+" "+S("BPA_SELECTED_TEXT"):e.t(e.optionKey?s[e.optionKey]:s):e.optionKey?s[e.optionKey]:s:null,filterVal:v,addProps:{length:y.length,currentIndex:_,selectOption:function(e){C(y[e])}},dropdownDisplay:function(e){const t=setTimeout(()=>d(e),500);return()=>{clearTimeout(t)}},handleClick:b,disable:e.disable,freeze:!!e.freeze,autoFocus:e.autoFocus,placeholder:e.placeholder,onBlur:null==e?void 0:e.onBlur,inputRef:e.ref}),n.createElement(t.ArrowDown,{onClick:N,className:"cp",disable:e.disable})),u?e.optionKey?n.createElement("div",{id:"jk-dropdown-unique",className:(A?"margin-top-10 display: table":"")+" options-card",style:c({},e.optionCardStyles),ref:h},y&&y.map((t,l)=>(console.log("option",t),n.createElement("div",{className:"cp profile-dropdown--item display: flex ",style:l===_?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},key:l,onClick:()=>C(t)},t.icon&&n.createElement("span",{className:"icon"}," ",t.icon," "),e.isPropertyAssess?n.createElement("div",null,e.t?e.t(t[e.optionKey]):t[e.optionKey]):n.createElement("span",null," ",e.t?e.t(t[e.optionKey]):t[e.optionKey]),n.createElement("div",null,"(",e.t("COMMON_MASTERS_DESIGNATION_"+t.designation),")")))),y&&0===y.length&&n.createElement("div",{className:"cp profile-dropdown--item display: flex ",key:"-1",onClick:()=>{}},n.createElement("span",null," ",e.t?e.t("CMN_NOOPTION"):"CMN_NOOPTION"))):n.createElement("div",{className:"options-card",style:c({},e.optionCardStyles,{overflow:"scroll",maxHeight:"350px"}),id:"jk-dropdown-unique",ref:h},e.option.filter(e=>(null==e?void 0:e.toUpperCase().indexOf(null==v?void 0:v.toUpperCase()))>-1).map((e,t)=>n.createElement("p",{key:t,style:t===_?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},onClick:()=>C(e)},e))):null)},Mt=e=>n.createElement("h1",{className:"heading-m"},e.label),kt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ut=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(kt,null)),Ht=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:g}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,A]=l.useState({}),[S,N]=l.useState({}),[b,C]=l.useState([]),[y,D]=l.useState(null),[O,L]=l.useState(null),[T,I]=l.useState(null),[w,P]=l.useState(null),[R,x]=l.useState([]),[F,B]=l.useState(null),[M,k]=l.useState(!1);function U(e){L(e.target.files[0])}return l.useEffect(()=>{var e;g&&g["egf-master"]&&x(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),l.useEffect(()=>{var e;C(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{P(null);const e=function(){if(O){const e=function(){if(O.size>=5242880)P(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",O,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):P(a("CS_FILE_UPLOAD_ERROR"))})},function(){P(a("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)}}()},[O]),l.useEffect(()=>{r&&A(null!=r&&r.showFinancialYearsModal?(e=>{let{t:l,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:l("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:n.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:F,setSelectedFinancialYear:B}):(e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(m||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:y,setSelectedApprover:D,selectFile:U,uploadedFile:T,setUploadedFile:I,businessService:v}))},[r,b,R,F,T]),r&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Mt,{label:a(h.label.heading)}),headerBarEnd:n.createElement(Ut,{onClick:d}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F:f||(null==r?void 0:r.docUploadRequired)&&!T,formId:"modal-action"},_?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};m.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:c({},m,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==F?void 0:F.name,propertyId:null==m?void 0:m.propertyId,tenantId:u,source:null==m?void 0:m.source,channel:null==m?void 0:m.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==O?void 0:O.name,fileStoreId:T}]),s({Property:c({},m,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):n.createElement(t.Loader,null)},Wt=e=>n.createElement("h1",{className:"heading-m"},e.label),jt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),zt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(jt,null)),Vt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:E,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')]"}]}]}}),[_,g]=l.useState({}),[h,A]=l.useState({}),[S,N]=l.useState([]),[b,C]=l.useState({}),[y,D]=l.useState(null),[O,L]=l.useState(null),[T,I]=l.useState(null),[w,P]=l.useState([]),[R,x]=l.useState(null);l.useEffect(()=>{var e;f&&f["egf-master"]&&P(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:F}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){D(e.target.files[0])}return l.useEffect(()=>{if(p&&F){var e;const t=F["common-masters"].Department;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),l.useEffect(()=>{!function(){try{I(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",y,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("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)}}()},[y]),l.useEffect(()=>{r&&g((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:m?l("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:C,selectFile:B,uploadedFile:O,setUploadedFile:L,businessService:v}))},[r,S,w,R,O]),r&&_.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Wt,{label:a(_.label.heading)}),headerBarEnd:n.createElement(zt,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){m=c({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:null}),s({Licenses:[m]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},Gt=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),qt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Yt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(qt,null)),Kt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)});console.log(p,"DEKHO");const[f,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState({}),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t,l,n,i,o,r;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:(null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.designation)||"N/A",displayName:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" ("+(a(null==e||null===(o=e.assignments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.designation)||"N/A")+")"}}))},[p]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{r&&_((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"SEND_BACK_TO_CITIZEN"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?l("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:v?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?n.createElement(Bt,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a,t:l}):null},{label:l("WF_COMMON_COMMENTS")+"*",type:"textarea",populators:{name:"comments"}},{label:l("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:w,uploadedFile:D,setUploadedFile:O,businessService:v,error:L}))},[r,A,D,L]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Gt,{label:a(f.label.heading)}),headerBarEnd:n.createElement(Yt,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},E?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){m=c({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null,wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null}),console.log("action",r),console.log("applicationData",m),s({Licenses:[m]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},Xt=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Qt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Qt,null)),Zt=e=>{var i,o,a,u,d,s,m,v,p,E,f,_,g,h,A,S,N,b;let{t:C,action:y,tenantId:D,closeModal:O,submitAction:L,applicationDetails:T,applicationData:I,businessService:w,workflowDetails:P,blockReason:R}=e;console.log("applicationData_BPAACTIONMODAL",I);const x=[...new Set(null==P||null===(i=P.data)||void 0===i||null===(o=i.initialActionState)||void 0===o||null===(a=o.nextActions)||void 0===a||null===(u=a.find(e=>(null==e?void 0:e.action)===(null==y?void 0:y.action)))||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.flatMap(e=>e.roles||[]))];console.log("workflowDetails_BPAACTIONMODAL",P,x,y),Digit.Hooks.obps.useObpsAPI(null!==(s=I)&&void 0!==s&&null!==(m=s.landInfo)&&void 0!==m&&null!==(v=m.address)&&void 0!==v&&v.city?null===(p=I)||void 0===p||null===(E=p.landInfo)||void 0===E||null===(f=E.address)||void 0===f?void 0:f.city:D,!1);const{data:F,isLoading:B}=Digit.Hooks.useEmployeeSearch(D,{roles:null==x?void 0:x.map(e=>({code:e})),zones:null===(_=I)||void 0===_||null===(g=_.additionalDetails)||void 0===g?void 0:g.zonenumber,categories:null===(h=I)||void 0===h||null===(A=h.additionalDetails)||void 0===A?void 0:A.categories,subcategories:null===(S=I)||void 0===S||null===(N=S.additionalDetails)||void 0===N?void 0:N.subcategories,assignedtenattids:null===(b=I)||void 0===b?void 0:b.tenantId,isActive:!0},{enabled:!(null!=y&&y.isTerminateState)});console.log("approverData",F),r.useQueryClient();const[M,k]=l.useState({}),[U,H]=l.useState({}),[W,j]=l.useState([]),[z,V]=l.useState([]),[G,q]=l.useState({}),[Y,K]=l.useState({}),[X,Q]=l.useState(null),[J,Z]=l.useState(null),[$,ee]=l.useState(null),[te,le]=l.useState(null),ne=!!Digit.Utils.browser.isMobile();function ie(e){Q(e.target.files[0])}l.useEffect(()=>{var e;j(null==F||null===(e=F.Employees)||void 0===e?void 0:e.map(e=>{var t,l,n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.designation}}))},[F]),l.useEffect(()=>{!function(){try{ee(null);const e=function(){if(X){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(X.size>=5242880)ee(C("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=X&&X.type&&!e.test(null==X?void 0:X.type))ee(C("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",X,Digit.ULBService.getStateId()||(null==D?void 0:D.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?Z(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):ee(C("CS_FILE_UPLOAD_ERROR"))})},function(){ee(C("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)}}()},[X]);const oe=e=>{let t=[];return e&&e.map((e,l)=>{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},ae=e=>{let t=[];var l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},re=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:oe(e.Documents),date:e.InspectionDate,questions:ae(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},ue=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return l.useEffect(()=>{V(null==R?void 0:R.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),y&&k((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectedBlockReason:d,setBlockReason:s,selectFile:c,uploadedFile:m,setUploadedFile:v,assigneeLabel:p,businessService:E,error:f,blockReasonFiltered:_}=e,g=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(g=!0),console.log("actionInModal",o),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+E+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||g||"BLOCK"==(null==o?void 0:o.action)||"VERIFY"==(null==o?void 0:o.action)||"SEND_FOR_INSPECTION_REPORT"==(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||g||"BLOCK"==(null==o?void 0:o.action)||"VERIFY"==(null==o?void 0:o.action)||"SEND_FOR_INSPECTION_REPORT"==(null==o?void 0:o.action)?null:n.createElement(Bt,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r,t:i})},{label:"BLOCK"==(null==o?void 0:o.action)?i("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==o?void 0:o.action)?n.createElement(t.Dropdown,{option:_,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:d,isMandatory:!0}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{v(null)},message:m?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:f})}]}]}})({t:C,action:y,approvers:W,selectedApprover:G,setSelectedApprover:q,selectedBlockReason:Y,setBlockReason:K,selectFile:ie,uploadedFile:J,setUploadedFile:Z,businessService:w,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:$,blockReasonFiltered:z}))},[y,W,te,J,$]),y&&M.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Xt,{label:C(M.label.heading)}),headerBarEnd:n.createElement(Jt,{onClick:O}),actionCancelLabel:C(M.label.cancel),actionCancelOnSubmit:O,actionSaveLabel:C(M.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:ne?{width:"720px"}:{},style:ne?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:ne?{paddingLeft:"5px"}:{}},B?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:M.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a,r,u,d,s,m,v,p,E,f,_,g,h,A,S,N,b,D,w,R,x,F,B,M,k,U,H,W,j,z,V,q,K,Q,Z,$,ee;if(I=c({},I,{documents:null===(t=I)||void 0===t?void 0:t.documents,additionalDetails:c({},null===(l=I)||void 0===l?void 0:l.additionalDetails,{fieldinspection_pending:re(I),pendingapproval:ue(),blockingReason:null==Y?void 0:Y.name}),workflow:{action:null==y?void 0:y.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null!=Y&&Y.name?(null==Y?void 0:Y.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null!=Y&&Y.name?(null==Y?void 0:Y.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==P||null===(o=P.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==P||null===(d=P.data)||void 0===d||null===(s=d.processInstances)||void 0===s||null===(m=s[0])||void 0===m||null===(v=m.assigner)||void 0===v?void 0:v.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==P||null===(p=P.data)||void 0===p||null===(E=p.processInstances)||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.state)||void 0===_?void 0:_.applicationStatus)?[null==P||null===(g=P.data)||void 0===g||null===(h=g.processInstances)||void 0===h||null===(A=h[0])||void 0===A||null===(S=A.assigner)||void 0===S?void 0:S.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,varificationDocuments:J?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==X?void 0:X.name,fileStoreId:J}]:null},action:null==y?void 0:y.action,riskType:null===(N=I)||void 0===N||null===(b=N.additionalDetails)||void 0===b?void 0:b.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==P||null===(D=P.data)||void 0===D||null===(w=D.processInstances)||void 0===w||null===(R=w[0])||void 0===R||null===(x=R.state)||void 0===x?void 0:x.applicationStatus)?[null==P||null===(F=P.data)||void 0===F||null===(B=F.processInstances)||void 0===B||null===(M=B[0])||void 0===M||null===(k=M.assigner)||void 0===k?void 0:k.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,wfDocuments:J?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==X?void 0:X.name,fileStoreId:J}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(U=I)||void 0===U||null===(H=U.additionalDetails)||void 0===H||null===(W=H.selfCertificationCharges)||void 0===W?void 0:W.BPA_MALBA_CHARGES)+parseInt(null===(j=I)||void 0===j||null===(z=j.additionalDetails)||void 0===z||null===(V=z.selfCertificationCharges)||void 0===V?void 0:V.BPA_LABOUR_CESS)+parseInt(null===(q=I)||void 0===q||null===(K=q.additionalDetails)||void 0===K||null===(Q=K.selfCertificationCharges)||void 0===Q?void 0:Q.BPA_WATER_CHARGES)+parseInt(null===(Z=I)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(ee=$.selfCertificationCharges)||void 0===ee?void 0:ee.BPA_GAUSHALA_CHARGES_CESS))O(),alert(C("Enterd Less Adjustment amount is invalid"));else{var te,le;const e=null==T||null===(te=T.nocData)||void 0===te?void 0:te.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:c({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}}),t={};let l=!0,n=!0;null==t||null===(le=t.Noc)||void 0===le||le.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=n||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(n=!1))});let i=[];e&&e.map(e=>{var t,o,a,r,u,d,s,c,m,v,p,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.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===(m=e.Noc)||void 0===m||null===(v=m.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&n)&&i.push(e)}),L({BPA:I},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:U,formId:"modal-action"})):n.createElement(t.Loader,null)},$t=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),el=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),tl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(el,null)),ll=e=>{var o,a,u,d,s,m,v;let{t:p,action:E,tenantId:f,closeModal:_,submitAction:g,applicationData:h,businessService:A}=e;const{data:S,isLoading:N}=Digit.Hooks.useEmployeeSearch(f,{roles:null===(o=workflowDetails)||void 0===o||null===(a=o.data)||void 0===a||null===(u=a.initialActionState)||void 0===u||null===(d=u.nextActions)||void 0===d||null===(s=d.filter(e=>(null==e?void 0:e.action)==(null==E?void 0:E.action)))||void 0===s||null===(m=s[0])||void 0===m||null===(v=m.assigneeRoles)||void 0===v?void 0:v.map(e=>({code:e})),isActive:!0},{enabled:!(null!=E&&E.isTerminateState)}),[b,C]=(r.useQueryClient(),l.useState({})),[y,D]=l.useState({}),[O,L]=l.useState([]),[T,I]=l.useState({}),[w,P]=l.useState(null),[R,x]=l.useState(null),[F,B]=l.useState(null),M=!!Digit.Utils.browser.isMobile();function k(e){P(e.target.files[0])}return i.useHistory(),l.useEffect(()=>{var e;L(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]),l.useEffect(()=>{!function(){try{B(null);const e=function(){if(w){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(w.size>=5242880)B(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=w&&w.type&&!e.test(null==w?void 0:w.type))B(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",w,Digit.ULBService.getStateId()||(null==f?void 0:f.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?x(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(p("CS_FILE_UPLOAD_ERROR"))})},function(){B(p("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)}}()},[w]),l.useEffect(()=>{E&&C((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,E=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(E=!0);let f=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(f=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||f?null:i(m||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||f?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:E,approvers:O,selectedApprover:T,setSelectedApprover:I,selectFile:k,uploadedFile:R,setUploadedFile:x,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:F}))},[E,O,R,F]),E&&b.form?n.createElement(t.Modal,{headerBarMain:n.createElement($t,{label:p(b.label.heading)}),headerBarEnd:n.createElement(tl,{onClick:_}),actionCancelLabel:p(b.label.cancel),actionCancelOnSubmit:_,actionSaveLabel:p(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:M?{width:"720px"}:{},style:M?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:M?{paddingLeft:"5px"}:{}},N?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:b.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=h)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=h)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),h=c({},h,{workflow:{action:null==E?void 0:E.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:R?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==w?void 0:w.name,fileStoreId:R}]:null},documents:o}),g({Noc:h},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):n.createElement(t.Loader,null)},nl=e=>n.createElement("h1",{className:"heading-m"},e.label),il=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ol=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(il,null)),al=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},rl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;const{data:p,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState({}),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function P(e){y(e.target.files[0])}return l.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]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{var e,l,i,o;"DisconnectWSConnection"==(null===(e=m)||void 0===e||null===(l=e.processInstance)||void 0===l?void 0:l.businessService)||"DisconnectSWConnection"==(null===(i=m)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:m,businessService:v,error:p}=e,E=!0,f=!1;return(null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(E=!1),o.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(f=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:E?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},f&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,l)=>n.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},l))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{m(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v,error:L})):r&&_((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,p=!0;return(null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(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==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v,error:L}))},[r,A,D,L]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(nl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(ol,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},E?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,d,v,p,E;if(null!==(t=m)&&void 0!==t&&t.isBillAmend){var f,_,g,h,A,S,b,y,O;const t=c({},null===(f=m)||void 0===f||null===(_=f.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),l=c({},null===(g=m)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(h=m)||void 0===h||null===(A=h.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=m)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(y=m)&&void 0!==y&&null!==(O=y.applicationType)&&void 0!==O&&O.includes("WATER")?"WS":"SW",assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]}});s({AmendmentUpdate:l})}else{if(m=c({},m,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:[],assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:c({},null===(l=m)||void 0===l?void 0:l.processInstance,{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]})}),null!=e&&e.date&&null!==(n=m)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=gt(null==e?void 0:e.date);m.disconnectionExecutionDate=al(t)}else if(null!=e&&e.date){const t=gt(null==e?void 0:e.date);m.connectionExecutionDate=al(t)}var L;if("DisconnectWSConnection"==(null===(o=m)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=m)||void 0===d||null===(v=d.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(L=m)||void 0===L?void 0:L.serviceType)?s({WaterConnection:m,disconnectRequest:!0}):s({SewerageConnection:m,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=m)||void 0===p?void 0:p.applicationType))s({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(E=m)||void 0===E?void 0:E.applicationType))s({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!0});else{var T,I,w,P,R,x,F,B,M,k,U,H,W;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(T=t.value)&&void 0!==T&&T.adhocPenalty&&(m.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(m.additionalDetails.adhocPenaltyComment=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(m.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebate&&(m.additionalDetails.adhocRebate=parseInt(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(m.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&&(m.additionalDetails.adhocRebateReason=(null==t||null===(H=t.value)||void 0===H?void 0:H.adhocRebateReason)||""),"WATER"==(null===(W=m)||void 0===W?void 0:W.serviceType)?s({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},ul=e=>n.createElement("h1",{className:"heading-m"},e.label),dl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),sl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(dl,null)),cl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState(null),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),[I,w]=l.useState(!1);function P(e){y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("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]),l.useEffect(()=>{r&&_((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:"WF_"+(null==l?void 0:l.action)+"_APPLICATION",submit:"WF_"+n+"_"+(null==l?void 0:l.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v}))},[r,A,D]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ul,{label:a(f.label.heading)}),headerBarEnd:n.createElement(sl,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};m.creationReason="CREATE",s({PetRegistrationApplications:[c({},m,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),s({PetRegistrationApplications:[c({},m,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},ml=e=>n.createElement("h1",{className:"heading-m"},e.label),vl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(vl,null)),El=e=>{var i,o,a;let{t:r,action:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;const p=Digit.ULBService.getStateId(),{data:E,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==E||null===(i=E.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",m);const[_,g]=l.useState({}),[h,A]=l.useState({}),[S,N]=l.useState([]),[b,C]=l.useState(""),[y,D]=l.useState([]),[O,L]=l.useState(null),T=null===(o=m)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",T);const I=l.useMemo(()=>{var e;if(f||!E||!T.length)return[];const t=new Set(T.map(e=>e.tradeType)),l=(null===(e=E.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",l),l?["1"]:["1","2","3"]},[f,E,T]);return console.log("years",I),l.useEffect(()=>{u&&g((e=>{let{t:l,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:l("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:C,businessService:v}))},[u,I,y,O]),u&&_.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ml,{label:r(_.label.heading)}),headerBarEnd:n.createElement(pl,{onClick:d}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=null===(t=m)||void 0===t?void 0:t.financialYear;const n=null==l?void 0:l.split("-")[1],i="20"+Number(n)+"-"+(Number(n)+1);m=c({},m,{financialYear:i,action:"INITIATE",additionalDetail:c({},m.additionalDetail,{validityYears:b.length>0?parseInt(b):""})}),s({Licenses:[m]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},fl=e=>n.createElement("h1",{className:"heading-m"},e.label),_l=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(_l,null)),hl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[f,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState(null),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),[I,w]=l.useState(!1);function P(e){w(!0),y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Lt(function(){return Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,m),l.useEffect(()=>{_((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const m=()=>n.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:l("SV_ASSIGNEE"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:u,t:l,optionKey:"name",select:s,selected:d})},{label:l("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:l("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement(m,null),n.createElement("span",null,"Uploading...")):a?"1 "+l("SV_FILE_UPLOADED"):l("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v,isUploading:I}))},[r,A,D]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(fl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(gl,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==m||null===(t=m.auditDetails)||void 0===t?void 0:t.createdBy]:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null};D&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),s({streetVendingDetail:c({},m,{workflow:l})})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},Al=e=>n.createElement("h1",{className:"heading-m"},e.label),Sl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Nl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Sl,null)),bl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState(null),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),[I,w]=l.useState(!1);function P(e){y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("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]),l.useEffect(()=>{r&&_((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:l("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:l("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+l("ES_CHB_ACTION_FILEUPLOADED"):l("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v}))},[r,A,D]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Al,{label:a(f.label.heading)}),headerBarEnd:n.createElement(Nl,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),s({hallsBookingApplication:[c({},m,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},Cl=e=>n.createElement("h1",{className:"heading-m"},e.label),yl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Dl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(yl,null)),Ol=e=>{var o,a,r;let{t:u,action:d,tenantId:s,closeModal:m,submitAction:v,applicationData:p,businessService:E,moduleCode:f}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),g=i.useHistory(),[h,A]=l.useState({}),[S,N]=l.useState({}),[b,C]=l.useState([]),[y,D]=l.useState(null),[O,L]=l.useState(null);return l.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),l.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):A((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:"WF_"+(null==l?void 0:l.action)+"_APPLICATION",submit:"WF_"+n+"_"+(null==l?void 0:l.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:b,selectedApprover:y,setSelectedApprover:D,uploadedFile:O,setUploadedFile:L,businessService:E}))},[d,b,O]),d&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Cl,{label:u(h.label.heading)}),headerBarEnd:n.createElement(Dl,{onClick:m}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:h.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:E,moduleName:f};O&&(t.documents=[]),v({Asset:c({},p,{workflow:t})})},defaultValues:S,formId:"modal-action"})):n.createElement(t.Loader,null)},Ll=e=>null!=e&&e.businessService.includes("PT")?n.createElement(Ht,e):null!=e&&e.businessService.includes("ptr")?n.createElement(cl,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?n.createElement(Vt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?n.createElement(El,e):null!=e&&e.moduleCode.includes("BPAREG")?n.createElement(Kt,e):null!=e&&e.moduleCode.includes("BPA")?n.createElement(Zt,e):null!=e&&e.moduleCode.includes("NOC")?n.createElement(ll,e):null!=e&&e.moduleCode.includes("WS")?n.createElement(rl,e):null!=e&&e.businessService.includes("street-vending")?n.createElement(hl,e):null!=e&&e.businessService.includes("chb")?n.createElement(bl,e):null!=e&&e.businessService.includes("asset-create")?n.createElement(Ol,e):void 0;function Tl(e){let{documents:l,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return n.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!s&&(null==l?void 0:l.map((e,i)=>{var o,s,c;return n.createElement(n.Fragment,{key:i},n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},n.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((l,i)=>{var o;return n.createElement("div",{style:{width:"180px"}},n.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),n.createElement("a",{target:"_",href:null==l?void 0:l.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},n.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==l?void 0:l.title)),a?null!=l&&null!==(o=l.documentType)&&void 0!==o&&o.includes("NOC")?n.createElement("p",{style:{textAlign:"center"}},d(null==l?void 0:l.documentType.split(".")[1])):n.createElement("p",{style:{textAlign:"center"}},d(null==l?void 0:l.documentType)):""))}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),n.createElement("div",{style:{width:"180px"}},n.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),n.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},n.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),n.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==l?void 0:l.length)!=i+1?n.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==l?void 0:l.map((e,l)=>{var o;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,n.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,l)=>n.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:l},n.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?n.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,n.createElement(t.PDFSvg,null),n.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")&&n.createElement("div",null,n.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Il=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],m=Digit.ULBService.getStateId(),[v,p]=l.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,f]=l.useState(null),[_,g]=l.useState([]),[h,A]=l.useState(!0),[S,N]=l.useState(!1),[b,C]=l.useState(!1),{isLoading:y,data:D}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:O,data:L}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return l.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==L||null===(t=L["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0])+"."+(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),g(d)},[!y,!O]),l.useEffect(()=>{let e=0;_.map(t=>{let l=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(l=!0)}),!l&&t.required&&(e+=1)}),A("0"!=e&&0!=e||!(v.length>0))},[v,S]),l.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),n.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==_?void 0:_.map((e,t)=>n.createElement("div",{style:{padding:"20px"}},n.createElement(wl,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:N,applicationStatus:s,actions:c,bpaTaxDocuments:_,checkEnablingDocs:b}))))};function wl(e){var i,o;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:m,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==r?void 0:r.code)})[0],E=Digit.ULBService.getStateId(),[f,_]=l.useState(p?c({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,h]=l.useState(null),[A,S]=l.useState(()=>(null==p?void 0:p.fileStoreId)||null),[N,b]=l.useState([]);return l.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==A?void 0:A.length)||null===A?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==f?void 0:f.code,fileStoreId:A,documentUid:A,fileName:(null==g?void 0:g.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}]})},[A,f]),l.useEffect(()=>{try{N.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],N.map(e=>{var t,l,n;null!=f&&f.code&&r.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===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),m[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(m)))}catch(e){Promise.reject(e)}},[N,f]),l.useEffect(()=>{},[g]),n.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&n.createElement(Tl,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?n.createElement("div",{style:{marginTop:"20px"}},n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),n.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:f,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:E,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&b(n),(i=n[n.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Pl(e){let{fiReport:l,isCitizen:i=!1}=e;const{t:a}=o.useTranslation();return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginTop:"10px"}},n.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),l.map((e,i)=>{var o,r,u,d,s,c;return n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},n.createElement(t.StatusTable,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==l?void 0:l.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+a("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=>n.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},n.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),n.createElement(Tl,{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 Rl(e){let{t:i,document:o,setNocDocuments:a,setError:r,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==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,m]=l.useState(),[v,p]=l.useState(null),[E,f]=l.useState(()=>(null==d?void 0:d.fileStoreId)||null);return l.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==E?void 0:E.length)||null===E?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==E),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:E,documentUid:E,fileName:(null==v?void 0:v.name)||""}]})},[E]),l.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,l,n,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?f(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),n.createElement("div",{style:{}},n.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},n.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&p(n.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const xl=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const m=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[g,h]=l.useState([]),[A,S]=l.useState([]),[N,b]=l.useState(!1),[C,y]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,O]=l.useState(null),L=window.location.href.includes("/employee/");return l.useEffect(()=>{var e;h(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),l.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=u?null==E||null===(o=E.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;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===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(n[0].docTypes[0]));let m=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),m.push(e)}),S(m))},[E,g]),l.useEffect(()=>{b("NOC_VERIFICATION_INPROGRESS"===v&&(null==p?void 0:p.length)>0)},[d,c]),n.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:L?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,l)=>{if(null!=e&&e.value)return n.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:L?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:L?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),n.createElement(Tl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),N&&(null==A?void 0:A.map((e,t)=>n.createElement(Rl,{key:t,document:e,t:o,error:D,setError:O,setNocDocuments:y,nocDocuments:C,checkEnablingDocs:N}))))},Fl=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[d,s,m]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);l.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return n.createElement("div",null,n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,l)=>n.createElement(t.CheckBox,{key:l,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,l)=>{const n=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>l===t?c({},e,{checked:n}):e))})(e,0,l),isLabelFirst:!0,index:l})),null==d?void 0:d.map((e,l)=>n.createElement("div",null,n.createElement(t.TextInput,{key:l,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,l),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),n.createElement(t.LinkButton,{label:n.createElement("div",null,n.createElement("span",null,n.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])})(l)}))),n.createElement(t.LinkButton,{style:{maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Bl(e){let{taxHeadEstimatesCalculation:l}=e;const{taxHeadEstimates:i}=l,{t:a}=o.useTranslation();return n.createElement("div",{style:{marginTop:"40px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,l)=>n.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:l===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),n.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==l?void 0:l.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ml(e){let{floors:l}=e;const{t:i}=o.useTranslation();return n.createElement(n.Fragment,null,l.map(e=>{var l;return n.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(l=e.values)||void 0===l?void 0:l.map((e,l)=>{var o;return n.createElement(n.Fragment,{key:l},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==l?"16px":"revert"}},i(e.title)),n.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},n.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,l)=>{var o;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:n.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:l===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function kl(e){let{owners:l}=e,i={};i=window.location.href.includes("/employee/pt/")?l.slice().reverse():l;const{t:a}=o.useTranslation(),r=(null==l?void 0:l.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",minWidth:"280px",width:"100%"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=c({},u,{maxWidth:"950px"}),u=c({},u,{maxWidth:"950px"}),s={}),l.sort((e,t)=>{var l,n;return(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.ownerSequence)-(null==t||null===(n=t.additionalDetails)||void 0===n?void 0:n.ownerSequence)}),n.createElement(n.Fragment,null,n.createElement("div",{className:"owner-details"},i.map((e,l)=>{var i;return n.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},n.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(l+1):a(null==e?void 0:e.title)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:d},n.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return!0===e.map&&"N/A"!==e.value?n.createElement(t.Row,{key:a(e.title),label:a(e.title),text:n.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):n.createElement("span",null,n.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Ul=e=>{var i,a;let{scrutinyDetails:r,paymentsList:u=[],additionalDetails:d,applicationData:s}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==s?void 0:s.status))&&window.location.href.includes("bpa");const[c,m]=l.useState(),[v,p]=l.useState(),[E,f]=l.useState(),_=Digit.ULBService.getStateId(),[g,h]=l.useState(),[A,S]=l.useState(),[N,b]=l.useState([]),[C,y]=l.useState(),[D,O]=l.useState(""),[L,T]=l.useState(null),[I,w]=l.useState({}),[P,R]=l.useState(!1),[x,F]=l.useState(!1);l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(C.size>=2e6)T(B("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?b([...N,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):T(B("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else T(B("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(N))},[N]),l.useEffect(()=>{var e,t,l,n,i,o,a;if(null!=d&&null!==(e=d.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==d?void 0:d.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i;return t===(null==d||null===(l=d.lessAdjustmentFeeFiles)||void 0===l?void 0:l.length)-1?null==d||null===(n=d.lessAdjustmentFeeFiles[(null==d||null===(i=d.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,_).then(e=>w(null==e?void 0:e.data))}m(null==d||null===(t=d.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==d||null===(l=d.selfCertificationCharges)||void 0===l?void 0:l.BPA_DEVELOPMENT_CHARGES),p(null==d||null===(n=d.selfCertificationCharges)||void 0===n?void 0:n.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==d||null===(i=d.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),f(null==d||null===(o=d.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==d||null===(a=d.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==d?void 0:d.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==d?void 0:d.otherFeesDiscription),b(null==d?void 0:d.lessAdjustmentFeeFiles)},[d]);const{t:B}=o.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?n.createElement("span",{style:{color:"#00703C"}},B(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?B(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void B("NA");return n.createElement(l.Fragment,null,!(null!=r&&r.isChecklist)&&n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement("div",null,null==r||null===(i=r.values)||void 0===i?void 0:i.map((e,l)=>null!=e&&e.isUnit?n.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:""+B(""+e.title),text:null!=e&&e.value?M(e)+" "+B(null==e?void 0:e.isUnit):B("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?n.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:""+B(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},B(null==e?void 0:e.title)):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},B(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,l)=>n.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},Hl=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:m}=o.useTranslation(),v=window.Digit.Utils.browser.isMobile(),p=[{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_DEDUCTION",id:"Deduction"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=l.useMemo(()=>p.map(e=>({Header:m(""+e.name),accessor:E(e.id),id:e.id})));function _(e){var t;let l=[],n=0,i=0,o=0;return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,a,r,u,d,s,c,v,p,E,f,_,g,h;const A=Number(null===(t=e.occupancies)||void 0===t||null===(a=t[0])||void 0===a?void 0:a.builtUpArea)||0,S=Number(null===(r=e.occupancies)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.floorArea)||0,N=Number(null===(d=e.occupancies)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.deduction)||0;n+=A,i+=S,o+=N,l.push({Floor:m("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:m(""+(null===(c=e.occupancies)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.type)),BuildupArea:Number(null===(p=e.occupancies)||void 0===p||null===(E=p[0])||void 0===E?void 0:E.builtUpArea).toFixed(2),Deduction:Number(null===(f=e.occupancies)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.deduction).toFixed(2),FloorArea:Number(null===(g=e.occupancies)||void 0===g||null===(h=g[0])||void 0===h?void 0:h.floorArea).toFixed(2)||0,key:m("BPA_FLOOR_NAME_"+e.number)})}),l.push({Floor:m("BPA_TOTAL"),Level:"",Occupancy:"",BuildupArea:Number(n).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL"),Deduction:Number(o).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL"),FloorArea:Number(i).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL")}),l}function g(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+m("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return n.createElement(l.Fragment,null,n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,l)=>null!=e&&e.isHeader?n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},m(null==e?void 0:e.title)):n.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+m(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""})),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,l)=>{var i,o,a,r,u;return n.createElement("div",{key:l,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.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"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},m("BPA_BLOCK_SUBHEADER")," ",l+1),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+m("BPA_SUB_OCCUPANCY_LABEL"),text:g(l)})),n.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},n.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:m,disableSort:!0,autoSort:!1,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:f,getCellProps:e=>({style:{}})})))})))},Wl=e=>{let{headComment:t,otherComment:l}=e;return n.createElement("div",{className:"checkpoint-comments-wrap"},n.createElement("h4",null,t),n.createElement("p",null,l))},jl=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,m]=l.useState(!1),{t:v}=o.useTranslation();return n.createElement("div",null,u.date&&n.createElement("p",null,u.date),n.createElement("p",null,u.name),u.mobileNumber&&n.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},n.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:s}),n.createElement("p",null,"    ")),u.source&&n.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&n.createElement(Wl,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?n.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>n.createElement("div",{className:"TLComments"},n.createElement("h3",null,v("WF_COMMON_COMMENTS")),!c&&n.createElement("div",null,n.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?n.createElement("button",{type:"button",onClick:()=>{m(!0)},style:{color:"#800000"}},v("View More")):null),c&&n.createElement("div",null,n.createElement("p",{style:{overflow:"visible"}},e),n.createElement("button",{type:"button",onClick:()=>{m(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?n.createElement("div",{className:"TLComments"},n.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),n.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function zl(e){let{units:l}=e;const{t:i}=o.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var o;return n.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",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(l+1)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.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,l)=>{var o;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:n.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:l===(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 Vl(e){let{units:l}=e;const{t:i}=o.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var o;return n.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",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(l+1)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.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,l)=>{var o;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:n.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:l===(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 Gl=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=o.useTranslation();let m=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{}):{};var v;const p=null==m?void 0:m.mode;var{connectionDetails:E,plumberDetails:f,roadCuttingDetails:_,roadCuttingAddlDetails:g,activationDetails:h}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(i=s.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),n.createElement("div",null,n.createElement("div",{className:"connection-details-new-value-wrapper"},null==E?void 0:E.map((e,l)=>n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),n.createElement("div",null,n.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),n.createElement("div",null,n.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==_?void 0:_.map(e=>{var l;return n.createElement("div",{style:(null==_?void 0:_.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(l=e.values)||void 0===l?void 0:l.map(e=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==s||null===(u=s.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&n.createElement("div",null,n.createElement("br",null),n.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,l)=>n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.activationDetails)&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),n.createElement("div",null,n.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},ql=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Yl=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Kl=e=>{var i,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[m,v,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[A,S]=l.useState(!1),[N,b]=l.useState(m||{}),[C,y]=l.useState(null),[D,O]=l.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[L,T]=l.useState(d.additionalDetails.values?d.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),l.useEffect(()=>{var e,t,l;const i=c({},null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==m||null===(l=m.billDetails)||void 0===l?void 0:l.length)>0){var o,a,r,u,s,p,E;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(o=m.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(r=m.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:n.createElement("span",null,"₹",null==m||null===(s=m.billDetails)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.taxAmount)}];T(e),O(null==m||null===(E=m.billDetails)||void 0===E?void 0:E[0])}else v(i),b(i)},[]);let w={};const P=e=>n.createElement("h1",{className:"heading-m"},e.label),R=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(R,null)),F=function(e,t,l){void 0===t&&(t=!1);let n=c({},N);if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}b(n)};return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},L&&n.createElement(t.StatusTable,null,n.createElement("div",null,null==L?void 0:L.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),n.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:n.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),n.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?n.createElement("div",{onClick:e=>{S(!0)}},n.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,A&&n.createElement(t.Modal,{headerBarMain:n.createElement(P,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:n.createElement(x,{onClick:()=>{b(m),S(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(m),S(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=N&&N.adhocPenalty?Number(null==N?void 0:N.adhocPenalty):0,l=null!=N&&N.adhocRebate?Number(null==N?void 0:N.adhocRebate):0;var n,i;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))y({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,m,p,E,g,h,A;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l=c({},null==d||null===(m=d.additionalDetails)||void 0===m||null===(p=m.appDetails)||void 0===p?void 0:p.additionalDetails,N);d.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==d||null===(E=d.additionalDetails)||void 0===E||null===(g=E.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(h=d.additionalDetails)||void 0===h||null===(A=h.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,p,E,g,h;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(g=E[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const A=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[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===(m=c[0])||void 0===m?void 0:m.taxAmount}];f(gt(e.Calculation[0])),O(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(A),N.billDetails=null==e?void 0:e.Calculation,v(N),S(!1)}).catch(e=>{var t,l,n,i,o,a;y({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.message?s(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else y({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},n.createElement("div",null,n.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:ql,optionKey:"title",select:e=>F("adhocPenaltyReason",!0,e),selected:(null==N?void 0:N.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==N||null===(r=N.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&n.createElement("div",{className:"field"},n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==N?void 0:N.adhocPenaltyComment)||"",onChange:e=>F("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==N?void 0:N.adhocPenalty)||"",onChange:e=>F("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))),n.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:Yl,optionKey:"title",select:e=>F("adhocRebateReason",!0,e),selected:(null==N?void 0:N.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==N||null===(u=N.adhocRebateReason_data)||void 0===u?void 0:u.title)&&n.createElement("div",{className:"field"},n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==N?void 0:N.adhocRebateComment)||"",onChange:e=>F("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==N?void 0:N.adhocRebate)||"",onChange:e=>F("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&n.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:s(null==C?void 0:C.message),onClose:()=>{y(!1)},isDleteBtn:!0})))},Xl=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:m}=e;const{t:v}=o.useTranslation(),[p,E]=l.useState(!1),[f,_]=l.useState({}),g=e=>n.createElement("h1",{className:"heading-m"},e.label),h=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(h,null));return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=m&&null!==(i=m.additionalDetails)&&void 0!==i&&i.isViewBreakup?n.createElement("div",{onClick:e=>(()=>{var e;let t=m.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),_(t),E(!0)})(),style:{marginTop:"12px"}},n.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&n.createElement(t.Modal,{headerBarMain:n.createElement(g,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:n.createElement(A,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},n.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==f||null===(a=f.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==f||null===(u=f.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==f?void 0:f.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==f||null===(s=f.billSlabData)||void 0===s||null===(c=s.TAX)||void 0===c?void 0:c.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Ql=e=>{let{assessmentData:t}=e;const[i,o]=l.useState(!1);return n.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},n.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),n.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&n.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,l)=>n.createElement("div",{key:l,className:"assessment-item",style:{marginBottom:"15px"}},n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},n.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),n.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),n.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},n.createElement("div",{style:{display:"flex",gap:"75px"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),n.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}},"          ",n.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",n.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),l!==t.length-1&&n.createElement("hr",null)))))},Jl=e=>{var t;let{applicationData:o}=e;const[a,r]=l.useState(!1);return i.useHistory(),n.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},n.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),n.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&n.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},n.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},n.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),n.createElement("span",{style:{flex:"1",color:"black"}},o.acknowldgementNumber)),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.propertyId)),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=o.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.status)),n.createElement("div",null,n.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+o.acknowldgementNumber,state:{propertyId:o.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Zl=e=>{let{payments:t}=e;const[i,o]=l.useState(!1);return n.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},n.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),n.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&n.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&n.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payments found"),(null==t?void 0:t.length)>0&&n.createElement("div",null,n.createElement("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"10px"}},n.createElement("thead",null,n.createElement("tr",{style:{backgroundColor:"#f5f5f5"}},n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Receipt Number"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction Date"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Amount Paid"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Payment Mode"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction ID"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Status"))),n.createElement("tbody",null,t.map((e,t)=>{var l,i;return n.createElement("tr",{key:e.id||t},n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},(null===(l=e.paymentDetails)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.receiptNumber)||e.receiptNumber||"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionDate?new Date(e.transactionDate).toLocaleDateString():"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},"₹",e.totalAmountPaid||e.amount||"0"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.paymentMode||e.instrumentType||"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionNumber||e.instrumentNumber||"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},n.createElement("span",{style:{color:"NEW"===e.paymentStatus||"SUCCESSFUL"===e.paymentStatus||"DEPOSITED"===e.paymentStatus?"green":"FAILED"===e.paymentStatus?"red":"orange",fontWeight:"bold"}},"DEPOSITED"===e.paymentStatus?n.createElement("p",null,"Deposited"):e.paymentStatus||"N/A")))}))),n.createElement("div",{style:{marginTop:"10px",fontSize:"14px",color:"#666"}},"Total Payments: ",t.length))))},$l=n.memo(e=>{let{width:t=85,height:l=100,style:i}=e;return n.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:l,viewBox:"0 0 20 20",fill:"gray"},n.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))}),en=n.memo(e=>{let{value:i,Code:o,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:i},{value:i},o,a),d=l.useMemo(()=>{var e;const t=null!=i&&i.documents?null==i||null===(e=i.documents)||void 0===e?void 0:e.documents:i;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===o))||[]},[i,o]);return r?n.createElement(t.Loader,null):n.createElement("div",{className:"timeline-docs-wrapper"},null==d?void 0:d.map((e,t)=>{const l=((e,t)=>{var l;const n=(null==e?void 0:e[t])||"",i=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==i?void 0:i.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==i?void 0:i[0])||""})(null==u?void 0:u.pdfFiles,null==e?void 0:e.fileStoreId);return l?n.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:l,className:"timeline-doc-link"},n.createElement($l,{className:"timeline-doc-icon"})):null}))}),tn=[{label:"CM_TIMELINE_NAME",key:"assignerName"},{label:"CM_TIMELINE_ACTION_TAKEN",key:"performedAction"},{label:"CM_TIMELINE_ACTION_TAKEN_ON",key:"lastModified"},{label:"CM_TIMELINE_DATE_RECEIVED",key:"createdDate"},{label:"CM_TIMELINE_NO_OF_DAYS",key:"noOfDays"}],ln=(n.memo(e=>{var t,l;let{checkpoint:i,t:o}=e;return n.createElement("div",{className:"timeline-card"},n.createElement("div",{className:"timeline-header"},null==tn?void 0:tn.map(e=>{let{label:t,key:l}=e;return n.createElement("div",{key:l,className:"timeline-header-item"},n.createElement("span",{className:"timeline-label"},o(t),":"),n.createElement("span",{className:"timeline-value"},o(null==i?void 0:i[l])||"N/A"))})),n.createElement("div",{className:"timeline-note"},n.createElement("span",{className:"timeline-label"},o("CM_TIMELINE_NOTE"),":"),n.createElement("div",{className:"note-box"},(null==i?void 0:i.comment)||o("CM_TIMELINE_NO_COMMENTS"))),(null==i||null===(t=i.documents)||void 0===t?void 0:t.length)>0&&n.createElement("div",{className:"timeline-docs"},n.createElement("span",{className:"timeline-label"},o("CM_TIMELINE_DOCUMENT_ATTACHED"),":"),null==i||null===(l=i.documents)||void 0===l?void 0:l.map((e,t)=>n.createElement(en,{key:(null==e?void 0:e.documentType)+"-"+t,value:null==i?void 0:i.documents,Code:null==e?void 0:e.documentType,index:t}))))}),n.memo(e=>{let{width:t=20,height:l=20,style:i}=e;return n.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:l,viewBox:"0 0 20 20",fill:"gray"},n.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))})),nn=n.memo(e=>{let{value:i,Code:o,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:i},{value:i},o,a),d=l.useMemo(()=>{var e;const t=null!=i&&i.documents?null==i||null===(e=i.documents)||void 0===e?void 0:e.documents:i;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===o))||[]},[i,o]);return r?n.createElement(t.Loader,null):n.createElement("div",{className:"custom-doc-container"},null==d?void 0:d.map((e,t)=>{const l=((e,t)=>{var l;const n=(null==e?void 0:e[t])||"",i=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==i?void 0:i.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==i?void 0:i[0])||""})(null==u?void 0:u.pdfFiles,null==e?void 0:e.fileStoreId);return l?n.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:l,className:"custom-doc-link"},n.createElement(ln,null),n.createElement("span",null,(null==e?void 0:e.fileName)||"Document")):null}))});function on(e){let{workflowDetails:t,t:i}=e;const o=e=>{if(null==e||!e.created||null==e||!e.timing)return null;const[t,l,n]=e.created.split("/");return new Date(n+"-"+l+"-"+t+" "+e.timing)},a=(e,t)=>{if(!e||!t)return null;const l=Math.floor((e-t)/6e4),n=Math.floor(l/60),i=Math.floor(n/24);return i>0?i+" day(s)":n>0?n+" hour(s)":l+" minute(s)"},r=l.useMemo(()=>(e=>{const t=(null==e?void 0:e.data)||e,l=null==t?void 0:t.timeline;if(!Array.isArray(l))return[];const n=[...l].reverse();return n.map((e,t)=>{var l;const i=o(e.auditDetails),r=t>0?o(null===(l=n[t-1])||void 0===l?void 0:l.auditDetails):null;return c({},e,{status:(null==e?void 0:e.state)||(null==e?void 0:e.status),assigner:(null==e?void 0:e.assigner)||null,assignes:Array.isArray(null==e?void 0:e.assignes)?e.assignes:[],wfComment:Array.isArray(null==e?void 0:e.wfComment)?e.wfComment:null!=e&&e.comment?[e.comment]:[],wfDocuments:Array.isArray(null==e?void 0:e.wfDocuments)?e.wfDocuments:[],actionDateTime:i,sla:a(i,r)})}).reverse()})(t),[t]),u=(null==r?void 0:r.filter(e=>!("SAVE_AS_DRAFT"===(null==e?void 0:e.performedAction))))||[];return console.log("sortedData",u),n.createElement(n.Fragment,null,n.createElement("div",{className:"custom-timeline-container"},n.createElement("div",{className:"custom-timeline-header"},n.createElement("div",{className:"custom-tracking-status-header"},n.createElement("div",{className:"custom-tracking-line"}),n.createElement("span",{className:"custom-tracking-status-text"},i("TRACKING STATUS")),n.createElement("div",{className:"custom-tracking-line"})),n.createElement("div",{className:"custom-title-bar-row"},n.createElement("h2",{className:"custom-timeline-title"},i("Application History")),n.createElement("div",{className:"custom-blue-bar"}))),n.createElement("div",{className:"custom-timeline-entries"},null==u?void 0:u.map((e,t)=>{var l,o,a,r,u,d,s,c,m,v,p,E;return n.createElement("div",{key:t,className:"custom-timeline-entry"},n.createElement("div",{className:"custom-vertical-line"}),n.createElement("div",{className:"custom-date-badge"},null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.created," ",null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.timing),n.createElement("div",{className:"custom-entry-content"},n.createElement("div",{className:"custom-icon-container"},n.createElement("div",{className:"custom-circular-icon"},n.createElement("svg",{className:"custom-mail-icon",viewBox:"0 0 24 24"},n.createElement("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),n.createElement("path",{d:"M3 7l9 6 9-6"})))),n.createElement("div",{className:"custom-content-card"},n.createElement("div",{className:"custom-card-top"},n.createElement("div",{className:"custom-card-left"},n.createElement("h3",{className:"custom-action-title"},i("Action taken by")),(null==e?void 0:e.assigner)&&n.createElement("div",{className:"custom-officer-info"},n.createElement("div",{className:"custom-officer-name"},(null==e||null===(a=e.assigner)||void 0===a?void 0:a.name)||i("CS_COMMON_NA")),(null==e||null===(r=e.assigner)||void 0===r?void 0:r.emailId)&&n.createElement("div",{className:"custom-officer-email"},n.createElement("span",{className:"custom-email-label"},i("Email"))," ",null==e||null===(u=e.assigner)||void 0===u?void 0:u.emailId))),(null==e?void 0:e.sla)&&n.createElement("div",{className:"custom-card-left"},n.createElement("h3",{className:"custom-action-title"},i("Time Taken")),n.createElement("div",{className:"custom-officer-email"},n.createElement("span",{className:"custom-email-label"},null==e?void 0:e.sla))),n.createElement("div",{className:"custom-card-right"},n.createElement("h3",{className:"custom-action-title"},i("Action")),n.createElement("div",{className:"custom-status-text"},i((null==e?void 0:e.performedAction)||"CS_COMMON_NA")))),(null==e?void 0:e.wfComment)&&(null==e||null===(d=e.wfComment)||void 0===d?void 0:d.length)>0&&(null==e||null===(s=e.wfComment)||void 0===s?void 0:s.some(e=>null==e?void 0:e.trim()))&&n.createElement("div",{className:"custom-comments-section"},n.createElement("div",{className:"custom-comment-text"},n.createElement("h4",{className:"custom-comments-title"},i("Officer Comments")),null==e||null===(c=e.wfComment)||void 0===c?void 0:c.map((e,t)=>n.createElement("p",{key:t},e))),(null==e||null===(m=e.assignes)||void 0===m?void 0:m.length)>0&&n.createElement("div",null,n.createElement("h3",{className:"custom-comments-title"},i("Assigned To")),n.createElement("div",{className:"custom-officer-info"},n.createElement("div",{className:"custom-officer-name"},null===(v=e.assignes[0])||void 0===v?void 0:v.name)))),(null==e?void 0:e.wfDocuments)&&(null==e||null===(p=e.wfDocuments)||void 0===p?void 0:p.length)>0&&n.createElement("div",{className:"custom-comments-section-no-border"},n.createElement("h4",{className:"custom-comments-title"},"Document Attached:"),n.createElement("div",{className:"custom-comment-text"},null==e||null===(E=e.wfDocuments)||void 0===E?void 0:E.map((t,l)=>n.createElement(nn,{key:(null==t?void 0:t.documentType)+"-"+l,value:null==e?void 0:e.wfDocuments,Code:null==t?void 0:t.documentType,index:l})))))))}))))}function an(e){var a,r,u,d,s,m,v,p,E,f,g,h,A,S,N,b;let{applicationDetails:C,demandData:y,workflowDetails:D,isDataLoading:O,applicationData:L,timelineStatusPrefix:T,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:P,oldValue:R,isInfoLabel:x=!1,propertyId:F,moduleCode:B}=e;const{t:M}=o.useTranslation(),k=i.useHistory(),U=Digit.ULBService.getCurrentTenantId(),[H,W]=l.useState(null),[j,z]=l.useState([]);let V=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const G=[{Header:M("BPA_DOCUMENT_DETAILS_LABEL"),accessor:"title",Cell:e=>{let{value:t}=e;return M(t)||M("CS_NA")}},{Header:M(" "),accessor:"url",Cell:e=>{let{value:l}=e;return l?n.createElement(t.LinkButton,{style:{float:"right",display:"inline"},label:M("View"),onClick:()=>{window.open(l,"_blank")}}):M("CS_NA")}}];function q(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}console.log("TIMELINE",C,B),l.useEffect(()=>{!function(){try{const e=function(){if(window.location.href.includes("employee/ws")&&null!=L&&L.connectionNo){const e=Ot(function(){return Promise.resolve(Digit.WSService.paymentsearch({tenantId:(null==L?void 0:L.tenantId)||U,filters:{consumerCodes:null==L?void 0:L.connectionNo,consumerCode:null==L?void 0:L.connectionNo},BusinessService:"SEWERAGE"===(null==L?void 0:L.serviceType)||"SEWARAGE"===(null==L?void 0:L.serviceType)?"SW":"WS"})).then(function(e){Array.isArray(e)&&e.length>0?z(e):null!=e&&e.Payments&&e.Payments.length>0&&z(e.Payments)})},function(e){console.error("❌ Payment fetch error:",e)});if(e&&e.then)return e.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[null==L?void 0:L.connectionNo,null==L?void 0:L.serviceType,U]);const[Y,K]=l.useState({}),[X,Q]=l.useState(),[J,Z]=l.useState([]),[$,ee]=l.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==L?void 0:L.status)||$.loading||$.loaded||$.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==$||!$.canLoad||$.loading||$.loaded||(ee({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0){const l=i.Assessments.filter(e=>"ACTIVE"===e.status),n=new Map;l.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,l=n.get(t);(!l||e.createdDate>l.createdDate)&&n.set(t,e)});const o=Array.from(n.values());return Z(o),Q(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==L?void 0:L.tenantId)||U,null==L?void 0:L.propertyId,K,ee));const te=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,n+"/"+l+"/"+t.getFullYear()},le=function(e,t,l){if(void 0===t&&(t=0),!e)return null;if("OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:te(null==L||null===(i=L.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==L?void 0:L.channel)||""};return n.createElement(jl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,m,v,p,E,f,g,h,A,S,N,b,y,D;const i={uuid:(null==e||null===(o=e.assigner)||void 0===o?void 0:o.uuid)||(null==e||null===(a=e.assignes)||void 0===a||null===(r=a[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==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+(_.get(e,"ProcessInstances["+t+"].assigner.mobileNumber")||_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber")),l}}},O=l&&Array.isArray(l)&&t>0&&t-1<l.length?l[t-1]:null,T={date:null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModified,name:(null==e||null===(d=e.assigner)||void 0===d?void 0:d.name)||(null==e||null===(s=e.assignes)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.name)||"N/A",mobileNumber:(null==L||null===(m=L.processInstance)||void 0===m||null===(v=m.assignes)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.uuid)===(null==e||null===(E=e.assigner)||void 0===E?void 0:E.uuid)&&null!=L&&null!==(f=L.processInstance)&&void 0!==f&&null!==(g=f.assignes)&&void 0!==g&&null!==(h=g[0])&&void 0!==h&&h.mobileNumber?null==L||null===(A=L.processInstance)||void 0===A||null===(S=A.assignes)||void 0===S||null===(N=S[0])||void 0===N?void 0:N.mobileNumber:(null==e||null===(b=e.assigner)||void 0===b?void 0:b.mobileNumber)||(null==e||null===(y=e.assignes)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.mobileNumber)||"N/A",comment:null!=e&&e.comment?M(e.comment):"",wfComment:O&&O.wfComment||[],thumbnailsToShow:(null==e?void 0:e.thumbnailsToShow)||[]};return n.createElement(jl,{data:T,OpenImage:q,privacy:i})}{var O,T,I,w,P;const t={date:te(null==L||null===(O=L.auditDetails)||void 0===O?void 0:O.lastModifiedTime),name:(null==e||null===(T=e.assignes)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.name)||"N/A",wfComment:(null==e?void 0:e.wfComment)||[],mobileNumber:(null==e||null===(w=e.assignes)||void 0===w||null===(P=w[0])||void 0===P?void 0:P.mobileNumber)||"N/A"};return n.createElement(jl,{data:t})}},ne=(e,t)=>e?t?e:M(e):M("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ue=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?ne(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+M(null==e?void 0:e.isUnit):M("N/A"):null!=e&&e.value?ne(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):M("N/A"),[de,se]=l.useState(!1),ce=(null==y||y.reduce((e,t)=>e+t.demandInterest,0),null==y||y.reduce((e,t)=>e+t.demandPenality,0),null==y||y.reduce((e,t)=>e+t.collectionTax,0),null==y||y.reduce((e,t)=>e+t.collectionInterest,0),null==y||y.reduce((e,t)=>e+t.collectionPenality,0),null==y||y.reduce((e,t)=>e+t.balanceTax,0),null==y||y.reduce((e,t)=>e+t.balanceInterest,0),null==y||y.reduce((e,t)=>e+t.balancePenality,0),function(e,t,l){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const n=c({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:c({},e.additionalDetails,{propertytobestatus:t}),workflow:c({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:c({},n)},U,l)).then(function(){})}catch(e){return Promise.reject(e)}}),me=null==C?void 0:C.applicationData,ve=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return l.useEffect(()=>{if("WS"!==B&&"SW"!==B&&!window.location.href.includes("employee/ws")&&!window.location.href.includes("/ws/")&&F)try{let e={consumerCodes:F};const t=!0;"BPAREG"===B?Digit.OBPSService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):"PT"===B&&Digit.PTService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)})}catch(e){console.error("❌ Payment search error for PT/BPREG:",e)}},[B,F,U]),n.createElement(t.Card,{style:{position:"relative"}},null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,o)=>{var a,r,u,d,s,c,m,v,p,E,f,_,g,h,A,S,N,b,y,O,L,T,I,w,x,F,B,k,U,H,W,j,z,q,Y,K,X,Q,J;return n.createElement(n.Fragment,{key:o},n.createElement("div",{style:(window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws"),{})},0!==o||e.asSectionHeader?n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:0==o&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+M(e.title):M(e.title),null!=e&&e.Component?n.createElement(e.Component,null):null)):n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},M(e.title)),(null==e?void 0:e.isTable)&&n.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},n.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>n.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},M(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?n.createElement(l.Fragment,null,n.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),n.createElement("tr",null,t.map(e=>n.createElement("td",{style:{textAlign:"left"}},M(e))))):n.createElement("tr",null,t.map(e=>n.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},M(e)))))),n.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((l,o)=>{var a,r;return!0===l.map&&"N/A"!==l.value?n.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:M(l.title),label:M(l.title),text:n.createElement("img",{src:M(l.value),alt:"",privacy:null==l?void 0:l.privacy})}):1==(null==l?void 0:l.isLink)?n.createElement(t.Row,{key:M(l.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?n.createElement("div",{style:{width:"200%"}},n.createElement(i.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},M(null==l?void 0:l.title)))):oe||ae?""+M(l.title):M(l.title),text:n.createElement("div",null,n.createElement(i.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==l?void 0:l.value))),last:o===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:l.caption,className:"border-none",rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):window.location.href.includes("modify")?n.createElement(t.Row,{className:"border-none",key:""+l.title,label:""+M(""+l.title),privacy:null==l?void 0:l.privacy,text:null!=l&&l.oldValue?null==l?void 0:l.oldValue:null!=l&&l.value?null==l?void 0:l.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):n.createElement(t.Row,{key:M(l.title),label:M(l.title),text:ue(l),last:o===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:l.caption,className:"border-none",privacy:null==l?void 0:l.privacy,rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}})})))),(null==e?void 0:e.belowComponent)&&n.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&n.createElement(Ul,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(d=C.applicationData)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.fiReport)&&n.createElement(Pl,{fiReport:null==C||null===(v=C.applicationData)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors)&&n.createElement(Ml,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners)&&n.createElement(kl,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&n.createElement(Vl,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&n.createElement(zl,{units:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.accessories}),!V&&(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.permissions)&&(null==D||null===(y=D.data)||void 0===y||null===(O=y.nextActions)||void 0===O?void 0:O.length)>0&&n.createElement(Fl,{applicationData:null==C?void 0:C.applicationData,t:M,permissions:null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.permissions}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.obpsDocuments)&&n.createElement("div",{style:{display:"flex"}},n.createElement(Il,{t:M,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&n.createElement(xl,{t:M,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:D}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.scruntinyDetails)&&n.createElement(Ul,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&n.createElement(Ul,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&n.createElement(Hl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl)&&n.createElement(t.Table,{className:"customTable table-border-style",t:M,data:(null==e||null===(U=e.additionalDetails)||void 0===U||null===(H=U.documentsWithUrl[0])||void 0===H?void 0:H.values)||[],columns:G,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&n.createElement(Bl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&n.createElement(Gl,{wsAdditionalDetails:e,oldValue:R}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.redirectUrl)&&n.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},n.createElement(i.Link,{to:null==e||null===(q=e.additionalDetails)||void 0===q||null===(Y=q.redirectUrl)||void 0===Y?void 0:Y.url},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(K=e.additionalDetails)||void 0===K||null===(X=K.redirectUrl)||void 0===X?void 0:X.title))),(null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.estimationDetails)&&n.createElement(Kl,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&n.createElement(Xl,{wsAdditionalDetails:e,workflowDetails:D}))}),(null==X?void 0:X.length)>0&&n.createElement(Ql,{assessmentData:J}),n.createElement(Zl,{payments:j}),"WS"!==B&&"SW"!==B&&"OBPS"!==B&&"BPAStakeholder"!==B&&"BPAREG"!==B&&n.createElement(Jl,{applicationData:null==C?void 0:C.applicationData}),I&&(null==D||null===(d=D.data)||void 0===d||null===(s=d.timeline)||void 0===s?void 0:s.length)>0&&n.createElement(n.Fragment,null,n.createElement(t.BreakLine,null),((null==D?void 0:D.isLoading)||O)&&n.createElement(t.Loader,null),!(null!=D&&D.isLoading)&&!O&&"BPAREG"!==B&&n.createElement(l.Fragment,null,n.createElement("div",{id:"timeline"},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},M("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=D&&null!==(m=D.data)&&void 0!==m&&m.timeline&&1===(null==D||null===(v=D.data)||void 0===v||null===(p=v.timeline)||void 0===p?void 0:p.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:M(""+T+(null==D||null===(E=D.data)||void 0===E||null===(f=E.timeline[0])||void 0===f?void 0:f.state)),customChild:le(null==D||null===(g=D.data)||void 0===g?void 0:g.timeline[0],null==D||null===(h=D.data)||void 0===h?void 0:h.timeline)}):n.createElement(t.ConnectingCheckPoints,null,(null==D||null===(A=D.data)||void 0===A?void 0:A.timeline)&&(null==D||null===(S=D.data)||void 0===S?void 0:S.timeline.slice(0,de?null==D?void 0:D.data.timeline.length:2).map((e,l,i)=>{var o;let a="";var r,u,d,s,c,m;return window.location.href.includes("/obps/")&&(a=null!=D&&null!==(r=D.data)&&void 0!==r&&null!==(u=r.timeline[l-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=D&&null!==(s=D.data)&&void 0!==s&&null!==(c=s.timeline[l-1])&&void 0!==c&&null!==(m=c.state)&&void 0!==m&&m.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==l?"":"_DONE"),n.createElement(n.Fragment,{key:l},n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,info:e.comment,label:M(""+T+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+a),customChild:le(e,l,null==D||null===(o=D.data)||void 0===o?void 0:o.timeline)}))}))),(null==D||null===(N=D.data)||void 0===N||null===(b=N.timeline)||void 0===b?void 0:b.length)>2&&n.createElement(t.LinkButton,{label:M(de?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{se(e=>!e)}}))),!(null!=D&&D.isLoading)&&!O&&"BPAREG"===B&&n.createElement(on,{workflowDetails:D,t:M})),window.location.href.includes("/pt/")?n.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},n.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==pe?ce(me,"ACTIVE",ve):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),n.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?ce(me,"INACTIVE",ve):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),n.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var l,n,i;if("INACTIVE"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&k.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),n.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):n.createElement("div",null),H&&n.createElement(t.Toast,{error:H.isError,label:M(H.label),onClose:()=>{W(null)},isDleteBtn:"false"}))}function rn(e){var l,i,o,a,r,u,d,s,c,m,v,p,E,f,_,g,h,A;let{t:S,showToast:N,closeToast:b,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var y;let e="";switch(null==N||null===(y=N.action)||void 0===y?void 0:y.action){case"SENDBACK":e="error"===(null==N?void 0:N.key)?null==N||null===(l=N.error)||void 0===l?void 0:l.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==N?void 0:N.key)?null==N||null===(i=N.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==N?void 0:N.key)?null==N||null===(o=N.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==N?void 0:N.key)?null==N||null===(a=N.error)||void 0===a?void 0:a.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==N?void 0:N.key)?null==N||null===(r=N.error)||void 0===r?void 0:r.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==N?void 0:N.key)?null==N||null===(u=N.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==N?void 0:N.key)?null==N||null===(d=N.error)||void 0===d?void 0:d.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==N?void 0:N.key)?null==N||null===(s=N.error)||void 0===s?void 0:s.message:S("ES_"+C+"_"+(null==N||null===(c=N.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,N&&n.createElement(t.Toast,{error:"error"===N.key,label:e,onClose:b}))}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 l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),l};let l="";switch(null==N||null===(D=N.action)||void 0===D?void 0:D.action){case"REVOCATE":l="error"===(null==N?void 0:N.key)?null==N||null===(m=N.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":l="error"===(null==N?void 0:N.key)?null==N||null===(v=N.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":l="error"===(null==N?void 0:N.key)?null==N||null===(p=N.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":l="error"===(null==N?void 0:N.key)?null==N||null===(E=N.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":l="error"===(null==N?void 0:N.key)?null==N||null===(f=N.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":l="error"===(null==N?void 0:N.key)?null==N||null===(_=N.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":l="error"===(null==N?void 0:N.key)?null==N||null===(g=N.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:l="error"===(null==N?void 0:N.key)?null==N||null===(h=N.error)||void 0===h?void 0:h.message:S("ES_"+C+"_"+(null==N||null===(A=N.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,N&&n.createElement(t.Toast,{error:"error"===N.key,label:l,onClose:b}))}{var O,L;const e="error"===(null==N?void 0:N.key)?null==N||null===(O=N.error)||void 0===O?void 0:O.message:"ES_"+C+"_"+(null==N||null===(L=N.action)||void 0===L?void 0:L.action)+"_UPDATE_SUCCESS";return n.createElement(n.Fragment,null,N&&n.createElement(t.Toast,{error:"error"===N.key,label:S(e),onClose:b}))}}function un(e){var i,a,r,u,d,s,m,v,p,E,f,_,g,h,A,S;let{workflowDetails:N,displayMenu:b,onActionSelect:C,setDisplayMenu:y,businessService:D,forcedActionPrefix:O,ActionBarStyle:L={},MenuStyle:T={}}=e;const{t:I}=o.useTranslation();let w=Digit.UserService.getUser();const P=l.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const R=null===(i=w)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,F=!1,B=(null==N||null===(u=N.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==R?void 0:R.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==N||null===(m=N.data)||void 0===m||null===(v=m.nextActions)||void 0===v?void 0:v.filter(e=>(null==R?void 0:R.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return console.log("ActionsInPayment",N),Digit.Hooks.useClickOutside(P,()=>{y(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==B?void 0:B.length)||null!=B&&null!==(p=B[0])&&void 0!==p&&null!==(E=p.redirectionUrl)&&void 0!==E&&E.pathname.includes("/pt/property-details/")&&1==(null==B?void 0:B.length)?(F=!1,x=!0):(null==B?void 0:B.length)>0&&(F=!0,x=!1),n.createElement(n.Fragment,null,!(null!=N&&N.isLoading)&&F&&!x&&n.createElement(t.ActionBar,{style:c({},L)},b&&(null!=N&&null!==(f=N.data)&&void 0!==f&&null!==(_=f.actionState)&&void 0!==_&&_.nextActions||null!=N&&null!==(g=N.data)&&void 0!==g&&g.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:B,optionKey:"action",t:I,onSelect:C,style:T}):null,n.createElement(t.SubmitBar,{ref:P,label:I("WF_TAKE_ACTION"),onSubmit:()=>y(!b)})),!(null!=N&&N.isLoading)&&!F&&x&&n.createElement(t.ActionBar,{style:c({},L)},n.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==B||null===(h=B[0])||void 0===h?void 0:h.action,value:null==B||null===(A=B[0])||void 0===A?void 0:A.action,onClick:e=>{C((null==B?void 0:B[0])||{})}},I((O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==B||null===(S=B[0])||void 0===S?void 0:S.action)))))}const dn=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),sn=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(dn,null));function cn(e){let{action:l,closeWarningPopup:i}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:n.createElement(sn,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px"}},n.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==l?void 0:l.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),n.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==l?void 0:l.AmountDueForPay)}),n.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},n.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),n.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==l||null===(e=l.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const mn=e=>{var a,u;let d=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(m,"BPA",["BlockReason"]),{t:p}=o.useTranslation(),E=i.useHistory();let{id:f}=i.useParams();const[_,g]=l.useState(!1),[h,A]=l.useState(null),[S,N]=l.useState(!1),[b,C]=l.useState(!1),[y,D]=l.useState(!1),{data:O}=Digit.Hooks.obps.useMDMS(m,"BPA",["RiskTypeComputation"]),{applicationDetails:L,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:P,setShowToast:R,isLoading:x,isDataLoading:F,applicationData:B,mutate:M,nocMutation:k,workflowDetails:U,id:H,businessService:W,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:q,ActionBarStyle:Y,MenuStyle:K,paymentsList:X,showTimeLine:Q=!0,oldValue:J,isInfoLabel:Z=!1,clearDataDetails:$,propertyId:ee}=e;l.useEffect(()=>{P&&U&&U.revalidate&&U.revalidate()},[P]);const te=r.useQueryClient(),le=()=>{A(null),N(!1)};return console.log("ActionsInPayment2",U),x||b?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,x?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement(an,{applicationDetails:L,demandData:T,id:H,workflowDetails:U,isDataLoading:F,applicationData:B,totalDemandTax:I,totalBalanceTax:w,businessService:W,timelineStatusPrefix:V,statusAttribute:q,paymentsList:X,showTimeLine:Q,oldValue:J,isInfoLabel:Z,propertyId:ee,moduleCode:z}),S?n.createElement(Ll,{t:p,action:h,tenantId:s,state:m,id:f,applicationDetails:L,applicationData:null==L?void 0:L.applicationData,closeModal:le,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,u,d,s,m,v,f,_,g,A,S,N,b,y,D){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(d=e.Licenses)||void 0===d||null===(s=d[0])||void 0===s||null===(m=s.additionalDetail)||void 0===m||null===(v=m.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(f=e.Licenses)||void 0===f||null===(_=f[0])||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(S=A.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(N=e.SewerageConnection)||void 0===N||null===(b=N.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(y=e.BPA)||void 0===y||null===(D=y.comment)||void 0===D?void 0:D.length)){var O,L;"INITIATE"===(null==e||null===(O=e.Licenses)||void 0===O||null===(L=O[0])||void 0===L?void 0:L.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function d(t){if(n)return t;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=h,E.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,E.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&E.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,m,v,f,_,g;null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(m=c.workflow)&&void 0!==m&&m.action.includes("RE-SUBMIT")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(f=v.workflow)&&void 0!==f&&f.action.includes("APPROVE")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(_=t.AmendmentUpdate)&&void 0!==_&&null!==(g=_.workflow)&&void 0!==g&&g.action.includes("REJECT")&&R({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,S,N;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return null!=e&&null!==(A=e.Licenses[0])&&void 0!==A&&null!==(S=A.businessService)&&void 0!==S&&S.includes("BPAREG")?(R({key:"success",action:h}),e.selectedAction=h,void E.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(R({key:"success",action:h}),void E.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(N=e.Licenses[0])||void 0===N?void 0:N.applicationNumber)));R({key:"success",action:h}),$&&setTimeout($,3e3),setTimeout(j,5e3);try{const e=(W||"").toUpperCase(),t=((null==h?void 0:h.action)||"").toUpperCase();e.includes("DISCONNECT")&&(t.includes("APPROVE")||t.includes("EXECUTE")||t.includes("APPROVE_CONNECTION"))&&setTimeout(()=>{var e;null!==(e=window)&&void 0!==e&&e.location&&(window.location.href="https://mseva.lgpunjab.gov.in/employee/inbox")},3e3)}catch(e){}te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),le()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const i=function(){if(!1!==t&&k){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==k?void 0:k.mutateAsync(e)),i=Ot(function(){return C(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,s,c,m,v;C(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(m=c.Errors)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.message)||e;le(),R({key:"error",error:{message:E}}),setTimeout(j,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(d):d(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(a=U.data)||void 0===a?void 0:a.timeline,businessService:W,workflowDetails:U,moduleCode:z,blockReason:null==v||null===(u=v.BPA)||void 0===u?void 0:u.BlockReason}):null,y?n.createElement(cn,{action:h,workflowDetails:U,businessService:W,isWarningPop:y,closeWarningPopup:()=>{D(!1)}}):null,n.createElement(rn,{t:p,showToast:P,closeToast:j,businessService:W}),n.createElement("div",null,d?n.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,l,n,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==O||null===(t=O.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==L||null===(l=L.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(i=n.plot)||void 0===i?void 0:i.area,null==L||null===(o=L.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const d=function(e,t,l,n,i,o,a,r,d,c,m,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null==u||null===(n=u.BPA)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(m=c.additionalDetails)||void 0===m||null===(v=m.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,s)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(p("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&n.createElement(un,{workflowDetails:U,displayMenu:_,onActionSelect:function(e){var t,l,n;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))E.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var d,s;E.push(""+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname),{data:null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.state})}else{var m;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(m=e.redirectionUrll)||void 0===m?void 0:m.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(l=t.state)||void 0===l||null===(n=l.applicationData)||void 0===n?void 0:n.workflowCode))N(!0);else{var v,p;E.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:c({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else N(!0);A(e),g(!1)},setDisplayMenu:g,businessService:W,forcedActionPrefix:G,ActionBarStyle:Y,MenuStyle:K}))))};function vn(e){var i;let{t:o,document:a,setNocDocuments:r,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==a?void 0:a.code)})[0],s=Digit.ULBService.getStateId(),[c,m]=l.useState(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i[0]),[v,p]=l.useState(null),[E,f]=l.useState(()=>(null==d?void 0:d.fileStoreId)||null);return l.useEffect(()=>{null!=c&&c.code&&r(e=>0===(null==E?void 0:E.length)||null===E?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==E),{documentType:null==c?void 0:c.code,fileStoreId:E,documentUid:E,fileName:(null==v?void 0:v.name)||""}])},[E,c]),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+o("NOC_UPLOAD_FILE_LABEL")),n.createElement("div",{className:"field"},n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t),n=l&&(null==l?void 0:l.map(e=>{var t,l,n;return{documentType:null==c?void 0:c.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,fileName:(null==e||null===(n=e.file)||void 0===n?void 0:n.name)||""}}));var i;sessionStorage.setItem("NewNOCDocs",JSON.stringify(n)),(i=l[l.length-1])&&p(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const pn=e=>{let{width:t=20,height:l=20,style:i}=e;return n.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:l,viewBox:"0 0 20 20",fill:"gray"},n.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))};function En(e){var t;let{value:l={}}=e;const{t:i}=o.useTranslation(),{data:a}=Digit.Hooks.noc.useNOCDocumentSearch({value:l},{value:l});let r=[];return null!=l&&l.workflowDocs&&(r=null==l?void 0:l.workflowDocs),a.pdfFiles&&0!==Object.keys(a.pdfFiles).length?n.createElement("div",{style:{marginTop:"19px"}},n.createElement(n.Fragment,null,n.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px"}},null===(t=r)||void 0===t?void 0:t.map((e,t)=>{var l,o;let r=f(null==a?void 0:a.pdfFiles,(null==e?void 0:e.documentAttachment)||(null==e?void 0:e.documentUid));return n.createElement("a",{target:"_",href:r,style:{width:"120px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",textDecoration:"none",color:"inherit"},key:t},n.createElement(pn,{width:85,height:100,style:{background:"#f6f6f6",padding:"8px"}}),n.createElement("p",{style:{marginTop:"8px",fontSize:"12px",wordWrap:"break-word",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},i(null==e||null===(l=e.documentType)||void 0===l||null===(o=l.replace(".","_"))||void 0===o?void 0:o.toUpperCase())))})))):n.createElement("div",null,i("NOC_NO_DOCUMENTS_MSG"))}const fn=e=>n.createElement("h1",{className:"heading-m"},e.label),_n=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gn=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(_n,null)),hn=e=>{var i;let{t:o,action:a,tenantId:r,getEmployees:u,closeModal:d,submitAction:s,applicationDetails:m,applicationData:v,businessService:p,showToast:E,setShowToast:f,closeToast:_,showErrorToast:g,errorOne:h,closeToastOne:A}=e;const[S,N]=l.useState({}),[b,C]=l.useState({}),[y,D]=l.useState([]),[O,L]=l.useState({}),[T,I]=l.useState(null),[w,P]=l.useState(null),[R,x]=l.useState(null),[F,B]=l.useState([]),[M,k]=l.useState(null),U=null==a||null===(i=a.state)||void 0===i?void 0:i.actions,H=(new Set(null==U?void 0:U.flatMap(e=>e.roles)),[...new Set(null==u?void 0:u.flatMap(e=>e.roles))]),{data:W}=Digit.Hooks.useEmployeeSearch(r,{roles:null==H?void 0:H.map(e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{data:j}=Digit.Hooks.pt.useMDMS(r,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});l.useEffect(()=>{var e;j&&j["egf-master"]&&B(null===(e=j["egf-master"])||void 0===e?void 0:e.FinancialYear)},[j]);const{data:z}=Digit.Hooks.useCustomMDMS(r,"common-masters",[{name:"Department"}]);function V(e){I(e.target.files[0])}return l.useEffect(()=>{if(W&&z){var e;const t=z["common-masters"].Department;D(null==W||null===(e=W.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[W,z]),l.useEffect(()=>{!function(){try{x(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)x(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):x(o("CS_FILE_UPLOAD_ERROR"))})},function(){x(o("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]),l.useEffect(()=>{if("SENDBACKTOCITIZEN"===(null==a?void 0:a.action)){var e,t,l;const n=(null==m||null===(e=m.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.auditDetails)||void 0===l?void 0:l.createdBy)||null;L({uuid:n})}},[a]),l.useEffect(()=>{a&&N((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SENDBACK"!=(null==i?void 0:i.action)||(c=!1),i.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NOC_CANCEL"},form:[{body:[{label:c?l("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:c?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:c?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"}},{label:l("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:O,setSelectedApprover:L,selectFile:V,uploadedFile:w,setUploadedFile:P,businessService:p}))},[a,y,F,M,w]),a&&S.form?n.createElement(t.Modal,{headerBarMain:n.createElement(fn,{label:o(S.label.heading)}),headerBarEnd:n.createElement(gn,{onClick:d}),actionCancelLabel:o(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:o(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==a?void 0:a.action);null!=a&&a.isTerminateState&&(l=!0);const n=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim();"APPROVE"===(null==a?void 0:a.action)||"REJECT"===(null==a?void 0:a.action)||null!=O&&O.uuid?!l||n?(v=c({},v,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=O&&O.uuid?[null==O?void 0:O.uuid]:null,wfDocuments:w?[{documentType:null==T?void 0:T.type,fileName:null==T?void 0:T.name,documentUid:w,filestoreId:w,documentAttachment:w}]:null}),s({Licenses:[v]})):f({key:"true",warning:!0,message:o("COMMON_COMMENTS_REQUIRED_LABEL")}):f({key:"true",warning:!0,message:o("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")})},defaultValues:b,formId:"modal-action"}),E&&n.createElement(t.Toast,{error:null==E?void 0:E.error,warning:null==E?void 0:E.warning,label:null==E?void 0:E.message,onClose:_,isDleteBtn:!0}),g&&n.createElement(t.Toast,{error:!0,label:h,isDleteBtn:!0,onClose:A})):n.createElement(t.Loader,null)},An=e=>{let{documents:i}=e;const{t:a}=o.useTranslation(),r=[{Header:a("BPA_DOCUMENT_NAME"),accessor:"title",Cell:e=>{let{value:t}=e;return a(t)||a("CS_NA")}},{Header:a("BPA_DOCUMENT_FILE"),accessor:"fileUrl",Cell:e=>{let{value:l}=e;return l?n.createElement(t.LinkButton,{style:{float:"right",display:"inline"},label:a("View"),onClick:()=>{window.open(l,"_blank")}}):a("CS_NA")}}],u={value:{workflowDocs:null==i?void 0:i.map(e=>({documentType:(null==e?void 0:e.documentType)||"",filestoreId:(null==e?void 0:e.filestoreId)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||""}))}},{data:d}=Digit.Hooks.noc.useNOCDocumentSearch(u,{enabled:(null==i?void 0:i.length)>0}),s=null==i?void 0:i.map(e=>{var t;const{documentUid:l,documentType:n}=e;return{documentUid:l,documentType:n,url:null==d||null===(t=d.pdfFiles)||void 0===t?void 0:t[l]}}),c=l.useMemo(()=>null==s?void 0:s.map((e,t)=>{var l;return{id:t,title:a(null==e||null===(l=e.documentType)||void 0===l?void 0:l.replaceAll(".","_"))||a("CS_NA"),fileUrl:e.url}}),[s]);return n.createElement("div",null,c&&n.createElement(t.Table,{className:"customTable table-border-style",t:a,data:c,columns:r,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1}))},Sn=e=>{let{formData:i}=e;const{t:a}=o.useTranslation(),r=l.useMemo(()=>{var e,t,l,n,o,a,r,u,d,s,m,v,p,E,f,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,P,R,x,F,B,M,k,U,H,W,j,z,V,G,q,Y,K,X;return{CalculationCriteria:[{applicationNumber:null==i||null===(e=i.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,tenantId:null==i||null===(n=i.apiData)||void 0===n||null===(o=n.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.tenantId,NOC:c({},null==i||null===(r=i.apiData)||void 0===r||null===(u=r.Noc)||void 0===u?void 0:u[0],{nocDetails:c({},null===(d=i.apiData)||void 0===d||null===(s=d.Noc)||void 0===s||null===(m=s[0])||void 0===m?void 0:m.nocDetails,{additionalDetails:c({},null==i||null===(v=i.apiData)||void 0===v||null===(p=v.Noc)||void 0===p||null===(E=p[0])||void 0===E||null===(f=E.nocDetails)||void 0===f?void 0:f.additionalDetails,{applicationDetails:c({},null==i?void 0:i.applicationDetails,{applicantGender:(null==i||null===(_=i.applicationDetails)||void 0===_||null===(g=_.applicantGender)||void 0===g?void 0:g.code)||(null==i||null===(h=i.applicationDetails)||void 0===h?void 0:h.applicantGender)||""}),siteDetails:c({},null==i?void 0:i.siteDetails,{ulbName:(null==i||null===(A=i.siteDetails)||void 0===A||null===(S=A.ulbName)||void 0===S?void 0:S.name)||(null==i||null===(N=i.siteDetails)||void 0===N?void 0:N.ulbName)||"",roadType:(null==i||null===(b=i.siteDetails)||void 0===b||null===(C=b.roadType)||void 0===C?void 0:C.name)||(null==i||null===(y=i.siteDetails)||void 0===y?void 0:y.roadType)||"",buildingStatus:(null==i||null===(D=i.siteDetails)||void 0===D||null===(O=D.buildingStatus)||void 0===O?void 0:O.name)||(null==i||null===(L=i.siteDetails)||void 0===L?void 0:L.buildingStatus)||"",isBasementAreaAvailable:(null==i||null===(T=i.siteDetails)||void 0===T||null===(I=T.isBasementAreaAvailable)||void 0===I?void 0:I.code)||(null==i||null===(w=i.siteDetails)||void 0===w?void 0:w.isBasementAreaAvailable)||"",district:(null==i||null===(P=i.siteDetails)||void 0===P||null===(R=P.district)||void 0===R?void 0:R.name)||(null==i||null===(x=i.siteDetails)||void 0===x?void 0:x.district)||"",zone:(null==i||null===(F=i.siteDetails)||void 0===F||null===(B=F.zone)||void 0===B?void 0:B.name)||(null==i||null===(M=i.siteDetails)||void 0===M?void 0:M.zone)||"",specificationBuildingCategory:(null==i||null===(k=i.siteDetails)||void 0===k||null===(U=k.specificationBuildingCategory)||void 0===U?void 0:U.name)||(null==i||null===(H=i.siteDetails)||void 0===H?void 0:H.specificationBuildingCategory)||"",specificationNocType:(null==i||null===(W=i.siteDetails)||void 0===W||null===(j=W.specificationNocType)||void 0===j?void 0:j.name)||(null==i||null===(z=i.siteDetails)||void 0===z?void 0:z.specificationNocType)||"",specificationRestrictedArea:(null==i||null===(V=i.siteDetails)||void 0===V||null===(G=V.specificationRestrictedArea)||void 0===G?void 0:G.code)||(null==i||null===(q=i.siteDetails)||void 0===q?void 0:q.specificationRestrictedArea)||"",specificationIsSiteUnderMasterPlan:(null==i||null===(Y=i.siteDetails)||void 0===Y||null===(K=Y.specificationIsSiteUnderMasterPlan)||void 0===K?void 0:K.code)||(null==i||null===(X=i.siteDetails)||void 0===X?void 0:X.specificationIsSiteUnderMasterPlan)||""})})})})}]}},[i]),{isLoading:u,data:d,revalidate:s}=Digit.Hooks.noc.useNOCFeeCalculator({payload:r},{enabled:!!r}),[m,v]=l.useState(null);l.useEffect(()=>{ht.isEqual(m,null==i?void 0:i.siteDetails)||(s(),v(null==i?void 0:i.siteDetails))},[null==i?void 0:i.siteDetails]);const p=l.useMemo(()=>{var e,t,l,n,i;if(null==d||null===(e=d.Calculation)||void 0===e||null===(t=e[0])||void 0===t||!t.totalAmount)return[];const o=(null==d||null===(l=d.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.reduce((e,t)=>e+((null==t?void 0:t.estimateAmount)||0),0))||"N/A";return[{id:"1",title:a("NOC_FEE_LABEL"),amount:o}]},[d,a]),E=[{Header:a("NOC_FEE_TYPE_LABEL"),accessor:"title",Cell:e=>{let{value:t}=e;return t||a("CS_NA")}},{Header:a("NOC_AMOUNT_LABEL"),accessor:"amount",Cell:e=>{let{value:t}=e;return null!=t?"₹ "+t.toLocaleString():a("CS_NA")}}];return u?n.createElement(t.Loader,null):n.createElement("div",null,u?n.createElement(t.Loader,null):n.createElement(t.Table,{className:"customTable table-border-style",t:a,data:p,columns:E,getCellProps:()=>({style:{}}),disableSort:!0,manualPagination:!1,isPaginationRequired:!1}))},Nn=(e,l,i,o)=>{var a,r,u,d,s,c;console.log("checkpoint here",e);const{wfComment:m,thumbnailsToShow:v,wfDocuments:p}=e;console.log("wfDocuments",p);const E={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.lastModified,time:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.timing,name:null==e||null===(u=e.assigner)||void 0===u?void 0:u.name,mobileNumber:null==e||null===(d=e.assigner)||void 0===d?void 0:d.mobileNumber,source:null==e||null===(s=e.assigner)||void 0===s?void 0:s.source};return n.createElement("div",null,(null==m?void 0:m.length)>0&&n.createElement("div",{className:"TLComments"},n.createElement("h3",null,o("WF_COMMON_COMMENTS")),n.createElement("p",{style:{overflowX:"scroll"}},m)),(null==v||null===(c=v.thumbs)||void 0===c?void 0:c.length)>0&&n.createElement(t.DisplayPhotos,{srcs:v.thumbs,onClick:(e,t)=>{var l;let n=(null===(l=v.fullImage)||void 0===l?void 0:l[t])||e;Digit.Utils.zoomImage(n)}}),(null==p?void 0:p.length)>0&&n.createElement("div",null,n.createElement("div",null,n.createElement(En,{value:{workflowDocs:p},index:l}))),n.createElement("div",{style:{marginTop:"8px"}},E.time&&n.createElement("p",null,E.time),E.date&&n.createElement("p",null,E.date),E.name&&n.createElement("p",null,E.name),E.mobileNumber&&n.createElement("p",null,E.mobileNumber),E.source&&n.createElement("p",null,o("ES_COMMON_FILED_VIA_"+E.source.toUpperCase()))))},bn=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=o.useTranslation();return window.Digit.Utils.browser.isMobile()?n.createElement(l.Fragment,null,n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})}))):n.createElement(n.Fragment,null,n.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},n.createElement("div",{className:"search-complaint-container"},n.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})})),n.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Cn=e=>{let{statuses:i,controlFilterForm:r,applicationTypesOfBPA:u}=e;const{t:d}=o.useTranslation(),s=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+d("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+d("ES_INBOX_ASSIGNED_TO_ALL")}]);return null==u||u.forEach(e=>{e.name=d("WF_BPA_"+e.code),e.i18nKey=d("WF_BPA_"+e.code)}),console.log("status heres===>",i),n.createElement(l.Fragment,null,n.createElement(t.FilterFormField,null,n.createElement(a.Controller,{name:"assignee",control:r,render:e=>n.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:s.filter(t=>t.code===e.value)[0],optionsKey:"name",options:s})})),n.createElement(t.FilterFormField,null,n.createElement(a.Controller,{name:"applicationStatus",control:r,defaultValue:[],render:e=>n.createElement(l.Fragment,null,null==i?void 0:i.map((l,i)=>n.createElement(t.CheckBox,{key:l.applicationstatus,label:d(l.applicationstatus)+" - "+l.count,value:l.applicationstatus,checked:e.value.includes(l.applicationstatus),onChange:()=>{var t;e.value.includes(t=l.applicationstatus)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t])},index:i})))})))};function yn(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Dn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function On(e){Dn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Ln(e,t){Dn(2,arguments);var l=On(e).getTime(),n=yn(t);return new Date(l+n)}function Tn(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function In(e){return Dn(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function wn(e){if(Dn(1,arguments),!In(e)&&"number"!=typeof e)return!1;var t=On(e);return!isNaN(Number(t))}var Pn={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Rn(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=t.width?String(t.width):e.defaultWidth,n=e.formats[l]||e.formats[e.defaultWidth];return n}}var xn={date:Rn({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Rn({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Rn({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Fn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Bn(e){return function(t,l){var n,i=l||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;n=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function Mn(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?Un(u,function(e){return e.test(r)}):kn(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(d):d,a=l.valueCallback?l.valueCallback(a):a;var s=t.slice(r.length);return{value:a,rest:s}}}function kn(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function Un(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var Hn,Wn={code:"en-US",formatDistance:function(e,t,l){var n,i=Pn[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=l&&l.addSuffix?l.comparison&&l.comparison>0?"in "+n:n+" ago":n},formatLong:xn,formatRelative:function(e,t,l,n){return Fn[e]},localize:{ordinalNumber:function(e,t){var l=Number(e),n=l%100;if(n>20||n<10)switch(n%10){case 1:return l+"st";case 2:return l+"nd";case 3:return l+"rd"}return l+"th"},era:Bn({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Bn({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Bn({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Bn({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Bn({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Hn={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e.match(Hn.matchPattern);if(!l)return null;var n=l[0],i=e.match(Hn.parsePattern);if(!i)return null;var o=Hn.valueCallback?Hn.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}),era:Mn({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Mn({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Mn({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Mn({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Mn({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function jn(e,t){Dn(2,arguments);var l=yn(t);return Ln(e,-l)}function zn(e){Dn(1,arguments);var t=1,l=On(e),n=l.getUTCDay(),i=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-i),l.setUTCHours(0,0,0,0),l}function Vn(e){Dn(1,arguments);var t=On(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var i=zn(n),o=new Date(0);o.setUTCFullYear(l,0,4),o.setUTCHours(0,0,0,0);var a=zn(o);return t.getTime()>=i.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function Gn(e){Dn(1,arguments);var t=Vn(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=zn(l);return n}function qn(e,t){Dn(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:yn(i),a=null==l.weekStartsOn?o:yn(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=On(e),u=r.getUTCDay(),d=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-d),r.setUTCHours(0,0,0,0),r}function Yn(e,t){Dn(1,arguments);var l=On(e),n=l.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:yn(a),u=null==i.firstWeekContainsDate?r:yn(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(n+1,0,u),d.setUTCHours(0,0,0,0);var s=qn(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var m=qn(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=m.getTime()?n:n-1}function Kn(e,t){Dn(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:yn(i),a=null==l.firstWeekContainsDate?o:yn(l.firstWeekContainsDate),r=Yn(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=qn(u,t);return d}function Xn(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var Qn={G:function(e,t,l){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return l.era(n,{width:"abbreviated"});case"GGGGG":return l.era(n,{width:"narrow"});case"GGGG":default:return l.era(n,{width:"wide"})}},y:function(e,t,l){if("yo"===t){var n=e.getUTCFullYear();return l.ordinalNumber(n>0?n:1-n,{unit:"year"})}return function(e,t){var l=e.getUTCFullYear(),n=l>0?l:1-l;return Xn("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var i=Yn(e,n),o=i>0?i:1-i;return"YY"===t?Xn(o%100,2):"Yo"===t?l.ordinalNumber(o,{unit:"year"}):Xn(o,t.length)},R:function(e,t){return Xn(Vn(e),t.length)},u:function(e,t){return Xn(e.getUTCFullYear(),t.length)},Q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Xn(n,2);case"Qo":return l.ordinalNumber(n,{unit:"quarter"});case"QQQ":return l.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return l.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return l.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Xn(n,2);case"qo":return l.ordinalNumber(n,{unit:"quarter"});case"qqq":return l.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return l.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return l.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,l){var n=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var l=e.getUTCMonth();return"M"===t?String(l+1):Xn(l+1,2)}(e,t);case"Mo":return l.ordinalNumber(n+1,{unit:"month"});case"MMM":return l.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return l.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return l.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,l){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return Xn(n+1,2);case"Lo":return l.ordinalNumber(n+1,{unit:"month"});case"LLL":return l.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return l.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return l.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,l,n){var i=function(e,t){Dn(1,arguments);var l=On(e),n=qn(l,t).getTime()-Kn(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(i,{unit:"week"}):Xn(i,t.length)},I:function(e,t,l){var n=function(e){Dn(1,arguments);var t=On(e),l=zn(t).getTime()-Gn(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):Xn(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return Xn(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){Dn(1,arguments);var t=On(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=l-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):Xn(n,t.length)},E:function(e,t,l){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return l.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return l.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return l.day(n,{width:"short",context:"formatting"});case"EEEE":default:return l.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return Xn(o,2);case"eo":return l.ordinalNumber(o,{unit:"day"});case"eee":return l.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(i,{width:"short",context:"formatting"});case"eeee":default:return l.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return Xn(o,t.length);case"co":return l.ordinalNumber(o,{unit:"day"});case"ccc":return l.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(i,{width:"narrow",context:"standalone"});case"cccccc":return l.day(i,{width:"short",context:"standalone"});case"cccc":default:return l.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return Xn(i,t.length);case"io":return l.ordinalNumber(i,{unit:"day"});case"iii":return l.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return l.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return l.day(n,{width:"short",context:"formatting"});case"iiii":default:return l.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,l){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,l){var n,i=e.getUTCHours();switch(n=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,l){var n,i=e.getUTCHours();switch(n=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,l){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),l.ordinalNumber(n,{unit:"hour"})}return function(e,t){return Xn(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,l){return"Ho"===t?l.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return Xn(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):Xn(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):Xn(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return Xn(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return Xn(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return Xn(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Zn(i);case"XXXX":case"XX":return $n(i);case"XXXXX":case"XXX":default:return $n(i,":")}},x:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Zn(i);case"xxxx":case"xx":return $n(i);case"xxxxx":case"xxx":default:return $n(i,":")}},O:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Jn(i,":");case"OOOO":default:return"GMT"+$n(i,":")}},z:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Jn(i,":");case"zzzz":default:return"GMT"+$n(i,":")}},t:function(e,t,l,n){return Xn(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return Xn((n._originalDate||e).getTime(),t.length)}};function Jn(e,t){var l=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return l+String(i);var a=t||"";return l+String(i)+a+Xn(o,2)}function Zn(e,t){return e%60==0?(e>0?"-":"+")+Xn(Math.abs(e)/60,2):$n(e,t)}function $n(e,t){var l=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+Xn(Math.floor(i/60),2)+l+Xn(i%60,2)}function ei(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function ti(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var li={p:ti,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return ei(e,t);switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"})}return l.replace("{{date}}",ei(i,t)).replace("{{time}}",ti(o,t))}},ni=["D","DD"],ii=["YY","YYYY"];function oi(e){return-1!==ni.indexOf(e)}function ai(e){return-1!==ii.indexOf(e)}function ri(e,t,l){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(l,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(l,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(l,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(l,"`; see: https://git.io/fxCyr"))}var ui=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,di=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,si=/^'([^]*?)'?$/,ci=/''/g,mi=/[a-zA-Z]/;function vi(e,t,l){Dn(2,arguments);var n=String(t),i=l||{},o=i.locale||Wn,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:yn(a),u=null==i.firstWeekContainsDate?r:yn(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=o.options&&o.options.weekStartsOn,s=null==d?0:yn(d),c=null==i.weekStartsOn?s:yn(i.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var m=On(e);if(!wn(m))throw new RangeError("Invalid time value");var v=Tn(m),p=jn(m,v),E={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:m},f=n.match(di).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,li[t])(e,o.formatLong,E):e}).join("").match(ui).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return pi(l);var a=Qn[n];if(a)return!i.useAdditionalWeekYearTokens&&ai(l)&&ri(l,t,e),!i.useAdditionalDayOfYearTokens&&oi(l)&&ri(l,t,e),a(p,l,o.localize,E);if(n.match(mi))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return f}function pi(e){return e.match(si)[1].replace(ci,"'")}const Ei={step:1,isValid:!1,formData:{},coordinates:{},ownerPhotos:[],ownerIds:[]},fi=function(e,t){switch(void 0===e&&(e=Ei),t.type){case"UPDATE_NOCNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return Ei;case"UPDATE_NOCNewApplication_CoOrdinates":return c({},e,{coordinates:c({},e.coordinates,{[t.payload.key]:t.payload.value})});case"UPDATE_NOC_OwnerPhotos":return c({},e,{ownerPhotos:c({},e.ownerPhotos,{[t.payload.key]:t.payload.value})});case"UPDATE_NOC_OwnerIds":return c({},e,{ownerIds:c({},e.ownerIds,{[t.payload.key]:t.payload.value})});default:return e}},_i=["path","url"],gi=[],hi=()=>{var e,l,a,r,u,d,s,c;const v=i.useRouteMatch(),{path:p}=v,E=(m(v,_i),o.useTranslation(),null===(e=Digit)||void 0===e||null===(l=e.ComponentRegistryService)||void 0===l?void 0:l.getComponent("NewNOCStepperForm")),f=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),_=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),g=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCCitizenApplicationOverview"),h=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewNOCEditApplication"),A=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("NOCCitizenSearchApplication");return n.createElement("span",{className:"pgr-citizen-wrapper",style:{width:"100%"}},n.createElement(i.Switch,null,n.createElement(t.AppContainer,null,(void 0===(S=gi)&&(S=[]),S.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":n.createElement(t.BackButton,null,"Back")),n.createElement(t.PrivateRoute,{path:p+"/new-application",component:E}),n.createElement(t.PrivateRoute,{path:p+"/response/:id",component:f}),n.createElement(t.PrivateRoute,{path:p+"/my-application",component:_}),n.createElement(t.PrivateRoute,{path:p+"/edit-application/:id",component:h}),n.createElement(t.PrivateRoute,{path:p+"/search/application-overview/:id",component:g}),n.createElement(t.PrivateRoute,{path:p+"/search-application",component:A}))));var S},Ai=e=>{let{children:t,currentStep:l=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),r=e=>{const t=e<=l;return{width:"56px",height:"56px",borderRadius:"50%",background:t?"linear-gradient(135deg,#2563eb,#7c3aed)":"#ffffff",color:t?"#ffffff":"#0f172a",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"8px",fontWeight:600,fontSize:"18px",border:t?"none":"1px solid rgba(15,23,42,0.08)",boxShadow:t?"0 6px 18px rgba(37,99,235,0.18)":"0 2px 6px rgba(2,6,23,0.04)",position:"relative"}},u={fontSize:"16px",color:"#0f172a",fontWeight:600,fontFamily:"Noto Sans, sans-serif",marginRight:"8px",textAlign:"right"},d={fontSize:"14px",color:"#6b7280",fontWeight:500,fontFamily:"Noto Sans, sans-serif",margin:"0 6px 0 0"},s={position:"absolute",width:"3px",height:"56px",backgroundColor:"rgba(15,23,42,0.06)",left:"50%",top:"100%",transform:"translateX(-50%)",borderRadius:"2px"},m=window.Digit.Utils.browser.isMobile(),v=i.length,p=m?{width:"32px",height:"32px",fontSize:"12px"}:{},E=m?{fontSize:"10px"}:{},f=m?{width:"auto",padding:"6px",marginBottom:"0",flexDirection:"column",alignItems:"center"}:{};return n.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:m?"column":"row",gap:"24px"}},n.createElement("div",{className:"stepper-navigation-bar",style:c({display:"flex",flexDirection:"column",alignItems:"center",padding:"18px",minWidth:"120px",maxWidth:"320px",marginBottom:"20px",marginTop:m?"20px":"0",height:m?"106px":""},m?{flexDirection:"row",overflowX:"auto",whiteSpace:"nowrap",minWidth:"100%",maxWidth:"100%",gap:"8px",padding:"10px"}:{})},[...Array(v)].map((e,t)=>{return n.createElement("div",{className:"step-content",key:t,style:c({},(o=t+1<=l,_=t===v-1,{display:"flex",alignItems:"center",justifyContent:"flex-start",flex:"0 0 auto",color:o?"#0D43A7":"#9CA3AF",padding:"14px 12px",width:"260px",marginBottom:_?"6px":"18px"}),f)},n.createElement("div",{className:"step-circle",style:c({},r(t+1),p)},t+1,t<v-1&&!m&&n.createElement("div",{style:s})),n.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:m?"center":"flex-end",margin:m?"4px":"10px"}},t+1===v?null:n.createElement("div",{className:"step-number",style:d}),n.createElement("div",{className:"step-label",style:c({},u,E,{textAlign:m?"center":"right"})},a(i[t].stepLabel))));var o,_})),n.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px",background:"transparent"}},t))},Si=e=>{let{stepsList:t=[],onSubmit:l,step:i,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=o.useTranslation();function d(){i<r.length?c():i===r.length&&l()}function s(){i>1&&m()}const c=()=>a(i+1),m=()=>a(i-1);return n.createElement(Ai,{currentStep:i,nextStep:c,prevStep:m,stepsList:r},(()=>{var e,t;const l=r[i-1],{component:o,key:a,texts:c,currStepConfig:m}=l,v=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return n.createElement(n.Fragment,null,n.createElement(v,{config:{key:a,texts:c,component:o,currStepNumber:i,currStepConfig:m},onGoNext:d,onBackClick:s,t:u}))})())},Ni=[{head:"NOC_APPLICATION_REGISTRATION",stepNumber:1,body:[{component:"NOCApplicantDetails",withoutLabel:!0,key:"applicantDetails",type:"component"},{component:"NOCProfessionalDetails",withoutLabel:!0,key:"professionalDetails",type:"component"}]},{head:"ES_SITE_DETAILS",stepNumber:2,body:[{component:"NOCSiteDetails",withoutLabel:!0,key:"siteDetails",type:"component"},{component:"NOCSpecificationDetails",withoutLabel:!0,key:"siteDetails",type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{component:"NOCDocumentsRequired",withoutLabel:!0,key:"documents",type:"component"}]},{head:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,body:[{component:"NOCSummary",withoutLabel:!0,key:"summary",type:"component"}]}],bi=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),Ci=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),yi=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),Di=(e,t)=>({type:"UPDATE_NOC_OwnerPhotos",payload:{key:e,value:t}}),Oi=(e,t)=>({type:"UPDATE_NOC_OwnerIds",payload:{key:e,value:t}}),Li=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Ni.filter(t=>t.stepNumber===e.stepNumber)})),Ti=e=>{var i,a,r,u,d,s,m,v,p,E,f,_,g,h,A,S,N;const{t:b}=o.useTranslation(),C=l.useRef(),[y,D]=l.useState(!1),[O,L]=l.useState(!1),[T,I]=l.useState(null),w=Digit.SessionStorage.get("userType");let P={};const R=Digit.ULBService.getStateId(),x=null===(i=window)||void 0===i||null===(a=i.Digit)||void 0===a||null===(r=a.Utils)||void 0===r||null===(u=r.browser)||void 0===u?void 0:u.isMobile();function F(t){null!=e&&e.customOpen?null==e||e.customOpen(t):B(t)}P=(e=>{let t={};return t={containerStyles:{display:"flex",justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap",margin:"0px",padding:"0px"},tagContainerStyles:{margin:"0px",display:"flex",justifyContent:"center",padding:"0px",width:"46%"},tagStyles:{height:"auto",padding:"5px",margin:0,width:"100%",margin:"5px"},textStyles:{wordBreak:"break-word",height:"auto",lineHeight:"16px",overflow:"hidden",maxHeight:"34px"},inputStyles:{width:"43%",minHeight:"42px",maxHeight:"42px",top:"5px",left:"5px"},buttonStyles:{height:"auto",minHeight:"40px",width:"43%",maxHeight:"40px",margin:"5px",padding:"0px"},closeIconStyles:{width:"20px"},uploadFile:{minHeight:"50px"}},t})(),null!=e&&e.uploadMessage&&null!=C&&null!==(d=C.current)&&void 0!==d&&d.value&&(C.current.value="",e.onDelete(),D(!1)),l.useEffect(()=>{var t,l;(null==C||null===(t=C.current)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)<=0&&null!==T&&(C.current.value="",e.onDelete())},[null==C||null===(s=C.current)||void 0===s?void 0:s.files]),l.useEffect(()=>{var e,t,l,n;null!=C&&null!==(e=C.current)&&void 0!==e&&null!==(t=e.files)&&void 0!==t&&t[0]?(D(!0),I(null==C||null===(l=C.current)||void 0===l||null===(n=l.files)||void 0===n?void 0:n[0])):D(!1)},[null==e?void 0:e.message]);const B=function(t){try{if(0===(null==t?void 0:t.length))return Promise.resolve();L(!0);const l=Ot(function(){return Promise.resolve(Digit.UploadServices.Filefetch([t],R)).then(function(l){if(L(!1),null!=l&&l.data){const n=l.data[t];n?window.open(n,"_blank"):null!=e&&e.setError?null==e||e.setError(b("CS_FILE_FETCH_ERROR")):console.error(b("CS_FILE_FETCH_ERROR"))}else null!=e&&e.setError?null==e||e.setError(b("CS_FILE_FETCH_ERROR")):console.error(b("CS_FILE_FETCH_ERROR"))})},function(){L(!1),null!=e&&e.setError?null==e||e.setError(b("CS_FILE_FETCH_ERROR")):console.error(b("CS_FILE_FETCH_ERROR"))});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};return n.createElement(l.Fragment,null,!!(null==e?void 0:e.showHint)&&n.createElement("p",{className:"cell-text"},b(null==e?void 0:e.hintText)),!(null!=e&&e.disabled)&&n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width")+" "+(e.disabled?" disabled":""),style:null!==(m=P)&&void 0!==m&&m.uploadFile?null===(v=P)||void 0===v?void 0:v.uploadFile:{}},n.createElement("div",{style:P?null===(p=P)||void 0===p?void 0:p.containerStyles:null},n.createElement(t.ButtonSelector,{theme:"border",label:b("CS_COMMON_CHOOSE_FILE"),style:c({},P?null===(E=P)||void 0===E?void 0:E.buttonStyles:{},e.disabled?{display:"none"}:{}),textStyles:null==e?void 0:e.textStyles,type:e.buttonType}),null==e||null===(f=e.uploadedFiles)||void 0===f?void 0:f.map((l,i)=>{var o;const a=l[1];return n.createElement("div",{className:"tag-container",style:P?null===(o=P)||void 0===o?void 0:o.tagContainerStyles:null},n.createElement(t.RemoveableTag,{extraStyles:P,key:i,text:l[0],onClick:t=>null==e?void 0:e.removeTargetedFile(a,t)}))}),!e.uploadedFile||e.error?n.createElement("h2",{className:"file-upload-status"},b("ES_NO_FILE_SELECTED_LABEL")):n.createElement("div",{style:x?{width:"80%",display:"flex",marginBottom:"10px",justifyContent:"center"}:null===(_=P)||void 0===_?void 0:_.tagContainerStyles},n.createElement(t.SubmitBar,{onSubmit:()=>{F(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")}))),n.createElement("input",{className:e.disabled?"disabled":"input-mirror-selector-button",style:P?c({},null===(g=P)||void 0===g?void 0:g.inputStyles,null==e?void 0:e.inputStyles):c({},null==e?void 0:e.inputStyles),ref:C,type:"file",id:e.id||"document-"+Math.floor(139*(Math.random()||1)),name:"file",multiple:e.multiple,accept:e.accept,disabled:e.disabled,onChange:t=>e.onUpload(t),onClick:e=>{const{target:t={}}=e||{};t.value=""}})),(null==e?void 0:e.disabled)&&(e.uploadedFile?n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width"),style:null!==(h=P)&&void 0!==h&&h.uploadFile?null===(A=P)||void 0===A?void 0:A.uploadFile:{}},n.createElement(t.SubmitBar,{onSubmit:()=>{F(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")})):n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width")+" "+(e.disabled?" disabled":""),style:null!==(S=P)&&void 0!==S&&S.uploadFile?null===(N=P)||void 0===N?void 0:N.uploadFile:{}},n.createElement("h2",{className:"file-upload-status"},b("ES_NO_FILE_SELECTED_LABEL")))),e.iserror&&n.createElement("p",{style:{color:"red"}},e.iserror),(null==e?void 0:e.showHintBelow)&&n.createElement("p",{className:"cell-text"},b(null==e?void 0:e.hintText)),O&&n.createElement(t.Loader,{page:!0}))},Ii=e=>{const{t:i,currentStepData:o,Controller:a,control:r,setValue:u,errors:s,errorStyle:m,reset:v,useFieldArray:p,watch:E,ownerIdList:f,setOwnerIdList:_,ownerPhotoList:g,setOwnerPhotoList:h}=e,A=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[S,N]=(d.useDispatch(),l.useState(!1)),b=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return x({key:"true",error:!0,message:i("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{x(null)},3e3),Promise.resolve();const n=Lt(function(){return Ot(function(){return N(!0),Promise.resolve(Digit.UploadServices.Filestorage("CLU",l,A)).then(function(t){var n,o;if(N(!1),(null==t||null===(n=t.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){const n=t.data.files[0].fileStoreId;_(t=>{const i=[...t],o={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Id":"Owner"+(e+1)+" Id",documentUid:n};return e<=(null==i?void 0:i.length)?i[e]=o:i.push(o),i}),x({key:"true",success:!0,message:i("FILE_UPLOAD_SUCCESS")})}else x({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(){N(!1),x({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{x(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},C=e=>{const t=null==g?void 0:g.filter((t,l)=>l!==e);h(t)},y=e=>{const t=null==f?void 0:f.filter((t,l)=>l!==e);_(t)},D=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return x({key:"true",error:!0,message:i("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{x(null)},3e3),Promise.resolve();const n=Lt(function(){return Ot(function(){return N(!0),Promise.resolve(Digit.UploadServices.Filestorage("NOC",l,A)).then(function(t){var n,o;if(N(!1),(null==t||null===(n=t.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){const n=t.data.files[0].fileStoreId;h(t=>{const i=[...t],o={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Photo":"Owner"+(e+1)+" Photo",documentUid:n};return e<=(null==i?void 0:i.length)?i[e]=o:i.push(o),i}),x({key:"true",success:!0,message:i("FILE_UPLOAD_SUCCESS")})}else x({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(){N(!1),x({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{x(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},{data:O}=Digit.Hooks.obps.useMDMS(A,"common-masters",["GenderType"]);let L=[];O&&O["common-masters"].GenderType.filter(e=>e.active).map(e=>{L.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const T=e=>{if(!e)return null;const t="string"==typeof e?e:null==e?void 0:e.code;return L.find(e=>e.code===t)||null},{fields:I,append:w,remove:P}=p({control:r,name:"owners"});l.useEffect(()=>{console.log("currentStepData1",o);const e=null==o?void 0:o.applicationDetails;if(!e)return;const t=Array.isArray(e.owners)&&e.owners.length?e.owners.map(e=>({mobileNumber:e.mobileNumber||"",ownerOrFirmName:e.ownerOrFirmName||e.name||"",emailId:e.emailId||"",fatherOrHusbandName:e.fatherOrHusbandName||"",propertyId:e.propertyId||"",gender:T(e.gender),dateOfBirth:e.dateOfBirth||e.dob||"",address:e.address||e.permanentAddress||""})):[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:""}];v(c({},e,{owners:t}))},[o,u,w,v]);const[R,x]=l.useState(null),F=window.location.pathname.includes("edit");return console.log("ownerIdList (local)==>",f),console.log("ownerPhotoList (local)==>",g),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},i("NOC_APPLICANT_DETAILS")),n.createElement("div",null,F&&n.createElement(t.CardSectionSubText,{style:{color:"red",margin:"10px 0px"}}," ","To update your Mobile No, Name, Email, Date of Birth, or Gender, please go the Citizen's Edit Profile section"),I.map((e,l)=>{var d,c,v,p,_,h,S,N,O,w,R,B,M,k,U,H,W,j,z,V,G,q,Y,K,X,Q,J,Z;return n.createElement("div",{key:e.id,style:{border:"1px solid #ddd",padding:"16px",marginBottom:"12px"}},n.createElement(t.CardSubHeader,null,0===l?i("NOC_PRIMARY_OWNER"):i("Owner")+" "+(l+1)),n.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,cursor:"pointer"},onClick:()=>(e=>{var t,l;y(e),C(e),null==o||null===(t=o.applicationDetails)||void 0===t||null===(l=t.owners)||void 0===l||l.filter((t,l)=>l!==e),P(e)})(l)},!F&&I.length>1&&"❌"),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_MOBILE_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{style:{display:"flex"},className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].mobileNumber",rules:{required:i("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:i("INVALID_MOBILE_NUMBER")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i,disabled:F})}),n.createElement("div",{style:{marginTop:"17px"},className:"search-icon",onClick:F?null:()=>function(e){try{const t=(e=>{var t;return null!=(t=E("owners["+e+"].mobileNumber"))?t:""})(e);return/^[6-9]\d{9}$/.test(t)?Promise.resolve(Ot(function(){return Promise.resolve(Digit.UserService.userSearch(A,{userName:t},{})).then(function(t){var l,n,i,o,a;const r=null!=(l=null==t?void 0:t.user)?l:[];if(!r.length)return void x({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"});const d=r[0];u("owners["+e+"].ownerOrFirmName",null!=(n=d.name)?n:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].emailId",null!=(i=d.emailId)?i:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].fatherOrHusbandName",null!=(o=d.fatherOrHusbandName)?o:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].address",null!=(a=d.permanentAddress)?a:"",{shouldValidate:!0,shouldDirty:!0});const s="string"==typeof d.dob?d.dob:"",c=s?s.slice(0,10):"";u("owners["+e+"].dateOfBirth",c,{shouldValidate:!0,shouldDirty:!0});const m=T(d.gender);u("owners["+e+"].gender",m,{shouldValidate:!0,shouldDirty:!0})})},function(){x({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})):(x({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve())}catch(e){return Promise.reject(e)}}(l)}," ",n.createElement(t.SearchIcon,null)," "))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(d=s.owners)||void 0===d||null===(c=d[l])||void 0===c||null===(v=c.mobileNumber)||void 0===v?void 0:v.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_FIRM_OWNER_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].ownerOrFirmName",rules:{required:i("REQUIRED_FIELD"),maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i,disabled:F})}))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(p=s.owners)||void 0===p||null===(_=p[l])||void 0===_||null===(h=_.ownerOrFirmName)||void 0===h?void 0:h.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].emailId",rules:{required:i("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:i("INVALID_EMAIL_FORMAT")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i,disabled:F})}))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(S=s.owners)||void 0===S||null===(N=S[l])||void 0===N||null===(O=N.emailId)||void 0===O?void 0:O.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].fatherOrHusbandName",rules:{pattern:{value:/^[A-Za-z\s]+$/,message:i("ONLY_ENGLISH_LETTERS_ALLOWED")},maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(w=s.owners)||void 0===w||null===(R=w[l])||void 0===R||null===(B=R.fatherOrHusbandName)||void 0===B?void 0:B.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].address",rules:{required:i("REQUIRED_FIELD"),maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(M=s.owners)||void 0===M||null===(k=M[l])||void 0===k||null===(U=k.address)||void 0===U?void 0:U.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_PROPERTY_ID_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].propertyId",rules:{required:i("REQUIRED_FIELD"),maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(H=s.owners)||void 0===H||null===(W=H[l])||void 0===W||null===(j=W.propertyId)||void 0===j?void 0:j.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_DOB_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].dateOfBirth",rules:{required:i("REQUIRED_FIELD"),validate:e=>{const t=new Date,l=new Date(e),n=t.getFullYear()-l.getFullYear(),o=t.getMonth()-l.getMonth(),a=t.getDate()-l.getDate();return n>=18||18===n&&(o>0||0===o&&a>=0)||i("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>n.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],disabled:F})}))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(z=s.owners)||void 0===z||null===(V=z[l])||void 0===V||null===(G=V.dateOfBirth)||void 0===G?void 0:G.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_GENDER_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].gender",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.RadioButtons,{t:i,options:L,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:F})}))),n.createElement(t.CardLabelError,{style:m},(null==s||null===(q=s.owners)||void 0===q||null===(Y=q[l])||void 0===Y||null===(K=Y.gender)||void 0===K?void 0:K.message)||""),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},i("NOC_APPLICANT_PASSPORT_PHOTO"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(Ti,{id:"passport-photo-"+l,onUpload:D(l),onDelete:()=>{C(l)},uploadedFile:null==g||null===(X=g[l])||void 0===X?void 0:X.filestoreId,message:null!=g&&null!==(Q=g[l])&&void 0!==Q&&Q.filestoreId?"1 "+i("FILEUPLOADED"):i("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:"image/*",disabled:F}))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},i("NOC_APPLICANT_ID_PROOF"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(Ti,{id:"id-proof-"+l,onUpload:b(l),onDelete:()=>{y(l)},uploadedFile:null==f||null===(J=f[l])||void 0===J?void 0:J.filestoreId,message:null!=f&&null!==(Z=f[l])&&void 0!==Z&&Z.filestoreId?"1 "+i("FILEUPLOADED"):i("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:".pdf",disabled:F}))))})),n.createElement("div",null,n.createElement("button",{type:"button",onClick:()=>w({mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:""}),style:{cursor:"pointer"}},!F&&"➕ Add Owner")),R&&n.createElement(t.Toast,{error:null==R?void 0:R.error,warning:null==R?void 0:R.warning,label:i(null==R?void 0:R.message),isDleteBtn:!0,onClose:()=>{x(null)}}))},wi=e=>{var i,o,a,r,u,d,s,c,m,v,p;const{t:E,currentStepData:f,Controller:_,control:g,setValue:h,errors:A,errorStyle:S}=e,N=window.localStorage.getItem("CITIZEN.CITY"),[b,C]=l.useState(null),[y,D]=l.useState(null),[O,L]=l.useState(null),[T,I]=l.useState(null),w=Digit.UserService.getUser(),P=null==w||null===(i=w.info)||void 0===i||null===(o=i.roles)||void 0===o?void 0:o.find(e=>"BPA_ARCHITECT"===(null==e?void 0:e.code)),{data:R}=Digit.Hooks.obps.useBPAREGSearch(P?"pb.punjab":N,{},{mobileNumber:null==w||null===(a=w.info)||void 0===a?void 0:a.mobileNumber},{cacheTime:0});return l.useEffect(()=>{console.log("currentStepData2",f);const e=null==f?void 0:f.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;h(t,l)})},[f,h]),l.useEffect(()=>{if(R)for(let i=0;i<(null==R||null===(e=R.Licenses)||void 0===e?void 0:e.length);i++){var e,t,l;if("APPROVED"===(null==R||null===(t=R.Licenses)||void 0===t||null===(l=t[i])||void 0===l?void 0:l.status)){var n;C(null==R||null===(n=R.Licenses)||void 0===n?void 0:n[i]);break}}},[R]),l.useEffect(()=>{var e,t,l,n,i,o,a,r;b&&(D(P?null==b||null===(a=b.tradeLicenseDetail)||void 0===a||null===(r=a.additionalDetail)||void 0===r?void 0:r.counsilForArchNo:null==b?void 0:b.licenseNumber),L((null==b||null===(e=b.tradeLicenseDetail)||void 0===e||null===(t=e.owners)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.permanentAddress)||(null==b||null===(n=b.tradeLicenseDetail)||void 0===n||null===(i=n.owners)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.correspondenceAddress)),I(Digit.DateUtils.ConvertEpochToDate(null==b?void 0:b.validTo)))},[b]),l.useEffect(()=>{y&&(h("professionalRegId",y,{shouldValidate:!0,shouldDirty:!1}),h("professionalAddress",O),h("professionalRegIdValidity",T,{shouldValidate:!0,shouldDirty:!1}))},[O,y,h,T]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},E("NOC_PROFESSIONAL_DETAILS")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,""+E("NOC_PROFESSIONAL_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalName",defaultValue:null==w||null===(r=w.info)||void 0===r?void 0:r.name,rules:{required:E("REQUIRED_FIELD"),maxLength:{value:100,message:E("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:E,disabled:"true"})}))),n.createElement(t.CardLabelError,{style:S},null!=A&&A.professionalName?A.professionalName.message:""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+E("NOC_PROFESSIONAL_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalEmailId",defaultValue:null==w||null===(u=w.info)||void 0===u?void 0:u.emailId,rules:{required:E("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:E("INVALID_EMAIL_FORMAT")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:E,disabled:"true"})}))),n.createElement(t.CardLabelError,{style:S},(null==A||null===(d=A.professionalEmailId)||void 0===d?void 0:d.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+E("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalRegId",rules:{required:E("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:E,disabled:"true"})}))),n.createElement(t.CardLabelError,{style:S},(null==A||null===(s=A.professionalRegId)||void 0===s?void 0:s.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+E("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalRegIdValidity",rules:{required:E("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:E,disabled:"true"})}))),n.createElement(t.CardLabelError,{style:S},(null==A||null===(c=A.professionalRegIdValidity)||void 0===c?void 0:c.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+E("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalMobileNumber",defaultValue:null==w||null===(m=w.info)||void 0===m?void 0:m.mobileNumber,rules:{required:E("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:E("INVALID_MOBILE_NUMBER")}},render:e=>n.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:E,disable:"true"})}))),n.createElement(t.CardLabelError,{style:S},(null==A||null===(v=A.professionalMobileNumber)||void 0===v?void 0:v.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+E("NOC_PROFESSIONAL_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalAddress",rules:{required:E("REQUIRED_FIELD"),maxLength:{value:100,message:E("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:E,disabled:"true",disable:"true"})}))),n.createElement(t.CardLabelError,{style:S},(null==A||null===(p=A.professionalAddress)||void 0===p?void 0:p.message)||""))},Pi=e=>{var i,o,a,r,u,d,s,m,v,p,E,f,_,g,h,A,S,N,b,C;let y;y=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const D=Digit.ULBService.getStateId(),{t:O,currentStepData:L,Controller:T,control:I,setValue:w,errors:P,errorStyle:R,useFieldArray:x,watch:F}=e,[B,M]=l.useState("0.00"),k=F("netPlotAreaAfterWidening"),U=F("areaLeftForRoadWidening");l.useEffect(()=>{const e=parseFloat(k),t=parseFloat(U),l=((isNaN(e)?0:e)+(isNaN(t)?0:t)).toFixed(2);M(l),w("netTotalArea",l)},[k,U]);const[H,W]=l.useState("0.00"),{fields:j,append:z,remove:V}=x({control:I,name:"floorArea"}),G=F("floorArea"),q=F("basementArea");l.useEffect(()=>{const e=null==G?void 0:G.reduce((e,t)=>{const l=parseFloat(null==t?void 0:t.value);return e+(isNaN(l)?0:l)},0),t=isNaN(q)?0:q,l=(e+parseFloat(t)).toFixed(2);W(l),w("totalFloorArea",l)},[G,q]);const[Y,K]=l.useState((null==L||null===(i=L.siteDetails)||void 0===i?void 0:i.ulbName)||null),[X,Q]=l.useState((null==L||null===(o=L.siteDetails)||void 0===o?void 0:o.ulbType)||""),[J,Z]=l.useState((null==L||null===(a=L.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:$,isLoading:ee}=Digit.Hooks.noc.useBuildingType(D),{data:te,isLoading:le}=Digit.Hooks.noc.useRoadType(D),{data:ne,isLoading:ie}=Digit.Hooks.useTenants(),oe=null==ne?void 0:ne.map(e=>c({},e,{displayName:O(e.i18nKey)}));l.useEffect(()=>{if(Y){var e;const t=null==Y||null===(e=Y.city)||void 0===e?void 0:e.ulbType;Q(t),w("ulbType",t)}},[Y,w]);const[ae,re]=l.useState((null==L||null===(r=L.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),ue=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],de=Digit.Hooks.noc.useTenants(),[se,ce]=l.useState(de),{data:me,isLoading:ve}=Digit.Hooks.useCustomMDMS(D,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+y+"')]"}]),[pe,Ee]=l.useState((null==L||null===(u=L.siteDetails)||void 0===u?void 0:u.district)||null);return l.useEffect(()=>{if(y&&(null==de?void 0:de.length)>0){const e=de.find(e=>e.code===y);e&&(Ee(e),w("district",e))}},[y,de]),l.useEffect(()=>{const e=null==L?void 0:L.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,l]=e;"floorArea"!==t&&w(t,l)}),Array.isArray(e.floorArea))){for(let e=j.length-1;e>=0;e--)V(e);e.floorArea.forEach(e=>{z({value:e.value||""})})}},[L,w,z,V]),n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardSectionHeader,{className:"card-section-header"},O("NOC_SITE_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_PLOT_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"plotNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},null!=P&&P.plotNo?P.plotNo.message:""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},O("NOC_PROPOSED_SITE_ADDRESS"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"proposedSiteAddress",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:200,message:O("MAX_200_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},null!=P&&P.proposedSiteAddress?P.proposedSiteAddress.message:""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ULB_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),!ie&&n.createElement(T,{control:I,name:"ulbName",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{K(t),e.onChange(t)},selected:e.value,option:oe,optionKey:"displayName",t:O})})),n.createElement(t.CardLabelError,{style:R},null!=P&&P.ulbName?P.ulbName.message:""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ULB_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"ulbType",render:e=>n.createElement(t.TextInput,{value:X||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_KHASRA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"khasraNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(d=P.khasraNo)||void 0===d?void 0:d.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_HADBAST_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"hadbastNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(s=P.hadbastNo)||void 0===s?void 0:s.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ROAD_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),!le&&n.createElement(T,{control:I,name:"roadType",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:te,optionKey:"name",t:O})})),n.createElement(t.CardLabelError,{style:R},(null==P||null===(m=P.roadType)||void 0===m?void 0:m.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"areaLeftForRoadWidening",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(v=P.areaLeftForRoadWidening)||void 0===v?void 0:v.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"netPlotAreaAfterWidening",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(p=P.netPlotAreaAfterWidening)||void 0===p?void 0:p.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_NET_TOTAL_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"netTotalArea",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},defaultValue:B,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:"true"})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(E=P.netTotalArea)||void 0===E?void 0:E.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ROAD_WIDTH_AT_SITE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"roadWidthAtSite",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},null!=P&&P.roadWidthAtSite?P.roadWidthAtSite.message:""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_BUILDING_STATUS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),!ee&&n.createElement(T,{control:I,name:"buildingStatus",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{Z(t),e.onChange(t)},selected:e.value,option:$,optionKey:"name",t:O})})),n.createElement(t.CardLabelError,{style:R},(null==P||null===(f=P.buildingStatus)||void 0===f?void 0:f.message)||""),"BUILTUP"===(null==J?void 0:J.code)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement(T,{control:I,name:"isBasementAreaAvailable",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{re(t),e.onChange(t)},selected:e.value,option:ue,optionKey:"i18nKey",t:O})})),n.createElement(t.CardLabelError,{style:R},(null==P||null===(_=P.isBasementAreaAvailable)||void 0===_?void 0:_.message)||""),"BUILTUP"===(null==J?void 0:J.code)&&"YES"===(null==ae?void 0:ae.code)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_BASEMENT_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"basementArea",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},null!=P&&P.basementArea?P.basementArea.message:""),"BUILTUP"===(null==J?void 0:J.code)&&j.map((e,l)=>n.createElement("div",{style:{display:"flex",gap:"10px",flexDirection:"column"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},0===l?"Ground":""+l," Floor Area(sq mt)",n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},n.createElement(T,{control:I,name:"floorArea."+l+".value",defaultValue:e.value,rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var i,o;return n.createElement(n.Fragment,null,n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}}),(null==P||null===(i=P.floorArea)||void 0===i||null===(o=i[l])||void 0===o?void 0:o.value)&&n.createElement(t.CardLabelError,{className:R},P.floorArea[l].value.message))}}),n.createElement("button",{type:"button",onClick:()=>V(l)},"❌")))),"BUILTUP"===(null==J?void 0:J.code)&&n.createElement("button",{type:"button",onClick:()=>z({value:""})},"➕ Add Floor"),"BUILTUP"===(null==J?void 0:J.code)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"totalFloorArea",defaultValue:H,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_WARD_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"wardNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(g=P.wardNo)||void 0===g?void 0:g.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_DISTRICT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement(T,{control:I,name:"district",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{Ee(t),e.onChange(t)},selected:e.value,option:se.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name",disable:"true",t:O})})),n.createElement(t.CardLabelError,{style:R},(null==P||null===(h=P.district)||void 0===h?void 0:h.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ZONE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),!ve&&n.createElement(T,{control:I,name:"zone",rules:{required:O("REQUIRED_FIELD")},render:e=>{var l,i,o;return n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:null==me||null===(l=me.tenant)||void 0===l||null===(i=l.zoneMaster)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.zones,optionKey:"code",t:O})}})),n.createElement(t.CardLabelError,{style:R},(null==P||null===(A=P.zone)||void 0===A?void 0:A.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_VILLAGE_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"villageName",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(S=P.villageName)||void 0===S?void 0:S.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_COLONY_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"colonyName",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(N=P.colonyName)||void 0===N?void 0:N.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_VASIKA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"vasikaNumber",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(b=P.vasikaNumber)||void 0===b?void 0:b.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"khewatAndKhatuniNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}))),n.createElement(t.CardLabelError,{style:R},(null==P||null===(C=P.khewatAndKhatuniNo)||void 0===C?void 0:C.message)||"")),n.createElement(t.BreakLine,null)))},Ri=e=>{var i,o,a,r;const{t:u,currentStepData:d,Controller:s,control:c,setValue:m,errors:v,errorStyle:p}=e,E=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[f,_]=l.useState((null==d||null===(i=d.siteDetails)||void 0===i?void 0:i.specificationBuildingCategory)||null),{data:g,isLoading:h}=Digit.Hooks.noc.useBuildingCategory(E),{data:A,isLoading:S}=Digit.Hooks.noc.useNocType(E),N=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return l.useEffect(()=>{console.log("currentStepData4",d);const e=null==d?void 0:d.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;m(t,l)})},[d,m]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,null,u("NOC_SPECIFICATION_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(s,{control:c,name:"specificationPlotArea",rules:{required:u("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:u("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:u("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:u})}))),n.createElement(t.CardLabelError,{style:p},null!=v&&v.specificationPlotArea?v.specificationPlotArea.message:""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_BUILDING_CATEGORY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),!h&&g.length>0&&n.createElement(s,{control:c,name:"specificationBuildingCategory",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{_(t),e.onChange(t)},selected:e.value,option:g,optionKey:"name",t:u})})),n.createElement(t.CardLabelError,{style:p},null!=v&&v.specificationBuildingCategory?v.specificationBuildingCategory.message:""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_NOC_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),!S&&n.createElement(s,{control:c,name:"specificationNocType",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:A,optionKey:"name",t:u})})),n.createElement(t.CardLabelError,{style:p},(null==v||null===(o=v.specificationNocType)||void 0===o?void 0:o.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_RESTRICTED_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement(s,{control:c,name:"specificationRestrictedArea",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey",t:u})})),n.createElement(t.CardLabelError,{style:p},(null==v||null===(a=v.specificationRestrictedArea)||void 0===a?void 0:a.message)||""),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement(s,{control:c,name:"specificationIsSiteUnderMasterPlan",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:N,optionKey:"i18nKey",t:u})})),n.createElement(t.CardLabelError,{style:p},(null==v||null===(r=v.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.message)||"")))},xi=e=>{let{ownerFileStoreId:i,ownerName:a}=e;const r=Digit.ULBService.getStateId(),[u,d]=(o.useTranslation(),l.useState(null)),[s,c]=l.useState(null);return l.useEffect(()=>{!function(){try{const e=function(){if(i)return Promise.resolve(Digit.UploadServices.Filefetch([i],r)).then(function(e){var t,l;null!=e&&null!==(t=e.data)&&void 0!==t&&t.fileStoreIds&&d(null===(l=e.data.fileStoreIds[0])||void 0===l?void 0:l.url)})}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[i]),n.createElement(t.Card,null,n.createElement("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"10px",padding:"0px 20px"}},n.createElement("div",{style:{textAlign:"center"}},n.createElement("img",{src:u,alt:"Primary Owner Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:u?"pointer":"default"},onClick:()=>u&&c(u)}),n.createElement("div",null,a||"Primary Owner Photo"))),s&&n.createElement(t.ImageViewer,{imageSrc:s,onClose:()=>{c(null)}}))};function Fi(e){var l,o,a,r,u,s,c,m,v,p,E,f,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,P,R,x,F,B,M,k,U,H,W,j,z,V,G,q,Y,K,X,Q,J,Z,$,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,_e,ge;let{currentStepData:he,t:Ae}=e;i.useLocation(),i.useHistory(),d.useDispatch(),console.log("formData in Summary Page",he);const Se=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}}),Ne=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerPhotos)||[]}),be=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerIds)||[]});console.log("coordinates in summary page",Se);const Ce=(e,l)=>n.createElement("div",{className:"bpa-summary-label-field-pair"},n.createElement(t.CardLabel,{className:"bpa-summary-bold-label"},e),n.createElement("div",null,l||"NA"));Digit.UserService.getUser();let ye=null==he||null===(l=he.documents)||void 0===l||null===(o=l.documents)||void 0===o?void 0:o.documents;return console.log("documents here in summary",ye),n.createElement("div",{className:"bpa-summary-page"},n.createElement("h2",{className:"bpa-summary-heading"},Ae("OWNER_OWNERPHOTO")),n.createElement("div",{className:"bpa-summary-section"},n.createElement(xi,{ownerFileStoreId:null==Ne||null===(a=Ne.ownerPhotoList)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.filestoreId,ownerName:null==he||null===(u=he.applicationDetails)||void 0===u||null===(s=u.owners)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.ownerOrFirmName})),null===(m=null!=(v=null==he||null===(p=he.applicationDetails)||void 0===p?void 0:p.owners)?v:[])||void 0===m?void 0:m.map((e,t)=>{var l;return n.createElement("div",{key:t,className:"bpa-summary-section"},n.createElement("h2",{className:"bpa-summary-heading"},0===t?Ae("NOC_PRIMARY_OWNER"):"Owner "+(t+1)),Ce(Ae("NOC_FIRM_OWNER_NAME_LABEL"),null==e?void 0:e.ownerOrFirmName),Ce(Ae("NOC_APPLICANT_EMAIL_LABEL"),null==e?void 0:e.emailId),Ce(Ae("BPA_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==e?void 0:e.fatherOrHusbandName),Ce(Ae("NOC_APPLICANT_MOBILE_NO_LABEL"),null==e?void 0:e.mobileNumber),Ce(Ae("NOC_APPLICANT_PROPERTY_ID_LABEL"),null==e?void 0:e.propertyId),Ce(Ae("NOC_APPLICANT_DOB_LABEL"),null==e?void 0:e.dateOfBirth),Ce(Ae("NOC_APPLICANT_GENDER_LABEL"),null==e||null===(l=e.gender)||void 0===l?void 0:l.code),Ce(Ae("NOC_APPLICANT_ADDRESS_LABEL"),null==e?void 0:e.address))}),(null==he||null===(E=he.applicationDetails)||void 0===E?void 0:E.professionalName)&&n.createElement(n.Fragment,null,n.createElement("h2",{className:"bpa-summary-heading"},Ae("NOC_PROFESSIONAL_DETAILS")),n.createElement("div",{className:"bpa-summary-section"},Ce(Ae("NOC_PROFESSIONAL_NAME_LABEL"),null==he||null===(f=he.applicationDetails)||void 0===f?void 0:f.professionalName),Ce(Ae("NOC_PROFESSIONAL_EMAIL_LABEL"),null==he||null===(_=he.applicationDetails)||void 0===_?void 0:_.professionalEmailId),Ce(Ae("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==he||null===(g=he.applicationDetails)||void 0===g?void 0:g.professionalRegId),Ce(Ae("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),null==he||null===(h=he.applicationDetails)||void 0===h?void 0:h.professionalRegIdValidity),Ce(Ae("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==he||null===(A=he.applicationDetails)||void 0===A?void 0:A.professionalMobileNumber),Ce(Ae("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==he||null===(S=he.applicationDetails)||void 0===S?void 0:S.professionalAddress))),n.createElement("h2",{className:"bpa-summary-heading"},Ae("NOC_SITE_DETAILS")),n.createElement("div",{className:"bpa-summary-section"},Ce(Ae("NOC_PLOT_NO_LABEL"),null==he||null===(N=he.siteDetails)||void 0===N?void 0:N.plotNo),Ce(Ae("NOC_PROPOSED_SITE_ADDRESS"),null==he||null===(b=he.siteDetails)||void 0===b?void 0:b.proposedSiteAddress),Ce(Ae("NOC_ULB_NAME_LABEL"),null==he||null===(C=he.siteDetails)||void 0===C||null===(y=C.ulbName)||void 0===y?void 0:y.name),Ce(Ae("NOC_ULB_TYPE_LABEL"),null==he||null===(D=he.siteDetails)||void 0===D?void 0:D.ulbType),Ce(Ae("NOC_KHASRA_NO_LABEL"),null==he||null===(O=he.siteDetails)||void 0===O?void 0:O.khasraNo),Ce(Ae("NOC_HADBAST_NO_LABEL"),null==he||null===(L=he.siteDetails)||void 0===L?void 0:L.hadbastNo),Ce(Ae("NOC_ROAD_TYPE_LABEL"),null==he||null===(T=he.siteDetails)||void 0===T||null===(I=T.roadType)||void 0===I?void 0:I.name),Ce(Ae("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==he||null===(w=he.siteDetails)||void 0===w?void 0:w.areaLeftForRoadWidening),Ce(Ae("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==he||null===(P=he.siteDetails)||void 0===P?void 0:P.netPlotAreaAfterWidening),Ce(Ae("NOC_NET_TOTAL_AREA_LABEL"),null==he||null===(R=he.siteDetails)||void 0===R?void 0:R.netTotalArea),Ce(Ae("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==he||null===(x=he.siteDetails)||void 0===x?void 0:x.roadWidthAtSite),Ce(Ae("NOC_BUILDING_STATUS_LABEL"),null==he||null===(F=he.siteDetails)||void 0===F||null===(B=F.buildingStatus)||void 0===B?void 0:B.name),Ce(Ae("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==he||null===(M=he.siteDetails)||void 0===M||null===(k=M.isBasementAreaAvailable)||void 0===k?void 0:k.code),"BUILTUP"===(null==he||null===(U=he.siteDetails)||void 0===U||null===(H=U.buildingStatus)||void 0===H?void 0:H.code)&&Ce(Ae("NOC_BASEMENT_AREA_LABEL"),null==he||null===(W=he.siteDetails)||void 0===W?void 0:W.basementArea),"BUILTUP"===(null==he||null===(j=he.siteDetails)||void 0===j||null===(z=j.buildingStatus)||void 0===z?void 0:z.code)&&(null==he||null===(V=he.siteDetails)||void 0===V||null===(G=V.floorArea)||void 0===G?void 0:G.map((e,t)=>Ce((e=>{if(0===e)return Ae("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,l=e%100;let n="th";return(l<11||l>13)&&(1===t?n="st":2===t?n="nd":3===t&&(n="rd")),""+e+n+" "+Ae("NOC_FLOOR_AREA_LABEL")})(t),null==e?void 0:e.value))),"BUILTUP"===(null==he||null===(q=he.siteDetails)||void 0===q||null===(Y=q.buildingStatus)||void 0===Y?void 0:Y.code)&&Ce(Ae("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),null==he||null===(K=he.siteDetails)||void 0===K?void 0:K.totalFloorArea),Ce(Ae("NOC_DISTRICT_LABEL"),null==he||null===(X=he.siteDetails)||void 0===X||null===(Q=X.district)||void 0===Q?void 0:Q.name),Ce(Ae("NOC_ZONE_LABEL"),null==he||null===(J=he.siteDetails)||void 0===J||null===(Z=J.zone)||void 0===Z?void 0:Z.name),Ce(Ae("NOC_SITE_WARD_NO_LABEL"),null==he||null===($=he.siteDetails)||void 0===$?void 0:$.wardNo),Ce(Ae("NOC_SITE_VILLAGE_NAME_LABEL"),null==he||null===(ee=he.siteDetails)||void 0===ee?void 0:ee.villageName),Ce(Ae("NOC_SITE_COLONY_NAME_LABEL"),null==he||null===(te=he.siteDetails)||void 0===te?void 0:te.colonyName),Ce(Ae("NOC_SITE_VASIKA_NO_LABEL"),null==he||null===(le=he.siteDetails)||void 0===le?void 0:le.vasikaNumber),Ce(Ae("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),null==he||null===(ne=he.siteDetails)||void 0===ne?void 0:ne.khewatAndKhatuniNo)),n.createElement("h2",{className:"bpa-summary-heading"},Ae("NOC_SPECIFICATION_DETAILS")),n.createElement("div",{className:"bpa-summary-section"},Ce(Ae("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==he||null===(ie=he.siteDetails)||void 0===ie?void 0:ie.specificationPlotArea),Ce(Ae("NOC_BUILDING_CATEGORY_LABEL"),null==he||null===(oe=he.siteDetails)||void 0===oe||null===(ae=oe.specificationBuildingCategory)||void 0===ae?void 0:ae.name),Ce(Ae("NOC_NOC_TYPE_LABEL"),null==he||null===(re=he.siteDetails)||void 0===re||null===(ue=re.specificationNocType)||void 0===ue?void 0:ue.name),Ce(Ae("NOC_RESTRICTED_AREA_LABEL"),null==he||null===(de=he.siteDetails)||void 0===de||null===(se=de.specificationRestrictedArea)||void 0===se?void 0:se.code),Ce(Ae("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),null==he||null===(ce=he.siteDetails)||void 0===ce||null===(me=ce.specificationIsSiteUnderMasterPlan)||void 0===me?void 0:me.code)),n.createElement("h2",{className:"bpa-summary-heading"},Ae("NOC_SITE_COORDINATES_LABEL")),n.createElement("div",{className:"bpa-summary-section"},Ce(Ae("COMMON_LATITUDE1_LABEL"),null==Se?void 0:Se.Latitude1),Ce(Ae("COMMON_LONGITUDE1_LABEL"),null==Se?void 0:Se.Longitude1),Ce(Ae("COMMON_LATITUDE2_LABEL"),null==Se?void 0:Se.Latitude2),Ce(Ae("COMMON_LONGITUDE2_LABEL"),null==Se?void 0:Se.Longitude2)),n.createElement("h2",{className:"bpa-summary-heading"},Ae("NOC_UPLOADED_OWNER_ID")),n.createElement("div",{className:"bpa-summary-section"},(null==be||null===(ve=be.ownerIdList)||void 0===ve?void 0:ve.length)>0&&n.createElement(An,{documents:null==be?void 0:be.ownerIdList})),n.createElement("h2",{className:"bpa-summary-heading"},Ae("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement("div",{className:"bpa-summary-section"},(null==he||null===(pe=he.documents)||void 0===pe||null===(Ee=pe.documents)||void 0===Ee||null===(fe=Ee.documents)||void 0===fe?void 0:fe.length)>0&&n.createElement(An,{documents:null==he||null===(_e=he.documents)||void 0===_e||null===(ge=_e.documents)||void 0===ge?void 0:ge.documents})),n.createElement("h2",{className:"bpa-summary-heading"},Ae("NOC_FEE_DETAILS_LABEL")),n.createElement("div",{className:"bpa-summary-section"},he&&n.createElement(Sn,{formData:he})))}function Bi(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:d,action:m,formData:v,handleSubmit:p,geocoordinates:E,setGeoCoordinates:f,dispatch:_}=e;const g=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],[h,A]=(Digit.ULBService.getCurrentTenantId(),l.useState(g?c({},g,{active:!0===(null==a?void 0:a.active),code:null==g?void 0:g.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[S,N]=l.useState(null),[b,C]=l.useState(()=>(null==g?void 0:g.filestoreId)||null);function y(e){const t=e.target.files[0];N(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),l=s.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&l){const n=P(e).toFixed(6),i=P(l).toFixed(6);t({latitude:n,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){console.log("EXIF parsing failed:",e),t({latitude:null,longitude:null})}})}(t).then(e=>{console.log("Latitude:",e.latitude),console.log("Longitude:",e.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(yi("Latitude1",e.latitude)),_(yi("Longitude1",e.longitude)),f(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(_(yi("Latitude1","")),_(yi("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(yi("Latitude2",e.latitude)),_(yi("Longitude2",e.longitude)),f(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(_(yi("Latitude2","")),_(yi("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:D}=a;var O=D;const[L,T]=l.useState(!1),[I,w]=l.useState(!1);function P(e){return e[0]+e[1]/60+e[2]/3600}return l.useEffect(()=>{null!=h&&h.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==b?void 0:b.length)||null===b?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==b))||[],{documentType:null==h?void 0:h.code,filestoreId:b,documentUid:b,documentAttachment:b}]})},[b,h]),l.useEffect(()=>{(null==d?void 0:d.length)>0&&(console.log("documents here",d),p())},[d]),l.useEffect(()=>{if("update"===m){var e,t;const l=null==v||null===(e=v.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],n=O.filter(e=>e.code===(null==l?void 0:l.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];n?(A(n),C(null==l?void 0:l.fileStoreId)):T(!0)}},[]),l.useEffect(()=>{var e;null!=a&&a.hasDropdown||A({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),l.useEffect(()=>{!function(){try{u(null);const e=function(){if(S){w(!0);const e=function(){if(S.size>=5242880)w(!1),u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return C(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",S,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?C(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),u(o("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)}}()},[S]),l.useEffect(()=>{L&&C(null)},[L]),n.createElement("div",{style:{marginBottom:"24px"}},I&&n.createElement(t.Loader,null),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"bpa-doc-required-label"},o(null==a?void 0:a.code.replaceAll(".","_"))," ",(null==a?void 0:a.required)&&n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"bpa-doc-required-field"},n.createElement(Ti,"OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?{id:"noc-doc",onUpload:y,onDelete:()=>{C(null)},uploadedFile:b,message:b?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".jpg, .jpeg, .png"}:{id:"noc-doc",onUpload:y,onDelete:()=>{C(null)},uploadedFile:b,message:b?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".pdf, .jpeg, .jpg, .png"})),n.createElement("p",{style:{padding:"10px",fontSize:"14px"}},o("OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?"Only .png, .jpeg, .jpg files are accepted with maximum size of 5 MB":"Only .pdf, .png, .jpeg, .jpg files are accepted with maximum size of 5 MB")),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude1)&&(null==E?void 0:E.Longitude1)&&n.createElement("p",{className:"bpa-doc-required-coordinates"},"Latitude: ",E.Latitude1," & Longitude: ",E.Longitude1," "),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null==E?void 0:E.Latitude2)&&(null==E?void 0:E.Longitude2)&&n.createElement("p",{className:"bpa-doc-required-coordinates"},"Latitude: ",E.Latitude2," & Longitude: ",E.Longitude2)))}const Mi=n.memo(function(e){var i,o,a;let{t:r,document:u,setDocuments:d,documents:m,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:E,handleSubmit:f}=e;console.log("documents here",m);const _=(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]);console.log("filteredDocument here",_);const g=Digit.ULBService.getStateId(),[h,A]=l.useState(_?c({},_,{active:!0,code:null==_?void 0:_.documentType,i18nKey:null==_?void 0:_.documentType}):(null==u||null===(i=u.dropdownData)||void 0===i?void 0:i.length)>0?null==u?void 0:u.dropdownData[0]:{}),[S,N]=l.useState(null),[b,C]=l.useState(()=>(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[y,D]=l.useState([]),[O,L]=l.useState([]),[T,I]=l.useState([]||(null==v||null===(o=v.documents)||void 0===o?void 0:o.documents.filter(e=>e.documentType===h.code))),[w,P]=l.useState(null),[R,x]=l.useState(null);function F(e){return e[0]+e[1]/60+e[2]/3600}l.useEffect(()=>{(null==m?void 0:m.length)>0&&f()},[m]),l.useEffect(()=>{O.length>0&&null!=h&&h.code&&(d(e=>{if(null===b||null==(null==b?void 0:b.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId);let l=[];return O&&O.map((e,t)=>{var n,i;l.push({documentType:null==h?void 0:h.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:w,longitude:R},documentUid:e.fileStoreId,fileName:(null===(n=T[t])||void 0===n?void 0:n.name)||"",id:m?null===(i=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===i?void 0:i.id:void 0})}),console.log("newfiles here",l),[...t,...l]}),L([])),null!=h&&h.code&&d(e=>{var t;return null===b||null==(null==b?void 0:b.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,l,n,i,o;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(l=e.documentType)||void 0===l?void 0:l.split(".")[1])==(null==h||null===(n=h.code)||void 0===n?void 0:n.split(".")[0])+"."+(null==h||null===(i=h.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:b.fileStoreId,documentUid:b.fileStoreId,fileName:(null==S?void 0:S.name)||b.fileName||"document",id:m?null===(t=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[b,h]),l.useEffect(()=>{h.code||null===b||L([...O,b])},[b]);const B=l.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",v);let l=[];return null==v||null===(e=v.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===h.code).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:g}}])),console.log("selectedUplDocs here",l),l},[v]);return n.createElement("div",null,n.createElement(t.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:g,getFormState:function(e){let t,l,n=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),l=s.getTag(this,"GPSLongitude");if(e&&l){const n=F(e),i=F(l);t({latitude:n,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),P(i.latitude),x(i.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),l=Object.values(t),l=null==v||null===(o=v.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),D(l);let s=[];null==e||e.map((e,t)=>{var l,n,o,a;s.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(l=e[1])||void 0===l||null===(n=l.fileStoreId)||void 0===n?void 0:n.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:m?null===(a=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===a?void 0:a.id:void 0})});const c=[...m.filter(e=>e.documentType!==n),...s];d(c),null===(r=l)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=n,function(e,t){e&&N(e.file),e&&I([...T,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...m.filter(e=>e.documentType!==n)];d(e)}},setuploadedstate:B,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&n.createElement(Tl,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(sessionStorage.getItem("Latitude")&&sessionStorage.getItem("Longitude")?n.createElement("div",null,n.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude")),n.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude")),E(!1)," "):n.createElement("div",null,n.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),E(!0)," ")))}),ki=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:null==Ni?void 0:Ni.filter(t=>(null==t?void 0:t.stepNumber)===(null==e?void 0:e.stepNumber))})),Ui=["tenantId","payments","pdfkey","EmpData"],Hi=(e,t,l,i)=>{var o,a,r,u,d,s;const{wfComment:c,thumbnailsToShow:m,wfDocuments:v}=e,p={date:null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.lastModified,time:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.timing,name:null==e||null===(r=e.assigner)||void 0===r?void 0:r.name,mobileNumber:null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber,source:null==e||null===(d=e.assigner)||void 0===d?void 0:d.source};return n.createElement("div",null,(null==c?void 0:c.length)>0&&n.createElement("div",{className:"TLComments"},n.createElement("h3",null,i("WF_COMMON_COMMENTS")),n.createElement("p",{style:{overflowX:"scroll"}},c)),(null==m||null===(s=m.thumbs)||void 0===s?void 0:s.length)>0&&n.createElement(DisplayPhotos,{srcs:m.thumbs,onClick:(e,t)=>{var l;let n=(null===(l=m.fullImage)||void 0===l?void 0:l[t])||e;Digit.Utils.zoomImage(n)}}),(null==v?void 0:v.length)>0&&n.createElement("div",null,n.createElement("div",null,n.createElement(En,{value:{workflowDocs:v},index:t}))),n.createElement("div",{style:{marginTop:"8px"}},p.time&&n.createElement("p",null,p.time),p.date&&n.createElement("p",null,p.date),p.name&&n.createElement("p",null,p.name),p.mobileNumber&&n.createElement("p",null,p.mobileNumber),p.source&&n.createElement("p",null,i("ES_COMMON_FILED_VIA_"+p.source.toUpperCase()))))},Wi=e=>{var i,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=o.useTranslation(),p=Digit.UserService.getUser().info;return n.createElement(l.Fragment,null,n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),n.createElement(t.CardLabelError,null,null==m||null===(i=m.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),n.createElement(t.SearchField,{className:"submit"},n.createElement(t.SubmitBar,{label:v("ES_COMMON_SEARCH"),submit:!0}),n.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),d("offset",s("offset")-s("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},v("ES_COMMON_CLEAR_ALL"))))},ji=["currentlyActiveMobileModal"],zi=["currentlyActiveMobileModal"],Vi=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:E}=o.useTranslation(),{handleSubmit:f}=a.useFormContext(),[_,g]=l.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{g({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),S=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,i=m(e,ji);const{closeMobilePopupModal:o}=i;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,i,n.createElement(A,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,E("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),n.createElement(u,{onSubmit:p,handleSubmit:f,isMobileView:!0,closeMobilePopupModal:o}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,zi)))},[_]);return s?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"searchBox"},n.createElement(t.SearchAction,{text:E("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"})})),_?n.createElement(t.PopUp,null,n.createElement(S,{onSubmit:e=>{g({type:"remove"}),p(e)},handleSubmit:f,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:_,closeMobilePopupModal:h})):null,null!=v&&null!==(i=v[0])&&void 0!==i&&i.display?n.createElement(t.Card,{style:{marginTop:20}},E(null==v||null===(r=v[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/citizen/noc/search/application-overview/",serviceRequestIdKey:E("NOC_APPLICATION_NUMBER")}))},Gi=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:d,isLoading:s,Count:c}=e;const{handleSubmit:m,setValue:v,getValues:p}=a.useFormContext();null==p("offset")&&v("offset",0),null==p("limit")&&v("limit",10);const[E,f]=l.useState(Number(p("offset"))/Number(p("limit"))),{t:_}=o.useTranslation(),g=()=>{v("offset",c&&10*Math.ceil(c/10)-p("limit")),m(u)()},h=()=>{v("offset",0),m(u)()},A=l.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){v("limit",Number(e.target.value)),m(u)()}function N(){v("offset",Number(p("offset"))+Number(p("limit"))),m(u)()}function b(){v("offset",Number(p("offset"))-Number(p("limit"))),m(u)()}l.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&f(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return s?n.createElement(t.Loader,null):null!=d&&null!==(e=d[0])&&void 0!==e&&e.display?n.createElement(t.Card,{style:{marginTop:20}},_(null==d||null===(l=d[0])||void 0===l?void 0:l.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.Table,{t:_,data:d,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===_("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:E,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:g,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,l};return n.createElement(n.Fragment,null,n.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},n.createElement(r,{onSubmit:u,handleSubmit:m,isMobileView:!1})),n.createElement(C,null))},qi=e=>{let{t:t,onSubmit:r,data:u,error:d,isLoading:s,Count:c}=e;const[m,v]=l.useState(null),p=a.useForm();l.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const E=(()=>{const{t:e}=o.useTranslation();return l.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),f=window.Digit.Utils.browser.isMobile(),_=l.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return n.createElement(a.FormProvider,p,f?n.createElement(Vi,{SearchFormFieldsComponent:Wi,propsMobileInboxCards:_,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(Gi,{columns:E,SearchFormFieldsComponent:Wi,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},Yi=e=>{let{matchPath:l}=e;const{t:i}=o.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const d=[{link:l+"/noc/new-application",i18nKey:i("NOC_NEW_APPLICATION")},{link:l+"/noc/my-application",i18nKey:i("NOC_MY_APPLICATION")},{link:l+"/noc/search-application",i18nKey:i("NOC_SEARCH_APPLICATION")}];return n.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_NOC"),links:d,Icon:()=>n.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},Ki=e=>{let{stateCode:l,userType:o,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:l,moduleCode:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),d?n.createElement(t.Loader,null):"citizen"===o?n.createElement(hi,null):n.createElement(Rt,{path:r,stateCode:l})},Xi={NOCModule:Ki,NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),u=i.useLocation(),d=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const s={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:E(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:m,data:{totalCount:v,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},s),config:{enabled:(null==s||null===(e=s.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),f=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),n.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));l.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[u.pathname]);const _=l.useMemo(()=>({Icon:n.createElement(f,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:m?"":v,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:m?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:v,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[m,v]);return Digit.Utils.NOCAccess()?n.createElement(t.EmployeeModuleCard,_):null},NOCLinks:Yi,NOCApplicationOverview:()=>{var e,a,r,u,d,s,m,E,f;const{id:_}=i.useParams(),{t:g}=o.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[S,N]=l.useState({}),[b,C]=l.useState(null),y={},[D]=l.useState(()=>(null==y?void 0:y.fileStoreId)||null),[O,L]=l.useState(null),[T,I]=l.useState([]),[w,P]=l.useState([]),[R,x]=l.useState([]),[F,B]=l.useState([]),[M,k]=l.useState([]),[U,H]=l.useState({}),[W,j]=l.useState(()=>[]),[z,V]=l.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:q}=Digit.Hooks.obps.useMDMS(A,"NOC",["DocumentTypeMapping"]),{data:Y}=Digit.Hooks.obps.useMDMS(A,"common-masters",["DocumentType"]),{isLoading:K,data:X}=Digit.Hooks.noc.useNOCDetails(g,h,{applicationNo:_}),{mutate:Q}=Digit.Hooks.noc.useNOCApplicationActions(h),J=Digit.Hooks.useWorkflowDetails({tenantId:h,id:_,moduleCode:"NOC"});var Z,$;null!=J&&null!==(e=J.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!J.isLoading&&(J.data.actionState.nextActions=[...null==J||null===(r=J.data)||void 0===r?void 0:r.nextActions]),J&&J.data&&!J.isLoading&&(J.data.initialActionState=(null==J||null===(Z=J.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==J||null===($=J.data)||void 0===$?void 0:$.actionState)||{},J.data.actionState=c({},J.data)),l.useEffect(()=>{P([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),l.useEffect(()=>{var e;x(null==q||null===(e=q.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[q]),l.useEffect(()=>{var e;B(null==Y||null===(e=Y["common-masters"])||void 0===e?void 0:e.DocumentType)},[Y]),l.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),l.useEffect(()=>{if(null!=w&&w.length&&null!=R&&R.length){let e=[];w.map(t=>{var l,n;const i=R.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=i&&null!==(l=i[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let l=e.documentType;e.dropdownData=[],F.forEach(t=>{let n=t.code.slice(0,l.length);l===n&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),I(t)}},[w,R,F]),l.useEffect(()=>{var e,t;let l=[];null==w||null===(e=w[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,n)=>{l.push(null==e?void 0:e.fileStoreId)}),j(null==l?void 0:l.map(e=>e))},[null==w||null===(u=w[0])||void 0===u?void 0:u.documents]),l.useEffect(()=>{null!=W&&W.length&&Digit.UploadServices.Filefetch(W,Digit.ULBService.getStateId()).then(e=>{H(null==e?void 0:e.data)})},[W]);const ee=e=>{let{t:i,nocDataDetails:o,nocDocumentsList:a}=e;if(null!=o&&o.length&&null!=a&&a.length&&null!=(null==o?void 0:o[0])){var r,u,d,s,c,m,E,f,_,g,h,A,S,N,b,C,y,D,I,w;const e="WF_"+(null==o||null===(r=o[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==o||null===(u=o[0])||void 0===u?void 0:u.applicationStatus);return n.createElement(l.Fragment,null,n.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+i("NOC_MAIN_"+p(null==a||null===(d=a[0])||void 0===d?void 0:d.code,".","_")+"_LABEL")),n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.createElement(t.Row,{className:"border-none",label:""+i("NOC_"+(null==o||null===(s=o[0])||void 0===s?void 0:s.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(c=o[0])||void 0===c?void 0:c.applicationNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(m=o[0])||void 0===m?void 0:m.applicationStatus)||"AUTO_APPROVED"==(null==o||null===(E=o[0])||void 0===E?void 0:E.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_SUBMITED_ON_LABEL"),text:null!=o&&null!==(f=o[0])&&void 0!==f&&null!==(_=f.additionalDetails)&&void 0!==_&&_.SubmittedOn?v(Number(null==o||null===(g=o[0])||void 0===g||null===(h=g.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVAL_NO_LABEL"),text:(null==o||null===(A=o[0])||void 0===A?void 0:A.nocNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?v(Number(null==o||null===(S=o[0])||void 0===S||null===(N=S.auditDetails)||void 0===N?void 0:N.lastModifiedTime)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(b=o[0])&&void 0!==b&&b.documents&&(null==o||null===(C=o[0])||void 0===C?void 0:C.documents.length)>0?n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==o||null===(y=o[0])||void 0===y||null===(D=y.documents)||void 0===D?void 0:D.map((e,l)=>{var o,r;return n.createElement("a",{target:"_",href:null===(o=U[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:l},n.createElement("div",{style:{display:"flex",justifyContent:"center"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},i("NOC_MAIN_"+p(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):n.createElement("div",null,n.createElement("p",null,i("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),n.createElement("div",null,(null==J||null===(I=J.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==T?void 0:T.map((e,t)=>n.createElement(vn,{key:t,document:e,t:i,error:O,setError:L,setNocDocuments:k,nocDocuments:M})):null)))}return n.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>n.createElement(l.Fragment,null,n.createElement("div",{style:{maxWidth:"950px"}},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>n.createElement(t.Row,{className:"border-none",label:""+g(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return l.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;N(c({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>n.createElement(ee,{t:g,data:X,nocDataDetails:w,nocDocumentsList:T})}]})),V(!1)}},[X,T,w,D,W,U]),n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",null,n.createElement(t.Header,{styles:{fontSize:"32px"}},g("NOC_APP_OVER_VIEW_HEADER"))),n.createElement(mn,{applicationDetails:S,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:Q,workflowDetails:J,businessService:null!=J&&null!==(d=J.data)&&void 0!==d&&d.applicationBusinessService?null==J||null===(s=J.data)||void 0===s?void 0:s.applicationBusinessService:null==X||null===(m=X.applicationData)||void 0===m?void 0:m.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:b,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(E=X.applicationData)||void 0===E||null===(f=E.additionalDetails)||void 0===f?void 0:f.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:r}=e;const{t:u}=o.useTranslation(),d=window.localStorage.getItem("Employee.tenant-id"),s={mobileNumber:"",applicationNo:""},m={moduleName:"noc-service",applicationStatus:[],businessService:"obpas_noc",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:E(!0)||[]},v={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),f=l.useMemo(()=>p||{filterForm:m,searchForm:s,tableForm:v},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[_,g]=l.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{searchForm:t.data})),c({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{filterForm:t.data})),c({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{tableForm:t.data})),c({},e,{tableForm:t.data})}},f),{data:h,isLoading:A}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:N}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},_)});l.useEffect(()=>{N&&N.revalidate()},[]);const[b,C]=l.useState([]),[y,D]=l.useState([]),[O,L]=l.useState(0);l.useEffect(()=>{N&&(D((null==N?void 0:N.statuses)||[]),C((null==N?void 0:N.table)||[]),L((null==N?void 0:N.totalCount)||0))},[N]);const T={logoIcon:n.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},I=l.useCallback(e=>{let{registerRef:t,searchFormState:l,searchFieldComponents:i}=e;return n.createElement(bn,{registerRef:t,searchFormState:l,searchFieldComponents:i})},[]),w=l.useCallback(e=>{let{registerRef:t,controlFilterForm:l,setFilterFormValue:i,getFilterFormValue:o}=e;return n.createElement(Cn,{statuses:y,isInboxLoading:S,registerRef:t,controlFilterForm:l,setFilterFormValue:i,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[y,S,h,A]),P={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},v)}),g({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),g({action:"mutateSearchForm",data:s})}},R={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},v)}),g({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:m,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),g({action:"mutateFilterForm",data:m})}},x=(e=>{var t,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:m,totalCount:v,table:p,dispatch:E,onSortingByData:f}=e;const{t:_}=o.useTranslation(),g=l.useMemo(()=>[{Header:_("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement(i.Link,{to:d+"/inbox/application-overview/"+t.original.applicationId},n.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,l;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>n.createElement("span",{className:"cell-text styled-cell"},e))(vi(new Date(null===(l=i.original)||void 0===l?void 0:l.date),"dd/MM/yyyy")):""}},{Header:_("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>_(null==e?void 0:e.status),disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:(null===(t=m.tableForm)||void 0===t?void 0:t.offset)/(null===(a=m.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return E({action:"mutateTableForm",data:c({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return E({action:"mutateTableForm",data:c({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=m.tableForm)||void 0===r?void 0:r.limit,onSort:f,totalRecords:v,onSearch:null==m||null===(u=m.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return E({action:"mutateTableForm",data:c({},m.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>E({action:"mutateTableForm",data:c({},m.tableForm,{offset:0})}),data:p,columns:g}})(c({},{parentRoute:r,onPageSizeChange:e=>{g({action:"mutateTableForm",data:c({},_.tableForm,{limit:e.target.value})})},formState:_,totalCount:O,table:b,dispatch:g,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===n||g({action:"mutateTableForm",data:c({},_.tableForm,{sortBy:t,sortOrder:l?"DESC":"ASC"})})}}})),F=(e=>{let{parentRoute:l,table:i}=e;const{t:r}=o.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:l,status:n}=e;return{[r("NOC_APPLICATION_NUMBER")]:t,[r("TL_COMMON_TABLE_COL_APP_DATE")]:vi(new Date(l),"dd/MM/yyyy"),[r("PT_COMMON_TABLE_COL_STATUS_LABEL")]:r(n)}}),linkPrefix:l+"/inbox/application-overview/",serviceRequestIdKey:r("NOC_APPLICATION_NUMBER"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:l}=a.useFormContext();return n.createElement(t.SearchField,null,n.createElement(a.Controller,{name:"sortOrder",control:l,render:l=>{let{onChange:i,value:o}=l;return n.createElement(t.RadioButtons,{onSelect:e=>{i(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:b}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;g({action:"mutateTableForm",data:c({},_.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),g({action:"mutateTableForm",data:v})}};return n.createElement(l.Fragment,null,n.createElement(t.Header,null,u("ES_COMMON_INBOX"),O?n.createElement("p",{className:"inbox-count"},O):null),n.createElement(t.InboxComposer,c({isInboxLoading:S,PropsForInboxLinks:T},P,R,B,{propsForInboxTable:x,propsForInboxMobileCards:F,formState:_})))},NOCSearchApplication:yt,NewNOCStepperForm:()=>{i.useHistory();const{t:e}=o.useTranslation(),a=d.useDispatch(),[r,u]=l.useState(null),s=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),l.useEffect(()=>{a({type:"RESET_NOC_NEW_APPLICATION_FORM"})},[]),n.createElement("div",{className:"card"},n.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("NOC_REGISTRATION_APPLICATION")),n.createElement(Si,{stepsList:Li,onSubmit:e=>{console.log("dataGet===",e)},step:s,setStep:e=>{a(Ci(e))}}),r&&n.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var i,r,u;let{config:s,onGoNext:m,onBackClick:v}=e;const p=d.useDispatch(),{t:E}=o.useTranslation(),[f,_]=l.useState(null),[g,h]=l.useState(""),[A,S]=l.useState([]),[N,b]=l.useState([]),C=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),y=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),D=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos});l.useEffect(()=>{ht.isEqual(A,y)||S(null==y?void 0:y.ownerIdList),ht.isEqual(N,D)||b(null==D?void 0:D.ownerPhotoList)},[y,D]);const O=Digit.UserService.getUser(),{control:L,handleSubmit:T,setValue:I,formState:{errors:w},trigger:P,watch:R,reset:x}=a.useForm({defaultValues:{owners:[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:""}]}}),F={Controller:a.Controller,control:L,setValue:I,errors:w,trigger:P,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:x,useFieldArray:a.useFieldArray,watch:R,config:s,ownerIdList:A,setOwnerIdList:S,ownerPhotoList:N,setOwnerPhotoList:b};function B(e){p(bi(s.key,e)),p(Oi("ownerIdList",A)),p(Di("ownerPhotoList",N)),m()}function M(e){v(s.key,e)}const[k,U]=l.useState((null==C||null===(i=C.applicationDetails)||void 0===i?void 0:i.isRegisteredStakeHolder)||!1),H=Digit.ULBService.getStateId(),[W,j]=l.useState(!1),z=null==O||null===(r=O.info)||void 0===r||null===(u=r.roles)||void 0===u?void 0:u.map(e=>e.code),{data:V,isLoading:G}=Digit.Hooks.obps.useMDMS(H,"StakeholderRegistraition","TradeTypetoRoleMapping");return l.useEffect(()=>{if(!G){var e,t;let l=[];null==V||null===(e=V.StakeholderRegistraition)||void 0===e||null===(t=e.TradeTypetoRoleMapping)||void 0===t||t.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{l.push(e)})});const n=null==l?void 0:l.filter((e,t,l)=>l.indexOf(e)===t);null==n||n.map(e=>{null!=z&&z.includes(e)&&U(!0)})}},[G]),l.useEffect(()=>{var e;null!=C&&null!==(e=C.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&I("isRegisteredStakeHolder","true")},[]),n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:T(e=>{P(),function(e){var t,l,n,i;const o=null!=(t=null==N?void 0:N.length)?t:0,a=null!=(l=null==A?void 0:A.length)?l:0,r=null!=(n=null==e||null===(i=e.owners)||void 0===i?void 0:i.length)?n:0;return r!==o?(setTimeout(()=>{_(null)},3e3),_({key:"true",error:!0,message:E("UPLOAD_ALL_OWNER_PHOTOS_LABEL")}),!1):r===a||(setTimeout(()=>{_(null)},3e3),_({key:"true",error:!0,message:E("UPLOAD_ALL_OWNER_IDS_LABEL")}),!1)}(e)&&B(e)})},n.createElement("div",{className:"employeeCard"},k?n.createElement(n.Fragment,null,n.createElement(wi,c({onGoBack:M,goNext:B,currentStepData:C,t:E},F)),n.createElement(Ii,c({onGoBack:M,goNext:B,currentStepData:C,t:E},F))):n.createElement(n.Fragment,null,n.createElement(Ii,c({onGoBack:M,goNext:B,currentStepData:C,t:E},F)))),n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),f&&n.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,label:E(null==f?void 0:f.message),isDleteBtn:!0,onClose:()=>{_(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:i,onBackClick:r,onGoNext:u}=e;const{t:s}=o.useTranslation(),m=d.useDispatch(),[v,p]=l.useState(null),[E,f]=l.useState(""),{control:_,handleSubmit:g,setValue:h,formState:{errors:A},trigger:S,watch:N}=(Digit.UserService.getUser(),a.useForm({defaultValues:{floorArea:[{value:""}]}})),b=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),y=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos}),D={Controller:a.Controller,control:_,setValue:h,errors:A,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:a.useFieldArray,watch:N};let O;O=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const L=e=>{if(null==e)return NaN;const t=String(e).trim().replace(/,/g,""),l=Number(t);return Number.isNaN(l)?NaN:Number(l.toFixed(5))};function T(e){m(bi(i.key,e)),u()}function I(e){r(i.key,e)}return n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:g(e=>{var t,l,n;if(S(),!((e,t)=>{const l=L(e),n=L(t);return!Number.isNaN(l)&&!Number.isNaN(n)&&Math.abs(l-n)<=1e-9})(null==e?void 0:e.netTotalArea,null==e?void 0:e.specificationPlotArea))return setTimeout(()=>{p(null)},3e3),void p({key:"true",error:!0,message:"NOC_PLOT_AREA_SUM_VALIDATION_MESG_LABEL"});m(bi(i.key,e)),null!=b&&null!==(t=b.apiData)&&void 0!==t&&null!==(l=t.Noc)&&void 0!==l&&null!==(n=l[0])&&void 0!==n&&n.applicationNo?u():function(e){try{var t,l,n,i,o,a,r,d,s,v,E,f,_,g,h,A,S,N,b,D,L,T,I;const w={applicationDetails:c({},null==e?void 0:e.applicationDetails),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(t=e.siteDetails)||void 0===t||null===(l=t.ulbName)||void 0===l?void 0:l.name)||"",roadType:(null==e||null===(n=e.siteDetails)||void 0===n||null===(i=n.roadType)||void 0===i?void 0:i.name)||"",buildingStatus:(null==e||null===(o=e.siteDetails)||void 0===o||null===(a=o.buildingStatus)||void 0===a?void 0:a.name)||"",isBasementAreaAvailable:(null==e||null===(r=e.siteDetails)||void 0===r||null===(d=r.isBasementAreaAvailable)||void 0===d?void 0:d.code)||"",district:(null==e||null===(s=e.siteDetails)||void 0===s||null===(v=s.district)||void 0===v?void 0:v.name)||"",zone:(null==e||null===(E=e.siteDetails)||void 0===E||null===(f=E.zone)||void 0===f?void 0:f.name)||"",specificationBuildingCategory:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.specificationBuildingCategory)||void 0===g?void 0:g.name)||"",specificationNocType:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.specificationNocType)||void 0===A?void 0:A.name)||"",specificationRestrictedArea:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.specificationRestrictedArea)||void 0===N?void 0:N.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(b=e.siteDetails)||void 0===b||null===(D=b.specificationIsSiteUnderMasterPlan)||void 0===D?void 0:D.code)||""}),ownerPhotos:Array.isArray(null==y?void 0:y.ownerPhotoList)?y.ownerPhotoList:[],ownerIds:Array.isArray(null==C?void 0:C.ownerIdList)?C.ownerIdList:[]},P=null===(L=null!=(T=null==w||null===(I=w.applicationDetails)||void 0===I?void 0:I.owners)?T:[])||void 0===L?void 0:L.map((e,t)=>{var l,n,i;return{mobileNumber:(null==e?void 0:e.mobileNumber)||"",name:(null==e?void 0:e.ownerOrFirmName)||"",emailId:(null==e?void 0:e.emailId)||"",userName:(null==e?void 0:e.mobileNumber)||"",fatherOrHusbandName:(null==e?void 0:e.fatherOrHusbandName)||"",permanentAddress:(null==e?void 0:e.address)||"",gender:(null==e||null===(l=e.gender)||void 0===l?void 0:l.code)||"",dob:Digit.Utils.pt.convertDateToEpoch((null==e?void 0:e.dateOfBirth)||""),additionalDetails:{ownerPhoto:c({},null==y||null===(n=y.ownerPhotoList)||void 0===n?void 0:n[t]),ownerId:c({},null==C||null===(i=C.ownerIdList)||void 0===i?void 0:i[t])}}}),R={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:O,owners:P,workflow:{action:"INITIATE"},nocDetails:{additionalDetails:w,tenantId:O}}};console.log("final Payload here==>",R);const x=Ot(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:O,details:R})).then(function(e){var t;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success :create api executed successfully !!!"),m(bi("apiData",e)),u()):(console.error("error : create api not executed properly !!!"),p({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(x&&x.then?x.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(c({},b,{siteDetails:c({},e)}))})},n.createElement("div",{className:"employeeCard"},n.createElement(Pi,c({onGoBack:I,goNext:T,currentStepData:b,t:s},D)),n.createElement(Ri,c({onGoBack:I,goNext:T,currentStepData:b,t:s},D))),n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:I}),n.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),v&&n.createElement(t.Toast,{isDleteBtn:!0,error:null==v?void 0:v.error,warning:null==v?void 0:v.warning,label:s(null==v?void 0:v.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const u=d.useDispatch(),[s,c]=l.useState(!1),[m,v]=l.useState(""),p=Digit.ULBService.getStateId(),{isLoading:E,data:f}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),_=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}}),g=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}});console.log("coordinates from redux",g);const h=d.useSelector(e=>{var t,l;return null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.formData})||{};return n.createElement(n.Fragment,null,n.createElement(t.FormComposer,{defaultValues:_,config:i.currStepConfig,onSubmit:function(e){var t,l,n,i;const a=function(e){if(!E){var t,l,n,i,o;const a="VACANT"===(null==h||null===(t=h.siteDetails)||void 0===t||null===(l=t.buildingStatus)||void 0===l?void 0:l.code)?null==f||null===(n=f.NOC)||void 0===n?void 0:n.Documents.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==f||null===(i=f.NOC)||void 0===i?void 0:i.Documents,r=(null==e||null===(o=e.documents)||void 0===o?void 0:o.documents)||[],u=a.filter(e=>e.required).map(e=>e.code),d=r.map(e=>e.documentType);return u.filter(e=>!d.includes(e))}}(e);return a.length>0?(v(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),c(!0),void setTimeout(()=>{c(!1),v("")},3e3)):null!=g&&null!==(t=g.Latitude1)&&void 0!==t&&t.trim()&&null!=g&&null!==(l=g.Latitude2)&&void 0!==l&&l.trim()&&null!=g&&null!==(n=g.Longitude1)&&void 0!==n&&n.trim()&&null!=g&&null!==(i=g.Longitude2)&&void 0!==i&&i.trim()?void o():(v(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),c(!0),void setTimeout(()=>{c(!1),v("")},3e3))},onFormValueChange:function(e,t){ht.isEqual(t,_)||u(bi(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),s&&n.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{c(!1),v("")}}))},NewNOCStepFormFour:e=>{var o,a,r,u,s,m,v,p,E,f,_,g,h,A,S,N;let{config:b,onBackClick:C,t:y}=e;d.useDispatch();const[D,O]=l.useState(null),[L,T]=l.useState(""),[I,w]=l.useState(!1),P=window.location.pathname.includes("edit");console.log("selectedCheckBox",I);const R=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.formData)||{}}),x=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}}),F=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerIds)||[]}),B=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerPhotos)||[]}),M=l.useRef();let k=Digit.UserService.getUser();const U=null==k||null===(o=k.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code),[H,W]=l.useState(!1);Digit.Hooks.useClickOutside(M,()=>{W(!1)},H);const j=i.useHistory();let z;z=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const V=e=>{console.log("formData in parent SummaryPage",R),G(R,e)},G=function(e,t){try{if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return O({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),setTimeout(()=>{O(null)},3e3),Promise.resolve();const l=function(e,t){var l,n,i,o,a,r,u,d,s,m,v,p,E,f,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,M;console.log("nocFormData",e);const k=c({},null==e||null===(l=e.apiData)||void 0===l||null===(n=l.Noc)||void 0===n?void 0:n[0],{workflow:{action:(null==t?void 0:t.action)||""},nocDetails:c({},null==e||null===(i=e.apiData)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.nocDetails,{additionalDetails:c({},null==e||null===(r=e.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(s=e.siteDetails)||void 0===s||null===(m=s.ulbName)||void 0===m?void 0:m.name)||"",roadType:(null==e||null===(v=e.siteDetails)||void 0===v||null===(p=v.roadType)||void 0===p?void 0:p.name)||"",buildingStatus:(null==e||null===(E=e.siteDetails)||void 0===E||null===(f=E.buildingStatus)||void 0===f?void 0:f.name)||"",isBasementAreaAvailable:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.isBasementAreaAvailable)||void 0===g?void 0:g.code)||"",district:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.district)||void 0===A?void 0:A.name)||"",zone:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.zone)||void 0===N?void 0:N.name)||"",specificationBuildingCategory:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.specificationBuildingCategory)||void 0===C?void 0:C.name)||"",specificationNocType:(null==e||null===(y=e.siteDetails)||void 0===y||null===(D=y.specificationNocType)||void 0===D?void 0:D.name)||"",specificationRestrictedArea:(null==e||null===(O=e.siteDetails)||void 0===O||null===(L=O.specificationRestrictedArea)||void 0===L?void 0:L.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(T=e.siteDetails)||void 0===T||null===(I=T.specificationIsSiteUnderMasterPlan)||void 0===I?void 0:I.code)||""}),coordinates:c({},x),ownerPhotos:Array.isArray(null==B?void 0:B.ownerPhotoList)?B.ownerPhotoList:[],ownerIds:Array.isArray(null==F?void 0:F.ownerIdList)?F.ownerIdList:[]})}),documents:[]}),U=(null==e||null===(w=e.documents)||void 0===w||null===(M=w.documents)||void 0===M?void 0:M.documents)||[];if(P){var H,W,j;const e=(null==R||null===(H=R.apiData)||void 0===H||null===(W=H.Noc)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.documents)||[],t=new Set(null==e?void 0:e.map(e=>e.documentType)),l=null==e?void 0:e.map(e=>{var t,l;const n=(null==U||null===(t=U.find(t=>t.documentType===e.documentType))||void 0===t?void 0:t.uuid)||(null==U||null===(l=U.find(t=>t.documentType===e.documentType))||void 0===l?void 0:l.documentAttachment);return c({},e,{uuid:n,documentAttachment:n})}),n=(null==U?void 0:U.filter(e=>!t.has(e.documentType)))||[],i=[...l,...null==n?void 0:n.map(e=>({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId}))];console.log("overallDocs",i),i.forEach(e=>{var t;null==k||null===(t=k.documents)||void 0===t||t.push(c({},e))})}else U.forEach(e=>{k.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})});return{Noc:c({},k)}}(e,t);console.log("finalPayload here==>",l);const n=Lt(function(){return Ot(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:z,details:l})).then(function(e){var l,n,i,o,a,r;"successful"===(null==e||null===(l=e.ResponseInfo)||void 0===l?void 0:l.status)?(console.log("success: Update API "),window.location.href.includes("citizen")?"CANCEL"==t.action?(O({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{j.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),j.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(O({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{j.push("/digit-ui/employee/noc/inbox")},3e3)):j.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(o=e.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.applicationNo),state:{data:e}}))):(console.error("Submission failed, not moving to next step.",null===(r=res)||void 0===r?void 0:r.response),O({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),O({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{O(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function q(e){C(b.key,e)}console.log("currentStepData in StepFour",R);const Y=(null==R||null===(r=R.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.applicationNo)||"";console.log("applicationNo here==>",Y);const K=Digit.Hooks.useWorkflowDetails({tenantId:z,id:Y,moduleCode:"obpas_noc"});console.log("workflow Details here==>",K);let X=(null==K||null===(m=K.data)||void 0===m||null===(v=m.actionState)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==U?void 0:U.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==K||null===(E=K.data)||void 0===E||null===(f=E.nextActions)||void 0===f?void 0:f.filter(e=>(null==U?void 0:U.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return console.log("actions here",X),n.createElement(n.Fragment,null,n.createElement(Fi,{onGoBack:q,goNext:V,currentStepData:R,t:y}),n.createElement(t.CheckBox,{label:"I hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+((null==R||null===(_=R.applicationDetails)||void 0===_||null===(g=_.owners)||void 0===g||null===(h=g[0])||void 0===h?void 0:h.ownerOrFirmName)||"NA")+"). I along with the applicant have read the Policy and understand all the terms and conditions of the Policy. We are committed to fulfill/abide by all the terms and conditions of the Policy. The information/documents submitted are true and correct as per record and no part of it is false and nothing has been concealed/misrepresented therein.",onChange:e=>function(e){w(e.target.checked)}(e),value:I,checked:I}),X&&n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:q}),H&&(null!=K&&null!==(A=K.data)&&void 0!==A&&null!==(S=A.actionState)&&void 0!==S&&S.nextActions||null!=K&&null!==(N=K.data)&&void 0!==N&&N.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:X,optionKey:"action",t:y,onSelect:function(e){V(e)}}):null,I&&n.createElement(t.SubmitBar,{ref:M,label:y("WF_TAKE_ACTION"),onSubmit:()=>W(!H)})),D&&n.createElement(t.Toast,{isDleteBtn:!0,error:null==D?void 0:D.error,warning:null==D?void 0:D.warning,label:y(null==D?void 0:D.message),onClose:()=>{O(null)}}))},NOCApplicantDetails:Ii,NOCProfessionalDetails:wi,NOCSiteDetails:Pi,NOCSpecificationDetails:Ri,NOCDocumentsRequired:e=>{var i,o,a,r,u,s,m,v;let{t:p,config:E,onSelect:_,formData:g}=e;Digit.ULBService.getStateId();const[h,A]=l.useState(null==g||null===(i=g.documents)||void 0===i?void 0:i.documents);console.log("documents in childStep three",h);const[S,N]=l.useState(null),[b,C]=l.useState(!0),[y,D]=l.useState(!1),[O,L]=l.useState(null),T=Digit.ULBService.getStateId(),I=d.useDispatch(),{isLoading:w,data:P}=Digit.Hooks.pt.usePropertyMDMS(T,"NOC",["Documents"]),R=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}});l.useEffect(()=>{Object.keys(R).length>0&&L(R)},[R]),console.log("coordinates (from redux)",R),console.log("geocoordinates",O);const x=d.useSelector(e=>{var t,l;return null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.formData})||{},F="VACANT"===(null==x||null===(o=x.siteDetails)||void 0===o||null===(a=o.buildingStatus)||void 0===a?void 0:a.code)?null==P||null===(r=P.NOC)||void 0===r||null===(u=r.Documents)||void 0===u?void 0:u.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==P||null===(s=P.NOC)||void 0===s?void 0:s.Documents,B=()=>{let e;e=c({},g.documents,{documents:h}),_(E.key,e)};l.useEffect(()=>{var e,t;let l=0;null==P||null===(e=P.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==h||h.map(l=>{e.required&&null!=l&&l.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(l+=1)}),C("0"!=l&&0!=l||!((null==h?void 0:h.length)>0))},[h,y]),l.useEffect(()=>{var e,t;"VACANT"===(null==x||null===(e=x.siteDetails)||void 0===e||null===(t=e.buildingStatus)||void 0===t?void 0:t.code)&&A(e=>null==e?void 0:e.filter(e=>"OWNER.BUILDINGDRAWING"!==e.documentType))},[null==x||null===(m=x.siteDetails)||void 0===m||null===(v=m.buildingStatus)||void 0===v?void 0:v.code]);const M={value:{workflowDocs:null==h?void 0:h.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:k}=Digit.Hooks.noc.useNOCDocumentSearch(M),U=null==h?void 0:h.map(e=>({code:e.documentType,link:f(null==k?void 0:k.pdfFiles,e.filestoreId)}));return n.createElement("div",null,w?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:p,config:E,onSelect:B,onSkip:()=>_(),isDisabled:b,onAdd:function(){}},null==F?void 0:F.map((e,t)=>{var l;return n.createElement(Bi,{key:t,document:e,t:p,error:S,setError:N,setDocuments:A,documents:h,setCheckRequiredFields:D,handleSubmit:B,geocoordinates:O,setGeoCoordinates:L,dispatch:I,previewLink:null==U||null===(l=U.find(t=>t.code===e.code))||void 0===l?void 0:l.link})}),S&&n.createElement(t.Toast,{label:S,isDleteBtn:!0,onClose:()=>N(null),error:!0})))},NOCSummary:Fi,NOCDocumentWithLatLong:e=>{var i,o,a;let{t:r,config:u,onSelect:d,formData:s}=e;const m=Digit.ULBService.getStateId(),[v,p]=l.useState((null==s||null===(i=s.documents)||void 0===i?void 0:i.documents)||[]),[E,f]=l.useState(null),[_,g]=l.useState(!0),[h,A]=l.useState(!1),[S,N]=l.useState(!1),b=gt((null==s?void 0:s.PrevStateDocuments)||[]),{isLoading:C,data:y}=Digit.Hooks.pt.usePropertyMDMS(m,"NOC",["Documents"]),D=()=>{let e;e=c({},s.documents,{documents:v}),d(u.key,e)};return l.useEffect(()=>{var e,t;const l=null==y||null===(e=y.NOC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>e.required).map(e=>e.code),n=null==l?void 0:l.filter(e=>v.reduce((t,l)=>{var n,i,o,a;return e==(null==l||null===(n=l.documentType)||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i[0])+"."+(null==l||null===(o=l.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));g(!((null==n?void 0:n.length)==(null==l?void 0:l.length)&&(null==v?void 0:v.length)>0))},[v,h]),n.createElement("div",null,C?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:r,config:u,onSelect:D,onSkip:()=>d(),onAdd:function(){}},null==y||null===(o=y.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},n.createElement(Mi,{key:t,document:e,t:r,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:A,formData:s,beforeUploadDocuments:b||[],isNextButtonDisabled:S,setIsNextButtonDisabled:N,handleSubmit:D}))),E&&n.createElement(t.Toast,{label:E,onClose:()=>f(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=s&&s.applicationNo?n.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==s?void 0:s.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCResponseCitizen:e=>{var l,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),m=i.useHistory(),v=null==s||null===(l=s.data)||void 0===l||null===(a=l.Noc)||void 0===a?void 0:a[0];console.log("nocData here",v),window.localStorage.getItem("CITIZEN.CITY");const{data:E}=Digit.Hooks.useStore.getInitData(),{tenants:f}=E||{},_=d.split("/").pop();return n.createElement("div",null,n.createElement(t.Card,null,n.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==v||null===(r=v.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?n.createElement("div",null,n.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=Ot(function(){var e,t,l,n;const i=v,o=null==i||null===(e=i.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==o?void 0:o.ulbType,r=(null==o||null===(l=o.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==o?void 0:o.ulbName),u=f.find(e=>e.code===i.tenantId);return Promise.resolve(It(i,u,a,r,c)).then(function(e){Digit.Utils.pdf.generateFormatted(e)})},function(e){console.log("Eroor Occurred !!!",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})):null,n.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{m.push("/digit-ui/citizen")}}),n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{m.push("/digit-ui/citizen/noc-home")}}))))},NOCCitizenMyApplications:e=>{var a,r,u;const{t:d}=o.useTranslation(),s=(i.useHistory(),(null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info)||{}),m=window.localStorage.getItem("CITIZEN.CITY"),{isLoading:v,data:p}=Digit.Hooks.noc.useNOCCitizenSearchApplication(c({},{sortBy:"createdTime",offset:0,sortOrder:"DESC",mobileNumber:""},{mobileNumber:(null==s?void 0:s.mobileNumber)||""}),m);console.log("data herein NOC==>",p);const E=["CS_CF_VIEW","CS_CF_TRACK","TL_VIEW_DETAILS"];return l.useEffect(()=>{p&&p.revalidate()},[]),v?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"applications-list-container"},n.createElement(t.Header,null,""+d("NOC_MY_APPLICATION")),0===(null==p||null===(r=p.data)||void 0===r?void 0:r.length)&&n.createElement(t.Card,{style:{textAlign:"center"}},d("NO_APPLICATIONS_MSG")),null==p||null===(u=p.data)||void 0===u?void 0:u.map((e,l)=>{var o;const a=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"Applications"!==t}));return n.createElement("div",{key:"card-"+l},n.createElement(t.Card,null,Object.keys(a).filter(e=>null!==a[e]).map(e=>n.createElement(t.KeyNote,{keyValue:d(e),note:d(a[e])})),n.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(o=e.Applications)||void 0===o?void 0:o.applicationNo)},n.createElement(t.SubmitBar,{label:d(E[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,d,s,v,p,E,f,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,P,R,x,F,B,M,k,U,H,W,j,z,V,G,q,Y,K,X,Q,J,Z,$,ee,te;const le=function(e){let{tenantId:t,payments:l,pdfkey:n,EmpData:i}=e;m(e,Ui);try{var o;const e=null==ce||null===(o=ce.Noc)||void 0===o?void 0:o[0];return Promise.resolve(Lt(function(){return Ot(function(){if(Ee(!0),!e)throw new Error("Noc Application data is missing");return Promise.resolve(function(e,t,l){try{var n,i,o;const r=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),u=(null==e||null===(n=e.nocDetails)||void 0===n?void 0:n.additionalDetails)||{},d=(null==u?void 0:u.siteDetails)||{},s=null!=u&&u.SubmittedOn?null===(i=new Date(Number(null==u?void 0:u.SubmittedOn)))||void 0===i?void 0:i.toLocaleDateString("en-GB"):"";let m=[],v=(null==d?void 0:d.basementArea)||"NA",p=(null==d?void 0:d.totalFloorArea)||"NA";var a;m="Built Up"===(null==d?void 0:d.buildingStatus)?null===(a=(null==d?void 0:d.floorArea)||[])||void 0===a?void 0:a.map((e,t)=>c({},e,{floorNo:"Floor No "+(t+1)})):[{floorNo:"Floor No NA",value:"NA"}];const E=["NOC_SANCTION_THREE","NOC_SANCTION_FOUR","NOC_SANCTION_FIVE","NOC_SANCTION_SIX","NOC_SANCTION_SEVEN","NOC_SANCTION_EIGHT"],f="Provisional"===(null==d?void 0:d.specificationNocType)?E:E.slice(1),_=null==f?void 0:f.map((e,l)=>({number:3+l,text:t(e)}));return Promise.resolve({Noc:[c({},e,{nocDetails:c({},e.nocDetails,{additionalDetails:c({},null===(o=e.nocDetails)||void 0===o?void 0:o.additionalDetails,{SubmittedOn:s,siteDetails:c({},d,{floorArea:m,basementArea:v,totalFloorArea:p})})}),currentDate:r,sanctionTerms:_},l)]})}catch(e){return Promise.reject(e)}}(e,ie,i)).then(function(e){return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},l,{Noc:e.Noc})]},n)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})})},function(e){console.error("Sanction Letter download error:",e)})},function(e,t){if(Ee(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}},{id:ne}=i.useParams(),{t:ie}=o.useTranslation(),oe=i.useHistory(),ae=window.localStorage.getItem("CITIZEN.CITY"),[re,ue]=l.useState({}),{isLoading:de,data:se}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:ne},ae),ce=null==se?void 0:se.resData,{data:me}=Digit.Hooks.useStore.getInitData(),{tenants:ve}=me||{},[pe,Ee]=l.useState(!1);let fe=Digit.UserService.getUser();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};fe=null==t?void 0:t.value}const _e=null===(e=fe)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);l.useEffect(()=>{var e;const t=null==ce||null===(e=ce.Noc)||void 0===e?void 0:e[0];if(t){var l,n,i,o,a,r;const e=null==t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,d=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,s=(null==t?void 0:t.documents)||[];ue({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:d?[d]:[],Documents:s.length>0?s:[]})}},[null==ce?void 0:ce.Noc]);const{data:ge,isLoading:he}=Digit.Hooks.useRecieptSearch({tenantId:ae,businessService:"obpas_noc",consumerCodes:ne,isEmployee:!1},{enabled:!!ne}),Ae=[];let Se=((e,t)=>{var l,n,i,o,a,r,u;const d=Digit.Hooks.useWorkflowDetails({tenantId:e,id:t,moduleCode:"obpas_noc",role:"EMPLOYEE"}),s=null==d||null===(l=d.data)||void 0===l||null===(n=l.processInstances)||void 0===n?void 0:n.find(e=>"APPROVE"===(null==e?void 0:e.action)),c=null==s||null===(i=s.assigner)||void 0===i?void 0:i.userName,m=Digit.Hooks.useEmployeeSearch(e,{codes:c,isActive:!0},{enabled:!(!c||null!=d&&d.isLoading)});console.log("employeeData",m);const v=null==m||null===(o=m.data)||void 0===o||null===(a=o.Employees)||void 0===a?void 0:a[0],p=null==v||null===(r=v.assignments)||void 0===r?void 0:r[0];return{officer:v?{code:null==v?void 0:v.code,id:null==v?void 0:v.id,name:null==v||null===(u=v.user)||void 0===u?void 0:u.name,department:null==p?void 0:p.department,designation:null==p?void 0:p.designation}:null}})(ae,ne);"APPROVED"===(null==ce||null===(u=ce.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.applicationStatus)&&(Ae.push({label:ie("DOWNLOAD_CERTIFICATE"),onClick:function(){try{var e;const t=null==ce||null===(e=ce.Noc)||void 0===e?void 0:e[0],l=ve.find(e=>e.code===t.tenantId);return Promise.resolve(It(t,l,ie)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),ge&&(null==ge?void 0:ge.Payments.length)>0&&!he&&(Ae.push({label:ie("PDF_STATIC_LABEL_WS_CONSOLIDATED_SANCTION_LETTER"),onClick:()=>{var e;return le({tenantId:null==ge||null===(e=ge.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ge?void 0:ge.Payments[0],pdfkey:"noc-sanctionletter",EmpData:Se})}}),Ae.push({label:ie("CHB_FEE_RECEIPT"),onClick:()=>{var e;return le({tenantId:null==ge||null===(e=ge.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==ge?void 0:ge.Payments[0],pdfkey:"noc-receipt",EmpData:Se})}})));const Ne=e=>{if(0===e)return ie("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,l=e%100;let n="th";return(l<11||l>13)&&(1===t?n="st":2===t?n="nd":3===t&&(n="rd")),""+e+n+" "+ie("NOC_FLOOR_AREA_LABEL")},[be,Ce]=l.useState(null),[ye,De]=l.useState(!1),[Oe,Le]=l.useState(null),[Te,Ie]=l.useState(!1),we=l.useRef();Digit.Hooks.useClickOutside(we,()=>{De(!1)},ye);const Pe=Digit.Hooks.useWorkflowDetails({tenantId:ae,id:ne,moduleCode:"obpas_noc"});var Re,xe;null!=Pe&&null!==(s=Pe.data)&&void 0!==s&&null!==(v=s.actionState)&&void 0!==v&&v.nextActions&&!Pe.isLoading&&(Pe.data.actionState.nextActions=[...null==Pe||null===(p=Pe.data)||void 0===p?void 0:p.nextActions]),Pe&&Pe.data&&!Pe.isLoading&&(Pe.data.initialActionState=(null==Pe||null===(Re=Pe.data)||void 0===Re?void 0:Re.initialActionState)||c({},null==Pe||null===(xe=Pe.data)||void 0===xe?void 0:xe.actionState)||{},Pe.data.actionState=c({},Pe.data)),l.useEffect(()=>{Pe&&Pe.revalidate(),se&&se.revalidate()},[]);let Fe=(null==Pe||null===(E=Pe.data)||void 0===E||null===(f=E.actionState)||void 0===f||null===(_=f.nextActions)||void 0===_?void 0:_.filter(e=>(null==_e?void 0:_e.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==Pe||null===(g=Pe.data)||void 0===g||null===(h=g.nextActions)||void 0===h?void 0:h.filter(e=>(null==_e?void 0:_e.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return console.log("actions here",Fe),de?n.createElement(t.Loader,null):n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},ie("NDC_APP_OVER_VIEW_HEADER")),pe&&n.createElement(t.Loader,null),Ae&&Ae.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>Ie(!Te),displayOptions:Te,options:Ae})),null==re||null===(A=re.applicantDetails)||void 0===A||null===(S=A[0])||void 0===S||null===(N=S.owners)||void 0===N?void 0:N.map((e,l)=>{var i;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?ie("NOC_PRIMARY_OWNER"):"OWNER "+(l+1)),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:ie("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.gender)||void 0===i?void 0:i.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.propertyId)||"N/A"})))))}),(null==re||null===(b=re.applicantDetails)||void 0===b?void 0:b.some(e=>{var t,l;return(null==e||null===(t=e.professionalName)||void 0===t||null===(l=t.trim())||void 0===l?void 0:l.length)>0}))&&(null==re||null===(C=re.applicantDetails)||void 0===C?void 0:C.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("NOC_PROFESSIONAL_DETAILS")),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:ie("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),text:(null==e?void 0:e.professionalRegIdValidity)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("NOC_SITE_DETAILS")),null==re||null===(y=re.siteDetails)||void 0===y?void 0:y.map((e,l)=>{var i,o,a,r,u,d,s;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:ie("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:ie("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,l)=>n.createElement(t.Row,{label:Ne(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:ie("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),n.createElement(t.Row,{label:ie("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("NOC_SPECIFICATION_DETAILS")),null==re||null===(D=re.siteDetails)||void 0===D?void 0:D.map((e,l)=>{var i,o,a,r;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:ie("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),n.createElement(t.Row,{label:ie("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("NOC_SITE_COORDINATES_LABEL")),null==re||null===(O=re.coordinates)||void 0===O?void 0:O.map((e,l)=>n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:ie("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),n.createElement(t.Row,{label:ie("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),n.createElement(t.Row,{label:ie("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),n.createElement(t.Row,{label:ie("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==ce||null===(L=ce.Noc)||void 0===L||null===(T=L[0])||void 0===T||null===(I=T.nocDetails)||void 0===I||null===(w=I.additionalDetails)||void 0===w||null===(P=w.ownerIds)||void 0===P?void 0:P.length)>0&&n.createElement(An,{documents:null==ce||null===(R=ce.Noc)||void 0===R||null===(x=R[0])||void 0===x||null===(F=x.nocDetails)||void 0===F||null===(B=F.additionalDetails)||void 0===B?void 0:B.ownerIds}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==re||null===(M=re.Documents)||void 0===M?void 0:M.length)>0&&n.createElement(An,{documents:re.Documents}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("NOC_FEE_DETAILS_LABEL")),(null==ce||null===(k=ce.Noc)||void 0===k||null===(U=k[0])||void 0===U?void 0:U.nocDetails)&&n.createElement(Sn,{formData:{apiData:c({},ce),applicationDetails:c({},null==ce||null===(H=ce.Noc)||void 0===H||null===(W=H[0])||void 0===W||null===(j=W.nocDetails)||void 0===j||null===(z=j.additionalDetails)||void 0===z?void 0:z.applicationDetails),siteDetails:c({},null==ce||null===(V=ce.Noc)||void 0===V||null===(G=V[0])||void 0===G||null===(q=G.nocDetails)||void 0===q||null===(Y=q.additionalDetails)||void 0===Y?void 0:Y.siteDetails)}})),(null==Pe||null===(K=Pe.data)||void 0===K?void 0:K.timeline)&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,ie("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==Pe||null===(X=Pe.data)||void 0===X?void 0:X.timeline.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:ie(null==Pe||null===(Q=Pe.data)||void 0===Q||null===(J=Q.timeline[0])||void 0===J?void 0:J.status)}):n.createElement(t.ConnectingCheckPoints,null,null==Pe||null===(Z=Pe.data)||void 0===Z?void 0:Z.timeline.map((e,l,i)=>n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,label:ie("NOC_STATUS_"+e.status),customChild:Hi(e,l,0,ie)})))),Fe&&Fe.length>0&&n.createElement(t.ActionBar,null,ye&&(null!=Pe&&null!==($=Pe.data)&&void 0!==$&&null!==(ee=$.actionState)&&void 0!==ee&&ee.nextActions||null!=Pe&&null!==(te=Pe.data)&&void 0!==te&&te.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:Fe,optionKey:"action",t:ie,onSelect:function(e){var t,l;console.log("selected action",e);const n=null==ce||null===(t=ce.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?oe.push("/digit-ui/citizen/noc/edit-application/"+n):"DRAFT"==(null==e?void 0:e.action)?(Ce({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{Ce(null)},3e3)):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?function(e){try{var t,l;const n=c({},(null==ce||null===(t=ce.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(l=e.Licenses)||void 0===l?void 0:l[0];n.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},n)},a=Lt(function(){return Ot(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:ae,details:o})).then(function(e){var t,l,n;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==i?void 0:i.action)?(Ce({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),Pe.revalidate(),Le(null)):(console.log("We are calling citizen response page"),oe.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo),state:{data:e}})):(Ce({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Le(null))})},function(){Ce({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{Ce(null)},3e3),e)throw t;return t});Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(i):"PAY"==(null==e?void 0:e.action)?oe.push("/digit-ui/citizen/payment/collect/obpas_noc/"+n+"/"+ae+"?tenantId="+ae):Le(e)}}):null,n.createElement(t.SubmitBar,{ref:we,label:ie("WF_TAKE_ACTION"),onSubmit:()=>De(!ye)})),be&&n.createElement(t.Toast,{error:null==be?void 0:be.error,warning:null==be?void 0:be.warning,label:ie(null==be?void 0:be.message),isDleteBtn:!0,onClose:()=>{Ce(null)}}))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,d,s,m,v,p,E,f,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,P,R,x,F,B,M,k,U,H,W,j,z,V,G,q,Y,K,X,Q,J,Z,$;const{id:ee}=i.useParams(),{t:te}=o.useTranslation(),le=window.localStorage.getItem("Employee.tenant-id"),ne=i.useHistory(),ie=null==le?void 0:le.split(".")[0],[oe,ae]=l.useState(null),[re,ue]=l.useState(null),[de,se]=l.useState(null),[ce,me]=l.useState(null),[ve,pe]=l.useState({}),[Ee,fe]=l.useState(!1),[_e,ge]=l.useState([]),[he,Ae]=l.useState(!1),[Se,Ne]=l.useState([]),{isLoading:be,data:Ce}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:ee},le),ye=null==Ce?void 0:Ce.resData;console.log("applicationDetails here==>",ye);const De=Digit.Hooks.useWorkflowDetails({tenantId:le,id:ee,moduleCode:"obpas_noc"});var Oe,Le;console.log("workflowDetails here=>",De),null!=De&&null!==(e=De.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!De.isLoading&&(De.data.actionState.nextActions=[...null==De||null===(r=De.data)||void 0===r?void 0:r.nextActions]),De&&De.data&&!De.isLoading&&(De.data.initialActionState=(null==De||null===(Oe=De.data)||void 0===Oe?void 0:Oe.initialActionState)||c({},null==De||null===(Le=De.data)||void 0===Le?void 0:Le.actionState)||{},De.data.actionState=c({},De.data)),l.useEffect(()=>{let e=null;try{return Ae(!0),Promise.resolve(Digit.WorkflowService.init(le,"obpas_noc")).then(function(t){var l,n,i;e=t,Ae(!1),Ne(null===(l=e)||void 0===l||null===(n=l.BusinessServices)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.states)})}catch(e){Promise.reject(e)}},[le]);const[Te,Ie]=l.useState(!1),[we,Pe]=l.useState(null),[Re,xe]=l.useState(!1),Fe=()=>{ae(null)};let Be=Digit.UserService.getUser();const Me=l.useRef();if(Digit.Hooks.useClickOutside(Me,()=>{Ie(!1)},Te),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};Be=null==t?void 0:t.value}const ke=null===(u=Be)||void 0===u||null===(d=u.info)||void 0===d||null===(s=d.roles)||void 0===s?void 0:s.map(e=>e.code);l.useEffect(()=>{De&&De.revalidate(),Ce&&Ce.revalidate()},[]);let Ue=(null==De||null===(m=De.data)||void 0===m||null===(v=m.actionState)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==ke?void 0:ke.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==De||null===(E=De.data)||void 0===E||null===(f=E.nextActions)||void 0===f?void 0:f.filter(e=>(null==ke?void 0:ke.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));console.log("actions here",Ue),l.useEffect(()=>{var e;const t=null==ye||null===(e=ye.Noc)||void 0===e?void 0:e[0];if(t){var l,n,i,o,a,r;const e=null==t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.applicationDetails,u=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,d=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,s=(null==t?void 0:t.documents)||[];pe({applicantDetails:e?[e]:[],siteDetails:u?[u]:[],coordinates:d?[d]:[],Documents:s.length>0?s:[]})}},[null==ye?void 0:ye.Noc]);const He=function(e){try{var t,l;const n=c({},(null==ye||null===(t=ye.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(l=e.Licenses)||void 0===l?void 0:l[0];n.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},n)};console.log("final Payload ",o);const a=Lt(function(){return Ot(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:le,details:o})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==i?void 0:i.action))ae({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),De.revalidate(),Pe(null),setTimeout(()=>{ne.push("/digit-ui/employee/noc/inbox")},3e3);else if("APPLY"===(null==i?void 0:i.action)||"RESUBMIT"===(null==i?void 0:i.action)||"DRAFT"===(null==i?void 0:i.action)){var l,n;console.log("We are calling employee response page"),ne.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo),state:{data:e}})}else ae({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),De.revalidate(),Pe(null),setTimeout(()=>{ne.push("/digit-ui/employee/noc/inbox")},3e3);else ae({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Pe(null)})},function(){ae({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{ae(null)},3e3),e)throw t;return t});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},We=e=>{if(0===e)return te("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,l=e%100;let n="th";return(l<11||l>13)&&(1===t?n="st":2===t?n="nd":3===t&&(n="rd")),""+e+n+" "+te("NOC_FLOOR_AREA_LABEL")};return console.log("displayData here",ve),n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},te("NDC_APP_OVER_VIEW_HEADER"))),null==ve||null===(_=ve.applicantDetails)||void 0===_||null===(g=_[0])||void 0===g||null===(h=g.owners)||void 0===h?void 0:h.map((e,l)=>{var i;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?te("NOC_PRIMARY_OWNER"):"OWNER "+(l+1)),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:te("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:te("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:te("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:te("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:te("NOC_APPLICANT_DOB_LABEL"),text:(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:te("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.gender)||void 0===i?void 0:i.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:te("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"}),n.createElement(t.Row,{label:te("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.propertyId)||"N/A"})))))}),(null==ve||null===(A=ve.applicantDetails)||void 0===A?void 0:A.some(e=>{var t,l;return(null==e||null===(t=e.professionalName)||void 0===t||null===(l=t.trim())||void 0===l?void 0:l.length)>0}))&&(null==ve||null===(S=ve.applicantDetails)||void 0===S?void 0:S.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("NOC_PROFESSIONAL_DETAILS")),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:te("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:te("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:te("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:te("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:te("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("NOC_SITE_DETAILS")),null==ve||null===(N=ve.siteDetails)||void 0===N?void 0:N.map((e,l)=>{var i,o,a,r,u,d,s;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:te("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:te("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:te("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:te("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:te("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:te("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:te("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:te("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:te("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:te("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:te("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:te("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),n.createElement(t.Row,{label:te("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:te("NOC_BASEMENT_AREA_LABEL"),text:(null==e?void 0:e.basementArea)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,l)=>n.createElement(t.Row,{label:We(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:te("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==e?void 0:e.totalFloorArea)||"N/A"}),n.createElement(t.Row,{label:te("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),n.createElement(t.Row,{label:te("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),n.createElement(t.Row,{label:te("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:te("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:te("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:te("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:te("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("NOC_SPECIFICATION_DETAILS")),null==ve||null===(b=ve.siteDetails)||void 0===b?void 0:b.map((e,l)=>{var i,o,a,r;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:te("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:te("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:te("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:te("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),n.createElement(t.Row,{label:te("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("NOC_SITE_COORDINATES_LABEL")),null==ve||null===(C=ve.coordinates)||void 0===C?void 0:C.map((e,l)=>n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:te("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),n.createElement(t.Row,{label:te("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),n.createElement(t.Row,{label:te("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),n.createElement(t.Row,{label:te("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==ye||null===(y=ye.Noc)||void 0===y||null===(D=y[0])||void 0===D||null===(O=D.nocDetails)||void 0===O||null===(L=O.additionalDetails)||void 0===L||null===(T=L.ownerIds)||void 0===T?void 0:T.length)>0&&n.createElement(An,{documents:null==ye||null===(I=ye.Noc)||void 0===I||null===(w=I[0])||void 0===w||null===(P=w.nocDetails)||void 0===P||null===(R=P.additionalDetails)||void 0===R?void 0:R.ownerIds}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==ve||null===(x=ve.Documents)||void 0===x?void 0:x.length)>0&&n.createElement(An,{documents:ve.Documents}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("NOC_FEE_DETAILS_LABEL")),(null==ye||null===(F=ye.Noc)||void 0===F||null===(B=F[0])||void 0===B?void 0:B.nocDetails)&&n.createElement(Sn,{formData:{apiData:c({},ye),applicationDetails:c({},null==ye||null===(M=ye.Noc)||void 0===M||null===(k=M[0])||void 0===k||null===(U=k.nocDetails)||void 0===U||null===(H=U.additionalDetails)||void 0===H?void 0:H.applicationDetails),siteDetails:c({},null==ye||null===(W=ye.Noc)||void 0===W||null===(j=W[0])||void 0===j||null===(z=j.nocDetails)||void 0===z||null===(V=z.additionalDetails)||void 0===V?void 0:V.siteDetails)}})),(null==De||null===(G=De.data)||void 0===G?void 0:G.timeline)&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,te("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),1===(null==De||null===(q=De.data)||void 0===q?void 0:q.timeline.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:te(null==De||null===(Y=De.data)||void 0===Y||null===(K=Y.timeline[0])||void 0===K?void 0:K.status)}):n.createElement(t.ConnectingCheckPoints,null,null==De||null===(X=De.data)||void 0===X?void 0:X.timeline.map((e,l,i)=>n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,label:te("NOC_STATUS_"+e.status),customChild:Nn(e,l,0,te)})))),(null==Ue?void 0:Ue.length)>0&&n.createElement(t.ActionBar,null,Te&&(null!=De&&null!==(Q=De.data)&&void 0!==Q&&null!==(J=Q.actionState)&&void 0!==J&&J.nextActions||null!=De&&null!==(Z=De.data)&&void 0!==Z&&Z.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:Ue,optionKey:"action",t:te,onSelect:function(e){var t,l,n,i,o;console.log("selected action",e);const a=null==ye||null===(t=ye.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,r=null==e||null===(n=e.state)||void 0===n||null===(i=n.actions)||void 0===i?void 0:i.filter(t=>t.action==(null==e?void 0:e.action)),u=null==Se?void 0:Se.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=r[0])||void 0===t?void 0:t.nextState)});ge(null==u||null===(o=u[0])||void 0===o?void 0:o.actions);const d={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?ne.push("/digit-ui/employee/noc/edit-application/"+a):"DRAFT"==(null==e?void 0:e.action)?(ae({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{ae(null)},3e3)):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?He(d):"PAY"==(null==e?void 0:e.action)?ne.push("/digit-ui/employee/payment/collect/obpas_noc/"+a+"/"+le+"?tenantId="+le):(xe(!0),Pe(e))}}):null,n.createElement(t.SubmitBar,{ref:Me,label:te("WF_TAKE_ACTION"),onSubmit:()=>Ie(!Te)})),Re?n.createElement(hn,{t:te,action:we,tenantId:le,state:ie,getEmployees:_e,id:ee,applicationDetails:ye,applicationData:null==ye?void 0:ye.Noc,closeModal:()=>{Pe(null),xe(!1)},submitAction:He,actionData:null==De||null===($=De.data)||void 0===$?void 0:$.timeline,workflowDetails:De,showToast:oe,setShowToast:ae,closeToast:Fe,errors:re,showErrorToast:de,errorOne:ce,closeToastOne:()=>{se(null)}}):null,oe&&n.createElement(t.Toast,{error:null==oe?void 0:oe.error,warning:null==oe?void 0:oe.warning,label:te(null==oe?void 0:oe.message),isDleteBtn:!0,onClose:Fe}),(be||he)&&n.createElement(t.Loader,{page:!0}))},NewNOCEditApplication:()=>{var e,a,r,u,s,m,v,p,E,f,_,g,h,A,S,N,b,C;const{id:y}=i.useParams(),{t:D}=(i.useHistory(),o.useTranslation()),O=d.useDispatch(),[L,T]=l.useState(null),I=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer),w=I.formData,P=I.step;let R;R=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY"),console.log("tenantId here",R);const{isLoading:x,data:F}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:y},R),B=null==F?void 0:F.resData;console.log("applicationDetails here==>",B);const M=(null==B||null===(e=B.Noc)||void 0===e?void 0:e[0])||{},k=(null==M||null===(a=M.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.applicationDetails)||{},U=(null==M||null===(u=M.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s?void 0:s.siteDetails)||{},H=(null==M||null===(m=M.documents)||void 0===m?void 0:m.filter(e=>(null==e?void 0:e.documentUid)||(null==e?void 0:e.documentType)))||[],W=(null==M||null===(v=M.nocDetails)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.coordinates)||{},j=(null==M||null===(E=M.nocDetails)||void 0===E||null===(f=E.additionalDetails)||void 0===f?void 0:f.ownerPhotos)||[],z=(null==M||null===(_=M.nocDetails)||void 0===_||null===(g=_.additionalDetails)||void 0===g?void 0:g.ownerIds)||[],V=Digit.ULBService.getStateId(),{data:G,isLoading:q}=Digit.Hooks.noc.useBuildingType(V),{data:Y}=Digit.Hooks.noc.useRoadType(V),{data:K}=Digit.Hooks.noc.useBuildingCategory(V),{data:X,isLoading:Q}=Digit.Hooks.noc.useNocType(V),{data:J,isLoading:Z}=Digit.Hooks.useTenants(),[$,ee]=l.useState(Digit.Hooks.noc.useTenants()),te=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],le=null==J?void 0:J.map(e=>c({},e,{displayName:D(e.i18nKey)})),{data:ne}=Digit.Hooks.obps.useMDMS(V,"common-masters",["GenderType"]);ne&&(null===(h=ne["common-masters"])||void 0===h||null===(A=h.GenderType)||void 0===A||null===(S=A.filter(e=>e.active))||void 0===S||S.map(e=>{}));const[ie,oe]=l.useState(null),{data:ae,isLoading:re}=Digit.Hooks.useCustomMDMS(V,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+R+"')]"}]),ue=(null==ae||null===(N=ae.tenant)||void 0===N||null===(b=N.zoneMaster)||void 0===b||null===(C=b[0])||void 0===C?void 0:C.zones)||[];return console.log("zoneOptions==>",ue),l.useEffect(()=>{if(O({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!x&&!q&&null!=M&&M.nocDetails&&!Z&&!re&&!Q){const e={documents:{documents:null==H?void 0:H.map(e=>({documentType:(null==e?void 0:e.documentType)||"",uuid:(null==e?void 0:e.uuid)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||"",filestoreId:(null==e?void 0:e.uuid)||""}))}};Object.entries(W).forEach(e=>{let[t,l]=e;O(yi(t,l))}),O(Oi("ownerIdList",z)),O(Di("ownerPhotoList",j));const t=c({},k),l=null==$?void 0:$.find(e=>{var t;return e.name===(null==U||null===(t=U.district)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.district)});oe(l);const n=c({},U,{ulbName:null==le?void 0:le.find(e=>{var t;return e.name===(null==U||null===(t=U.ulbName)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.ulbName)}),roadType:null==Y?void 0:Y.find(e=>{var t;return e.name===(null==U||null===(t=U.roadType)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.roadType)}),buildingStatus:null==G?void 0:G.find(e=>{var t;return e.name===(null==U||null===(t=U.buildingStatus)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.buildingStatus)}),isBasementAreaAvailable:null==te?void 0:te.find(e=>{var t;return e.code===(null==U||null===(t=U.isBasementAreaAvailable)||void 0===t?void 0:t.code)||e.code===(null==U?void 0:U.isBasementAreaAvailable)}),district:l,zone:null==ue?void 0:ue.find(e=>{var t;return e.name===(null==U||null===(t=U.zone)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.zone)}),specificationBuildingCategory:null==K?void 0:K.find(e=>{var t;return e.name===(null==U||null===(t=U.specificationBuildingCategory)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.specificationBuildingCategory)}),specificationNocType:null==X?void 0:X.find(e=>{var t;return e.name===(null==U||null===(t=U.specificationNocType)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.specificationNocType)}),specificationRestrictedArea:null==te?void 0:te.find(e=>{var t;return e.code===(null==U||null===(t=U.specificationRestrictedArea)||void 0===t?void 0:t.code)||e.code===(null==U?void 0:U.specificationRestrictedArea)}),specificationIsSiteUnderMasterPlan:null==te?void 0:te.find(e=>{var t;return e.code===(null==U||null===(t=U.specificationIsSiteUnderMasterPlan)||void 0===t?void 0:t.code)||e.code===(null==U?void 0:U.specificationIsSiteUnderMasterPlan)})});O(bi("applicationDetails",t)),O(bi("siteDetails",n)),O(bi("documents",e)),O(bi("apiData",B))}},[x,B,q,re,Q]),x||!w.applicationDetails?n.createElement("div",null,n.createElement(t.Loader,null)):n.createElement("div",{className:"card"},n.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},D("NOC_REGISTRATION_APPLICATION")),n.createElement(Si,{stepsList:ki,onSubmit:e=>{},step:P,setStep:e=>{O(Ci(e))}}),L&&n.createElement(t.Toast,{error:L.key,label:D(L.label),onClose:()=>{T(null)},isDleteBtn:"true"}))},NOCCitizenSearchApplication:()=>{const{t:e}=o.useTranslation(),i=Digit.UserService.getUser().info;let a;a=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const r={offset:0,limit:10,tenantId:a,mobileNumber:null==i?void 0:i.mobileNumber},[u,d]=l.useState(r),s=window.Digit.Utils.browser.isMobile(),[c,m]=l.useState([{display:"ES_COMMON_NO_DATA"}]),[v,p]=l.useState(0),{data:E,isLoading:f,error:_}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(u,a,{});return l.useEffect(()=>{var e;null==E?m([{display:"ES_COMMON_NO_DATA"}]):(null==E||null===(e=E.data)||void 0===e?void 0:e.length)>0&&(m(null==E?void 0:E.data),p(null==E?void 0:E.totalCount))},[E]),n.createElement("div",null,n.createElement(t.CardHeader,{styles:s?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},e("ACTION_TEST_SEARCH_NOC_APPLICATION")),n.createElement(qi,{t:e,tenantId:a,onSubmit:function(e,t){console.log("_data==>",e);let l=gt(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),d(l)},isLoading:f,Count:v,error:_,data:c}))}};exports.NOCLinks=Yi,exports.NOCModule=Ki,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:fi}),exports.initNOCComponents=()=>{Object.entries(Xi).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@mseva/digit-ui-react-components"),l=require("react"),n=e(l),i=require("react-router-dom"),o=require("react-i18next"),a=require("react-hook-form"),r=require("react-query"),u=require("redux"),d=require("react-redux"),s=e(require("exif-js"));function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}function m(e,t){if(null==e)return{};var l={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;l[n]=e[n]}return l}const v=e=>{if(e){const t=new Date(e);let l=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,n+"/"+l+"/"+i}return null},p=function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e},f=function(e){void 0===e&&(e=!1);let t=window.location.href.includes("/search");const l=[{code:t?"FIRE_NOC":"FIRE_NOC_SRV",active:!0,roles:["FIRE_NOC_APPROVER"],i18nKey:"WF_FIRE_NOC_FIRE_NOC_SRV"},{code:t?"AIRPORT_AUTHORITY":"AIRPORT_NOC_SRV",active:!0,roles:["AIRPORT_AUTHORITY_APPROVER"],i18nKey:"WF_FIRE_NOC_AIRPORT_NOC_SRV"}],n=[],i=Digit.UserService.getUser().info.roles;return l.map((t,o)=>{let{roles:a}=t;a.map(t=>{i.map(i=>{var a;i.code===t&&n.push(e?null==l||null===(a=l[o])||void 0===a?void 0:a.code:null==l?void 0:l[o])})})}),n},E=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",i=(null==n?void 0:n.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o};var g=function(e,t){return e===t||e!=e&&t!=t},h=function(e,t){for(var l=e.length;l--;)if(g(e[l][0],t))return l;return-1},A=Array.prototype.splice;function S(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}S.prototype.clear=function(){this.__data__=[],this.size=0},S.prototype.delete=function(e){var t=this.__data__,l=h(t,e);return!(l<0||(l==t.length-1?t.pop():A.call(t,l,1),--this.size,0))},S.prototype.get=function(e){var t=this.__data__,l=h(t,e);return l<0?void 0:t[l][1]},S.prototype.has=function(e){return h(this.__data__,e)>-1},S.prototype.set=function(e,t){var l=this.__data__,n=h(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var N=S,b="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 y,D="object"==typeof b&&b&&b.Object===Object&&b,O="object"==typeof self&&self&&self.Object===Object&&self,L=D||O||Function("return this")(),T=L.Symbol,I=Object.prototype,w=I.hasOwnProperty,x=I.toString,R=T?T.toStringTag:void 0,P=Object.prototype.toString,F=T?T.toStringTag:void 0,B=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=w.call(e,R),l=e[R];try{e[R]=void 0;var n=!0}catch(e){}var i=x.call(e);return n&&(t?e[R]=l:delete e[R]),i}(e):function(e){return P.call(e)}(e)},M=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!M(e))return!1;var t=B(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},U=L["__core-js_shared__"],H=(y=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+y:"",W=Function.prototype.toString,j=function(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""},z=/^\[object .+?Constructor\]$/,V=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),G=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!M(e)||(t=e,H&&H in t))&&(k(e)?V:z).test(j(e));var t}(l)?l:void 0},Y=G(L,"Map"),q=G(Object,"create"),K=Object.prototype.hasOwnProperty,X=Object.prototype.hasOwnProperty;function Q(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}Q.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(q){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return K.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:X.call(t,e)},Q.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this};var J=Q,Z=function(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map};function $(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}$.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(Y||N),string:new J}},$.prototype.delete=function(e){var t=Z(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return Z(this,e).get(e)},$.prototype.has=function(e){return Z(this,e).has(e)},$.prototype.set=function(e,t){var l=Z(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var ee=$;function te(e){var t=this.__data__=new N(e);this.size=t.size}te.prototype.clear=function(){this.__data__=new N,this.size=0},te.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},te.prototype.get=function(e){return this.__data__.get(e)},te.prototype.has=function(e){return this.__data__.has(e)},te.prototype.set=function(e,t){var l=this.__data__;if(l instanceof N){var n=l.__data__;if(!Y||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new ee(n)}return l.set(e,t),this.size=l.size,this};var le=te,ne=function(){try{var e=G(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ie=function(e,t,l){"__proto__"==t&&ne?ne(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},oe=Object.prototype.hasOwnProperty,ae=function(e,t,l){var n=e[t];oe.call(e,t)&&g(n,l)&&(void 0!==l||t in e)||ie(e,t,l)},re=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?ie(l,r,u):ae(l,r,u)}return l},ue=function(e){return null!=e&&"object"==typeof e},de=function(e){return ue(e)&&"[object Arguments]"==B(e)},se=Object.prototype,ce=se.hasOwnProperty,me=se.propertyIsEnumerable,ve=de(function(){return arguments}())?de:function(e){return ue(e)&&ce.call(e,"callee")&&!me.call(e,"callee")},pe=Array.isArray,fe=function(){return!1},Ee=C(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?L.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||fe}),_e=/^(?:0|[1-9]\d*)$/,ge=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&_e.test(e))&&e>-1&&e%1==0&&e<t},he=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;var Se=function(e){return function(t){return e(t)}},Ne=C(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&D.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),be=Ne&&Ne.isTypedArray,Ce=be?Se(be):function(e){return ue(e)&&he(e.length)&&!!Ae[B(e)]},ye=Object.prototype.hasOwnProperty,De=function(e,t){var l=pe(e),n=!l&&ve(e),i=!l&&!n&&Ee(e),o=!l&&!n&&!i&&Ce(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!ye.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ge(d,u))||r.push(d);return r},Oe=Object.prototype,Le=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)},Te=function(e,t){return function(l){return e(t(l))}},Ie=Te(Object.keys,Object),we=Object.prototype.hasOwnProperty,xe=function(e){return null!=e&&he(e.length)&&!k(e)},Re=function(e){return xe(e)?De(e):function(e){if(!Le(e))return Ie(e);var t=[];for(var l in Object(e))we.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Pe=Object.prototype.hasOwnProperty,Fe=function(e){return xe(e)?De(e,!0):function(e){if(!M(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Le(e),l=[];for(var n in e)("constructor"!=n||!t&&Pe.call(e,n))&&l.push(n);return l}(e)},Be=C(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?L.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Me=function(){return[]},ke=Object.prototype.propertyIsEnumerable,Ue=Object.getOwnPropertySymbols,He=Ue?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];ke.call(e,r)&&(a[o++]=r)}return a}(Ue(e)))}:Me,We=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},je=Te(Object.getPrototypeOf,Object),ze=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)We(t,He(e)),e=je(e);return t}:Me,Ve=function(e,t,l){var n=t(e);return pe(e)?n:We(n,l(e))},Ge=function(e){return Ve(e,Re,He)},Ye=function(e){return Ve(e,Fe,ze)},qe=G(L,"DataView"),Ke=G(L,"Promise"),Xe=G(L,"Set"),Qe=G(L,"WeakMap"),Je=j(qe),Ze=j(Y),$e=j(Ke),et=j(Xe),tt=j(Qe),lt=B;(qe&&"[object DataView]"!=lt(new qe(new ArrayBuffer(1)))||Y&&"[object Map]"!=lt(new Y)||Ke&&"[object Promise]"!=lt(Ke.resolve())||Xe&&"[object Set]"!=lt(new Xe)||Qe&&"[object WeakMap]"!=lt(new Qe))&&(lt=function(e){var t=B(e),l="[object Object]"==t?e.constructor:void 0,n=l?j(l):"";if(n)switch(n){case Je:return"[object DataView]";case Ze:return"[object Map]";case $e:return"[object Promise]";case et:return"[object Set]";case tt:return"[object WeakMap]"}return t});var nt=lt,it=Object.prototype.hasOwnProperty,ot=L.Uint8Array,at=function(e){var t=new e.constructor(e.byteLength);return new ot(t).set(new ot(e)),t},rt=/\w*$/,ut=T?T.prototype:void 0,dt=ut?ut.valueOf:void 0,st=Object.create,ct=function(){function e(){}return function(t){if(!M(t))return{};if(st)return st(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),mt=Ne&&Ne.isMap,vt=mt?Se(mt):function(e){return ue(e)&&"[object Map]"==nt(e)},pt=Ne&&Ne.isSet,ft=pt?Se(pt):function(e){return ue(e)&&"[object Set]"==nt(e)},Et={};Et["[object Arguments]"]=Et["[object Array]"]=Et["[object ArrayBuffer]"]=Et["[object DataView]"]=Et["[object Boolean]"]=Et["[object Date]"]=Et["[object Float32Array]"]=Et["[object Float64Array]"]=Et["[object Int8Array]"]=Et["[object Int16Array]"]=Et["[object Int32Array]"]=Et["[object Map]"]=Et["[object Number]"]=Et["[object Object]"]=Et["[object RegExp]"]=Et["[object Set]"]=Et["[object String]"]=Et["[object Symbol]"]=Et["[object Uint8Array]"]=Et["[object Uint8ClampedArray]"]=Et["[object Uint16Array]"]=Et["[object Uint32Array]"]=!0,Et["[object Error]"]=Et["[object Function]"]=Et["[object WeakMap]"]=!1;var _t=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!M(t))return t;var c=pe(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&it.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(t),!u)return function(e,t){var l=-1,n=e.length;for(t||(t=Array(n));++l<n;)t[l]=e[l];return t}(t,r)}else{var m=nt(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(Ee(t))return Be(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!o){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||Le(e)?{}:ct(je(e))}(t),!u)return d?function(e,t){return re(e,ze(e),t)}(t,function(e,t){return e&&re(t,Fe(t),e)}(r,t)):function(e,t){return re(e,He(e),t)}(t,function(e,t){return e&&re(t,Re(t),e)}(r,t))}else{if(!Et[m])return o?t:{};r=function(e,t,l){var n,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return at(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var l=t?at(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);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 l=t?at(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(n=e).constructor(n.source,rt.exec(n))).lastIndex=n.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return dt?Object(dt.call(e)):{}}}(t,m,u)}}a||(a=new le);var p=a.get(t);if(p)return p;a.set(t,r),ft(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):vt(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var f=c?void 0:(s?d?Ye:Ge:d?Fe:Re)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(f||t,function(i,o){f&&(i=t[o=i]),ae(r,o,e(i,l,n,o,t,a))}),r},gt=function(e){return _t(e,5)},ht=C(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",m="[object Map]",v="[object Number]",p="[object Object]",f="[object RegExp]",E="[object Set]",_="[object String]",g="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",C="[object Float64Array]",y="[object Int8Array]",D="[object Int16Array]",O="[object Int32Array]",L="[object Uint8Array]",T="[object Uint16Array]",I="[object Uint32Array]",w=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,B=RegExp(P.source),M=RegExp(F.source),k=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,G=RegExp(V.source),Y=/^\s+/,q=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Q=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,$=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\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",me="["+ce+"]",ve="["+se+"]",pe="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+ce+pe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ne="(?:"+fe+"|"+Ee+")",be="(?:"+Se+"|"+Ee+")",Ce="(?:"+ve+"|"+_e+")?",ye="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+ye,Oe="(?:"+[ge+ve+"?",ve,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Le=RegExp("['’]","g"),Te=RegExp(ve,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Oe+ye,"g"),we=RegExp([Se+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,Se,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,Se+Ne,"$"].join("|")+")",Se+"?"+Ne+"+(?:['’](?: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_])",pe,De].join("|"),"g"),xe=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 ]/,Pe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fe=-1,Be={};Be[N]=Be[C]=Be[y]=Be[D]=Be[O]=Be[L]=Be["[object Uint8ClampedArray]"]=Be[T]=Be[I]=!0,Be[o]=Be[a]=Be[A]=Be[r]=Be[S]=Be[u]=Be[d]=Be[s]=Be[m]=Be[v]=Be[p]=Be[f]=Be[E]=Be[_]=Be[h]=!1;var Me={};Me[o]=Me[a]=Me[A]=Me[S]=Me[r]=Me[u]=Me[N]=Me[C]=Me[y]=Me[D]=Me[O]=Me[m]=Me[v]=Me[p]=Me[f]=Me[E]=Me[_]=Me[g]=Me[L]=Me["[object Uint8ClampedArray]"]=Me[T]=Me[I]=!0,Me[d]=Me[s]=Me[h]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,We="object"==typeof b&&b&&b.Object===Object&&b,je="object"==typeof self&&self&&self.Object===Object&&self,ze=We||je||Function("return this")(),Ve=t&&!t.nodeType&&t,Ge=Ve&&e&&!e.nodeType&&e,Ye=Ge&&Ge.exports===Ve,qe=Ye&&We.process,Ke=function(){try{return Ge&&Ge.require&&Ge.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ke&&Ke.isArrayBuffer,Qe=Ke&&Ke.isDate,Je=Ke&&Ke.isMap,Ze=Ke&&Ke.isRegExp,$e=Ke&&Ke.isSet,et=Ke&&Ke.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function mt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function vt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var pt=St("length");function ft(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function Et(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):Et(e,ht,l)}function gt(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function ht(e){return e!=e}function At(e,t){var l=null==e?0:e.length;return l?Ct(e,t)/l:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function Nt(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Ct(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function yt(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Ot(e){return function(t){return e(t)}}function Lt(e,t){return dt(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function It(e,t){for(var l=-1,n=e.length;++l<n&&_t(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length;l--&&_t(t,e[l],0)>-1;);return l}function xt(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Rt=Nt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Pt=Nt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Ft(e){return"\\"+ke[e]}function Bt(e){return xe.test(e)}function Mt(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function kt(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Bt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Bt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Gt=Nt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Yt=function e(t){var b=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,Pe))).Array,q=t.Date,se=t.Error,ce=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,fe=t.String,Ee=t.TypeError,_e=b.prototype,ge=ve.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Se=ge.hasOwnProperty,Ne=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,ye=Ae.call(ve),De=ze._,Oe=pe("^"+Ae.call(Se).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?t.Buffer:void 0,xe=t.Symbol,ke=t.Uint8Array,We=Ie?Ie.allocUnsafe:void 0,je=kt(ve.getPrototypeOf,ve),Ve=ve.create,Ge=ge.propertyIsEnumerable,qe=_e.splice,Ke=xe?xe.isConcatSpreadable:void 0,pt=xe?xe.iterator:void 0,Nt=xe?xe.toStringTag:void 0,qt=function(){try{var e=Ji(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=q&&q.now!==ze.Date.now&&q.now,Qt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=me.ceil,Zt=me.floor,$t=ve.getOwnPropertySymbols,el=Ie?Ie.isBuffer:void 0,tl=t.isFinite,ll=_e.join,nl=kt(ve.keys,ve),il=me.max,ol=me.min,al=q.now,rl=t.parseInt,ul=me.random,dl=_e.reverse,sl=Ji(t,"DataView"),cl=Ji(t,"Map"),ml=Ji(t,"Promise"),vl=Ji(t,"Set"),pl=Ji(t,"WeakMap"),fl=Ji(ve,"create"),El=pl&&new pl,_l={},gl=Oo(sl),hl=Oo(cl),Al=Oo(ml),Sl=Oo(vl),Nl=Oo(pl),bl=xe?xe.prototype:void 0,Cl=bl?bl.valueOf:void 0,yl=bl?bl.toString:void 0;function Dl(e){if(Va(e)&&!Ra(e)&&!(e instanceof Il)){if(e instanceof Tl)return e;if(Se.call(e,"__wrapped__"))return Lo(e)}return new Tl(e)}var Ol=function(){function e(){}return function(t){if(!za(t))return{};if(Ve)return Ve(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Ll(){}function Tl(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Il(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function wl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function xl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Rl(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}function Pl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Rl;++t<l;)this.add(e[t])}function Fl(e){var t=this.__data__=new xl(e);this.size=t.size}function Bl(e,t){var l=Ra(e),n=!l&&xa(e),i=!l&&!n&&Ma(e),o=!l&&!n&&!i&&Za(e),a=l||n||i||o,r=a?yt(e.length,fe):[],u=r.length;for(var d in e)!t&&!Se.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function Ml(e){var t=e.length;return t?e[Pn(0,t-1)]:void 0}function kl(e,t){return No(fi(e),ql(t,0,e.length))}function Ul(e){return No(fi(e))}function Hl(e,t,l){(void 0!==l&&!Ta(e[t],l)||void 0===l&&!(t in e))&&Gl(e,t,l)}function Wl(e,t,l){var n=e[t];Se.call(e,t)&&Ta(n,l)&&(void 0!==l||t in e)||Gl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ta(e[l][0],t))return l;return-1}function zl(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function Vl(e,t){return e&&Ei(t,Ar(t),e)}function Gl(e,t,l){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Yl(e,t){for(var l=-1,n=t.length,i=b(n),o=null==e;++l<n;)i[l]=o?void 0:fr(e,t[l]);return i}function ql(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function Kl(e,t,l,n,i,a){var d,h=1&t,b=2&t,w=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!za(e))return e;var x=Ra(e);if(x){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return fi(e,d)}else{var R=eo(e),P=R==s||R==c;if(Ma(e))return di(e,h);if(R==p||R==o||P&&!i){if(d=b||P?{}:lo(e),!h)return b?function(e,t){return Ei(e,$i(e),t)}(e,function(e,t){return e&&Ei(t,Sr(t),e)}(d,e)):function(e,t){return Ei(e,Zi(e),t)}(e,Vl(d,e))}else{if(!Me[R])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case A:return si(e);case r:case u:return new n(+e);case S:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case N:case C:case y:case D:case O:case L:case"[object Uint8ClampedArray]":case T:case I:return ci(e,l);case m:return new n;case v:case _:return new n(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new n;case g:return Cl?ve(Cl.call(e)):{}}}(e,R,h)}}a||(a=new Fl);var F=a.get(e);if(F)return F;a.set(e,d),Xa(e)?e.forEach(function(n){d.add(Kl(n,t,l,n,e,a))}):Ga(e)&&e.forEach(function(n,i){d.set(i,Kl(n,t,l,i,e,a))});var B=x?void 0:(w?b?Vi:zi:b?Sr:Ar)(e);return nt(B||e,function(n,i){B&&(n=e[i=n]),Wl(d,i,Kl(n,t,l,i,e,a))}),d}function Xl(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Ql(e,t,n){if("function"!=typeof e)throw new Ee(l);return go(function(){e.apply(void 0,n)},t)}function Jl(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Ot(l))),n?(o=ut,a=!1):t.length>=200&&(o=Tt,a=!1,t=new Pl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var m=d;m--;)if(t[m]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Dl.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Dl}},(Dl.prototype=Ll.prototype).constructor=Dl,(Tl.prototype=Ol(Ll.prototype)).constructor=Tl,(Il.prototype=Ol(Ll.prototype)).constructor=Il,wl.prototype.clear=function(){this.__data__=fl?fl(null):{},this.size=0},wl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wl.prototype.get=function(e){var t=this.__data__;if(fl){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return Se.call(t,e)?t[e]:void 0},wl.prototype.has=function(e){var t=this.__data__;return fl?void 0!==t[e]:Se.call(t,e)},wl.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=fl&&void 0===t?"__lodash_hash_undefined__":t,this},xl.prototype.clear=function(){this.__data__=[],this.size=0},xl.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():qe.call(t,l,1),--this.size,0))},xl.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},xl.prototype.has=function(e){return jl(this.__data__,e)>-1},xl.prototype.set=function(e,t){var l=this.__data__,n=jl(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this},Rl.prototype.clear=function(){this.size=0,this.__data__={hash:new wl,map:new(cl||xl),string:new wl}},Rl.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return Xi(this,e).get(e)},Rl.prototype.has=function(e){return Xi(this,e).has(e)},Rl.prototype.set=function(e,t){var l=Xi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},Pl.prototype.add=Pl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Pl.prototype.has=function(e){return this.__data__.has(e)},Fl.prototype.clear=function(){this.__data__=new xl,this.size=0},Fl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},Fl.prototype.get=function(e){return this.__data__.get(e)},Fl.prototype.has=function(e){return this.__data__.has(e)},Fl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof xl){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Rl(n)}return l.set(e,t),this.size=l.size,this};var Zl=hi(rn),$l=hi(un,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Ai(),an=Ai(!0);function rn(e,t){return e&&on(e,t,Ar)}function un(e,t){return e&&an(e,t,Ar)}function dn(e,t){return at(t,function(t){return Ha(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[Do(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return Ra(e)?n:st(n,l(e))}function mn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Nt&&Nt in ve(e)?function(e){var t=Se.call(e,Nt),l=e[Nt];try{e[Nt]=void 0;var n=!0}catch(e){}var i=Ce.call(e);return n&&(t?e[Nt]=l:delete e[Nt]),i}(e):function(e){return Ce.call(e)}(e)}function vn(e,t){return e>t}function pn(e,t){return null!=e&&Se.call(e,t)}function fn(e,t){return null!=e&&t in ve(e)}function En(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=b(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Ot(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new Pl(a&&s):void 0}s=e[0];var c=-1,m=r[0];e:for(;++c<i&&d.length<u;){var v=s[c],p=t?t(v):v;if(v=l||0!==v?v:0,!(m?Tt(m,p):n(d,p,l))){for(a=o;--a;){var f=r[a];if(!(f?Tt(f,p):n(e[a],p,l)))continue e}m&&m.push(p),d.push(v)}}return d}function _n(e,t,l){var n=null==(e=po(e,t=oi(t,e)))?e:e[Do(Uo(t))];return null==n?void 0:tt(n,e,l)}function gn(e){return Va(e)&&mn(e)==o}function hn(e,t,l,n,i){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=Ra(e),h=Ra(t),N=c?a:eo(e),b=h?a:eo(t),C=(N=N==o?p:N)==p,y=(b=b==o?p:b)==p,D=N==b;if(D&&Ma(e)){if(!Ma(t))return!1;c=!0,C=!1}if(D&&!C)return s||(s=new Fl),c||Za(e)?Wi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case S:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!o(new ke(e),new ke(t)));case r:case u:case v:return Ta(+e,+t);case d:return e.name==t.name&&e.message==t.message;case f:case _:return e==t+"";case m:var s=Mt;case E:if(s||(s=Ht),e.size!=t.size&&!(1&n))return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var p=Wi(s(e),s(t),n,i,o,a);return a.delete(e),p;case g:if(Cl)return Cl.call(e)==Cl.call(t)}return!1}(e,t,N,l,n,i,s);if(!(1&l)){var O=C&&Se.call(e,"__wrapped__"),L=y&&Se.call(t,"__wrapped__");if(O||L){var T=O?e.value():e,I=L?t.value():t;return s||(s=new Fl),i(T,I,l,n,s)}}return!!D&&(s||(s=new Fl),function(e,t,l,n,i,o){var a=1&l,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Se.call(t,s)))return!1}var c=o.get(e),m=o.get(t);if(c&&m)return c==t&&m==e;var v=!0;o.set(e,t),o.set(t,e);for(var p=a;++d<u;){var f=e[s=r[d]],E=t[s];if(n)var _=a?n(E,f,s,t,e,o):n(f,E,s,e,t,o);if(!(void 0===_?f===E||i(f,E,l,n,o):_)){v=!1;break}p||(p="constructor"==s)}if(v&&!p){var g=e.constructor,h=t.constructor;g==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof h&&h instanceof h||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,s))}(e,t,l,n,hn,i))}function An(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=ve(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Fl;if(n)var m=n(d,s,u,e,t,c);if(!(void 0===m?hn(s,d,3,n,c):m))return!1}}return!0}function Sn(e){return!(!za(e)||(t=e,be&&be in t))&&(Ha(e)?Oe:ie).test(Oo(e));var t}function Nn(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Ra(e)?On(e[0],e[1]):Dn(e):tu(e)}function bn(e){if(!so(e))return nl(e);var t=[];for(var l in ve(e))Se.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Cn(e,t){return e<t}function yn(e,t){var l=-1,n=Fa(e)?b(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Dn(e){var t=Qi(e);return 1==t.length&&t[0][2]?mo(t[0][0],t[0][1]):function(l){return l===e||An(l,e,t)}}function On(e,t){return ao(e)&&co(t)?mo(Do(e),t):function(l){var n=fr(l,e);return void 0===n&&n===t?Er(l,e):hn(t,n,3)}}function Ln(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new Fl),za(o))!function(e,t,l,n,i,o,a){var r=Eo(e,l),u=Eo(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var m=Ra(u),v=!m&&Ma(u),p=!m&&!v&&Za(u);s=u,m||v||p?Ra(r)?s=r:Ba(r)?s=fi(r):v?(c=!1,s=di(u,!0)):p?(c=!1,s=ci(u,!0)):s=[]:qa(u)||xa(u)?(s=r,xa(r)?s=ar(r):za(r)&&!Ha(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,Ln,n,i);else{var r=n?n(Eo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hl(e,a,r)}},Sr)}function Tn(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function In(e,t,l){t=t.length?dt(t,function(e){return Ra(e)?function(t){return sn(t,1===e.length?e[0]:e)}:e}):[Yr];var n=-1;return t=dt(t,Ot(Ki())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=mi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(yn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function wn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function xn(e,t,l,n){var i=n?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=fi(t)),l&&(r=dt(e,Ot(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&qe.call(r,u,1),qe.call(e,u,1);return e}function Rn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?qe.call(e,i,1):Jn(e,i)}}return e}function Pn(e,t){return e+Zt(ul()*(t-e+1))}function Fn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Bn(e,t){return ho(vo(e,t,Yr),e+"")}function Mn(e){return Ml(Tr(e))}function kn(e,t){var l=Tr(e);return No(l,ql(t,0,l.length))}function Un(e,t,l,n){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=za(s)?s:io(t[i+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=El?function(e,t){return El.set(e,t),e}:Yr,Wn=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Yr;function jn(e){return No(Tr(e))}function zn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=b(i);++n<i;)o[n]=e[n+t];return o}function Vn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Gn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Ja(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Yn(e,t,Yr,l)}function Yn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Ja(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),m=void 0!==c,v=null===c,p=c==c,f=Ja(c);if(a)var E=n||p;else E=d?p&&(n||m):r?p&&m&&(n||!v):u?p&&m&&!v&&(n||!f):!v&&!f&&(n?c<=t:c<t);E?i=s+1:o=s}return ol(o,4294967294)}function qn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ta(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Kn(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function Xn(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,Xn)+"";if(Ja(e))return yl?yl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Qn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:Fi(e);if(d)return Ht(d);a=!1,i=Tt,u=new Pl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var m=u.length;m--;)if(u[m]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Jn(e,t){return null==(e=po(e,t=oi(t,e)))||delete e[Do(Uo(t))]}function Zn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function $n(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?zn(e,n?0:o,n?o+1:i):zn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Il&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Qn(e[0]):[];for(var i=-1,o=b(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Jl(o[i]||a,e[r],t,l));return Qn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ba(e)?e:[]}function ii(e){return"function"==typeof e?e:Yr}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:yo(rr(e))}var ai=Bn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:zn(e,t,l)}var ui=Kt||function(e){return ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=We?We(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function mi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,u=t==t,d=Ja(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function vi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=b(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function pi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=b(s+d),m=!n;++i<s;)c[i]=e[i];for(var v=i;++u<d;)c[v+u]=t[u];for(;++a<r;)(m||i<o)&&(c[v+l[a]]=e[i++]);return c}function fi(e,t){var l=-1,n=e.length;for(t||(t=b(n));++l<n;)t[l]=e[l];return t}function Ei(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?Gl(l,r,u):Wl(l,r,u)}return l}function _i(e,t){return function(l,n){var i=Ra(l)?lt:zl,o=t?t():{};return i(l,e,Ki(n,2),o)}}function gi(e){return Bn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function hi(e,t){return function(l,n){if(null==l)return l;if(!Fa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=ve(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Ai(e){return function(t,l,n){for(var i=-1,o=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function Si(e){return function(t){var l=Bt(t=rr(t))?zt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function Ni(e){return function(t){return ct(Hr(xr(t).replace(Le,"")),e,"")}}function bi(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 l=Ol(e.prototype),n=e.apply(l,t);return za(n)?n:l}}function Ci(e){return function(t,l,n){var i=ve(t);if(!Fa(t)){var o=Ki(l,3);t=Ar(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function yi(e){return ji(function(t){var n=t.length,i=n,o=Tl.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Ee(l);if(o&&!r&&"wrapper"==Yi(a))var r=new Tl([],!0)}for(i=r?i:n;++i<n;){var u=Yi(a=t[i]),d="wrapper"==u?Gi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Yi(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&Ra(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Di(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,m=2&t,v=24&t,p=512&t,f=m?void 0:bi(e);return function E(){for(var _=arguments.length,g=b(_),h=_;h--;)g[h]=arguments[h];if(v)var A=qi(E),S=xt(g,A);if(n&&(g=vi(g,n,i,v)),o&&(g=pi(g,o,a,v)),_-=S,v&&_<d){var N=Ut(g,A);return Ri(e,t,Di,E.placeholder,l,g,N,r,u,d-_)}var C=c?l:this,y=m?C[e]:e;return _=g.length,r?g=fo(g,r):p&&_>1&&g.reverse(),s&&u<_&&(g.length=u),this&&this!==ze&&this instanceof E&&(y=f||bi(y)),y.apply(C,g)}}function Oi(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Li(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=Xn(l),n=Xn(n)):(l=Kn(l),n=Kn(n)),i=e(l,n)}return i}}function Ti(e){return ji(function(t){return t=dt(t,Ot(Ki())),Bn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Ii(e,t){var l=(t=void 0===t?" ":Xn(t)).length;if(l<2)return l?Fn(t,e):t;var n=Fn(t,Jt(e/jt(t)));return Bt(t)?ri(zt(n),0,e).join(""):n.slice(0,e)}function wi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l,n){for(var i=-1,o=il(Jt((t-e)/(l||1)),0),a=b(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function xi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=or(t),l=or(l)),e(t,l)}}function Ri(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],m=l.apply(void 0,c);return ro(e)&&_o(m,c),m.placeholder=n,Ao(m,e,t)}function Pi(e){var t=me[e];return function(e,l){if(e=or(e),(l=null==l?0:ol(nr(l),292))&&tl(e)){var n=(rr(e)+"e").split("e");return+((n=(rr(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var Fi=vl&&1/Ht(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:Jr;function Bi(e){return function(t){var l=eo(t);return l==m?Mt(t):l==E?Wt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Mi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new Ee(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var m=o,v=a;o=a=void 0}var p=s?void 0:Gi(e),f=[e,t,i,o,a,m,v,r,u,d];if(p&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?pi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,p),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:il(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,l){var n=bi(e);return function i(){for(var o=arguments.length,a=b(o),r=o,u=qi(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Ri(e,t,Di,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==ze&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Di.apply(void 0,f):function(e,t,l,n){var i=1&t,o=bi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=b(d+r),c=this&&this!==ze&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var E=function(e,t,l){var n=1&t,i=bi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return Ao((p?Hn:_o)(E,f),e,t)}function ki(e,t,l,n){return void 0===e||Ta(e,ge[l])&&!Se.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return za(e)&&za(t)&&(o.set(t,e),Ln(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return qa(e)?void 0:e}function Wi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,m=!0,v=2&l?new Pl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var p=e[c],f=t[c];if(n)var E=a?n(f,p,c,t,e,o):n(p,f,c,e,t,o);if(void 0!==E){if(E)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Tt(v,t)&&(p===e||i(p,e,l,n,o)))return v.push(t)})){m=!1;break}}else if(p!==f&&!i(p,f,l,n,o)){m=!1;break}}return o.delete(e),o.delete(t),m}function ji(e){return ho(vo(e,void 0,Po),e+"")}function zi(e){return cn(e,Ar,Zi)}function Vi(e){return cn(e,Sr,$i)}var Gi=El?function(e){return El.get(e)}:Jr;function Yi(e){for(var t=e.name+"",l=_l[t],n=Se.call(_l,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function qi(e){return(Se.call(Dl,"placeholder")?Dl:e).placeholder}function Ki(){var e=Dl.iteratee||qr;return e=e===qr?Nn:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map}function Qi(e){for(var t=Ar(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Ji(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return Sn(l)?l:void 0}var Zi=$t?function(e){return null==e?[]:(e=ve(e),at($t(e),function(t){return Ge.call(e,t)}))}:iu,$i=$t?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:iu,eo=mn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=Do(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Ra(e)||xa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Ol(je(e))}function no(e){return Ra(e)||xa(e)||!!(Ke&&e&&e[Ke])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!za(l))return!1;var n=typeof t;return!!("number"==n?Fa(l)&&io(t,l.length):"string"==n&&t in l)&&Ta(l[t],e)}function ao(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Ja(e))||j.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ro(e){var t=Yi(e),l=Dl[t];if("function"!=typeof l||!(t in Il.prototype))return!1;if(e===l)return!0;var n=Gi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=S||cl&&eo(new cl)!=m||ml&&"[object Promise]"!=eo(ml.resolve())||vl&&eo(new vl)!=E||pl&&eo(new pl)!=h)&&(eo=function(e){var t=mn(e),l=t==p?e.constructor:void 0,n=l?Oo(l):"";if(n)switch(n){case gl:return S;case hl:return m;case Al:return"[object Promise]";case Sl:return E;case Nl:return h}return t});var uo=he?Ha:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!za(e)}function mo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=b(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=b(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function po(e,t){return t.length<2?e:sn(e,zn(t,0,-1))}function fo(e,t){for(var l=e.length,n=ol(t.length,l),i=fi(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=So(Hn),go=Qt||function(e,t){return ze.setTimeout(e,t)},ho=So(Wn);function Ao(e,t,l){var n=t+"";return ho(e,function(e,t){var l=t.length;if(!l)return e;var n=l-1;return t[n]=(l>1?"& ":"")+t[n],t=t.join(l>2?", ":" "),e.replace(K,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Q):[]}(n),l)))}function So(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function No(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=Pn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var bo,Co,yo=(bo=ba(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,l,n,i){t.push(n?i.replace($,"$1"):l||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=bo.cache,bo);function Do(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Oo(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Lo(e){if(e instanceof Il)return e.clone();var t=new Tl(e.__wrapped__,e.__chain__);return t.__actions__=fi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var To=Bn(function(e,t){return Ba(e)?Jl(e,nn(t,1,Ba,!0)):[]}),Io=Bn(function(e,t){var l=Uo(t);return Ba(l)&&(l=void 0),Ba(e)?Jl(e,nn(t,1,Ba,!0),Ki(l,2)):[]}),wo=Bn(function(e,t){var l=Uo(t);return Ba(l)&&(l=void 0),Ba(e)?Jl(e,nn(t,1,Ba,!0),void 0,l):[]});function xo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),Et(e,Ki(t,3),i)}function Ro(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=nr(l),i=l<0?il(n+i,0):ol(i,n-1)),Et(e,Ki(t,3),i,!0)}function Po(e){return null!=e&&e.length?nn(e,1):[]}function Fo(e){return e&&e.length?e[0]:void 0}var Bo=Bn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?En(t):[]}),Mo=Bn(function(e){var t=Uo(e),l=dt(e,ni);return t===Uo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?En(l,Ki(t,2)):[]}),ko=Bn(function(e){var t=Uo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?En(l,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Bn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?xn(e,t):e}var jo=ji(function(e,t){var l=null==e?0:e.length,n=Yl(e,t);return Rn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(mi)),n});function zo(e){return null==e?e:dl.call(e)}var Vo=Bn(function(e){return Qn(nn(e,1,Ba,!0))}),Go=Bn(function(e){var t=Uo(e);return Ba(t)&&(t=void 0),Qn(nn(e,1,Ba,!0),Ki(t,2))}),Yo=Bn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Qn(nn(e,1,Ba,!0),void 0,t)});function qo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ba(e))return t=il(e.length,t),!0}),yt(t,function(t){return dt(e,St(t))})}function Ko(e,t){if(!e||!e.length)return[];var l=qo(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var Xo=Bn(function(e,t){return Ba(e)?Jl(e,t):[]}),Qo=Bn(function(e){return ti(at(e,Ba))}),Jo=Bn(function(e){var t=Uo(e);return Ba(t)&&(t=void 0),ti(at(e,Ba),Ki(t,2))}),Zo=Bn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ba),void 0,t)}),$o=Bn(qo),ea=Bn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Ko(e,l)});function ta(e){var t=Dl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Yl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Il&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new Tl(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=_i(function(e,t,l){Se.call(e,l)?++e[l]:Gl(e,l,1)}),oa=Ci(xo),aa=Ci(Ro);function ra(e,t){return(Ra(e)?nt:Zl)(e,Ki(t,3))}function ua(e,t){return(Ra(e)?it:$l)(e,Ki(t,3))}var da=_i(function(e,t,l){Se.call(e,l)?e[l].push(t):Gl(e,l,[t])}),sa=Bn(function(e,t,l){var n=-1,i="function"==typeof t,o=Fa(e)?b(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):_n(e,t,l)}),o}),ca=_i(function(e,t,l){Gl(e,l,t)});function ma(e,t){return(Ra(e)?dt:yn)(e,Ki(t,3))}var va=_i(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),pa=Bn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),In(e,nn(t,1),[])}),fa=Xt||function(){return ze.Date.now()};function Ea(e,t,l){return t=l?void 0:t,Mi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var n;if("function"!=typeof t)throw new Ee(l);return e=nr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ga=Bn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,qi(ga));n|=32}return Mi(e,n,t,l,i)}),ha=Bn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,qi(ha));n|=32}return Mi(t,n,e,l,i)});function Aa(e,t,n){var i,o,a,r,u,d,s=0,c=!1,m=!1,v=!0;if("function"!=typeof e)throw new Ee(l);function p(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function f(e){return s=e,u=go(_,t),c?p(e):r}function E(e){var l=e-d;return void 0===d||l>=t||l<0||m&&e-s>=a}function _(){var e=fa();if(E(e))return g(e);u=go(_,function(e){var l=t-(e-d);return m?ol(l,a-(e-s)):l}(e))}function g(e){return u=void 0,v&&i?p(e):(i=o=void 0,r)}function h(){var e=fa(),l=E(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return f(d);if(m)return ui(u),u=go(_,t),p(d)}return void 0===u&&(u=go(_,t)),r}return t=or(t)||0,za(n)&&(c=!!n.leading,a=(m="maxWait"in n)?il(or(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),h.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},h.flush=function(){return void 0===u?r:g(fa())},h}var Sa=Bn(function(e,t){return Ql(e,1,t)}),Na=Bn(function(e,t,l){return Ql(e,or(t)||0,l)});function ba(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(ba.Cache||Rl),n}function Ca(e){if("function"!=typeof e)throw new Ee(l);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)}}ba.Cache=Rl;var ya=ai(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Ot(Ki())):dt(nn(t,1),Ot(Ki()))).length;return Bn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Da=Bn(function(e,t){return Mi(e,32,void 0,t,Ut(t,qi(Da)))}),Oa=Bn(function(e,t){return Mi(e,64,void 0,t,Ut(t,qi(Oa)))}),La=ji(function(e,t){return Mi(e,256,void 0,void 0,void 0,t)});function Ta(e,t){return e===t||e!=e&&t!=t}var Ia=xi(vn),wa=xi(function(e,t){return e>=t}),xa=gn(function(){return arguments}())?gn:function(e){return Va(e)&&Se.call(e,"callee")&&!Ge.call(e,"callee")},Ra=b.isArray,Pa=Xe?Ot(Xe):function(e){return Va(e)&&mn(e)==A};function Fa(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ba(e){return Va(e)&&Fa(e)}var Ma=el||ou,ka=Qe?Ot(Qe):function(e){return Va(e)&&mn(e)==u};function Ua(e){if(!Va(e))return!1;var t=mn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qa(e)}function Ha(e){if(!za(e))return!1;var t=mn(e);return t==s||t==c||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==nr(e)}function ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function za(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Va(e){return null!=e&&"object"==typeof e}var Ga=Je?Ot(Je):function(e){return Va(e)&&eo(e)==m};function Ya(e){return"number"==typeof e||Va(e)&&mn(e)==v}function qa(e){if(!Va(e)||mn(e)!=p)return!1;var t=je(e);if(null===t)return!0;var l=Se.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Ae.call(l)==ye}var Ka=Ze?Ot(Ze):function(e){return Va(e)&&mn(e)==f},Xa=$e?Ot($e):function(e){return Va(e)&&eo(e)==E};function Qa(e){return"string"==typeof e||!Ra(e)&&Va(e)&&mn(e)==_}function Ja(e){return"symbol"==typeof e||Va(e)&&mn(e)==g}var Za=et?Ot(et):function(e){return Va(e)&&ja(e.length)&&!!Be[mn(e)]},$a=xi(Cn),er=xi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Fa(e))return Qa(e)?zt(e):fi(e);if(pt&&e[pt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[pt]());var t=eo(e);return(t==m?Mt:t==E?Ht:Tr)(e)}function lr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function nr(e){var t=lr(e),l=t%1;return t==t?l?t-l:t:0}function ir(e){return e?ql(nr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if(za(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=za(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var l=ne.test(e);return l||oe.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return Ei(e,Sr(e))}function rr(e){return null==e?"":Xn(e)}var ur=gi(function(e,t){if(so(t)||Fa(t))Ei(t,Ar(t),e);else for(var l in t)Se.call(t,l)&&Wl(e,l,t[l])}),dr=gi(function(e,t){Ei(t,Sr(t),e)}),sr=gi(function(e,t,l,n){Ei(t,Sr(t),e,n)}),cr=gi(function(e,t,l,n){Ei(t,Ar(t),e,n)}),mr=ji(Yl),vr=Bn(function(e,t){e=ve(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=Sr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ta(s,ge[d])&&!Se.call(e,d))&&(e[d]=o[d])}return e}),pr=Bn(function(e){return e.push(void 0,Ui),tt(br,void 0,e)});function fr(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function Er(e,t){return null!=e&&to(e,t,fn)}var _r=Oi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=l},zr(Yr)),gr=Oi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Se.call(e,t)?e[t].push(l):e[t]=[l]},Ki),hr=Bn(_n);function Ar(e){return Fa(e)?Bl(e):bn(e)}function Sr(e){return Fa(e)?Bl(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var l in ve(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&Se.call(e,n))&&l.push(n);return l}(e)}var Nr=gi(function(e,t,l){Ln(e,t,l)}),br=gi(function(e,t,l,n){Ln(e,t,l,n)}),Cr=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),Ei(e,Vi(e),l),n&&(l=Kl(l,7,Hi));for(var i=t.length;i--;)Jn(l,t[i]);return l}),yr=ji(function(e,t){return null==e?{}:function(e,t){return wn(e,t,function(t,l){return Er(e,l)})}(e,t)});function Dr(e,t){if(null==e)return{};var l=dt(Vi(e),function(e){return[e]});return t=Ki(t),wn(e,l,function(e,l){return t(e,l[0])})}var Or=Bi(Ar),Lr=Bi(Sr);function Tr(e){return null==e?[]:Lt(e,Ar(e))}var Ir=Ni(function(e,t,l){return t=t.toLowerCase(),e+(l?wr(t):t)});function wr(e){return Ur(rr(e).toLowerCase())}function xr(e){return(e=rr(e))&&e.replace(re,Rt).replace(Te,"")}var Rr=Ni(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),Pr=Ni(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Fr=Si("toLowerCase"),Br=Ni(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),Mr=Ni(function(e,t,l){return e+(l?" ":"")+Ur(t)}),kr=Ni(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=Si("toUpperCase");function Hr(e,t,l){return e=rr(e),void 0===(t=l?void 0:t)?function(e){return Re.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(J)||[]}(e):e.match(t)||[]}var Wr=Bn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),jr=ji(function(e,t){return nt(t,function(t){t=Do(t),Gl(e,t,ga(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=yi(),Gr=yi(!0);function Yr(e){return e}function qr(e){return Nn("function"==typeof e?e:Kl(e,1))}var Kr=Bn(function(e,t){return function(l){return _n(l,e,t)}}),Xr=Bn(function(e,t){return function(l){return _n(e,l,t)}});function Qr(e,t,l){var n=Ar(t),i=dn(t,n);null!=l||za(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,Ar(t)));var o=!(za(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=fi(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Zr=Ti(dt),$r=Ti(ot),eu=Ti(vt);function tu(e){return ao(e)?St(Do(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=wi(),nu=wi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Li(function(e,t){return e+t},0),uu=Pi("ceil"),du=Li(function(e,t){return e/t},1),su=Pi("floor"),cu=Li(function(e,t){return e*t},1),mu=Pi("round"),vu=Li(function(e,t){return e-t},0);return Dl.after=function(e,t){if("function"!=typeof t)throw new Ee(l);return e=nr(e),function(){if(--e<1)return t.apply(this,arguments)}},Dl.ary=Ea,Dl.assign=ur,Dl.assignIn=dr,Dl.assignInWith=sr,Dl.assignWith=cr,Dl.at=mr,Dl.before=_a,Dl.bind=ga,Dl.bindAll=jr,Dl.bindKey=ha,Dl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Dl.chain=ta,Dl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=b(Jt(n/t));i<n;)a[o++]=zn(e,i,i+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=b(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?fi(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=Ki();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new Ee(l);return[n(e[0]),e[1]]}):[],Bn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=Ar(e);return function(l){return Xl(l,e,t)}}(Kl(e,1))},Dl.constant=zr,Dl.countBy=ia,Dl.create=function(e,t){var l=Ol(e);return null==t?l:Vl(l,t)},Dl.curry=function e(t,l,n){var i=Mi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.curryRight=function e(t,l,n){var i=Mi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.debounce=Aa,Dl.defaults=vr,Dl.defaultsDeep=pr,Dl.defer=Sa,Dl.delay=Na,Dl.difference=To,Dl.differenceBy=Io,Dl.differenceWith=wo,Dl.drop=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=l||void 0===t?1:nr(t))<0?0:t,n):[]},Dl.dropRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,0,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t):[]},Dl.dropRightWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3),!0):[]},Dl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=nr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:nr(n))<0&&(n+=i),n=l>n?0:ir(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(Ra(e)?at:ln)(e,Ki(t,3))},Dl.flatMap=function(e,t){return nn(ma(e,t),1)},Dl.flatMapDeep=function(e,t){return nn(ma(e,t),1/0)},Dl.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(ma(e,t),l)},Dl.flatten=Po,Dl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Dl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Dl.flip=function(e){return Mi(e,512)},Dl.flow=Vr,Dl.flowRight=Gr,Dl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Dl.functions=function(e){return null==e?[]:dn(e,Ar(e))},Dl.functionsIn=function(e){return null==e?[]:dn(e,Sr(e))},Dl.groupBy=da,Dl.initial=function(e){return null!=e&&e.length?zn(e,0,-1):[]},Dl.intersection=Bo,Dl.intersectionBy=Mo,Dl.intersectionWith=ko,Dl.invert=_r,Dl.invertBy=gr,Dl.invokeMap=sa,Dl.iteratee=qr,Dl.keyBy=ca,Dl.keys=Ar,Dl.keysIn=Sr,Dl.map=ma,Dl.mapKeys=function(e,t){var l={};return t=Ki(t,3),rn(e,function(e,n,i){Gl(l,t(e,n,i),e)}),l},Dl.mapValues=function(e,t){var l={};return t=Ki(t,3),rn(e,function(e,n,i){Gl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(Kl(e,1))},Dl.matchesProperty=function(e,t){return On(e,Kl(t,1))},Dl.memoize=ba,Dl.merge=Nr,Dl.mergeWith=br,Dl.method=Kr,Dl.methodOf=Xr,Dl.mixin=Qr,Dl.negate=Ca,Dl.nthArg=function(e){return e=nr(e),Bn(function(t){return Tn(t,e)})},Dl.omit=Cr,Dl.omitBy=function(e,t){return Dr(e,Ca(Ki(t)))},Dl.once=function(e){return _a(2,e)},Dl.orderBy=function(e,t,l,n){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(l=n?void 0:l)||(l=null==l?[]:[l]),In(e,t,l))},Dl.over=Zr,Dl.overArgs=ya,Dl.overEvery=$r,Dl.overSome=eu,Dl.partial=Da,Dl.partialRight=Oa,Dl.partition=va,Dl.pick=yr,Dl.pickBy=Dr,Dl.property=tu,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Ho,Dl.pullAll=Wo,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?xn(e,t,Ki(l,2)):e},Dl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?xn(e,t,void 0,l):e},Dl.pullAt=jo,Dl.range=lu,Dl.rangeRight=nu,Dl.rearg=La,Dl.reject=function(e,t){return(Ra(e)?at:ln)(e,Ca(Ki(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=Ki(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Rn(e,i),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new Ee(l);return Bn(e,t=void 0===t?t:nr(t))},Dl.reverse=zo,Dl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),(Ra(e)?kl:kn)(e,t)},Dl.set=function(e,t,l){return null==e?e:Un(e,t,l)},Dl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Dl.shuffle=function(e){return(Ra(e)?Ul:jn)(e)},Dl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:nr(t),l=void 0===l?n:nr(l)),zn(e,t,l)):[]},Dl.sortBy=pa,Dl.sortedUniq=function(e){return e&&e.length?qn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?qn(e,Ki(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Ka(t))&&!(t=Xn(t))&&Bt(e)?ri(zt(e),0,l):e.split(t,l):[]},Dl.spread=function(e,t){if("function"!=typeof e)throw new Ee(l);return t=null==t?0:il(nr(t),0),Bn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Dl.tail=function(e){var t=null==e?0:e.length;return t?zn(e,1,t):[]},Dl.take=function(e,t,l){return e&&e.length?zn(e,0,(t=l||void 0===t?1:nr(t))<0?0:t):[]},Dl.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t,n):[]},Dl.takeRightWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?$n(e,Ki(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(l);return za(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Aa(e,t,{leading:i,maxWait:t,trailing:o})},Dl.thru=la,Dl.toArray=tr,Dl.toPairs=Or,Dl.toPairsIn=Lr,Dl.toPath=function(e){return Ra(e)?dt(e,Do):Ja(e)?[e]:fi(yo(rr(e)))},Dl.toPlainObject=ar,Dl.transform=function(e,t,l){var n=Ra(e),i=n||Ma(e)||Za(e);if(t=Ki(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:za(e)&&Ha(o)?Ol(je(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Dl.unary=function(e){return Ea(e,1)},Dl.union=Vo,Dl.unionBy=Go,Dl.unionWith=Yo,Dl.uniq=function(e){return e&&e.length?Qn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Qn(e,Ki(t,2)):[]},Dl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qn(e,void 0,t):[]},Dl.unset=function(e,t){return null==e||Jn(e,t)},Dl.unzip=qo,Dl.unzipWith=Ko,Dl.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Dl.values=Tr,Dl.valuesIn=function(e){return null==e?[]:Lt(e,Sr(e))},Dl.without=Xo,Dl.words=Hr,Dl.wrap=function(e,t){return Da(ii(t),e)},Dl.xor=Qo,Dl.xorBy=Jo,Dl.xorWith=Zo,Dl.zip=$o,Dl.zipObject=function(e,t){return li(e||[],t||[],Wl)},Dl.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Dl.zipWith=ea,Dl.entries=Or,Dl.entriesIn=Lr,Dl.extend=dr,Dl.extendWith=sr,Qr(Dl,Dl),Dl.add=ru,Dl.attempt=Wr,Dl.camelCase=Ir,Dl.capitalize=wr,Dl.ceil=uu,Dl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=or(l))==l?l:0),void 0!==t&&(t=(t=or(t))==t?t:0),ql(or(e),t,l)},Dl.clone=function(e){return Kl(e,4)},Dl.cloneDeep=function(e){return Kl(e,5)},Dl.cloneDeepWith=function(e,t){return Kl(e,5,t="function"==typeof t?t:void 0)},Dl.cloneWith=function(e,t){return Kl(e,4,t="function"==typeof t?t:void 0)},Dl.conformsTo=function(e,t){return null==t||Xl(e,t,Ar(t))},Dl.deburr=xr,Dl.defaultTo=function(e,t){return null==e||e!=e?t:e},Dl.divide=du,Dl.endsWith=function(e,t,l){e=rr(e),t=Xn(t);var n=e.length,i=l=void 0===l?n:ql(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Dl.eq=Ta,Dl.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(F,Pt):e},Dl.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Dl.every=function(e,t,l){var n=Ra(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,Ki(t,3))},Dl.find=oa,Dl.findIndex=xo,Dl.findKey=function(e,t){return ft(e,Ki(t,3),rn)},Dl.findLast=aa,Dl.findLastIndex=Ro,Dl.findLastKey=function(e,t){return ft(e,Ki(t,3),un)},Dl.floor=su,Dl.forEach=ra,Dl.forEachRight=ua,Dl.forIn=function(e,t){return null==e?e:on(e,Ki(t,3),Sr)},Dl.forInRight=function(e,t){return null==e?e:an(e,Ki(t,3),Sr)},Dl.forOwn=function(e,t){return e&&rn(e,Ki(t,3))},Dl.forOwnRight=function(e,t){return e&&un(e,Ki(t,3))},Dl.get=fr,Dl.gt=Ia,Dl.gte=wa,Dl.has=function(e,t){return null!=e&&to(e,t,pn)},Dl.hasIn=Er,Dl.head=Fo,Dl.identity=Yr,Dl.includes=function(e,t,l,n){e=Fa(e)?e:Tr(e),l=l&&!n?nr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),Qa(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&_t(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),_t(e,t,i)},Dl.inRange=function(e,t,l){return t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=or(e),t,l)},Dl.invoke=hr,Dl.isArguments=xa,Dl.isArray=Ra,Dl.isArrayBuffer=Pa,Dl.isArrayLike=Fa,Dl.isArrayLikeObject=Ba,Dl.isBoolean=function(e){return!0===e||!1===e||Va(e)&&mn(e)==r},Dl.isBuffer=Ma,Dl.isDate=ka,Dl.isElement=function(e){return Va(e)&&1===e.nodeType&&!qa(e)},Dl.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Za(e)||xa(e)))return!e.length;var t=eo(e);if(t==m||t==E)return!e.size;if(so(e))return!bn(e).length;for(var l in e)if(Se.call(e,l))return!1;return!0},Dl.isEqual=function(e,t){return hn(e,t)},Dl.isEqualWith=function(e,t,l){var n=(l="function"==typeof l?l:void 0)?l(e,t):void 0;return void 0===n?hn(e,t,void 0,l):!!n},Dl.isError=Ua,Dl.isFinite=function(e){return"number"==typeof e&&tl(e)},Dl.isFunction=Ha,Dl.isInteger=Wa,Dl.isLength=ja,Dl.isMap=Ga,Dl.isMatch=function(e,t){return e===t||An(e,t,Qi(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,An(e,t,Qi(t),l)},Dl.isNaN=function(e){return Ya(e)&&e!=+e},Dl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sn(e)},Dl.isNil=function(e){return null==e},Dl.isNull=function(e){return null===e},Dl.isNumber=Ya,Dl.isObject=za,Dl.isObjectLike=Va,Dl.isPlainObject=qa,Dl.isRegExp=Ka,Dl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Dl.isSet=Xa,Dl.isString=Qa,Dl.isSymbol=Ja,Dl.isTypedArray=Za,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return Va(e)&&eo(e)==h},Dl.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==mn(e)},Dl.join=function(e,t){return null==e?"":ll.call(e,t)},Dl.kebabCase=Rr,Dl.last=Uo,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=nr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):Et(e,ht,i,!0)},Dl.lowerCase=Pr,Dl.lowerFirst=Fr,Dl.lt=$a,Dl.lte=er,Dl.max=function(e){return e&&e.length?tn(e,Yr,vn):void 0},Dl.maxBy=function(e,t){return e&&e.length?tn(e,Ki(t,2),vn):void 0},Dl.mean=function(e){return At(e,Yr)},Dl.meanBy=function(e,t){return At(e,Ki(t,2))},Dl.min=function(e){return e&&e.length?tn(e,Yr,Cn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,Ki(t,2),Cn):void 0},Dl.stubArray=iu,Dl.stubFalse=ou,Dl.stubObject=function(){return{}},Dl.stubString=function(){return""},Dl.stubTrue=function(){return!0},Dl.multiply=cu,Dl.nth=function(e,t){return e&&e.length?Tn(e,nr(t)):void 0},Dl.noConflict=function(){return ze._===this&&(ze._=De),this},Dl.noop=Jr,Dl.now=fa,Dl.pad=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ii(Zt(i),l)+e+Ii(Jt(i),l)},Dl.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?e+Ii(t-n,l):e},Dl.padStart=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?Ii(t-n,l)+e:e},Dl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace(Y,""),t||0)},Dl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Pn(e,t)},Dl.reduce=function(e,t,l){var n=Ra(e)?ct:bt,i=arguments.length<3;return n(e,Ki(t,4),l,i,Zl)},Dl.reduceRight=function(e,t,l){var n=Ra(e)?mt:bt,i=arguments.length<3;return n(e,Ki(t,4),l,i,$l)},Dl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),Fn(rr(e),t)},Dl.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[Do(t[n])];void 0===o&&(n=i,o=l),e=Ha(o)?o.call(e):o}return e},Dl.round=mu,Dl.runInContext=e,Dl.sample=function(e){return(Ra(e)?Ml:Mn)(e)},Dl.size=function(e){if(null==e)return 0;if(Fa(e))return Qa(e)?jt(e):e.length;var t=eo(e);return t==m||t==E?e.size:bn(e).length},Dl.snakeCase=Br,Dl.some=function(e,t,l){var n=Ra(e)?vt:Vn;return l&&oo(e,t,l)&&(t=void 0),n(e,Ki(t,3))},Dl.sortedIndex=function(e,t){return Gn(e,t)},Dl.sortedIndexBy=function(e,t,l){return Yn(e,t,Ki(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Gn(e,t);if(n<l&&Ta(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return Gn(e,t,!0)},Dl.sortedLastIndexBy=function(e,t,l){return Yn(e,t,Ki(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Gn(e,t,!0)-1;if(Ta(e[l],t))return l}return-1},Dl.startCase=Mr,Dl.startsWith=function(e,t,l){return e=rr(e),l=null==l?0:ql(nr(l),0,e.length),t=Xn(t),e.slice(l,l+t.length)==t},Dl.subtract=vu,Dl.sum=function(e){return e&&e.length?Ct(e,Yr):0},Dl.sumBy=function(e,t){return e&&e.length?Ct(e,Ki(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,ki);var i,o,a=sr({},t.imports,n.imports,ki),r=Ar(a),u=Lt(a,r),d=0,s=t.interpolate||ue,c="__p += '",m=pe((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fe+"]")+"\n";e.replace(m,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,Ft),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Se.call(t,"variable")&&t.variable;if(p){if(Z.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(w,""):c).replace(x,"$1").replace(R,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var f=Wr(function(){return ce(r,v+"return "+c).apply(void 0,u)});if(f.source=c,Ua(f))throw f;return f},Dl.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=yt(n,t=Ki(t));++l<e;)t(l);return i},Dl.toFinite=lr,Dl.toInteger=nr,Dl.toLength=ir,Dl.toLower=function(e){return rr(e).toLowerCase()},Dl.toNumber=or,Dl.toSafeInteger=function(e){return e?ql(nr(e),-9007199254740991,9007199254740991):0===e?e:0},Dl.toString=rr,Dl.toUpper=function(e){return rr(e).toUpperCase()},Dl.trim=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return Dt(e);if(!e||!(t=Xn(t)))return e;var n=zt(e),i=zt(t);return ri(n,It(n,i),wt(n,i)+1).join("")},Dl.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xn(t)))return e;var n=zt(e);return ri(n,0,wt(n,zt(t))+1).join("")},Dl.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace(Y,"");if(!e||!(t=Xn(t)))return e;var n=zt(e);return ri(n,It(n,zt(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if(za(t)){var i="separator"in t?t.separator:i;l="length"in t?nr(t.length):l,n="omission"in t?Xn(t.omission):n}var o=(e=rr(e)).length;if(Bt(e)){var a=zt(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),Ka(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=pe(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xn(i),r)!=r){var m=u.lastIndexOf(i);m>-1&&(u=u.slice(0,m))}return u+n},Dl.unescape=function(e){return(e=rr(e))&&B.test(e)?e.replace(P,Gt):e},Dl.uniqueId=function(e){var t=++Ne;return rr(e)+t},Dl.upperCase=kr,Dl.upperFirst=Ur,Dl.each=ra,Dl.eachRight=ua,Dl.first=Fo,Qr(Dl,(au={},rn(Dl,function(e,t){Se.call(Dl.prototype,t)||(au[t]=e)}),au),{chain:!1}),Dl.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dl[e].placeholder=Dl}),nt(["drop","take"],function(e,t){Il.prototype[e]=function(l){l=void 0===l?1:il(nr(l),0);var n=this.__filtered__&&!t?new Il(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Il.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),nt(["filter","map","takeWhile"],function(e,t){var l=t+1,n=1==l||3==l;Il.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ki(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Il.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Il.prototype[e]=function(){return this.__filtered__?new Il(this):this[l](1)}}),Il.prototype.compact=function(){return this.filter(Yr)},Il.prototype.find=function(e){return this.filter(e).head()},Il.prototype.findLast=function(e){return this.reverse().find(e)},Il.prototype.invokeMap=Bn(function(e,t){return"function"==typeof e?new Il(this):this.map(function(l){return _n(l,e,t)})}),Il.prototype.reject=function(e){return this.filter(Ca(Ki(e)))},Il.prototype.slice=function(e,t){e=nr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Il(l):(e<0?l=l.takeRight(-e):e&&(l=l.drop(e)),void 0!==t&&(l=(t=nr(t))<0?l.dropRight(-t):l.take(t-e)),l)},Il.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Il.prototype.toArray=function(){return this.take(4294967295)},rn(Il.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Dl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Dl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Il,u=a[0],d=r||Ra(t),s=function(e){var t=i.apply(Dl,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,m=!!this.__actions__.length,v=o&&!c,p=r&&!m;if(!o&&d){t=p?t:new Il(this);var f=e.apply(t,a);return f.__actions__.push({func:la,args:[s],thisArg:void 0}),new Tl(f,c)}return v&&p?e.apply(this,a):(f=this.thru(s),v?n?f.value()[0]:f.value():f)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ra(i)?i:[],e)}return this[l](function(l){return t.apply(Ra(l)?l:[],e)})}}),rn(Il.prototype,function(e,t){var l=Dl[t];if(l){var n=l.name+"";Se.call(_l,n)||(_l[n]=[]),_l[n].push({name:t,func:l})}}),_l[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],Il.prototype.clone=function(){var e=new Il(this.__wrapped__);return e.__actions__=fi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fi(this.__views__),e},Il.prototype.reverse=function(){if(this.__filtered__){var e=new Il(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Il.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=Ra(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,m=0,v=ol(u,this.__takeCount__);if(!l||!n&&i==u&&v==u)return ei(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var f=-1,E=e[d+=t];++f<c;){var _=s[f],g=_.type,h=(0,_.iteratee)(E);if(2==g)E=h;else if(!h){if(1==g)continue e;break e}}p[m++]=E}return p},Dl.prototype.at=na,Dl.prototype.chain=function(){return ta(this)},Dl.prototype.commit=function(){return new Tl(this.value(),this.__chain__)},Dl.prototype.next=function(){void 0===this.__values__&&(this.__values__=tr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Dl.prototype.plant=function(e){for(var t,l=this;l instanceof Ll;){var n=Lo(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Dl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Il){var t=e;return this.__actions__.length&&(t=new Il(this)),(t=t.reverse()).__actions__.push({func:la,args:[zo],thisArg:void 0}),new Tl(t,this.__chain__)}return this.thru(zo)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dl.prototype.first=Dl.prototype.head,pt&&(Dl.prototype[pt]=function(){return this}),Dl}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(b)});const At=e=>{var i,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=o.useTranslation(),p=Digit.UserService.getUser().info;return n.createElement(l.Fragment,null,n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),n.createElement(t.CardLabelError,null,null==m||null===(i=m.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),n.createElement(t.SearchField,{className:"submit"},n.createElement(t.SubmitBar,{label:v("ES_COMMON_SEARCH"),submit:!0}),n.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),d("offset",s("offset")-s("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},v("ES_COMMON_CLEAR_ALL"))))},St=["currentlyActiveMobileModal"],Nt=["currentlyActiveMobileModal"],bt=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=a.useFormContext(),[_,g]=l.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{g({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),S=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,i=m(e,St);const{closeMobilePopupModal:o}=i;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,i,n.createElement(A,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),n.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,Nt)))},[_]);return s?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"searchBox"},n.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"})})),_?n.createElement(t.PopUp,null,n.createElement(S,{onSubmit:e=>{g({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:_,closeMobilePopupModal:h})):null,null!=v&&null!==(i=v[0])&&void 0!==i&&i.display?n.createElement(t.Card,{style:{marginTop:20}},f(null==v||null===(r=v[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/employee/noc/inbox/application-overview/",serviceRequestIdKey:f("NOC_APPLICATION_NUMBER")}))},Ct=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:d,isLoading:s,Count:c}=e;const{handleSubmit:m,setValue:v,getValues:p}=a.useFormContext();null==p("offset")&&v("offset",0),null==p("limit")&&v("limit",10);const[f,E]=l.useState(Number(p("offset"))/Number(p("limit"))),{t:_}=o.useTranslation(),g=()=>{v("offset",c&&10*Math.ceil(c/10)-p("limit")),m(u)()},h=()=>{v("offset",0),m(u)()},A=l.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){v("limit",Number(e.target.value)),m(u)()}function N(){v("offset",Number(p("offset"))+Number(p("limit"))),m(u)()}function b(){v("offset",Number(p("offset"))-Number(p("limit"))),m(u)()}l.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return s?n.createElement(t.Loader,null):null!=d&&null!==(e=d[0])&&void 0!==e&&e.display?n.createElement(t.Card,{style:{marginTop:20}},_(null==d||null===(l=d[0])||void 0===l?void 0:l.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.Table,{t:_,data:d,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===_("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:g,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,l};return n.createElement(n.Fragment,null,n.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},n.createElement(r,{onSubmit:u,handleSubmit:m,isMobileView:!1})),n.createElement(C,null))},yt=e=>{let{t:t,onSubmit:r,data:u,error:d,isLoading:s,Count:c}=e;const[m,v]=l.useState(null),p=a.useForm();l.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation();return l.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(i.Link,{to:"/digit-ui/employee/noc/inbox/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),_=l.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return n.createElement(a.FormProvider,p,E?n.createElement(bt,{SearchFormFieldsComponent:At,propsMobileInboxCards:_,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(Ct,{columns:f,SearchFormFieldsComponent:At,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},Dt=e=>{const{t:i}=o.useTranslation(),a=Digit.UserService.getUser().info;let r;r=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const u={offset:0,limit:10,tenantId:r,mobileNumber:null==a?void 0:a.mobileNumber},[d,s]=l.useState(u),c=window.Digit.Utils.browser.isMobile(),[m,v]=l.useState([{display:"ES_COMMON_NO_DATA"}]),[p,f]=l.useState(0),{data:E,isLoading:_,error:g}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(d,r,{});return l.useEffect(()=>{var e;null==E?v([{display:"ES_COMMON_NO_DATA"}]):(null==E||null===(e=E.data)||void 0===e?void 0:e.length)>0&&(v(null==E?void 0:E.data),f(null==E?void 0:E.totalCount))},[E]),n.createElement("div",null,n.createElement(t.CardHeader,{styles:c?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},i("ACTION_TEST_SEARCH_NOC_APPLICATION")),n.createElement(yt,{t:i,tenantId:r,onSubmit:function(e,t){console.log("_data==>",e);let l=gt(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),s(l)},isLoading:_,Count:p,error:g,data:m}))};function Ot(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function Lt(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const Tt=(e,t)=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const l=e%10,n=e%100;let i="th";return(n<11||n>13)&&(1===l?i="st":2===l?i="nd":3===l&&(i="rd")),""+e+i+" "+t("NOC_FLOOR_AREA_LABEL")},It=function(e,t,l,n,i){try{var o,a,r,u;const d=Digit.ULBService.getStateId(),s=e||{};let c=[],m="";const v=(null==s||null===(o=s.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.ownerPhotos)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.filestoreId)||"";return Promise.resolve(Digit.UploadServices.Filefetch([v],d)).then(function(e){var o,a,r,u,d;const v=null==e||null===(o=e.data)||void 0===o||null===(a=o.fileStoreIds)||void 0===a?void 0:a[0];m=(null==v?void 0:v.url)||"",null!=s&&null!==(r=s.nocDetails)&&void 0!==r&&null!==(u=r.additionalDetails)&&void 0!==u&&null!==(d=u.applicationDetails)&&void 0!==d&&d.professionalName&&c.push(((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v,p,f,E,_,g,h;let A=[{title:t("NOC_PROFESSIONAL_NAME_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.applicationDetails)||void 0===i?void 0:i.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.applicationDetails)||void 0===r?void 0:r.professionalEmailId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.applicationDetails)||void 0===s?void 0:s.professionalRegId)||"N/A"},{title:t("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(m=c.additionalDetails)||void 0===m||null===(v=m.applicationDetails)||void 0===v?void 0:v.professionalRegIdValidity)||"N/A"},{title:t("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),value:(null==e||null===(p=e.nocDetails)||void 0===p||null===(f=p.additionalDetails)||void 0===f||null===(E=f.applicationDetails)||void 0===E?void 0:E.professionalMobileNumber)||"N/A"},{title:t("NOC_PROFESSIONAL_ADDRESS_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(g=_.additionalDetails)||void 0===g||null===(h=g.applicationDetails)||void 0===h?void 0:h.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:A}})(s,i));const p=(null==s?void 0:s.applicationNo)||"NA",f=i("LOCAL_GOVERNMENT_PUNJAB"),_=null==t?void 0:t.contactNumber,g=null==t?void 0:t.emailId,h=i("NOC_ACKNOWLEDGEMENT_TITLE"),A=null==t?void 0:t.code,S=((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v;let p=[{title:t("COMMON_LATITUDE1_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.coordinates)||void 0===i?void 0:i.Latitude1)||"N/A"},{title:t("COMMON_LONGITUDE1_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.coordinates)||void 0===r?void 0:r.Longitude1)||"N/A"},{title:t("COMMON_LATITUDE2_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.coordinates)||void 0===s?void 0:s.Latitude2)||"N/A"},{title:t("COMMON_LONGITUDE2_LABEL"),value:(null==e||null===(c=e.nocDetails)||void 0===c||null===(m=c.additionalDetails)||void 0===m||null===(v=m.coordinates)||void 0===v?void 0:v.Longitude2)||"N/A"}];return{title:t("NOC_SITE_COORDINATES_LABEL"),values:p}})(s,i),N=((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v,p,f,E,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,x;let R=[{title:t("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.siteDetails)||void 0===i?void 0:i.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r||null===(u=r.specificationBuildingCategory)||void 0===u?void 0:u.name)||(null==e||null===(d=e.nocDetails)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.siteDetails)||void 0===c?void 0:c.specificationBuildingCategory)||"N/A"},{title:t("NOC_NOC_TYPE_LABEL"),value:(null==e||null===(m=e.nocDetails)||void 0===m||null===(v=m.additionalDetails)||void 0===v||null===(p=v.siteDetails)||void 0===p||null===(f=p.specificationNocType)||void 0===f?void 0:f.name)||(null==e||null===(E=e.nocDetails)||void 0===E||null===(_=E.additionalDetails)||void 0===_||null===(g=_.siteDetails)||void 0===g?void 0:g.specificationNocType)||"N/A"},{title:t("NOC_RESTRICTED_AREA_LABEL"),value:(null==e||null===(h=e.nocDetails)||void 0===h||null===(A=h.additionalDetails)||void 0===A||null===(S=A.siteDetails)||void 0===S||null===(N=S.specificationRestrictedArea)||void 0===N?void 0:N.code)||(null==e||null===(b=e.nocDetails)||void 0===b||null===(C=b.additionalDetails)||void 0===C||null===(y=C.siteDetails)||void 0===y?void 0:y.specificationRestrictedArea)||"N/A"},{title:t("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),value:(null==e||null===(D=e.nocDetails)||void 0===D||null===(O=D.additionalDetails)||void 0===O||null===(L=O.siteDetails)||void 0===L||null===(T=L.specificationIsSiteUnderMasterPlan)||void 0===T?void 0:T.code)||(null==e||null===(I=e.nocDetails)||void 0===I||null===(w=I.additionalDetails)||void 0===w||null===(x=w.siteDetails)||void 0===x?void 0:x.specificationIsSiteUnderMasterPlan)||"N/A"}];return{title:t("NOC_SPECIFICATION_DETAILS"),values:R}})(s,i),b=((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,v,p,f,E,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,x,R,P,F,B,M,k,U,H,W,j,z,V,G,Y,q,K,X,Q,J,Z,$,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,me,ve,pe,fe,Ee,_e,ge,he,Ae,Se,Ne,be,Ce,ye,De,Oe,Le,Te,Ie,we,xe,Re,Pe,Fe,Be;let Me=[{title:t("NOC_PLOT_NO_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(i=n.siteDetails)||void 0===i?void 0:i.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(o=e.nocDetails)||void 0===o||null===(a=o.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.proposedSiteAddress)||"N/A"},{title:t("NOC_ULB_NAME_LABEL"),value:(null==e||null===(u=e.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d||null===(s=d.siteDetails)||void 0===s||null===(c=s.ulbName)||void 0===c?void 0:c.name)||(null==e||null===(m=e.nocDetails)||void 0===m||null===(v=m.additionalDetails)||void 0===v||null===(p=v.siteDetails)||void 0===p?void 0:p.ulbName)||"N/A"},{title:t("NOC_ULB_TYPE_LABEL"),value:(null==e||null===(f=e.nocDetails)||void 0===f||null===(E=f.additionalDetails)||void 0===E||null===(_=E.siteDetails)||void 0===_?void 0:_.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(g=e.nocDetails)||void 0===g||null===(h=g.additionalDetails)||void 0===h||null===(A=h.siteDetails)||void 0===A?void 0:A.khasraNo)||"N/A"},{title:t("NOC_HADBAST_NO_LABEL"),value:(null==e||null===(S=e.nocDetails)||void 0===S||null===(N=S.additionalDetails)||void 0===N||null===(b=N.siteDetails)||void 0===b?void 0:b.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(C=e.nocDetails)||void 0===C||null===(y=C.additionalDetails)||void 0===y||null===(D=y.siteDetails)||void 0===D||null===(O=D.roadType)||void 0===O?void 0:O.name)||(null==e||null===(L=e.nocDetails)||void 0===L||null===(T=L.additionalDetails)||void 0===T||null===(I=T.siteDetails)||void 0===I?void 0:I.roadType)||"N/A"},{title:t("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),value:(null==e||null===(w=e.nocDetails)||void 0===w||null===(x=w.additionalDetails)||void 0===x||null===(R=x.siteDetails)||void 0===R?void 0:R.areaLeftForRoadWidening)||"N/A"},{title:t("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),value:(null==e||null===(P=e.nocDetails)||void 0===P||null===(F=P.additionalDetails)||void 0===F||null===(B=F.siteDetails)||void 0===B?void 0:B.netPlotAreaAfterWidening)||"N/A"},{title:t("NOC_NET_TOTAL_AREA_LABEL"),value:(null==e||null===(M=e.nocDetails)||void 0===M||null===(k=M.additionalDetails)||void 0===k||null===(U=k.siteDetails)||void 0===U?void 0:U.netTotalArea)||"N/A"},{title:t("NOC_ROAD_WIDTH_AT_SITE_LABEL"),value:(null==e||null===(H=e.nocDetails)||void 0===H||null===(W=H.additionalDetails)||void 0===W||null===(j=W.siteDetails)||void 0===j?void 0:j.roadWidthAtSite)||"N/A"},{title:t("NOC_DISTRICT_LABEL"),value:(null==e||null===(z=e.nocDetails)||void 0===z||null===(V=z.additionalDetails)||void 0===V||null===(G=V.siteDetails)||void 0===G||null===(Y=G.district)||void 0===Y?void 0:Y.name)||(null==e||null===(q=e.nocDetails)||void 0===q||null===(K=q.additionalDetails)||void 0===K||null===(X=K.siteDetails)||void 0===X?void 0:X.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(Q=e.nocDetails)||void 0===Q||null===(J=Q.additionalDetails)||void 0===J||null===(Z=J.siteDetails)||void 0===Z||null===($=Z.zone)||void 0===$?void 0:$.name)||(null==e||null===(ee=e.nocDetails)||void 0===ee||null===(te=ee.additionalDetails)||void 0===te||null===(le=te.siteDetails)||void 0===le?void 0:le.zone)||"N/A"},{title:t("NOC_SITE_WARD_NO_LABEL"),value:(null==e||null===(ne=e.nocDetails)||void 0===ne||null===(ie=ne.additionalDetails)||void 0===ie||null===(oe=ie.siteDetails)||void 0===oe?void 0:oe.wardNo)||"N/A"},{title:t("NOC_SITE_VILLAGE_NAME_LABEL"),value:(null==e||null===(ae=e.nocDetails)||void 0===ae||null===(re=ae.additionalDetails)||void 0===re||null===(ue=re.siteDetails)||void 0===ue?void 0:ue.villageName)||"N/A"},{title:t("NOC_SITE_COLONY_NAME_LABEL"),value:(null==e||null===(de=e.nocDetails)||void 0===de||null===(se=de.additionalDetails)||void 0===se||null===(ce=se.siteDetails)||void 0===ce?void 0:ce.colonyName)||"N/A"},{title:t("NOC_SITE_VASIKA_NO_LABEL"),value:(null==e||null===(me=e.nocDetails)||void 0===me||null===(ve=me.additionalDetails)||void 0===ve||null===(pe=ve.siteDetails)||void 0===pe?void 0:pe.vasikaNumber)||"N/A"},{title:t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),value:(null==e||null===(fe=e.nocDetails)||void 0===fe||null===(Ee=fe.additionalDetails)||void 0===Ee||null===(_e=Ee.siteDetails)||void 0===_e?void 0:_e.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(ge=e.nocDetails)||void 0===ge||null===(he=ge.additionalDetails)||void 0===he||null===(Ae=he.siteDetails)||void 0===Ae||null===(Se=Ae.buildingStatus)||void 0===Se?void 0:Se.name)||(null==e||null===(Ne=e.nocDetails)||void 0===Ne||null===(be=Ne.additionalDetails)||void 0===be||null===(Ce=be.siteDetails)||void 0===Ce?void 0:Ce.buildingStatus)||"N/A"}];var ke,Ue,He,We,je,ze,Ve,Ge,Ye,qe,Ke,Xe,Qe,Je,Ze,$e,et;return null!=e&&null!==(ye=e.nocDetails)&&void 0!==ye&&null!==(De=ye.additionalDetails)&&void 0!==De&&null!==(Oe=De.siteDetails)&&void 0!==Oe&&Oe.isBasementAreaAvailable&&Me.push({title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:(null==e||null===(ke=e.nocDetails)||void 0===ke||null===(Ue=ke.additionalDetails)||void 0===Ue||null===(He=Ue.siteDetails)||void 0===He||null===(We=He.isBasementAreaAvailable)||void 0===We?void 0:We.code)||(null==e||null===(je=e.nocDetails)||void 0===je||null===(ze=je.additionalDetails)||void 0===ze||null===(Ve=ze.siteDetails)||void 0===Ve?void 0:Ve.isBasementAreaAvailable)||"N/A"}),null!=e&&null!==(Le=e.nocDetails)&&void 0!==Le&&null!==(Te=Le.additionalDetails)&&void 0!==Te&&null!==(Ie=Te.siteDetails)&&void 0!==Ie&&Ie.basementArea&&Me.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:(null==e||null===(Ge=e.nocDetails)||void 0===Ge||null===(Ye=Ge.additionalDetails)||void 0===Ye||null===(qe=Ye.siteDetails)||void 0===qe?void 0:qe.basementArea)||"N/A"}),"Built UP"==(null==e||null===(we=e.nocDetails)||void 0===we||null===(xe=we.additionalDetails)||void 0===xe||null===(Re=xe.siteDetails)||void 0===Re?void 0:Re.buildingStatus)&&(null==e||null===(Ke=e.nocDetails)||void 0===Ke||null===(Xe=Ke.additionalDetails)||void 0===Xe||null===(Qe=Xe.siteDetails)||void 0===Qe||null===(Je=Qe.floorArea)||void 0===Je||Je.map((e,l)=>Me.push({title:Tt(l,t),value:null==e?void 0:e.value}))),"Built Up"==(null==e||null===(Pe=e.nocDetails)||void 0===Pe||null===(Fe=Pe.additionalDetails)||void 0===Fe||null===(Be=Fe.siteDetails)||void 0===Be?void 0:Be.buildingStatus)&&Me.push({title:t("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),value:(null==e||null===(Ze=e.nocDetails)||void 0===Ze||null===($e=Ze.additionalDetails)||void 0===$e||null===(et=$e.siteDetails)||void 0===et?void 0:et.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:Me}})(s,i),C=((e,t)=>{var l,n,i,o;return(null!=(l=null==e||null===(n=e.nocDetails)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.applicationDetails)||void 0===o?void 0:o.owners)?l:[]).map((e,l)=>{var n;return{title:0===l?"Primary Owner":"Owner "+(l+1)+" Details",values:[{title:t("NOC_FIRM_OWNER_NAME_LABEL"),value:(null==e?void 0:e.ownerOrFirmName)||"NA"},{title:t("NOC_APPLICANT_EMAIL_LABEL"),value:(null==e?void 0:e.emailId)||"NA"},{title:t("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),value:(null==e?void 0:e.fatherOrHusbandName)||"NA"},{title:t("NOC_APPLICANT_MOBILE_NO_LABEL"),value:(null==e?void 0:e.mobileNumber)||"NA"},{title:t("NOC_APPLICANT_DOB_LABEL"),value:null!=e&&e.dateOfBirth?new Date(e.dateOfBirth).toLocaleDateString("en-GB"):"NA"},{title:t("NOC_APPLICANT_GENDER_LABEL"),value:(null==e||null===(n=e.gender)||void 0===n?void 0:n.code)||"NA"},{title:t("NOC_APPLICANT_ADDRESS_LABEL"),value:(null==e?void 0:e.address)||"NA"},{title:t("NOC_APPLICANT_PROPERTY_ID_LABEL"),value:(null==e?void 0:e.propertyId)||"NA"}]}})})(s,i),y=((e,t)=>{var l;let n=[{title:t("CS_APPLICATION_NUMBER"),value:(null==e?void 0:e.applicationNo)||"N/A"},{title:t("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime,"dd/MM/yyyy")||"NA"}];return{title:t("CS_APPLICATION_DETAILS"),values:n}})(s,i);return Promise.resolve(function(e,t){try{var l;function n(l){var n;return{title:t("NOC_TITILE_DOCUMENT_UPLOADED"),values:(null==e||null===(n=e.documents)||void 0===n?void 0:n.length)>0?e.documents.map((e,n)=>{var i;return E(null==l?void 0:l.data,null==e?void 0:e.uuid),{title:t(null==e||null===(i=e.documentType)||void 0===i?void 0:i.replace(/\./g,"_"))||t("CS_NA")}}):{title:t("PT_NO_DOCUMENTS"),value:" "}}}const i=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.uuid),o=(null==i?void 0:i.length)>0;return Promise.resolve(o?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(n):n(o))}catch(e){return Promise.reject(e)}}(s,i)).then(function(e){return{t:i,tenantId:A,name:h,email:g,phoneNumber:_,heading:f,applicationNumber:p,details:[y,...c,...C,b,N,S,e],imageURL:m,ulbType:l,ulbName:n}})})}catch(e){return Promise.reject(e)}},wt=e=>{var l,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),m=i.useHistory(),v=null==s||null===(l=s.data)||void 0===l||null===(a=l.Noc)||void 0===a?void 0:a[0];window.localStorage.getItem("Employee.tenant-id"),console.log("nocData in Response",v);const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},_=d.split("/").pop();return n.createElement("div",null,n.createElement(t.Card,null,n.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==v||null===(r=v.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?n.createElement("div",null,n.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=Ot(function(){var e,t,l,n;const i=v,o=null==i||null===(e=i.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==o?void 0:o.ulbType,r=(null==o||null===(l=o.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==o?void 0:o.ulbName),u=E.find(e=>e.code===i.tenantId);return Promise.resolve(It(i,u,a,r,c)).then(function(e){Digit.Utils.pdf.generateFormatted(e)})},function(e){console.log("Eroor Occurred !!!",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})):null,n.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{m.push("/digit-ui/employee")}}),n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{m.push("/digit-ui/employee/noc/inbox")}}))))},xt=e=>{let{location:l}=e;const{t:i}=o.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:i("ES_COMMON_INBOX"),show:!(!l.pathname.includes("noc/inbox")&&!l.pathname.includes("noc/new-application"))},{path:"/digit-ui/employee/noc/new-application",content:i("NOC_NEW_APPLICATION"),show:!!l.pathname.includes("noc/new-application")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:i("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!l.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:i("ES_COMMON_APPLICATION_SEARCH"),show:!!l.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:i("NOC_APP_OVER_VIEW_HEADER"),show:!!l.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return n.createElement(t.BreadCrumb,{crumbs:a})},Rt=e=>{var a,r,u,d,s,m,v,p,f,E;let{path:_}=e;const g=i.useLocation(),h=(o.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),A=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NOCInbox"),S=null===(s=Digit)||void 0===s||null===(m=s.ComponentRegistryService)||void 0===m?void 0:m.getComponent("NewNOCStepperForm"),N=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview"),b=null===(f=Digit)||void 0===f||null===(E=f.ComponentRegistryService)||void 0===E?void 0:E.getComponent("NewNOCEditApplication"),C=window.location.href.includes("/response"),y=window.Digit.Utils.browser.isMobile();return n.createElement(l.Fragment,null,C?null:n.createElement("div",{style:window.location.href.includes("application-overview")||y?{marginLeft:"10px"}:{}},n.createElement(xt,{location:g})),n.createElement(i.Switch,null,n.createElement(t.PrivateRoute,{path:_+"/inbox/application-overview/:id",component:N}),n.createElement(t.PrivateRoute,{path:_+"/search/application-overview/:id",component:h}),n.createElement(t.PrivateRoute,{path:_+"/new-application",component:S}),n.createElement(t.PrivateRoute,{path:_+"/edit-application/:id",component:b}),n.createElement(t.PrivateRoute,{path:_+"/inbox",component:e=>n.createElement(A,c({},e,{parentRoute:_}))}),n.createElement(t.PrivateRoute,{path:_+"/search",component:e=>n.createElement(Dt,c({},e,{parentRoute:_}))}),n.createElement(t.PrivateRoute,{path:_+"/response/:id",component:wt})))},Pt=e=>{const[t,i]=l.useState(e.selectedVal?e.selectedVal:"");return l.useEffect(()=>{e.keepNull?i(""):e.selectedVal?i(e.selectedVal):(i(""),e.setFilter(""))},[e.selectedVal,e.forceSet]),n.createElement("input",{ref:e.inputRef,className:"employee-select-wrap--elipses "+(e.disable&&"disabled"),type:"text",value:t,onChange:function(t){e.freeze||(i(t.target.value),e.setFilter(t.target.value))},onClick:e.onClick,onFocus:function(){e.disable||e.dropdownDisplay(!0)},onBlur:t=>{var l;e.dropdownDisplay(!1),null==e||null===(l=e.onBlur)||void 0===l||l.call(e,t),e.selectedVal!==e.filterVal&&setTimeout(()=>{e.setforceSet(e=>e+1)},1e3)},onKeyDown:t=>{var l,n,i,o,a,r,u,d,s,c,m,v,p;if("ArrowDown"==t.key)e.setOptionIndex(t=>t+1==e.addProps.length?0:t+1),e.addProps.currentIndex+1==e.addProps.length?null==t||null===(l=t.target)||void 0===l||null===(n=l.parentElement)||void 0===n||null===(i=n.parentElement)||void 0===i||null===(o=i.children)||void 0===o||null===(a=o.namedItem("jk-dropdown-unique"))||void 0===a||null===(r=a.scrollTo)||void 0===r||r.call(a,0,0):(null==e||null===(u=e.addProps)||void 0===u?void 0:u.currentIndex)>2&&(null==t||null===(d=t.target)||void 0===d||null===(s=d.parentElement)||void 0===s||null===(c=s.parentElement)||void 0===c||null===(m=c.children)||void 0===m||null===(v=m.namedItem("jk-dropdown-unique"))||void 0===v||null===(p=v.scrollBy)||void 0===p||p.call(v,0,45)),t.preventDefault();else if("ArrowUp"==t.key){var f,E,_,g,h,A,S,N,b,C,y,D,O;e.setOptionIndex(t=>0!==t?t-1:e.addProps.length-1),0==e.addProps.currentIndex?null==t||null===(f=t.target)||void 0===f||null===(E=f.parentElement)||void 0===E||null===(_=E.parentElement)||void 0===_||null===(g=_.children)||void 0===g||null===(h=g.namedItem("jk-dropdown-unique"))||void 0===h||null===(A=h.scrollTo)||void 0===A||A.call(h,1e5,1e5):(null==e||null===(S=e.addProps)||void 0===S?void 0:S.currentIndex)>2&&(null==t||null===(N=t.target)||void 0===N||null===(b=N.parentElement)||void 0===b||null===(C=b.parentElement)||void 0===C||null===(y=C.children)||void 0===y||null===(D=y.namedItem("jk-dropdown-unique"))||void 0===D||null===(O=D.scrollBy)||void 0===O||O.call(D,0,-45)),t.preventDefault()}else"Enter"==t.key&&e.addProps.selectOption(e.addProps.currentIndex)},readOnly:e.disable,autoFocus:e.autoFocus,placeholder:e.placeholder,autoComplete:"off",style:c({},e.style,{zIndex:"auto"})})},Ft=e=>e,Bt=e=>{var i,o,a;const r=Digit.SessionStorage.get("userType"),[u,d]=l.useState(!1),[s,m]=l.useState(e.selected?e.selected:null),[v,p]=l.useState(""),[f,E]=l.useState(0),[_,g]=l.useState(-1),h=l.useRef(null),A=!!e.customSelector,S=e.t||Ft;function N(){if(!e.disable){var t,l=u;l||document.addEventListener("mousedown",b,!1),d(!l),null==e||null===(t=e.onBlur)||void 0===t||t.call(e)}}function b(e){h.current&&h.current.contains(e.target)||(document.removeEventListener("mousedown",b,!1),d(!1))}function C(t){t!==s||e.allowMultiselect?(e.select(t),m(t),d(!1)):(m(t),E(f+1))}l.useEffect(()=>{m(e.selected)},[e.selected]),console.log("option",e.option);let y=e.option&&(null===(i=e.option)||void 0===i?void 0:i.filter(t=>{var l,n;return(null===(l=S(t[e.optionKey]))||void 0===l||null===(n=l.toUpperCase())||void 0===n?void 0:n.indexOf(null==v?void 0:v.toUpperCase()))>-1}))||[];var D,O;return"PropertyType"==(null==e||null===(o=e.option)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.label)&&(y=e.option),e.isBPAREG&&s&&((null===(D=e.option)||void 0===D||null===(O=D.filter(e=>(null==e?void 0:e.code)===(null==s?void 0:s.code)))||void 0===O?void 0:O.length)>0||m(null)),n.createElement("div",{className:("employee"===r?"employee-select-wrap":"select-wrap")+" "+(null!=e&&e.className?null==e?void 0:e.className:""),style:c({},e.style)},A&&n.createElement("div",{className:e.showArrow?"cp flex-right column-gap-5":"cp",onClick:N},e.customSelector,e.showArrow&&n.createElement(t.ArrowDown,{onClick:N,className:e.disable&&"disabled"})),!A&&n.createElement("div",{className:(u?"select-active":"select")+" "+(e.disable&&"disabled"),style:e.errorStyle?{border:"1px solid red"}:{}},n.createElement(Pt,{autoComplete:e.autoComplete,setFilter:function(e){p(e)},forceSet:f,setforceSet:E,setOptionIndex:g,keepNull:e.keepNull,selectedVal:s?e.t?e.isMultiSelectEmp?s+" "+S("BPA_SELECTED_TEXT"):e.t(e.optionKey?s[e.optionKey]:s):e.optionKey?s[e.optionKey]:s:null,filterVal:v,addProps:{length:y.length,currentIndex:_,selectOption:function(e){C(y[e])}},dropdownDisplay:function(e){const t=setTimeout(()=>d(e),500);return()=>{clearTimeout(t)}},handleClick:b,disable:e.disable,freeze:!!e.freeze,autoFocus:e.autoFocus,placeholder:e.placeholder,onBlur:null==e?void 0:e.onBlur,inputRef:e.ref}),n.createElement(t.ArrowDown,{onClick:N,className:"cp",disable:e.disable})),u?e.optionKey?n.createElement("div",{id:"jk-dropdown-unique",className:(A?"margin-top-10 display: table":"")+" options-card",style:c({},e.optionCardStyles),ref:h},y&&y.map((t,l)=>(console.log("option",t),n.createElement("div",{className:"cp profile-dropdown--item display: flex ",style:l===_?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},key:l,onClick:()=>C(t)},t.icon&&n.createElement("span",{className:"icon"}," ",t.icon," "),e.isPropertyAssess?n.createElement("div",null,e.t?e.t(t[e.optionKey]):t[e.optionKey]):n.createElement("span",null," ",e.t?e.t(t[e.optionKey]):t[e.optionKey]),n.createElement("div",null,"(",e.t("COMMON_MASTERS_DESIGNATION_"+t.designation),")")))),y&&0===y.length&&n.createElement("div",{className:"cp profile-dropdown--item display: flex ",key:"-1",onClick:()=>{}},n.createElement("span",null," ",e.t?e.t("CMN_NOOPTION"):"CMN_NOOPTION"))):n.createElement("div",{className:"options-card",style:c({},e.optionCardStyles,{overflow:"scroll",maxHeight:"350px"}),id:"jk-dropdown-unique",ref:h},e.option.filter(e=>(null==e?void 0:e.toUpperCase().indexOf(null==v?void 0:v.toUpperCase()))>-1).map((e,t)=>n.createElement("p",{key:t,style:t===_?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},onClick:()=>C(e)},e))):null)},Mt=e=>n.createElement("h1",{className:"heading-m"},e.label),kt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ut=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(kt,null)),Ht=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:g}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,A]=l.useState({}),[S,N]=l.useState({}),[b,C]=l.useState([]),[y,D]=l.useState(null),[O,L]=l.useState(null),[T,I]=l.useState(null),[w,x]=l.useState(null),[R,P]=l.useState([]),[F,B]=l.useState(null),[M,k]=l.useState(!1);function U(e){L(e.target.files[0])}return l.useEffect(()=>{var e;g&&g["egf-master"]&&P(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),l.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),l.useEffect(()=>{!function(){try{x(null);const e=function(){if(O){const e=function(){if(O.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",O,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("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)}}()},[O]),l.useEffect(()=>{r&&A(null!=r&&r.showFinancialYearsModal?(e=>{let{t:l,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:l("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:n.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:F,setSelectedFinancialYear:B}):(e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(m||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:y,setSelectedApprover:D,selectFile:U,uploadedFile:T,setUploadedFile:I,businessService:v}))},[r,b,R,F,T]),r&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Mt,{label:a(h.label.heading)}),headerBarEnd:n.createElement(Ut,{onClick:d}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F:E||(null==r?void 0:r.docUploadRequired)&&!T,formId:"modal-action"},_?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};m.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:c({},m,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==F?void 0:F.name,propertyId:null==m?void 0:m.propertyId,tenantId:u,source:null==m?void 0:m.source,channel:null==m?void 0:m.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==O?void 0:O.name,fileStoreId:T}]),s({Property:c({},m,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):n.createElement(t.Loader,null)},Wt=e=>n.createElement("h1",{className:"heading-m"},e.label),jt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),zt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(jt,null)),Vt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;console.log("ActionModalActions: ",r);const{data:p}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,g]=l.useState({}),[h,A]=l.useState({}),[S,N]=l.useState([]),[b,C]=l.useState({}),[y,D]=l.useState(null),[O,L]=l.useState(null),[T,I]=l.useState(null),[w,x]=l.useState([]),[R,P]=l.useState(null);l.useEffect(()=>{var e;E&&E["egf-master"]&&x(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:F}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function B(e){D(e.target.files[0])}return l.useEffect(()=>{if(p&&F){var e;const t=F["common-masters"].Department;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),l.useEffect(()=>{!function(){try{I(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",y,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("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)}}()},[y]),l.useEffect(()=>{r&&g((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:m?l("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:C,selectFile:B,uploadedFile:O,setUploadedFile:L,businessService:v}))},[r,S,w,R,O]),r&&_.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Wt,{label:a(_.label.heading)}),headerBarEnd:n.createElement(zt,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){m=c({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:null}),s({Licenses:[m]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},Gt=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Yt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),qt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Yt,null)),Kt=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)});console.log(p,"DEKHO");const[E,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState({}),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t,l,n,i,o,r;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:(null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.designation)||"N/A",displayName:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" ("+(a(null==e||null===(o=e.assignments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.designation)||"N/A")+")"}}))},[p]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{r&&_((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"SEND_BACK_TO_CITIZEN"!=(null==i?void 0:i.action)||(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?l("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:v?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?n.createElement(Bt,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a,t:l}):null},{label:l("WF_COMMON_COMMENTS")+"*",type:"textarea",populators:{name:"comments"}},{label:l("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:w,uploadedFile:D,setUploadedFile:O,businessService:v,error:L}))},[r,A,D,L]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Gt,{label:a(E.label.heading)}),headerBarEnd:n.createElement(qt,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){m=c({},m,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null,wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null}),console.log("action",r),console.log("applicationData",m),s({Licenses:[m]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},Xt=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Qt=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Qt,null)),Zt=e=>{var i,o,a,u,d,s,m,v,p,f,E,_,g,h,A,S,N,b;let{t:C,action:y,tenantId:D,closeModal:O,submitAction:L,applicationDetails:T,applicationData:I,businessService:w,workflowDetails:x,blockReason:R}=e;console.log("applicationData_BPAACTIONMODAL",I);const P=[...new Set(null==x||null===(i=x.data)||void 0===i||null===(o=i.initialActionState)||void 0===o||null===(a=o.nextActions)||void 0===a||null===(u=a.find(e=>(null==e?void 0:e.action)===(null==y?void 0:y.action)))||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.flatMap(e=>e.roles||[]))];console.log("workflowDetails_BPAACTIONMODAL",x,P,y),Digit.Hooks.obps.useObpsAPI(null!==(s=I)&&void 0!==s&&null!==(m=s.landInfo)&&void 0!==m&&null!==(v=m.address)&&void 0!==v&&v.city?null===(p=I)||void 0===p||null===(f=p.landInfo)||void 0===f||null===(E=f.address)||void 0===E?void 0:E.city:D,!1);const{data:F,isLoading:B}=Digit.Hooks.useEmployeeSearch(D,{roles:null==P?void 0:P.map(e=>({code:e})),zones:null===(_=I)||void 0===_||null===(g=_.additionalDetails)||void 0===g?void 0:g.zonenumber,categories:null===(h=I)||void 0===h||null===(A=h.additionalDetails)||void 0===A?void 0:A.categories,subcategories:null===(S=I)||void 0===S||null===(N=S.additionalDetails)||void 0===N?void 0:N.subcategories,assignedtenattids:null===(b=I)||void 0===b?void 0:b.tenantId,isActive:!0},{enabled:!(null!=y&&y.isTerminateState)});console.log("approverData",F),r.useQueryClient();const[M,k]=l.useState({}),[U,H]=l.useState({}),[W,j]=l.useState([]),[z,V]=l.useState([]),[G,Y]=l.useState({}),[q,K]=l.useState({}),[X,Q]=l.useState(null),[J,Z]=l.useState(null),[$,ee]=l.useState(null),[te,le]=l.useState(null),ne=!!Digit.Utils.browser.isMobile();function ie(e){Q(e.target.files[0])}l.useEffect(()=>{var e;j(null==F||null===(e=F.Employees)||void 0===e?void 0:e.map(e=>{var t,l,n;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name,designation:null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.designation}}))},[F]),l.useEffect(()=>{!function(){try{ee(null);const e=function(){if(X){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(X.size>=5242880)ee(C("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=X&&X.type&&!e.test(null==X?void 0:X.type))ee(C("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",X,Digit.ULBService.getStateId()||(null==D?void 0:D.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?Z(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):ee(C("CS_FILE_UPLOAD_ERROR"))})},function(){ee(C("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)}}()},[X]);const oe=e=>{let t=[];return e&&e.map((e,l)=>{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},ae=e=>{let t=[];var l;for(l=0;l<(null==e?void 0:e.questionLength);l++){var n;t.push({remarks:e["Remarks_"+l],question:null==e?void 0:e.questionList[l].question,value:null==e||null===(n=e["question_"+l])||void 0===n?void 0:n.code})}return t},re=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:oe(e.Documents),date:e.InspectionDate,questions:ae(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},ue=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),l=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let n=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return n=null===(e=n)||void 0===e?void 0:e.concat(null!==l?l.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),n};return l.useEffect(()=>{V(null==R?void 0:R.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),y&&k((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectedBlockReason:d,setBlockReason:s,selectFile:c,uploadedFile:m,setUploadedFile:v,assigneeLabel:p,businessService:f,error:E,blockReasonFiltered:_}=e,g=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(g=!0),console.log("actionInModal",o),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+f+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||g||"BLOCK"==(null==o?void 0:o.action)||"VERIFY"==(null==o?void 0:o.action)||"SEND_FOR_INSPECTION_REPORT"==(null==o?void 0:o.action)||"ESIGN"==(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||g||"BLOCK"==(null==o?void 0:o.action)||"VERIFY"==(null==o?void 0:o.action)||"SEND_FOR_INSPECTION_REPORT"==(null==o?void 0:o.action)||"ESIGN"==(null==o?void 0:o.action)?null:n.createElement(Bt,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r,t:i})},{label:"BLOCK"==(null==o?void 0:o.action)?i("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==o?void 0:o.action)?n.createElement(t.Dropdown,{option:_,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:d,isMandatory:!0}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{v(null)},message:m?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:E})}]}]}})({t:C,action:y,approvers:W,selectedApprover:G,setSelectedApprover:Y,selectedBlockReason:q,setBlockReason:K,selectFile:ie,uploadedFile:J,setUploadedFile:Z,businessService:w,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:$,blockReasonFiltered:z}))},[y,W,te,J,$]),y&&M.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Xt,{label:C(M.label.heading)}),headerBarEnd:n.createElement(Jt,{onClick:O}),actionCancelLabel:C(M.label.cancel),actionCancelOnSubmit:O,actionSaveLabel:C(M.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:ne?{width:"720px"}:{},style:ne?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:ne?{paddingLeft:"5px"}:{}},B?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:M.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a,r,u,d,s,m,v,p,f,E,_,g,h,A,S,N,b,D,w,R,P,F,B,M,k,U,H,W,j,z,V,Y,K,Q,Z,$,ee;if(I=c({},I,{documents:null===(t=I)||void 0===t?void 0:t.documents,additionalDetails:c({},null===(l=I)||void 0===l?void 0:l.additionalDetails,{fieldinspection_pending:re(I),pendingapproval:ue(),blockingReason:null==q?void 0:q.name}),workflow:{action:null==y?void 0:y.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null!=q&&q.name?(null==q?void 0:q.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,comments:(null==e||null===(i=e.comments)||void 0===i?void 0:i.length)>0?null!=q&&q.name?(null==q?void 0:q.name)+" - "+(null==e?void 0:e.comments):null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==x||null===(o=x.data)||void 0===o||null===(a=o.processInstances)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.state)||void 0===u?void 0:u.applicationStatus)?[null==x||null===(d=x.data)||void 0===d||null===(s=d.processInstances)||void 0===s||null===(m=s[0])||void 0===m||null===(v=m.assigner)||void 0===v?void 0:v.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==x||null===(p=x.data)||void 0===p||null===(f=p.processInstances)||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.state)||void 0===_?void 0:_.applicationStatus)?[null==x||null===(g=x.data)||void 0===g||null===(h=g.processInstances)||void 0===h||null===(A=h[0])||void 0===A||null===(S=A.assigner)||void 0===S?void 0:S.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,varificationDocuments:J?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==X?void 0:X.name,fileStoreId:J}]:null},action:null==y?void 0:y.action,riskType:null===(N=I)||void 0===N||null===(b=N.additionalDetails)||void 0===b?void 0:b.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==x||null===(D=x.data)||void 0===D||null===(w=D.processInstances)||void 0===w||null===(R=w[0])||void 0===R||null===(P=R.state)||void 0===P?void 0:P.applicationStatus)?[null==x||null===(F=x.data)||void 0===F||null===(B=F.processInstances)||void 0===B||null===(M=B[0])||void 0===M||null===(k=M.assigner)||void 0===k?void 0:k.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,wfDocuments:J?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==X?void 0:X.name,fileStoreId:J}]:null}),parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(U=I)||void 0===U||null===(H=U.additionalDetails)||void 0===H||null===(W=H.selfCertificationCharges)||void 0===W?void 0:W.BPA_MALBA_CHARGES)+parseInt(null===(j=I)||void 0===j||null===(z=j.additionalDetails)||void 0===z||null===(V=z.selfCertificationCharges)||void 0===V?void 0:V.BPA_LABOUR_CESS)+parseInt(null===(Y=I)||void 0===Y||null===(K=Y.additionalDetails)||void 0===K||null===(Q=K.selfCertificationCharges)||void 0===Q?void 0:Q.BPA_WATER_CHARGES)+parseInt(null===(Z=I)||void 0===Z||null===($=Z.additionalDetails)||void 0===$||null===(ee=$.selfCertificationCharges)||void 0===ee?void 0:ee.BPA_GAUSHALA_CHARGES_CESS))O(),alert(C("Enterd Less Adjustment amount is invalid"));else{var te,le;const e=null==T||null===(te=T.nocData)||void 0===te?void 0:te.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:c({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}}),t={};let l=!0,n=!0;null==t||null===(le=t.Noc)||void 0===le||le.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=l&&1!=n||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(n=!1))});let i=[];e&&e.map(e=>{var t,o,a,r,u,d,s,c,m,v,p,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.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===(m=e.Noc)||void 0===m||null===(v=m.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(p=e.Noc)||void 0===p?void 0:p.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&n)&&i.push(e)}),L({BPA:I},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:U,formId:"modal-action"})):n.createElement(t.Loader,null)},$t=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),el=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),tl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(el,null)),ll=e=>{var o,a,u,d,s,m,v;let{t:p,action:f,tenantId:E,closeModal:_,submitAction:g,applicationData:h,businessService:A}=e;const{data:S,isLoading:N}=Digit.Hooks.useEmployeeSearch(E,{roles:null===(o=workflowDetails)||void 0===o||null===(a=o.data)||void 0===a||null===(u=a.initialActionState)||void 0===u||null===(d=u.nextActions)||void 0===d||null===(s=d.filter(e=>(null==e?void 0:e.action)==(null==f?void 0:f.action)))||void 0===s||null===(m=s[0])||void 0===m||null===(v=m.assigneeRoles)||void 0===v?void 0:v.map(e=>({code:e})),isActive:!0},{enabled:!(null!=f&&f.isTerminateState)}),[b,C]=(r.useQueryClient(),l.useState({})),[y,D]=l.useState({}),[O,L]=l.useState([]),[T,I]=l.useState({}),[w,x]=l.useState(null),[R,P]=l.useState(null),[F,B]=l.useState(null),M=!!Digit.Utils.browser.isMobile();function k(e){x(e.target.files[0])}return i.useHistory(),l.useEffect(()=>{var e;L(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]),l.useEffect(()=>{!function(){try{B(null);const e=function(){if(w){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(w.size>=5242880)B(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=w&&w.type&&!e.test(null==w?void 0:w.type))B(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",w,Digit.ULBService.getStateId()||(null==E?void 0:E.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(p("CS_FILE_UPLOAD_ERROR"))})},function(){B(p("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)}}()},[w]),l.useEffect(()=>{f&&C((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(m||"WF_ROLE_"+(null===(l=o.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:o.isTerminateState||E?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:f,approvers:O,selectedApprover:T,setSelectedApprover:I,selectFile:k,uploadedFile:R,setUploadedFile:P,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:F}))},[f,O,R,F]),f&&b.form?n.createElement(t.Modal,{headerBarMain:n.createElement($t,{label:p(b.label.heading)}),headerBarEnd:n.createElement(tl,{onClick:_}),actionCancelLabel:p(b.label.cancel),actionCancelOnSubmit:_,actionSaveLabel:p(b.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:M?{width:"720px"}:{},style:M?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:M?{paddingLeft:"5px"}:{}},N?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:b.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=h)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=h)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),h=c({},h,{workflow:{action:null==f?void 0:f.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:R?[{documentType:(null==f?void 0:f.action)+" DOC",fileName:null==w?void 0:w.name,fileStoreId:R}]:null},documents:o}),g({Noc:h},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):n.createElement(t.Loader,null)},nl=e=>n.createElement("h1",{className:"heading-m"},e.label),il=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ol=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(il,null)),al=function(e,t){void 0===t&&(t="dayend");try{const l=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),n=new Date(Date.UTC(l[1],l[2]-1,l[3]));return n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),"dayend"===t&&(n.setHours(n.getHours()+24),n.setSeconds(n.getSeconds()-1)),n.getTime()}catch(t){return e}},rl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;const{data:p,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState({}),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function x(e){y(e.target.files[0])}return l.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]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))T(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),T(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{var e,l,i,o;"DisconnectWSConnection"==(null===(e=m)||void 0===e||null===(l=e.processInstance)||void 0===l?void 0:l.businessService)||"DisconnectSWConnection"==(null===(i=m)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:m,businessService:v,error:p}=e,f=!0,E=!1;return(null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,l)=>n.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},l))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{m(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:x,uploadedFile:D,setUploadedFile:O,businessService:v,error:L})):r&&_((e=>{var l;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,p=!0;return(null!=o&&null!==(l=o.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(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==m?void 0:m.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:x,uploadedFile:D,setUploadedFile:O,businessService:v,error:L}))},[r,A,D,L]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(nl,{label:a(E.label.heading)}),headerBarEnd:n.createElement(ol,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,d,v,p,f;if(null!==(t=m)&&void 0!==t&&t.isBillAmend){var E,_,g,h,A,S,b,y,O;const t=c({},null===(E=m)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),l=c({},null===(g=m)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(h=m)||void 0===h||null===(A=h.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=m)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(y=m)&&void 0!==y&&null!==(O=y.applicationType)&&void 0!==O&&O.includes("WATER")?"WS":"SW",assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]}});s({AmendmentUpdate:l})}else{if(m=c({},m,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=N&&N.uuid?[null==N?void 0:N.uuid]:[],assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null,processInstance:c({},null===(l=m)||void 0===l?void 0:l.processInstance,{action:null==r?void 0:r.action,assignes:null!=N&&N.uuid?[{uuid:null==N?void 0:N.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:[]})}),null!=e&&e.date&&null!==(n=m)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=gt(null==e?void 0:e.date);m.disconnectionExecutionDate=al(t)}else if(null!=e&&e.date){const t=gt(null==e?void 0:e.date);m.connectionExecutionDate=al(t)}var L;if("DisconnectWSConnection"==(null===(o=m)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=m)||void 0===d||null===(v=d.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(L=m)||void 0===L?void 0:L.serviceType)?s({WaterConnection:m,disconnectRequest:!0}):s({SewerageConnection:m,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(p=m)||void 0===p?void 0:p.applicationType))s({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=m)||void 0===f?void 0:f.applicationType))s({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!0});else{var T,I,w,x,R,P,F,B,M,k,U,H,W;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(T=t.value)&&void 0!==T&&T.adhocPenalty&&(m.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(m.additionalDetails.adhocPenaltyComment=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(m.additionalDetails.adhocPenaltyReason=(null==t||null===(P=t.value)||void 0===P?void 0:P.adhocPenaltyReason)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebate&&(m.additionalDetails.adhocRebate=parseInt(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(m.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&&(m.additionalDetails.adhocRebateReason=(null==t||null===(H=t.value)||void 0===H?void 0:H.adhocRebateReason)||""),"WATER"==(null===(W=m)||void 0===W?void 0:W.serviceType)?s({WaterConnection:m,disconnectRequest:!1,reconnectRequest:!1}):s({SewerageConnection:m,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},ul=e=>n.createElement("h1",{className:"heading-m"},e.label),dl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),sl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(dl,null)),cl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState(null),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),[I,w]=l.useState(!1);function x(e){y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("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]),l.useEffect(()=>{r&&_((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:"WF_"+(null==l?void 0:l.action)+"_APPLICATION",submit:"WF_"+n+"_"+(null==l?void 0:l.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:x,uploadedFile:D,setUploadedFile:O,businessService:v}))},[r,A,D]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ul,{label:a(E.label.heading)}),headerBarEnd:n.createElement(sl,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};m.creationReason="CREATE",s({PetRegistrationApplications:[c({},m,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};t.assignes=null!=r&&r.isTerminateState||!N?[]:[N],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),s({PetRegistrationApplications:[c({},m,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},ml=e=>n.createElement("h1",{className:"heading-m"},e.label),vl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(vl,null)),fl=e=>{var i,o,a;let{t:r,action:u,closeModal:d,submitAction:s,applicationData:m,businessService:v}=e;const p=Digit.ULBService.getStateId(),{data:f,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(p,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",m);const[_,g]=l.useState({}),[h,A]=l.useState({}),[S,N]=l.useState([]),[b,C]=l.useState(""),[y,D]=l.useState([]),[O,L]=l.useState(null),T=null===(o=m)||void 0===o||null===(a=o.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",T);const I=l.useMemo(()=>{var e;if(E||!f||!T.length)return[];const t=new Set(T.map(e=>e.tradeType)),l=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",l),l?["1"]:["1","2","3"]},[E,f,T]);return console.log("years",I),l.useEffect(()=>{u&&g((e=>{let{t:l,action:i,years:o,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:l("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:o,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:C,businessService:v}))},[u,I,y,O]),u&&_.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ml,{label:r(_.label.heading)}),headerBarEnd:n.createElement(pl,{onClick:d}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=null===(t=m)||void 0===t?void 0:t.financialYear;const n=null==l?void 0:l.split("-")[1],i="20"+Number(n)+"-"+(Number(n)+1);m=c({},m,{financialYear:i,action:"INITIATE",additionalDetail:c({},m.additionalDetail,{validityYears:b.length>0?parseInt(b):""})}),s({Licenses:[m]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},El=e=>n.createElement("h1",{className:"heading-m"},e.label),_l=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),gl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(_l,null)),hl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState(null),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),[I,w]=l.useState(!1);function x(e){w(!0),y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Lt(function(){return Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(w(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,m),l.useEffect(()=>{_((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const m=()=>n.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:l("SV_ASSIGNEE"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:u,t:l,optionKey:"name",select:s,selected:d})},{label:l("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:l("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:c?n.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},n.createElement(m,null),n.createElement("span",null,"Uploading...")):a?"1 "+l("SV_FILE_UPLOADED"):l("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:x,uploadedFile:D,setUploadedFile:O,businessService:v,isUploading:I}))},[r,A,D]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(El,{label:a(E.label.heading)}),headerBarEnd:n.createElement(gl,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==m||null===(t=m.auditDetails)||void 0===t?void 0:t.createdBy]:null!=N&&N.uuid?[null==N?void 0:N.uuid]:null};D&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),s({streetVendingDetail:c({},m,{workflow:l})})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},Al=e=>n.createElement("h1",{className:"heading-m"},e.label),Sl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Nl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Sl,null)),bl=e=>{var i,o;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:m,businessService:v,moduleCode:p}=e;console.log("applicationData",m);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=l.useState({}),[g,h]=l.useState({}),[A,S]=l.useState([]),[N,b]=l.useState(null),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),[I,w]=l.useState(!1);function x(e){y(e.target.files[0])}return l.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)T(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?O(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(a("CS_FILE_UPLOAD_ERROR"))})},function(){T(a("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]),l.useEffect(()=>{r&&_((e=>{let{t:l,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:l("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:l("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+l("ES_CHB_ACTION_FILEUPLOADED"):l("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:N,setSelectedApprover:b,selectFile:x,uploadedFile:D,setUploadedFile:O,businessService:v}))},[r,A,D]),r&&E.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Al,{label:a(E.label.heading)}),headerBarEnd:n.createElement(Nl,{onClick:d}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:p};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),s({hallsBookingApplication:[c({},m,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):n.createElement(t.Loader,null)},Cl=e=>n.createElement("h1",{className:"heading-m"},e.label),yl=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Dl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(yl,null)),Ol=e=>{var o,a,r;let{t:u,action:d,tenantId:s,closeModal:m,submitAction:v,applicationData:p,businessService:f,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(o=d.roles)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),g=i.useHistory(),[h,A]=l.useState({}),[S,N]=l.useState({}),[b,C]=l.useState([]),[y,D]=l.useState(null),[O,L]=l.useState(null);return l.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),l.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==p?void 0:p.applicationNo)):A((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:"WF_"+(null==l?void 0:l.action)+"_APPLICATION",submit:"WF_"+n+"_"+(null==l?void 0:l.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:d,approvers:b,selectedApprover:y,setSelectedApprover:D,uploadedFile:O,setUploadedFile:L,businessService:f}))},[d,b,O]),d&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Cl,{label:u(h.label.heading)}),headerBarEnd:n.createElement(Dl,{onClick:m}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:m,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:h.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:f,moduleName:E};O&&(t.documents=[]),v({Asset:c({},p,{workflow:t})})},defaultValues:S,formId:"modal-action"})):n.createElement(t.Loader,null)},Ll=e=>null!=e&&e.businessService.includes("PT")?n.createElement(Ht,e):null!=e&&e.businessService.includes("ptr")?n.createElement(cl,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?n.createElement(Vt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?n.createElement(fl,e):null!=e&&e.moduleCode.includes("BPAREG")?n.createElement(Kt,e):null!=e&&e.moduleCode.includes("BPA")?n.createElement(Zt,e):null!=e&&e.moduleCode.includes("NOC")?n.createElement(ll,e):null!=e&&e.moduleCode.includes("WS")?n.createElement(rl,e):null!=e&&e.businessService.includes("street-vending")?n.createElement(hl,e):null!=e&&e.businessService.includes("chb")?n.createElement(bl,e):null!=e&&e.businessService.includes("asset-create")?n.createElement(Ol,e):void 0;function Tl(e){let{documents:l,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=o.useTranslation(),s=window.location.href.includes("stakeholder");return n.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!s&&(null==l?void 0:l.map((e,i)=>{var o,s,c;return n.createElement(n.Fragment,{key:i},n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},n.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((l,i)=>{var o;return n.createElement("div",{style:{width:"180px"}},n.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),n.createElement("a",{target:"_",href:null==l?void 0:l.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},n.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==l?void 0:l.title)),a?null!=l&&null!==(o=l.documentType)&&void 0!==o&&o.includes("NOC")?n.createElement("p",{style:{textAlign:"center"}},d(null==l?void 0:l.documentType.split(".")[1])):n.createElement("p",{style:{textAlign:"center"}},d(null==l?void 0:l.documentType)):""))}):!window.location.href.includes("citizen")&&n.createElement("div",null,n.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),n.createElement("div",{style:{width:"180px"}},n.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),n.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},n.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),a?(null!==(s=value)&&void 0!==s&&null!==(c=s.documentType)&&void 0!==c&&c.includes("NOC"),n.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==l?void 0:l.length)!=i+1?n.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==l?void 0:l.map((e,l)=>{var o;return n.createElement(n.Fragment,{key:l},null!=e&&e.title?n.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,n.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,l)=>n.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:l},n.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?n.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,n.createElement(t.PDFSvg,null),n.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")&&n.createElement("div",null,n.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Il=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(t=d.data)||void 0===t?void 0:t.nextActions)||[],m=Digit.ULBService.getStateId(),[v,p]=l.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=l.useState(null),[_,g]=l.useState([]),[h,A]=l.useState(!0),[S,N]=l.useState(!1),[b,C]=l.useState(!1),{isLoading:y,data:D}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:O,data:L}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return l.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==L||null===(t=L["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0])+"."+(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),g(d)},[!y,!O]),l.useEffect(()=>{let e=0;_.map(t=>{let l=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(l=!0)}),!l&&t.required&&(e+=1)}),A("0"!=e&&0!=e||!(v.length>0))},[v,S]),l.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),n.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==_?void 0:_.map((e,t)=>n.createElement("div",{style:{padding:"20px"}},n.createElement(wl,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:N,applicationStatus:s,actions:c,bpaTaxDocuments:_,checkEnablingDocs:b}))))};function wl(e){var i,o;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:m,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==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[E,_]=l.useState(p?c({},p,{active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[g,h]=l.useState(null),[A,S]=l.useState(()=>(null==p?void 0:p.fileStoreId)||null),[N,b]=l.useState([]);return l.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==A?void 0:A.length)||null===A?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==E?void 0:E.code,fileStoreId:A,documentUid:A,fileName:(null==g?void 0:g.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[A,E]),l.useEffect(()=>{try{N.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],N.map(e=>{var t,l,n;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),m[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(m)))}catch(e){Promise.reject(e)}},[N,E]),l.useEffect(()=>{},[g]),n.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&n.createElement(Tl,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?n.createElement("div",{style:{marginTop:"20px"}},n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),n.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),n.createElement(t.LabelFieldPair,{style:{width:"100%"}},n.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&b(n),(i=n[n.length-1])&&h(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function xl(e){let{fiReport:l,isCitizen:i=!1}=e;const{t:a}=o.useTranslation();return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginTop:"10px"}},n.createElement(i?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),l.map((e,i)=>{var o,r,u,d,s,c;return n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},n.createElement(t.StatusTable,null,n.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==l?void 0:l.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+a("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=>n.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},n.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),n.createElement(Tl,{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 Rl(e){let{t:i,document:o,setNocDocuments:a,setError:r,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==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[c,m]=l.useState(),[v,p]=l.useState(null),[f,E]=l.useState(()=>(null==d?void 0:d.fileStoreId)||null);return l.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const l=null==e?void 0:e.filter(e=>{var t,l;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code)});return 0===(null==f?void 0:f.length)||null===f?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),l.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=Ot(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,l,n,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?E(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),n.createElement("div",{style:{}},n.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},n.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&p(n.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Pl=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const m=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",p=(null==c||null===(i=c.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[g,h]=l.useState([]),[A,S]=l.useState([]),[N,b]=l.useState(!1),[C,y]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,O]=l.useState(null),L=window.location.href.includes("/employee/");return l.useEffect(()=>{var e;h(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),l.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;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===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(n[0].docTypes[0]));let m=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),m.push(e)}),S(m))},[f,g]),l.useEffect(()=>{b("NOC_VERIFICATION_INPROGRESS"===v&&(null==p?void 0:p.length)>0)},[d,c]),n.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:L?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,l)=>{if(null!=e&&e.value)return n.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:L?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:L?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),n.createElement(Tl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),N&&(null==A?void 0:A.map((e,t)=>n.createElement(Rl,{key:t,document:e,t:o,error:D,setError:O,setNocDocuments:y,nocDocuments:C,checkEnablingDocs:N}))))},Fl=e=>{let{permissions:i,t:o}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[d,s,m]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);l.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return n.createElement("div",null,n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,l)=>n.createElement(t.CheckBox,{key:l,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,l)=>{const n=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>l===t?c({},e,{checked:n}):e))})(e,0,l),isLabelFirst:!0,index:l})),null==d?void 0:d.map((e,l)=>n.createElement("div",null,n.createElement(t.TextInput,{key:l,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,l),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),n.createElement(t.LinkButton,{label:n.createElement("div",null,n.createElement("span",null,n.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])})(l)}))),n.createElement(t.LinkButton,{style:{maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Bl(e){let{taxHeadEstimatesCalculation:l}=e;const{taxHeadEstimates:i}=l,{t:a}=o.useTranslation();return n.createElement("div",{style:{marginTop:"40px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,l)=>n.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:l===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),n.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),n.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==l?void 0:l.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ml(e){let{floors:l}=e;const{t:i}=o.useTranslation();return n.createElement(n.Fragment,null,l.map(e=>{var l;return n.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(l=e.values)||void 0===l?void 0:l.map((e,l)=>{var o;return n.createElement(n.Fragment,{key:l},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==l?"16px":"revert"}},i(e.title)),n.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},n.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,l)=>{var o;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:n.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:l===(null==e||null===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function kl(e){let{owners:l}=e,i={};i=window.location.href.includes("/employee/pt/")?l.slice().reverse():l;const{t:a}=o.useTranslation(),r=(null==l?void 0:l.length)||1;let u={marginTop:"19px"},d={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",minWidth:"280px",width:"100%"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u=c({},u,{maxWidth:"950px"}),u=c({},u,{maxWidth:"950px"}),s={}),l.sort((e,t)=>{var l,n;return(null==e||null===(l=e.additionalDetails)||void 0===l?void 0:l.ownerSequence)-(null==t||null===(n=t.additionalDetails)||void 0===n?void 0:n.ownerSequence)}),n.createElement(n.Fragment,null,n.createElement("div",{className:"owner-details"},i.map((e,l)=>{var i;return n.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},n.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(l+1):a(null==e?void 0:e.title)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:d},n.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return!0===e.map&&"N/A"!==e.value?n.createElement(t.Row,{key:a(e.title),label:a(e.title),text:n.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):n.createElement("span",null,n.createElement(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Ul=e=>{var i,a;let{scrutinyDetails:r,paymentsList:u=[],additionalDetails:d,applicationData:s}=e;(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==s?void 0:s.status))&&window.location.href.includes("bpa");const[c,m]=l.useState(),[v,p]=l.useState(),[f,E]=l.useState(),_=Digit.ULBService.getStateId(),[g,h]=l.useState(),[A,S]=l.useState(),[N,b]=l.useState([]),[C,y]=l.useState(),[D,O]=l.useState(""),[L,T]=l.useState(null),[I,w]=l.useState({}),[x,R]=l.useState(!1),[P,F]=l.useState(!1);l.useEffect(()=>{!function(){try{T(null);const e=function(){if(C&&null!=C&&C.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==C||null===(t=C.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(C.size>=2e6)T(B("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?b([...N,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):T(B("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else T(B("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),l.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(N))},[N]),l.useEffect(()=>{var e,t,l,n,i,o,a;if(null!=d&&null!==(e=d.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==d?void 0:d.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i;return t===(null==d||null===(l=d.lessAdjustmentFeeFiles)||void 0===l?void 0:l.length)-1?null==d||null===(n=d.lessAdjustmentFeeFiles[(null==d||null===(i=d.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,_).then(e=>w(null==e?void 0:e.data))}m(null==d||null===(t=d.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==d||null===(l=d.selfCertificationCharges)||void 0===l?void 0:l.BPA_DEVELOPMENT_CHARGES),p(null==d||null===(n=d.selfCertificationCharges)||void 0===n?void 0:n.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==d||null===(i=d.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),E(null==d||null===(o=d.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==d||null===(a=d.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),h(null==d?void 0:d.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==d?void 0:d.otherFeesDiscription),b(null==d?void 0:d.lessAdjustmentFeeFiles)},[d]);const{t:B}=o.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?n.createElement("span",{style:{color:"#00703C"}},B(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?B(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void B("NA");return n.createElement(l.Fragment,null,!(null!=r&&r.isChecklist)&&n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},n.createElement(t.StatusTable,null,n.createElement("div",null,null==r||null===(i=r.values)||void 0===i?void 0:i.map((e,l)=>null!=e&&e.isUnit?n.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:""+B(""+e.title),text:null!=e&&e.value?M(e)+" "+B(null==e?void 0:e.isUnit):B("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?n.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:""+B(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},B(null==e?void 0:e.title)):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},B(null==e?void 0:e.title))),null==r||null===(a=r.permit)||void 0===a?void 0:a.map((e,l)=>n.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))))))},Hl=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:m}=o.useTranslation(),v=window.Digit.Utils.browser.isMobile(),p=[{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_DEDUCTION",id:"Deduction"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],f=e=>{const t=e;return(e,l,n)=>e[t]},E=l.useMemo(()=>p.map(e=>({Header:m(""+e.name),accessor:f(e.id),id:e.id})));function _(e){var t;let l=[],n=0,i=0,o=0;return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,a,r,u,d,s,c,v,p,f,E,_,g,h;const A=Number(null===(t=e.occupancies)||void 0===t||null===(a=t[0])||void 0===a?void 0:a.builtUpArea)||0,S=Number(null===(r=e.occupancies)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.floorArea)||0,N=Number(null===(d=e.occupancies)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.deduction)||0;n+=A,i+=S,o+=N,l.push({Floor:m("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:m(""+(null===(c=e.occupancies)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.type)),BuildupArea:Number(null===(p=e.occupancies)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.builtUpArea).toFixed(2),Deduction:Number(null===(E=e.occupancies)||void 0===E||null===(_=E[0])||void 0===_?void 0:_.deduction).toFixed(2),FloorArea:Number(null===(g=e.occupancies)||void 0===g||null===(h=g[0])||void 0===h?void 0:h.floorArea).toFixed(2)||0,key:m("BPA_FLOOR_NAME_"+e.number)})}),l.push({Floor:m("BPA_TOTAL"),Level:"",Occupancy:"",BuildupArea:Number(n).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL"),Deduction:Number(o).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL"),FloorArea:Number(i).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL")}),l}function g(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+m("BPA_SUBOCCUPANCYTYPE_"+function(e,t,l){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===l&&(l=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,l);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return n||"NA"}return n.createElement(l.Fragment,null,n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,l)=>null!=e&&e.isHeader?n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},m(null==e?void 0:e.title)):n.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+m(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""})),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(d=u.planDetail)||void 0===d?void 0:d.blocks.map((e,l)=>{var i,o,a,r,u;return n.createElement("div",{key:l,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.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"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},m("BPA_BLOCK_SUBHEADER")," ",l+1),n.createElement(t.StatusTable,null,n.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+m("BPA_SUB_OCCUPANCY_LABEL"),text:g(l)})),n.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},n.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:m,disableSort:!0,autoSort:!1,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:E,getCellProps:e=>({style:{}})})))})))},Wl=e=>{let{headComment:t,otherComment:l}=e;return n.createElement("div",{className:"checkpoint-comments-wrap"},n.createElement("h4",null,t),n.createElement("p",null,l))},jl=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,m]=l.useState(!1),{t:v}=o.useTranslation();return n.createElement("div",null,u.date&&n.createElement("p",null,u.date),n.createElement("p",null,u.name),u.mobileNumber&&n.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},n.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:s}),n.createElement("p",null,"    ")),u.source&&n.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&n.createElement(Wl,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?n.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>n.createElement("div",{className:"TLComments"},n.createElement("h3",null,v("WF_COMMON_COMMENTS")),!c&&n.createElement("div",null,n.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?n.createElement("button",{type:"button",onClick:()=>{m(!0)},style:{color:"#800000"}},v("View More")):null),c&&n.createElement("div",null,n.createElement("p",{style:{overflow:"visible"}},e),n.createElement("button",{type:"button",onClick:()=>{m(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==u||null===(a=u.thumbnailsToShow)||void 0===a||null===(r=a.thumbs)||void 0===r?void 0:r.length)>0?n.createElement("div",{className:"TLComments"},n.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),n.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function zl(e){let{units:l}=e;const{t:i}=o.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var o;return n.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",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(l+1)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.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,l)=>{var o;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:n.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:l===(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 Vl(e){let{units:l}=e;const{t:i}=o.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var o;return n.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",minWidth:"280px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(l+1)),n.createElement(n.Fragment,{key:l},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.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,l)=>{var o;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:n.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:l===(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 Gl=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=o.useTranslation();let m=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{}):{};var v;const p=null==m?void 0:m.mode;var{connectionDetails:f,plumberDetails:E,roadCuttingDetails:_,roadCuttingAddlDetails:g,activationDetails:h}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(i=s.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),n.createElement("div",null,n.createElement("div",{className:"connection-details-new-value-wrapper"},null==f?void 0:f.map((e,l)=>n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(a=s.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=p&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),n.createElement("div",null,n.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:"",privacy:e.privacy}))))),(null==s||null===(r=s.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=p&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),n.createElement("div",null,n.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==_?void 0:_.map(e=>{var l;return n.createElement("div",{style:(null==_?void 0:_.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(l=e.values)||void 0===l?void 0:l.map(e=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))}))),(null==s||null===(u=s.additionalDetails)||void 0===u?void 0:u.roadCuttingAddlDetails)&&n.createElement("div",null,n.createElement("br",null),n.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,l)=>n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==s||null===(d=s.additionalDetails)||void 0===d?void 0:d.activationDetails)&&n.createElement(t.StatusTable,null,n.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),n.createElement("div",null,n.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Yl=[{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"}],ql=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Kl=e=>{var i,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=o.useTranslation(),[m,v,p]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),h=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[A,S]=l.useState(!1),[N,b]=l.useState(m||{}),[C,y]=l.useState(null),[D,O]=l.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[L,T]=l.useState(d.additionalDetails.values?d.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),l.useEffect(()=>{var e,t,l;const i=c({},null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==m||null===(l=m.billDetails)||void 0===l?void 0:l.length)>0){var o,a,r,u,s,p,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(o=m.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(r=m.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:n.createElement("span",null,"₹",null==m||null===(s=m.billDetails)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.taxAmount)}];T(e),O(null==m||null===(f=m.billDetails)||void 0===f?void 0:f[0])}else v(i),b(i)},[]);let w={};const x=e=>n.createElement("h1",{className:"heading-m"},e.label),R=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),P=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(R,null)),F=function(e,t,l){void 0===t&&(t=!1);let n=c({},N);if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}b(n)};return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},L&&n.createElement(t.StatusTable,null,n.createElement("div",null,null==L?void 0:L.map((e,l)=>n.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),n.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),n.createElement("div",null,n.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+s("WS_COMMON_TOTAL_AMT"),text:n.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),n.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+s("CS_INBOX_STATUS_FILTER"),text:s(h?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:h?{color:"#00703C"}:{color:"#D4351C"}}))),null!=d&&null!==(a=d.additionalDetails)&&void 0!==a&&a.isAdhocRebate?n.createElement("div",{onClick:e=>{S(!0)}},n.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},s("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,A&&n.createElement(t.Modal,{headerBarMain:n.createElement(x,{label:s("PT_ADD_REBATE_PENALITY")}),headerBarEnd:n.createElement(P,{onClick:()=>{b(m),S(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(m),S(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=N&&N.adhocPenalty?Number(null==N?void 0:N.adhocPenalty):0,l=null!=N&&N.adhocRebate?Number(null==N?void 0:N.adhocRebate):0;var n,i;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))y({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,m,p,f,g,h,A;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l=c({},null==d||null===(m=d.additionalDetails)||void 0===m||null===(p=m.appDetails)||void 0===p?void 0:p.additionalDetails,N);d.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==d||null===(f=d.additionalDetails)||void 0===f||null===(g=f.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(h=d.additionalDetails)||void 0===h||null===(A=h.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,m,p,f,g,h;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(g=f[0])||void 0===g||null===(h=g.taxHeadEstimates)||void 0===h||h.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const A=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(r=e.Calculation)||void 0===r||null===(u=r[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===(m=c[0])||void 0===m?void 0:m.taxAmount}];E(gt(e.Calculation[0])),O(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),T(A),N.billDetails=null==e?void 0:e.Calculation,v(N),S(!1)}).catch(e=>{var t,l,n,i,o,a;y({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.message?s(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else y({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},n.createElement("div",null,n.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_PENALTY")),n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:Yl,optionKey:"title",select:e=>F("adhocPenaltyReason",!0,e),selected:(null==N?void 0:N.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==N||null===(r=N.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&n.createElement("div",{className:"field"},n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==N?void 0:N.adhocPenaltyComment)||"",onChange:e=>F("adhocPenaltyComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")})))),n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==N?void 0:N.adhocPenalty)||"",onChange:e=>F("adhocPenalty",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))),n.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},n.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},s("PT_AD_REBATE")),n.createElement(t.CardLabel,null,s("PT_TX_HEADS")),n.createElement("div",{className:"field"},n.createElement(t.Dropdown,{isMandatory:!0,option:ql,optionKey:"title",select:e=>F("adhocRebateReason",!0,e),selected:(null==N?void 0:N.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==N||null===(u=N.adhocRebateReason_data)||void 0===u?void 0:u.title)&&n.createElement("div",{className:"field"},n.createElement(t.CardLabel,null,s("PT_REASON")),n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==N?void 0:N.adhocRebateComment)||"",onChange:e=>F("adhocRebateComment",!1,e)},w={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:s("TL_NAME_ERROR_MESSAGE")}))),n.createElement(t.CardLabel,null,s("PT_HEAD_AMT")),n.createElement("div",{className:"field"},n.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:s,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==N?void 0:N.adhocRebate)||"",onChange:e=>F("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&n.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:s(null==C?void 0:C.message),onClose:()=>{y(!1)},isDleteBtn:!0})))},Xl=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:m}=e;const{t:v}=o.useTranslation(),[p,f]=l.useState(!1),[E,_]=l.useState({}),g=e=>n.createElement("h1",{className:"heading-m"},e.label),h=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),A=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(h,null));return n.createElement(l.Fragment,null,n.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=m&&null!==(i=m.additionalDetails)&&void 0!==i&&i.isViewBreakup?n.createElement("div",{onClick:e=>(()=>{var e;let t=m.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),_(t),f(!0)})(),style:{marginTop:"12px"}},n.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,p&&n.createElement(t.Modal,{headerBarMain:n.createElement(g,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:n.createElement(A,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},n.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),n.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(d=u.CHARGES)||void 0===d?void 0:d.map(e=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.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=>n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:n.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),n.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),n.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:n.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Ql=e=>{let{assessmentData:t}=e;const[i,o]=l.useState(!1);return n.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},n.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),n.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&n.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},t.map((e,l)=>n.createElement("div",{key:l,className:"assessment-item",style:{marginBottom:"15px"}},n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},n.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),n.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),n.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},n.createElement("div",{style:{display:"flex",gap:"75px"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),n.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}},"          ",n.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",n.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),l!==t.length-1&&n.createElement("hr",null)))))},Jl=e=>{var t;let{applicationData:o}=e;const[a,r]=l.useState(!1);return i.useHistory(),n.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},n.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{r(!a)}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),n.createElement("span",{style:{fontSize:"1.2em"}},a?"<":">"))),a&&n.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},n.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},n.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),n.createElement("span",{style:{flex:"1",color:"black"}},o.acknowldgementNumber)),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.propertyId)),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=o.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),n.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},n.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),n.createElement("span",{className:"value",style:{flex:"1",color:"black"}},o.status)),n.createElement("div",null,n.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+o.acknowldgementNumber,state:{propertyId:o.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},Zl=e=>{let{payments:t}=e;const[i,o]=l.useState(!1);return n.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},n.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},n.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),n.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&n.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&n.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payments found"),(null==t?void 0:t.length)>0&&n.createElement("div",null,n.createElement("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"10px"}},n.createElement("thead",null,n.createElement("tr",{style:{backgroundColor:"#f5f5f5"}},n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Receipt Number"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction Date"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Amount Paid"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Payment Mode"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Transaction ID"),n.createElement("th",{style:{border:"1px solid #ddd",padding:"8px",textAlign:"left"}},"Status"))),n.createElement("tbody",null,t.map((e,t)=>{var l,i;return n.createElement("tr",{key:e.id||t},n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},(null===(l=e.paymentDetails)||void 0===l||null===(i=l[0])||void 0===i?void 0:i.receiptNumber)||e.receiptNumber||"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionDate?new Date(e.transactionDate).toLocaleDateString():"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},"₹",e.totalAmountPaid||e.amount||"0"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.paymentMode||e.instrumentType||"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},e.transactionNumber||e.instrumentNumber||"N/A"),n.createElement("td",{style:{border:"1px solid #ddd",padding:"8px"}},n.createElement("span",{style:{color:"NEW"===e.paymentStatus||"SUCCESSFUL"===e.paymentStatus||"DEPOSITED"===e.paymentStatus?"green":"FAILED"===e.paymentStatus?"red":"orange",fontWeight:"bold"}},"DEPOSITED"===e.paymentStatus?n.createElement("p",null,"Deposited"):e.paymentStatus||"N/A")))}))),n.createElement("div",{style:{marginTop:"10px",fontSize:"14px",color:"#666"}},"Total Payments: ",t.length))))},$l=n.memo(e=>{let{width:t=85,height:l=100,style:i}=e;return n.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:l,viewBox:"0 0 20 20",fill:"gray"},n.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))}),en=n.memo(e=>{let{value:i,Code:o,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:i},{value:i},o,a),d=l.useMemo(()=>{var e;const t=null!=i&&i.documents?null==i||null===(e=i.documents)||void 0===e?void 0:e.documents:i;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===o))||[]},[i,o]);return r?n.createElement(t.Loader,null):n.createElement("div",{className:"timeline-docs-wrapper"},null==d?void 0:d.map((e,t)=>{const l=((e,t)=>{var l;const n=(null==e?void 0:e[t])||"",i=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==i?void 0:i.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==i?void 0:i[0])||""})(null==u?void 0:u.pdfFiles,null==e?void 0:e.fileStoreId);return l?n.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:l,className:"timeline-doc-link"},n.createElement($l,{className:"timeline-doc-icon"})):null}))}),tn=[{label:"CM_TIMELINE_NAME",key:"assignerName"},{label:"CM_TIMELINE_ACTION_TAKEN",key:"performedAction"},{label:"CM_TIMELINE_ACTION_TAKEN_ON",key:"lastModified"},{label:"CM_TIMELINE_DATE_RECEIVED",key:"createdDate"},{label:"CM_TIMELINE_NO_OF_DAYS",key:"noOfDays"}],ln=(n.memo(e=>{var t,l;let{checkpoint:i,t:o}=e;return n.createElement("div",{className:"timeline-card"},n.createElement("div",{className:"timeline-header"},null==tn?void 0:tn.map(e=>{let{label:t,key:l}=e;return n.createElement("div",{key:l,className:"timeline-header-item"},n.createElement("span",{className:"timeline-label"},o(t),":"),n.createElement("span",{className:"timeline-value"},o(null==i?void 0:i[l])||"N/A"))})),n.createElement("div",{className:"timeline-note"},n.createElement("span",{className:"timeline-label"},o("CM_TIMELINE_NOTE"),":"),n.createElement("div",{className:"note-box"},(null==i?void 0:i.comment)||o("CM_TIMELINE_NO_COMMENTS"))),(null==i||null===(t=i.documents)||void 0===t?void 0:t.length)>0&&n.createElement("div",{className:"timeline-docs"},n.createElement("span",{className:"timeline-label"},o("CM_TIMELINE_DOCUMENT_ATTACHED"),":"),null==i||null===(l=i.documents)||void 0===l?void 0:l.map((e,t)=>n.createElement(en,{key:(null==e?void 0:e.documentType)+"-"+t,value:null==i?void 0:i.documents,Code:null==e?void 0:e.documentType,index:t}))))}),n.memo(e=>{let{width:t=20,height:l=20,style:i}=e;return n.createElement("svg",{style:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:l,viewBox:"0 0 20 20",fill:"gray"},n.createElement("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}))})),nn=n.memo(e=>{let{value:i,Code:o,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:i},{value:i},o,a),d=l.useMemo(()=>{var e;const t=null!=i&&i.documents?null==i||null===(e=i.documents)||void 0===e?void 0:e.documents:i;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===o))||[]},[i,o]);return r?n.createElement(t.Loader,null):n.createElement("div",{className:"custom-doc-container"},null==d?void 0:d.map((e,t)=>{const l=((e,t)=>{var l;const n=(null==e?void 0:e[t])||"",i=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==i?void 0:i.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==i?void 0:i[0])||""})(null==u?void 0:u.pdfFiles,(null==e?void 0:e.fileStoreId)||(null==e?void 0:e.documentUid));return l?n.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:l,className:"custom-doc-link"},n.createElement(ln,null),n.createElement("span",null,(null==e?void 0:e.fileName)||"Document")):null}))});function on(e){let{workflowDetails:t,t:i}=e;const o=e=>{if(null==e||!e.created||null==e||!e.timing)return null;const[t,l,n]=e.created.split("/");return new Date(n+"-"+l+"-"+t+" "+e.timing)},a=(e,t)=>{if(!e||!t)return null;const l=Math.floor((e-t)/6e4),n=Math.floor(l/60),i=Math.floor(n/24);return i>0?i+" day(s)":n>0?n+" hour(s)":l+" minute(s)"},r=l.useMemo(()=>(e=>{const t=(null==e?void 0:e.data)||e,l=null==t?void 0:t.timeline;if(!Array.isArray(l))return[];const n=[...l].reverse();return n.map((e,t)=>{var l;const i=o(e.auditDetails),r=t>0?o(null===(l=n[t-1])||void 0===l?void 0:l.auditDetails):null;return c({},e,{status:(null==e?void 0:e.state)||(null==e?void 0:e.status),assigner:(null==e?void 0:e.assigner)||null,assignes:Array.isArray(null==e?void 0:e.assignes)?e.assignes:[],wfComment:Array.isArray(null==e?void 0:e.wfComment)?e.wfComment:null!=e&&e.comment?[e.comment]:[],wfDocuments:Array.isArray(null==e?void 0:e.wfDocuments)?e.wfDocuments:[],actionDateTime:i,sla:a(i,r)})}).reverse()})(t),[t]),u=(null==r?void 0:r.filter(e=>!("SAVE_AS_DRAFT"===(null==e?void 0:e.performedAction))))||[];return n.createElement(n.Fragment,null,n.createElement("div",{className:"custom-timeline-container"},n.createElement("div",{className:"custom-timeline-header"},n.createElement("div",{className:"custom-tracking-status-header"},n.createElement("div",{className:"custom-tracking-line"}),n.createElement("span",{className:"custom-tracking-status-text"},i("TRACKING STATUS")),n.createElement("div",{className:"custom-tracking-line"})),n.createElement("div",{className:"custom-title-bar-row"},n.createElement("h2",{className:"custom-timeline-title"},i("Application History")),n.createElement("div",{className:"custom-blue-bar"}))),n.createElement("div",{className:"custom-timeline-entries"},null==u?void 0:u.map((e,t)=>{var l,o,a,r,u,d,s,c,m,v,p,f;return n.createElement("div",{key:t,className:"custom-timeline-entry"},n.createElement("div",{className:"custom-vertical-line"}),n.createElement("div",{className:"custom-date-badge"},null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.created," ",null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.timing),n.createElement("div",{className:"custom-entry-content"},n.createElement("div",{className:"custom-icon-container"},n.createElement("div",{className:"custom-circular-icon"},n.createElement("svg",{className:"custom-mail-icon",viewBox:"0 0 24 24"},n.createElement("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),n.createElement("path",{d:"M3 7l9 6 9-6"})))),n.createElement("div",{className:"custom-content-card"},n.createElement("div",{className:"custom-card-top"},n.createElement("div",{className:"custom-card-left"},n.createElement("h3",{className:"custom-action-title"},i("Action taken by")),(null==e?void 0:e.assigner)&&n.createElement("div",{className:"custom-officer-info"},n.createElement("div",{className:"custom-officer-name"},(null==e||null===(a=e.assigner)||void 0===a?void 0:a.name)||i("CS_COMMON_NA")),(null==e||null===(r=e.assigner)||void 0===r?void 0:r.emailId)&&n.createElement("div",{className:"custom-officer-email"},n.createElement("span",{className:"custom-email-label"},i("Email"))," ",null==e||null===(u=e.assigner)||void 0===u?void 0:u.emailId))),(null==e?void 0:e.sla)&&n.createElement("div",{className:"custom-card-left"},n.createElement("h3",{className:"custom-action-title"},i("Time Taken")),n.createElement("div",{className:"custom-officer-email"},n.createElement("span",{className:"custom-email-label"},null==e?void 0:e.sla))),n.createElement("div",{className:"custom-card-right"},n.createElement("h3",{className:"custom-action-title"},i("Action")),n.createElement("div",{className:"custom-status-text"},i((null==e?void 0:e.performedAction)||"CS_COMMON_NA")))),(null==e?void 0:e.wfComment)&&(null==e||null===(d=e.wfComment)||void 0===d?void 0:d.length)>0&&(null==e||null===(s=e.wfComment)||void 0===s?void 0:s.some(e=>null==e?void 0:e.trim()))&&n.createElement("div",{className:"custom-comments-section"},n.createElement("div",{className:"custom-comment-text"},n.createElement("h4",{className:"custom-comments-title"},i("Officer Comments")),null==e||null===(c=e.wfComment)||void 0===c?void 0:c.map((e,t)=>n.createElement("p",{key:t},e))),(null==e||null===(m=e.assignes)||void 0===m?void 0:m.length)>0&&n.createElement("div",null,n.createElement("h3",{className:"custom-comments-title"},i("Assigned To")),n.createElement("div",{className:"custom-officer-info"},n.createElement("div",{className:"custom-officer-name"},null===(v=e.assignes[0])||void 0===v?void 0:v.name)))),(null==e?void 0:e.wfDocuments)&&(null==e||null===(p=e.wfDocuments)||void 0===p?void 0:p.length)>0&&n.createElement("div",{className:"custom-comments-section-no-border"},n.createElement("h4",{className:"custom-comments-title"},"Document Attached:"),n.createElement("div",{className:"custom-comment-text"},null==e||null===(f=e.wfDocuments)||void 0===f?void 0:f.map((t,l)=>n.createElement(nn,{key:(null==t?void 0:t.documentType)+"-"+l,value:null==e?void 0:e.wfDocuments,Code:null==t?void 0:t.documentType,index:l})))))))}))))}function an(e){var a,r,u,d,s,m,v,p,f,E,g,h,A,S,N,b;let{applicationDetails:C,demandData:y,workflowDetails:D,isDataLoading:O,applicationData:L,timelineStatusPrefix:T,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:x,oldValue:R,isInfoLabel:P=!1,propertyId:F,moduleCode:B}=e;const{t:M}=o.useTranslation(),k=i.useHistory(),U=Digit.ULBService.getCurrentTenantId(),[H,W]=l.useState(null),[j,z]=l.useState([]);let V=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const G=[{Header:M("BPA_DOCUMENT_DETAILS_LABEL"),accessor:"title",Cell:e=>{let{value:t}=e;return M(t)||M("CS_NA")}},{Header:M(" "),accessor:"url",Cell:e=>{let{value:l}=e;return l?n.createElement(t.LinkButton,{style:{float:"right",display:"inline"},label:M("View"),onClick:()=>{window.open(l,"_blank")}}):M("CS_NA")}}];function Y(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}console.log("TIMELINE",C,B),l.useEffect(()=>{!function(){try{const e=function(){if(window.location.href.includes("employee/ws")&&null!=L&&L.connectionNo){const e=Ot(function(){return Promise.resolve(Digit.WSService.paymentsearch({tenantId:(null==L?void 0:L.tenantId)||U,filters:{consumerCodes:null==L?void 0:L.connectionNo,consumerCode:null==L?void 0:L.connectionNo},BusinessService:"SEWERAGE"===(null==L?void 0:L.serviceType)||"SEWARAGE"===(null==L?void 0:L.serviceType)?"SW":"WS"})).then(function(e){Array.isArray(e)&&e.length>0?z(e):null!=e&&e.Payments&&e.Payments.length>0&&z(e.Payments)})},function(e){console.error("❌ Payment fetch error:",e)});if(e&&e.then)return e.then(function(){})}}();Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[null==L?void 0:L.connectionNo,null==L?void 0:L.serviceType,U]);const[q,K]=l.useState({}),[X,Q]=l.useState(),[J,Z]=l.useState([]),[$,ee]=l.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==L?void 0:L.status)||$.loading||$.loaded||$.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==$||!$.canLoad||$.loading||$.loaded||(ee({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0){const l=i.Assessments.filter(e=>"ACTIVE"===e.status),n=new Map;l.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,l=n.get(t);(!l||e.createdDate>l.createdDate)&&n.set(t,e)});const o=Array.from(n.values());return Z(o),Q(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==L?void 0:L.tenantId)||U,null==L?void 0:L.propertyId,K,ee));const te=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let l=t.getMonth()+1,n=t.getDate();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,n+"/"+l+"/"+t.getFullYear()},le=function(e,t,l){if(void 0===t&&(t=0),!e)return null;if("OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:te(null==L||null===(i=L.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==L?void 0:L.channel)||""};return n.createElement(jl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,m,v,p,f,E,g,h,A,S,N,b,y,D;const i={uuid:(null==e||null===(o=e.assigner)||void 0===o?void 0:o.uuid)||(null==e||null===(a=e.assignes)||void 0===a||null===(r=a[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==C?void 0:C.tenantId,businessIds:null==C?void 0:C.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+(_.get(e,"ProcessInstances["+t+"].assigner.mobileNumber")||_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber")),l}}},O=l&&Array.isArray(l)&&t>0&&t-1<l.length?l[t-1]:null,T={date:null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModified,name:(null==e||null===(d=e.assigner)||void 0===d?void 0:d.name)||(null==e||null===(s=e.assignes)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.name)||"N/A",mobileNumber:(null==L||null===(m=L.processInstance)||void 0===m||null===(v=m.assignes)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.uuid)===(null==e||null===(f=e.assigner)||void 0===f?void 0:f.uuid)&&null!=L&&null!==(E=L.processInstance)&&void 0!==E&&null!==(g=E.assignes)&&void 0!==g&&null!==(h=g[0])&&void 0!==h&&h.mobileNumber?null==L||null===(A=L.processInstance)||void 0===A||null===(S=A.assignes)||void 0===S||null===(N=S[0])||void 0===N?void 0:N.mobileNumber:(null==e||null===(b=e.assigner)||void 0===b?void 0:b.mobileNumber)||(null==e||null===(y=e.assignes)||void 0===y||null===(D=y[0])||void 0===D?void 0:D.mobileNumber)||"N/A",comment:null!=e&&e.comment?M(e.comment):"",wfComment:O&&O.wfComment||[],thumbnailsToShow:(null==e?void 0:e.thumbnailsToShow)||[]};return n.createElement(jl,{data:T,OpenImage:Y,privacy:i})}{var O,T,I,w,x;const t={date:te(null==L||null===(O=L.auditDetails)||void 0===O?void 0:O.lastModifiedTime),name:(null==e||null===(T=e.assignes)||void 0===T||null===(I=T[0])||void 0===I?void 0:I.name)||"N/A",wfComment:(null==e?void 0:e.wfComment)||[],mobileNumber:(null==e||null===(w=e.assignes)||void 0===w||null===(x=w[0])||void 0===x?void 0:x.mobileNumber)||"N/A"};return n.createElement(jl,{data:t})}},ne=(e,t)=>e?t?e:M(e):M("NA"),ie=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),oe=window.location.href.includes("employee/noc"),ae=window.location.href.includes("employee/obps"),re=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ue=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?ne(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+M(null==e?void 0:e.isUnit):M("N/A"):null!=e&&e.value?ne(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):M("N/A"),[de,se]=l.useState(!1),ce=(null==y||y.reduce((e,t)=>e+t.demandInterest,0),null==y||y.reduce((e,t)=>e+t.demandPenality,0),null==y||y.reduce((e,t)=>e+t.collectionTax,0),null==y||y.reduce((e,t)=>e+t.collectionInterest,0),null==y||y.reduce((e,t)=>e+t.collectionPenality,0),null==y||y.reduce((e,t)=>e+t.balanceTax,0),null==y||y.reduce((e,t)=>e+t.balanceInterest,0),null==y||y.reduce((e,t)=>e+t.balancePenality,0),function(e,t,l){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const n=c({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:c({},e.additionalDetails,{propertytobestatus:t}),workflow:c({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:c({},n)},U,l)).then(function(){})}catch(e){return Promise.reject(e)}}),me=null==C?void 0:C.applicationData,ve=(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==C||null===(r=C.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return l.useEffect(()=>{if("WS"!==B&&"SW"!==B&&!window.location.href.includes("employee/ws")&&!window.location.href.includes("/ws/")&&F)try{let e={consumerCodes:F};const t=!0;"BPAREG"===B?Digit.OBPSService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):"PT"===B&&Digit.PTService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)})}catch(e){console.error("❌ Payment search error for PT/BPREG:",e)}},[B,F,U]),n.createElement(t.Card,{style:{position:"relative"}},null==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,o)=>{var a,r,u,d,s,c,m,v,p,f,E,_,g,h,A,S,N,b,y,O,L,T,I,w,P,F,B,k,U,H,W,j,z,Y,q,K,X,Q,J;return n.createElement(n.Fragment,{key:o},n.createElement("div",{style:(window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws"),{})},0!==o||e.asSectionHeader?n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:0==o&&ie?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},oe?""+M(e.title):M(e.title),null!=e&&e.Component?n.createElement(e.Component,null):null)):n.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},M(e.title)),(null==e?void 0:e.isTable)&&n.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},n.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>n.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},M(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?n.createElement(l.Fragment,null,n.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),n.createElement("tr",null,t.map(e=>n.createElement("td",{style:{textAlign:"left"}},M(e))))):n.createElement("tr",null,t.map(e=>n.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},M(e)))))),n.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ie?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((l,o)=>{var a,r;return!0===l.map&&"N/A"!==l.value?n.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:M(l.title),label:M(l.title),text:n.createElement("img",{src:M(l.value),alt:"",privacy:null==l?void 0:l.privacy})}):1==(null==l?void 0:l.isLink)?n.createElement(t.Row,{key:M(l.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?n.createElement("div",{style:{width:"200%"}},n.createElement(i.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},M(null==l?void 0:l.title)))):oe||ae?""+M(l.title):M(l.title),text:n.createElement("div",null,n.createElement(i.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==l?void 0:l.value))),last:o===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:l.caption,className:"border-none",rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):window.location.href.includes("modify")?n.createElement(t.Row,{className:"border-none",key:""+l.title,label:""+M(""+l.title),privacy:null==l?void 0:l.privacy,text:null!=l&&l.oldValue?null==l?void 0:l.oldValue:null!=l&&l.value?null==l?void 0:l.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):n.createElement(t.Row,{key:M(l.title),label:M(l.title),text:ue(l),last:o===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:l.caption,className:"border-none",privacy:null==l?void 0:l.privacy,rowContainerStyle:re(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}})})))),(null==e?void 0:e.belowComponent)&&n.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&n.createElement(Ul,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:x,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(d=C.applicationData)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.fieldinspection_pending)||void 0===c?void 0:c.length)>0&&(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.fiReport)&&n.createElement(xl,{fiReport:null==C||null===(v=C.applicationData)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&n.createElement(Ml,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners)&&n.createElement(kl,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&n.createElement(Vl,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&n.createElement(zl,{units:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.accessories}),!V&&(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.permissions)&&(null==D||null===(y=D.data)||void 0===y||null===(O=y.nextActions)||void 0===O?void 0:O.length)>0&&n.createElement(Fl,{applicationData:null==C?void 0:C.applicationData,t:M,permissions:null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.permissions}),(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.obpsDocuments)&&n.createElement("div",{style:{display:"flex"}},n.createElement(Il,{t:M,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&n.createElement(Pl,{t:M,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:D}),(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.scruntinyDetails)&&n.createElement(Ul,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&n.createElement(Ul,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.subOccupancyTableDetails)&&n.createElement(Hl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.documentsWithUrl)&&n.createElement(t.Table,{className:"customTable table-border-style",t:M,data:(null==e||null===(U=e.additionalDetails)||void 0===U||null===(H=U.documentsWithUrl[0])||void 0===H?void 0:H.values)||[],columns:G,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&n.createElement(Bl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&n.createElement(Gl,{wsAdditionalDetails:e,oldValue:R}),(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.redirectUrl)&&n.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},n.createElement(i.Link,{to:null==e||null===(Y=e.additionalDetails)||void 0===Y||null===(q=Y.redirectUrl)||void 0===q?void 0:q.url},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(K=e.additionalDetails)||void 0===K||null===(X=K.redirectUrl)||void 0===X?void 0:X.title))),(null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.estimationDetails)&&n.createElement(Kl,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.estimationDetails)&&n.createElement(Xl,{wsAdditionalDetails:e,workflowDetails:D}))}),(null==X?void 0:X.length)>0&&n.createElement(Ql,{assessmentData:J}),n.createElement(Zl,{payments:j}),"WS"!==B&&"SW"!==B&&"OBPS"!==B&&"BPAStakeholder"!==B&&"BPAREG"!==B&&n.createElement(Jl,{applicationData:null==C?void 0:C.applicationData}),I&&(null==D||null===(d=D.data)||void 0===d||null===(s=d.timeline)||void 0===s?void 0:s.length)>0&&n.createElement(n.Fragment,null,n.createElement(t.BreakLine,null),((null==D?void 0:D.isLoading)||O)&&n.createElement(t.Loader,null),!(null!=D&&D.isLoading)&&!O&&"BPAREG"!==B&&n.createElement(l.Fragment,null,n.createElement("div",{id:"timeline"},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},M("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=D&&null!==(m=D.data)&&void 0!==m&&m.timeline&&1===(null==D||null===(v=D.data)||void 0===v||null===(p=v.timeline)||void 0===p?void 0:p.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:M(""+T+(null==D||null===(f=D.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:le(null==D||null===(g=D.data)||void 0===g?void 0:g.timeline[0],null==D||null===(h=D.data)||void 0===h?void 0:h.timeline)}):n.createElement(t.ConnectingCheckPoints,null,(null==D||null===(A=D.data)||void 0===A?void 0:A.timeline)&&(null==D||null===(S=D.data)||void 0===S?void 0:S.timeline.slice(0,de?null==D?void 0:D.data.timeline.length:2).map((e,l,i)=>{var o;let a="";var r,u,d,s,c,m;return window.location.href.includes("/obps/")&&(a=null!=D&&null!==(r=D.data)&&void 0!==r&&null!==(u=r.timeline[l-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=D&&null!==(s=D.data)&&void 0!==s&&null!==(c=s.timeline[l-1])&&void 0!==c&&null!==(m=c.state)&&void 0!==m&&m.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==l?"":"_DONE"),n.createElement(n.Fragment,{key:l},n.createElement(t.CheckPoint,{keyValue:l,isCompleted:0===l,info:e.comment,label:M(""+T+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+a),customChild:le(e,l,null==D||null===(o=D.data)||void 0===o?void 0:o.timeline)}))}))),(null==D||null===(N=D.data)||void 0===N||null===(b=N.timeline)||void 0===b?void 0:b.length)>2&&n.createElement(t.LinkButton,{label:M(de?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{se(e=>!e)}}))),!(null!=D&&D.isLoading)&&!O&&"BPAREG"===B&&n.createElement(on,{workflowDetails:D,t:M})),window.location.href.includes("/pt/")?n.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},n.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("employee")?"INACTIVE"==pe?ce(me,"ACTIVE",ve):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),n.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?ce(me,"INACTIVE",ve):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),n.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var l,n,i;if("INACTIVE"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,a,r;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status)&&k.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),n.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):n.createElement("div",null),H&&n.createElement(t.Toast,{error:H.isError,label:M(H.label),onClose:()=>{W(null)},isDleteBtn:"false"}))}function rn(e){var l,i,o,a,r,u,d,s,c,m,v,p,f,E,_,g,h,A;let{t:S,showToast:N,closeToast:b,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var y;let e="";switch(null==N||null===(y=N.action)||void 0===y?void 0:y.action){case"SENDBACK":e="error"===(null==N?void 0:N.key)?null==N||null===(l=N.error)||void 0===l?void 0:l.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==N?void 0:N.key)?null==N||null===(i=N.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==N?void 0:N.key)?null==N||null===(o=N.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==N?void 0:N.key)?null==N||null===(a=N.error)||void 0===a?void 0:a.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==N?void 0:N.key)?null==N||null===(r=N.error)||void 0===r?void 0:r.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==N?void 0:N.key)?null==N||null===(u=N.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==N?void 0:N.key)?null==N||null===(d=N.error)||void 0===d?void 0:d.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==N?void 0:N.key)?null==N||null===(s=N.error)||void 0===s?void 0:s.message:S("ES_"+C+"_"+(null==N||null===(c=N.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,N&&n.createElement(t.Toast,{error:"error"===N.key,label:e,onClose:b}))}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 l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?S(e[1]):S(e[0]),l};let l="";switch(null==N||null===(D=N.action)||void 0===D?void 0:D.action){case"REVOCATE":l="error"===(null==N?void 0:N.key)?null==N||null===(m=N.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":l="error"===(null==N?void 0:N.key)?null==N||null===(v=N.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":l="error"===(null==N?void 0:N.key)?null==N||null===(p=N.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":l="error"===(null==N?void 0:N.key)?null==N||null===(f=N.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":l="error"===(null==N?void 0:N.key)?null==N||null===(E=N.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":l="error"===(null==N?void 0:N.key)?null==N||null===(_=N.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":l="error"===(null==N?void 0:N.key)?null==N||null===(g=N.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:l="error"===(null==N?void 0:N.key)?null==N||null===(h=N.error)||void 0===h?void 0:h.message:S("ES_"+C+"_"+(null==N||null===(A=N.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,N&&n.createElement(t.Toast,{error:"error"===N.key,label:l,onClose:b}))}{var O,L;const e="error"===(null==N?void 0:N.key)?null==N||null===(O=N.error)||void 0===O?void 0:O.message:"ES_"+C+"_"+(null==N||null===(L=N.action)||void 0===L?void 0:L.action)+"_UPDATE_SUCCESS";return n.createElement(n.Fragment,null,N&&n.createElement(t.Toast,{error:"error"===N.key,label:S(e),onClose:b}))}}function un(e){var i,a,r,u,d,s,m,v,p,f,E,_,g,h,A,S;let{workflowDetails:N,displayMenu:b,onActionSelect:C,setDisplayMenu:y,businessService:D,forcedActionPrefix:O,ActionBarStyle:L={},MenuStyle:T={}}=e;const{t:I}=o.useTranslation();let w=Digit.UserService.getUser();const x=l.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};w=null==t?void 0:t.value}const R=null===(i=w)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let P=!1,F=!1,B=(null==N||null===(u=N.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==R?void 0:R.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==N||null===(m=N.data)||void 0===m||null===(v=m.nextActions)||void 0===v?void 0:v.filter(e=>(null==R?void 0:R.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return console.log("ActionsInPayment",N),Digit.Hooks.useClickOutside(x,()=>{y(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==B?void 0:B.length)||null!=B&&null!==(p=B[0])&&void 0!==p&&null!==(f=p.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==B?void 0:B.length)?(F=!1,P=!0):(null==B?void 0:B.length)>0&&(F=!0,P=!1),n.createElement(n.Fragment,null,!(null!=N&&N.isLoading)&&F&&!P&&n.createElement(t.ActionBar,{style:c({},L)},b&&(null!=N&&null!==(E=N.data)&&void 0!==E&&null!==(_=E.actionState)&&void 0!==_&&_.nextActions||null!=N&&null!==(g=N.data)&&void 0!==g&&g.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:B,optionKey:"action",t:I,onSelect:C,style:T}):null,n.createElement(t.SubmitBar,{ref:x,label:I("WF_TAKE_ACTION"),onSubmit:()=>y(!b)})),!(null!=N&&N.isLoading)&&!F&&P&&n.createElement(t.ActionBar,{style:c({},L)},n.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==B||null===(h=B[0])||void 0===h?void 0:h.action,value:null==B||null===(A=B[0])||void 0===A?void 0:A.action,onClick:e=>{C((null==B?void 0:B[0])||{})}},I((O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==B||null===(S=B[0])||void 0===S?void 0:S.action)))))}const dn=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),sn=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(dn,null));function cn(e){let{action:l,closeWarningPopup:i}=e;const{t:a}=o.useTranslation(),r=window.Digit.Utils.browser.isMobile();return n.createElement(n.Fragment,null,n.createElement(t.Modal,{headerBarMain:n.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:n.createElement(sn,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px"}},n.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==l?void 0:l.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),n.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==l?void 0:l.AmountDueForPay)}),n.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},n.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),n.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==l||null===(e=l.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const mn=e=>{var a,u;let d=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),m=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(m,"BPA",["BlockReason"]),{t:p}=o.useTranslation(),f=i.useHistory();let{id:E}=i.useParams();const[_,g]=l.useState(!1),[h,A]=l.useState(null),[S,N]=l.useState(!1),[b,C]=l.useState(!1),[y,D]=l.useState(!1),{data:O}=Digit.Hooks.obps.useMDMS(m,"BPA",["RiskTypeComputation"]),{applicationDetails:L,demandData:T,totalDemandTax:I,totalBalanceTax:w,showToast:x,setShowToast:R,isLoading:P,isDataLoading:F,applicationData:B,mutate:M,nocMutation:k,workflowDetails:U,id:H,businessService:W,closeToast:j,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:q,MenuStyle:K,paymentsList:X,showTimeLine:Q=!0,oldValue:J,isInfoLabel:Z=!1,clearDataDetails:$,propertyId:ee}=e;l.useEffect(()=>{x&&U&&U.revalidate&&U.revalidate()},[x]);const te=r.useQueryClient(),le=()=>{A(null),N(!1)};return console.log("ActionsInPayment2",U),P||b?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,P?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement(an,{applicationDetails:L,demandData:T,id:H,workflowDetails:U,isDataLoading:F,applicationData:B,totalDemandTax:I,totalBalanceTax:w,businessService:W,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:X,showTimeLine:Q,oldValue:J,isInfoLabel:Z,propertyId:ee,moduleCode:z}),S?n.createElement(Ll,{t:p,action:h,tenantId:s,state:m,id:E,applicationDetails:L,applicationData:null==L?void 0:L.applicationData,closeModal:le,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,u,d,s,m,v,E,_,g,A,S,N,b,y,D){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(d=e.Licenses)||void 0===d||null===(s=d[0])||void 0===s||null===(m=s.additionalDetail)||void 0===m||null===(v=m.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(E=e.Licenses)||void 0===E||null===(_=E[0])||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(S=A.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(N=e.SewerageConnection)||void 0===N||null===(b=N.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(y=e.BPA)||void 0===y||null===(D=y.comment)||void 0===D?void 0:D.length)){var O,L;"INITIATE"===(null==e||null===(O=e.Licenses)||void 0===O||null===(L=O[0])||void 0===L?void 0:L.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function d(t){if(n)return t;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=h,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=h,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,m,v,E,_,g;null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(m=c.workflow)&&void 0!==m&&m.action.includes("RE-SUBMIT")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(E=v.workflow)&&void 0!==E&&E.action.includes("APPROVE")?R({key:"success",label:p("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(_=t.AmendmentUpdate)&&void 0!==_&&null!==(g=_.workflow)&&void 0!==g&&g.action.includes("REJECT")&&R({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,S,N;if((null==e||null===(r=e.Licenses)||void 0===r?void 0:r.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return null!=e&&null!==(A=e.Licenses[0])&&void 0!==A&&null!==(S=A.businessService)&&void 0!==S&&S.includes("BPAREG")?(R({key:"success",action:h}),e.selectedAction=h,void f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(R({key:"success",action:h}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(N=e.Licenses[0])||void 0===N?void 0:N.applicationNumber)));R({key:"success",action:h}),$&&setTimeout($,3e3),setTimeout(j,5e3);try{const e=(W||"").toUpperCase(),t=((null==h?void 0:h.action)||"").toUpperCase();e.includes("DISCONNECT")&&(t.includes("APPROVE")||t.includes("EXECUTE")||t.includes("APPROVE_CONNECTION"))&&setTimeout(()=>{var e;null!==(e=window)&&void 0!==e&&e.location&&(window.location.href="https://mseva.lgpunjab.gov.in/employee/inbox")},3e3)}catch(e){}te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),le()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const i=function(){if(!1!==t&&k){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==k?void 0:k.mutateAsync(e)),i=Ot(function(){return C(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,s,c,m,v;C(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?p(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.code):(null==e||null===(s=e.response)||void 0===s||null===(c=s.data)||void 0===c||null===(m=c.Errors)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.message)||e;le(),R({key:"error",error:{message:f}}),setTimeout(j,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(d):d(i)}alert(p("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(a=U.data)||void 0===a?void 0:a.timeline,businessService:W,workflowDetails:U,moduleCode:z,blockReason:null==v||null===(u=v.BPA)||void 0===u?void 0:u.BlockReason}):null,y?n.createElement(cn,{action:h,workflowDetails:U,businessService:W,isWarningPop:y,closeWarningPopup:()=>{D(!1)}}):null,n.createElement(rn,{t:p,showToast:x,closeToast:j,businessService:W}),n.createElement("div",null,d?n.createElement(t.SubmitBar,{style:{marginRight:20},label:p("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return console.log("JJJJJJ",e),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==B?void 0:B.applicationNo})).then(function(e){var t,l,n,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==O||null===(t=O.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==L||null===(l=L.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(i=n.plot)||void 0===i?void 0:i.area,null==L||null===(o=L.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null};const d=function(e,t,l,n,i,o,a,r,d,c,m,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null==u||null===(n=u.BPA)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(m=c.additionalDetails)||void 0===m||null===(v=m.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,s)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(p("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&n.createElement(un,{workflowDetails:U,displayMenu:_,onActionSelect:function(e){var t,l,n;if(console.log("action====",e),e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(u=location)||void 0===u?void 0:u.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var d,s;f.push(""+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname),{data:null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.state})}else{var m;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(m=e.redirectionUrll)||void 0===m?void 0:m.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(l=t.state)||void 0===l||null===(n=l.applicationData)||void 0===n?void 0:n.workflowCode))N(!0);else{var v,p;f.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:c({},null===(p=e.redirectionUrl)||void 0===p?void 0:p.state)})}else N(!0);A(e),g(!1)},setDisplayMenu:g,businessService:W,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:K}))))};function vn(e){var i;let{t:o,document:a,setNocDocuments:r,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==a?void 0:a.code)})[0],s=Digit.ULBService.getStateId(),[c,m]=l.useState(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i[0]),[v,p]=l.useState(null),[f,E]=l.useState(()=>(null==d?void 0:d.fileStoreId)||null);return l.useEffect(()=>{null!=c&&c.code&&r(e=>0===(null==f?void 0:f.length)||null===f?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==c?void 0:c.code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}])},[f,c]),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller",style:{fontWeight:"700",width:"50%"}},""+o("NOC_UPLOAD_FILE_LABEL")),n.createElement("div",{className:"field"},n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t),n=l&&(null==l?void 0:l.map(e=>{var t,l,n;return{documentType:null==c?void 0:c.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,fileName:(null==e||null===(n=e.file)||void 0===n?void 0:n.name)||""}}));var i;sessionStorage.setItem("NewNOCDocs",JSON.stringify(n)),(i=l[l.length-1])&&p(i.file)})(e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const pn=e=>n.createElement("h1",{className:"heading-m"},e.label),fn=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},n.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),n.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),En=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(fn,null)),_n=e=>{var i;let{t:o,action:a,tenantId:r,getEmployees:u,closeModal:d,submitAction:s,applicationDetails:m,applicationData:v,businessService:p,showToast:f,setShowToast:E,closeToast:_,showErrorToast:g,errorOne:h,closeToastOne:A}=e;const[S,N]=l.useState({}),[b,C]=l.useState({}),[y,D]=l.useState([]),[O,L]=l.useState({}),[T,I]=l.useState(null),[w,x]=l.useState(null),[R,P]=l.useState(null),[F,B]=l.useState([]),[M,k]=l.useState(null),U=null==a||null===(i=a.state)||void 0===i?void 0:i.actions,H=(new Set(null==U?void 0:U.flatMap(e=>e.roles)),[...new Set(null==u?void 0:u.flatMap(e=>e.roles))]),{data:W}=Digit.Hooks.useEmployeeSearch(r,{roles:null==H?void 0:H.map(e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{data:j}=Digit.Hooks.pt.useMDMS(r,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}});l.useEffect(()=>{var e;j&&j["egf-master"]&&B(null===(e=j["egf-master"])||void 0===e?void 0:e.FinancialYear)},[j]);const{data:z}=Digit.Hooks.useCustomMDMS(r,"common-masters",[{name:"Department"}]);function V(e){I(e.target.files[0])}return l.useEffect(()=>{if(W&&z){var e;const t=z["common-masters"].Department;D(null==W||null===(e=W.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[W,z]),l.useEffect(()=>{!function(){try{P(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)P(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?x(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):P(o("CS_FILE_UPLOAD_ERROR"))})},function(){P(o("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]),l.useEffect(()=>{if("SENDBACKTOCITIZEN"===(null==a?void 0:a.action)){var e,t,l;const n=(null==m||null===(e=m.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.auditDetails)||void 0===l?void 0:l.createdBy)||null;L({uuid:n})}},[a]),l.useEffect(()=>{a&&N((e=>{let{t:l,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SENDBACK"!=(null==i?void 0:i.action)||(c=!1),i.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NOC_CANCEL"},form:[{body:[{label:c?l("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:c?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:c?n.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"}},{label:l("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+l("ES_PT_ACTION_FILEUPLOADED"):l("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:y,selectedApprover:O,setSelectedApprover:L,selectFile:V,uploadedFile:w,setUploadedFile:x,businessService:p}))},[a,y,F,M,w]),a&&S.form?n.createElement(t.Modal,{headerBarMain:n.createElement(pn,{label:o(S.label.heading)}),headerBarEnd:n.createElement(En,{onClick:d}),actionCancelLabel:o(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:o(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:S.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==a?void 0:a.action);null!=a&&a.isTerminateState&&(l=!0);const n=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim();return"APPROVE"===(null==a?void 0:a.action)||"REJECT"===(null==a?void 0:a.action)||null!=O&&O.uuid?l&&!n?(setTimeout(()=>{_()},2e3),void E({key:"true",error:!0,message:o("COMMON_COMMENTS_REQUIRED_LABEL")})):(v=c({},v,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=O&&O.uuid?[null==O?void 0:O.uuid]:null,wfDocuments:w?[{documentType:null==T?void 0:T.type,fileName:null==T?void 0:T.name,documentUid:w,filestoreId:w,documentAttachment:w}]:null}),void s({Licenses:[v]})):(setTimeout(()=>{_()},2e3),void E({key:"true",error:!0,message:o("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")}))},defaultValues:b,formId:"modal-action"}),f&&n.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,label:null==f?void 0:f.message,onClose:_,isDleteBtn:!0}),g&&n.createElement(t.Toast,{error:!0,label:h,isDleteBtn:!0,onClose:A})):n.createElement(t.Loader,null)},gn=e=>{let{documents:i}=e;const{t:a}=o.useTranslation(),r=[{Header:a("BPA_DOCUMENT_NAME"),accessor:"title",Cell:e=>{let{value:t}=e;return a(t)||a("CS_NA")}},{Header:a("BPA_DOCUMENT_FILE"),accessor:"fileUrl",Cell:e=>{let{value:l}=e;return l?n.createElement(t.LinkButton,{style:{float:"right",display:"inline"},label:a("View"),onClick:()=>{window.open(l,"_blank")}}):a("CS_NA")}}],u={value:{workflowDocs:null==i?void 0:i.map(e=>({documentType:(null==e?void 0:e.documentType)||"",filestoreId:(null==e?void 0:e.filestoreId)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||""}))}},{data:d}=Digit.Hooks.noc.useNOCDocumentSearch(u,{enabled:(null==i?void 0:i.length)>0}),s=null==i?void 0:i.map(e=>{var t;const{documentUid:l,documentType:n}=e;return{documentUid:l,documentType:n,url:null==d||null===(t=d.pdfFiles)||void 0===t?void 0:t[l]}}),c=l.useMemo(()=>null==s?void 0:s.map((e,t)=>{var l;return{id:t,title:a(null==e||null===(l=e.documentType)||void 0===l?void 0:l.replaceAll(".","_"))||a("CS_NA"),fileUrl:e.url}}),[s]);return n.createElement("div",null,c&&n.createElement(t.Table,{className:"customTable table-border-style",t:a,data:c,columns:r,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1}))},hn=e=>{let{formData:i}=e;const{t:a}=o.useTranslation(),r=l.useMemo(()=>{var e,t,l,n,o,a,r,u,d,s,m,v,p,f,E,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,x,R,P,F,B,M,k,U,H,W,j,z,V,G,Y,q,K,X;return{CalculationCriteria:[{applicationNumber:null==i||null===(e=i.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,tenantId:null==i||null===(n=i.apiData)||void 0===n||null===(o=n.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.tenantId,NOC:c({},null==i||null===(r=i.apiData)||void 0===r||null===(u=r.Noc)||void 0===u?void 0:u[0],{nocDetails:c({},null===(d=i.apiData)||void 0===d||null===(s=d.Noc)||void 0===s||null===(m=s[0])||void 0===m?void 0:m.nocDetails,{additionalDetails:c({},null==i||null===(v=i.apiData)||void 0===v||null===(p=v.Noc)||void 0===p||null===(f=p[0])||void 0===f||null===(E=f.nocDetails)||void 0===E?void 0:E.additionalDetails,{applicationDetails:c({},null==i?void 0:i.applicationDetails,{applicantGender:(null==i||null===(_=i.applicationDetails)||void 0===_||null===(g=_.applicantGender)||void 0===g?void 0:g.code)||(null==i||null===(h=i.applicationDetails)||void 0===h?void 0:h.applicantGender)||""}),siteDetails:c({},null==i?void 0:i.siteDetails,{ulbName:(null==i||null===(A=i.siteDetails)||void 0===A||null===(S=A.ulbName)||void 0===S?void 0:S.name)||(null==i||null===(N=i.siteDetails)||void 0===N?void 0:N.ulbName)||"",roadType:(null==i||null===(b=i.siteDetails)||void 0===b||null===(C=b.roadType)||void 0===C?void 0:C.name)||(null==i||null===(y=i.siteDetails)||void 0===y?void 0:y.roadType)||"",buildingStatus:(null==i||null===(D=i.siteDetails)||void 0===D||null===(O=D.buildingStatus)||void 0===O?void 0:O.name)||(null==i||null===(L=i.siteDetails)||void 0===L?void 0:L.buildingStatus)||"",isBasementAreaAvailable:(null==i||null===(T=i.siteDetails)||void 0===T||null===(I=T.isBasementAreaAvailable)||void 0===I?void 0:I.code)||(null==i||null===(w=i.siteDetails)||void 0===w?void 0:w.isBasementAreaAvailable)||"",district:(null==i||null===(x=i.siteDetails)||void 0===x||null===(R=x.district)||void 0===R?void 0:R.name)||(null==i||null===(P=i.siteDetails)||void 0===P?void 0:P.district)||"",zone:(null==i||null===(F=i.siteDetails)||void 0===F||null===(B=F.zone)||void 0===B?void 0:B.name)||(null==i||null===(M=i.siteDetails)||void 0===M?void 0:M.zone)||"",specificationBuildingCategory:(null==i||null===(k=i.siteDetails)||void 0===k||null===(U=k.specificationBuildingCategory)||void 0===U?void 0:U.name)||(null==i||null===(H=i.siteDetails)||void 0===H?void 0:H.specificationBuildingCategory)||"",specificationNocType:(null==i||null===(W=i.siteDetails)||void 0===W||null===(j=W.specificationNocType)||void 0===j?void 0:j.name)||(null==i||null===(z=i.siteDetails)||void 0===z?void 0:z.specificationNocType)||"",specificationRestrictedArea:(null==i||null===(V=i.siteDetails)||void 0===V||null===(G=V.specificationRestrictedArea)||void 0===G?void 0:G.code)||(null==i||null===(Y=i.siteDetails)||void 0===Y?void 0:Y.specificationRestrictedArea)||"",specificationIsSiteUnderMasterPlan:(null==i||null===(q=i.siteDetails)||void 0===q||null===(K=q.specificationIsSiteUnderMasterPlan)||void 0===K?void 0:K.code)||(null==i||null===(X=i.siteDetails)||void 0===X?void 0:X.specificationIsSiteUnderMasterPlan)||""})})})})}]}},[i]),{isLoading:u,data:d,revalidate:s}=Digit.Hooks.noc.useNOCFeeCalculator({payload:r},{enabled:!!r}),[m,v]=l.useState(null);l.useEffect(()=>{ht.isEqual(m,null==i?void 0:i.siteDetails)||(s(),v(null==i?void 0:i.siteDetails))},[null==i?void 0:i.siteDetails]);const p=l.useMemo(()=>{var e,t,l,n,i;if(null==d||null===(e=d.Calculation)||void 0===e||null===(t=e[0])||void 0===t||!t.totalAmount)return[];const o=(null==d||null===(l=d.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.reduce((e,t)=>e+((null==t?void 0:t.estimateAmount)||0),0))||"N/A";return[{id:"1",title:a("NOC_FEE_LABEL"),amount:o}]},[d,a]),f=[{Header:a("NOC_FEE_TYPE_LABEL"),accessor:"title",Cell:e=>{let{value:t}=e;return t||a("CS_NA")}},{Header:a("NOC_AMOUNT_LABEL"),accessor:"amount",Cell:e=>{let{value:t}=e;return null!=t?"₹ "+t.toLocaleString():a("CS_NA")}}];return u?n.createElement(t.Loader,null):n.createElement("div",null,u?n.createElement(t.Loader,null):n.createElement(t.Table,{className:"customTable table-border-style",t:a,data:p,columns:f,getCellProps:()=>({style:{}}),disableSort:!0,manualPagination:!1,isPaginationRequired:!1}))},An=e=>{let{ownerFileStoreId:i,ownerName:a}=e;const r=Digit.ULBService.getStateId(),[u,d]=(o.useTranslation(),l.useState(null)),[s,c]=l.useState(null);return l.useEffect(()=>{!function(){try{const e=function(){if(i)return Promise.resolve(Digit.UploadServices.Filefetch([i],r)).then(function(e){var t,l;null!=e&&null!==(t=e.data)&&void 0!==t&&t.fileStoreIds&&d(null===(l=e.data.fileStoreIds[0])||void 0===l?void 0:l.url)})}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[i]),n.createElement(t.Card,null,n.createElement("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"10px",padding:"0px 20px"}},n.createElement("div",{style:{textAlign:"center"}},n.createElement("img",{src:u,alt:"Primary Owner Photo",style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:u?"pointer":"default"},onClick:()=>u&&c(u)}),n.createElement("div",null,a||"Primary Owner Photo"))),s&&n.createElement(t.ImageViewer,{imageSrc:s,onClose:()=>{c(null)}}))},Sn=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=o.useTranslation();return window.Digit.Utils.browser.isMobile()?n.createElement(l.Fragment,null,n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})}))):n.createElement(n.Fragment,null,n.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},n.createElement("div",{className:"search-complaint-container"},n.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:i({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:i({})})),n.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Nn=e=>{let{statuses:i,controlFilterForm:r,applicationTypesOfBPA:u}=e;const{t:d}=o.useTranslation(),s=(Digit.ULBService.getStateId(),[{code:"ASSIGNED_TO_ME",name:""+d("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+d("ES_INBOX_ASSIGNED_TO_ALL")}]);return null==u||u.forEach(e=>{e.name=d("WF_BPA_"+e.code),e.i18nKey=d("WF_BPA_"+e.code)}),console.log("status heres===>",i),n.createElement(l.Fragment,null,n.createElement(t.FilterFormField,null,n.createElement(a.Controller,{name:"assignee",control:r,render:e=>n.createElement(t.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:s.filter(t=>t.code===e.value)[0],optionsKey:"name",options:s})})),n.createElement(t.FilterFormField,null,n.createElement(a.Controller,{name:"applicationStatus",control:r,defaultValue:[],render:e=>n.createElement(l.Fragment,null,null==i?void 0:i.map((l,i)=>n.createElement(t.CheckBox,{key:l.applicationstatus,label:d(l.applicationstatus)+" - "+l.count,value:l.applicationstatus,checked:e.value.includes(l.applicationstatus),onChange:()=>{var t;e.value.includes(t=l.applicationstatus)?e.onChange(e.value.filter(e=>e!==t)):e.onChange([...e.value,t])},index:i})))})))};function bn(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Cn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function yn(e){Cn(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Dn(e,t){Cn(2,arguments);var l=yn(e).getTime(),n=bn(t);return new Date(l+n)}function On(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function Ln(e){return Cn(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Tn(e){if(Cn(1,arguments),!Ln(e)&&"number"!=typeof e)return!1;var t=yn(e);return!isNaN(Number(t))}var In={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function wn(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=t.width?String(t.width):e.defaultWidth,n=e.formats[l]||e.formats[e.defaultWidth];return n}}var xn={date:wn({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:wn({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:wn({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Rn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Pn(e){return function(t,l){var n,i=l||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;n=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function Fn(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?Mn(u,function(e){return e.test(r)}):Bn(u,function(e){return e.test(r)});a=e.valueCallback?e.valueCallback(d):d,a=l.valueCallback?l.valueCallback(a):a;var s=t.slice(r.length);return{value:a,rest:s}}}function Bn(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function Mn(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var kn,Un={code:"en-US",formatDistance:function(e,t,l){var n,i=In[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=l&&l.addSuffix?l.comparison&&l.comparison>0?"in "+n:n+" ago":n},formatLong:xn,formatRelative:function(e,t,l,n){return Rn[e]},localize:{ordinalNumber:function(e,t){var l=Number(e),n=l%100;if(n>20||n<10)switch(n%10){case 1:return l+"st";case 2:return l+"nd";case 3:return l+"rd"}return l+"th"},era:Pn({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Pn({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Pn({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Pn({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Pn({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(kn={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e.match(kn.matchPattern);if(!l)return null;var n=l[0],i=e.match(kn.parsePattern);if(!i)return null;var o=kn.valueCallback?kn.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}),era:Fn({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Fn({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Fn({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Fn({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Fn({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Hn(e,t){Cn(2,arguments);var l=bn(t);return Dn(e,-l)}function Wn(e){Cn(1,arguments);var t=1,l=yn(e),n=l.getUTCDay(),i=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-i),l.setUTCHours(0,0,0,0),l}function jn(e){Cn(1,arguments);var t=yn(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var i=Wn(n),o=new Date(0);o.setUTCFullYear(l,0,4),o.setUTCHours(0,0,0,0);var a=Wn(o);return t.getTime()>=i.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function zn(e){Cn(1,arguments);var t=jn(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=Wn(l);return n}function Vn(e,t){Cn(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:bn(i),a=null==l.weekStartsOn?o:bn(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=yn(e),u=r.getUTCDay(),d=(u<a?7:0)+u-a;return r.setUTCDate(r.getUTCDate()-d),r.setUTCHours(0,0,0,0),r}function Gn(e,t){Cn(1,arguments);var l=yn(e),n=l.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:bn(a),u=null==i.firstWeekContainsDate?r:bn(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(n+1,0,u),d.setUTCHours(0,0,0,0);var s=Vn(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var m=Vn(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=m.getTime()?n:n-1}function Yn(e,t){Cn(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:bn(i),a=null==l.firstWeekContainsDate?o:bn(l.firstWeekContainsDate),r=Gn(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=Vn(u,t);return d}function qn(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var Kn={G:function(e,t,l){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return l.era(n,{width:"abbreviated"});case"GGGGG":return l.era(n,{width:"narrow"});case"GGGG":default:return l.era(n,{width:"wide"})}},y:function(e,t,l){if("yo"===t){var n=e.getUTCFullYear();return l.ordinalNumber(n>0?n:1-n,{unit:"year"})}return function(e,t){var l=e.getUTCFullYear(),n=l>0?l:1-l;return qn("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var i=Gn(e,n),o=i>0?i:1-i;return"YY"===t?qn(o%100,2):"Yo"===t?l.ordinalNumber(o,{unit:"year"}):qn(o,t.length)},R:function(e,t){return qn(jn(e),t.length)},u:function(e,t){return qn(e.getUTCFullYear(),t.length)},Q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return qn(n,2);case"Qo":return l.ordinalNumber(n,{unit:"quarter"});case"QQQ":return l.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return l.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return l.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,l){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return qn(n,2);case"qo":return l.ordinalNumber(n,{unit:"quarter"});case"qqq":return l.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return l.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return l.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,l){var n=e.getUTCMonth();switch(t){case"M":case"MM":return function(e,t){var l=e.getUTCMonth();return"M"===t?String(l+1):qn(l+1,2)}(e,t);case"Mo":return l.ordinalNumber(n+1,{unit:"month"});case"MMM":return l.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return l.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return l.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,l){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return qn(n+1,2);case"Lo":return l.ordinalNumber(n+1,{unit:"month"});case"LLL":return l.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return l.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return l.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,l,n){var i=function(e,t){Cn(1,arguments);var l=yn(e),n=Vn(l,t).getTime()-Yn(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(i,{unit:"week"}):qn(i,t.length)},I:function(e,t,l){var n=function(e){Cn(1,arguments);var t=yn(e),l=Wn(t).getTime()-zn(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):qn(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return qn(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){Cn(1,arguments);var t=yn(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=l-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):qn(n,t.length)},E:function(e,t,l){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return l.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return l.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return l.day(n,{width:"short",context:"formatting"});case"EEEE":default:return l.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return qn(o,2);case"eo":return l.ordinalNumber(o,{unit:"day"});case"eee":return l.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(i,{width:"short",context:"formatting"});case"eeee":default:return l.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return qn(o,t.length);case"co":return l.ordinalNumber(o,{unit:"day"});case"ccc":return l.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(i,{width:"narrow",context:"standalone"});case"cccccc":return l.day(i,{width:"short",context:"standalone"});case"cccc":default:return l.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return qn(i,t.length);case"io":return l.ordinalNumber(i,{unit:"day"});case"iii":return l.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return l.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return l.day(n,{width:"short",context:"formatting"});case"iiii":default:return l.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,l){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,l){var n,i=e.getUTCHours();switch(n=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,l){var n,i=e.getUTCHours();switch(n=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,l){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),l.ordinalNumber(n,{unit:"hour"})}return function(e,t){return qn(e.getUTCHours()%12||12,t.length)}(e,t)},H:function(e,t,l){return"Ho"===t?l.ordinalNumber(e.getUTCHours(),{unit:"hour"}):function(e,t){return qn(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):qn(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):qn(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return qn(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return qn(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return qn(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return Qn(i);case"XXXX":case"XX":return Jn(i);case"XXXXX":case"XXX":default:return Jn(i,":")}},x:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Qn(i);case"xxxx":case"xx":return Jn(i);case"xxxxx":case"xxx":default:return Jn(i,":")}},O:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xn(i,":");case"OOOO":default:return"GMT"+Jn(i,":")}},z:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xn(i,":");case"zzzz":default:return"GMT"+Jn(i,":")}},t:function(e,t,l,n){return qn(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return qn((n._originalDate||e).getTime(),t.length)}};function Xn(e,t){var l=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return l+String(i);var a=t||"";return l+String(i)+a+qn(o,2)}function Qn(e,t){return e%60==0?(e>0?"-":"+")+qn(Math.abs(e)/60,2):Jn(e,t)}function Jn(e,t){var l=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+qn(Math.floor(i/60),2)+l+qn(i%60,2)}function Zn(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function $n(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var ei={p:$n,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return Zn(e,t);switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"})}return l.replace("{{date}}",Zn(i,t)).replace("{{time}}",$n(o,t))}},ti=["D","DD"],li=["YY","YYYY"];function ni(e){return-1!==ti.indexOf(e)}function ii(e){return-1!==li.indexOf(e)}function oi(e,t,l){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(l,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(l,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(l,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(l,"`; see: https://git.io/fxCyr"))}var ai=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ri=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ui=/^'([^]*?)'?$/,di=/''/g,si=/[a-zA-Z]/;function ci(e,t,l){Cn(2,arguments);var n=String(t),i=l||{},o=i.locale||Un,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:bn(a),u=null==i.firstWeekContainsDate?r:bn(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=o.options&&o.options.weekStartsOn,s=null==d?0:bn(d),c=null==i.weekStartsOn?s:bn(i.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var m=yn(e);if(!Tn(m))throw new RangeError("Invalid time value");var v=On(m),p=Hn(m,v),f={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:m},E=n.match(ri).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,ei[t])(e,o.formatLong,f):e}).join("").match(ai).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return mi(l);var a=Kn[n];if(a)return!i.useAdditionalWeekYearTokens&&ii(l)&&oi(l,t,e),!i.useAdditionalDayOfYearTokens&&ni(l)&&oi(l,t,e),a(p,l,o.localize,f);if(n.match(si))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return E}function mi(e){return e.match(ui)[1].replace(di,"'")}const vi={step:1,isValid:!1,formData:{},coordinates:{},ownerPhotos:[],ownerIds:[]},pi=function(e,t){switch(void 0===e&&(e=vi),t.type){case"UPDATE_NOCNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_NOCNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_NOC_NEW_APPLICATION_FORM":return vi;case"UPDATE_NOCNewApplication_CoOrdinates":return c({},e,{coordinates:c({},e.coordinates,{[t.payload.key]:t.payload.value})});case"UPDATE_NOC_OwnerPhotos":return c({},e,{ownerPhotos:c({},e.ownerPhotos,{[t.payload.key]:t.payload.value})});case"UPDATE_NOC_OwnerIds":return c({},e,{ownerIds:c({},e.ownerIds,{[t.payload.key]:t.payload.value})});default:return e}},fi=["path","url"],Ei=[],_i=()=>{var e,l,a,r,u,d,s,c;const v=i.useRouteMatch(),{path:p}=v,f=(m(v,fi),o.useTranslation(),null===(e=Digit)||void 0===e||null===(l=e.ComponentRegistryService)||void 0===l?void 0:l.getComponent("NewNOCStepperForm")),E=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),_=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),g=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCCitizenApplicationOverview"),h=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NewNOCEditApplication"),A=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("NOCCitizenSearchApplication");return n.createElement("span",{className:"pgr-citizen-wrapper",style:{width:"100%"}},n.createElement(i.Switch,null,n.createElement(t.AppContainer,null,(void 0===(S=Ei)&&(S=[]),S.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":n.createElement(t.BackButton,null,"Back")),n.createElement(t.PrivateRoute,{path:p+"/new-application",component:f}),n.createElement(t.PrivateRoute,{path:p+"/response/:id",component:E}),n.createElement(t.PrivateRoute,{path:p+"/my-application",component:_}),n.createElement(t.PrivateRoute,{path:p+"/edit-application/:id",component:h}),n.createElement(t.PrivateRoute,{path:p+"/search/application-overview/:id",component:g}),n.createElement(t.PrivateRoute,{path:p+"/search-application",component:A}))));var S},gi=e=>{let{children:t,currentStep:l=1,stepsList:i=[]}=e;const{t:a}=o.useTranslation(),r=e=>{const t=e<=l;return{width:"56px",height:"56px",borderRadius:"50%",background:t?"linear-gradient(135deg,#2563eb,#7c3aed)":"#ffffff",color:t?"#ffffff":"#0f172a",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"8px",fontWeight:600,fontSize:"18px",border:t?"none":"1px solid rgba(15,23,42,0.08)",boxShadow:t?"0 6px 18px rgba(37,99,235,0.18)":"0 2px 6px rgba(2,6,23,0.04)",position:"relative"}},u={fontSize:"16px",color:"#0f172a",fontWeight:600,fontFamily:"Noto Sans, sans-serif",marginRight:"8px",textAlign:"right"},d={fontSize:"14px",color:"#6b7280",fontWeight:500,fontFamily:"Noto Sans, sans-serif",margin:"0 6px 0 0"},s={position:"absolute",width:"3px",height:"56px",backgroundColor:"rgba(15,23,42,0.06)",left:"50%",top:"100%",transform:"translateX(-50%)",borderRadius:"2px"},m=window.Digit.Utils.browser.isMobile(),v=i.length,p=m?{width:"32px",height:"32px",fontSize:"12px"}:{},f=m?{fontSize:"10px"}:{},E=m?{width:"auto",padding:"6px",marginBottom:"0",flexDirection:"column",alignItems:"center"}:{};return n.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:m?"column":"row",gap:"24px"}},n.createElement("div",{className:"stepper-navigation-bar",style:c({display:"flex",flexDirection:"column",alignItems:"center",padding:"18px",minWidth:"120px",maxWidth:"320px",marginBottom:"20px",marginTop:m?"20px":"0",height:m?"106px":""},m?{flexDirection:"row",overflowX:"auto",whiteSpace:"nowrap",minWidth:"100%",maxWidth:"100%",gap:"8px",padding:"10px"}:{})},[...Array(v)].map((e,t)=>{return n.createElement("div",{className:"step-content",key:t,style:c({},(o=t+1<=l,_=t===v-1,{display:"flex",alignItems:"center",justifyContent:"flex-start",flex:"0 0 auto",color:o?"#0D43A7":"#9CA3AF",padding:"14px 12px",width:"260px",marginBottom:_?"6px":"18px"}),E)},n.createElement("div",{className:"step-circle",style:c({},r(t+1),p)},t+1,t<v-1&&!m&&n.createElement("div",{style:s})),n.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:m?"center":"flex-end",margin:m?"4px":"10px"}},t+1===v?null:n.createElement("div",{className:"step-number",style:d}),n.createElement("div",{className:"step-label",style:c({},u,f,{textAlign:m?"center":"right"})},a(i[t].stepLabel))));var o,_})),n.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px",background:"transparent"}},t))},hi=e=>{let{stepsList:t=[],onSubmit:l,step:i,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=o.useTranslation();function d(){i<r.length?c():i===r.length&&l()}function s(){i>1&&m()}const c=()=>a(i+1),m=()=>a(i-1);return n.createElement(gi,{currentStep:i,nextStep:c,prevStep:m,stepsList:r},(()=>{var e,t;const l=r[i-1],{component:o,key:a,texts:c,currStepConfig:m}=l,v=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(o);return n.createElement(n.Fragment,null,n.createElement(v,{config:{key:a,texts:c,component:o,currStepNumber:i,currStepConfig:m},onGoNext:d,onBackClick:s,t:u}))})())},Ai=[{head:"NOC_APPLICATION_REGISTRATION",stepNumber:1,body:[{component:"NOCApplicantDetails",withoutLabel:!0,key:"applicantDetails",type:"component"},{component:"NOCProfessionalDetails",withoutLabel:!0,key:"professionalDetails",type:"component"}]},{head:"ES_SITE_DETAILS",stepNumber:2,body:[{component:"NOCSiteDetails",withoutLabel:!0,key:"siteDetails",type:"component"},{component:"NOCSpecificationDetails",withoutLabel:!0,key:"siteDetails",type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{component:"NOCDocumentsRequired",withoutLabel:!0,key:"documents",type:"component"}]},{head:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,body:[{component:"NOCSummary",withoutLabel:!0,key:"summary",type:"component"}]}],Si=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),Ni=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),bi=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),Ci=(e,t)=>({type:"UPDATE_NOC_OwnerPhotos",payload:{key:e,value:t}}),yi=(e,t)=>({type:"UPDATE_NOC_OwnerIds",payload:{key:e,value:t}}),Di=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:Ai.filter(t=>t.stepNumber===e.stepNumber)})),Oi=e=>{var i,a,r,u,d,s,m,v,p,f,E,_,g,h,A,S,N;const{t:b}=o.useTranslation(),C=l.useRef(),[y,D]=l.useState(!1),[O,L]=l.useState(!1),[T,I]=l.useState(null),w=Digit.SessionStorage.get("userType");let x={};const R=Digit.ULBService.getStateId(),P=null===(i=window)||void 0===i||null===(a=i.Digit)||void 0===a||null===(r=a.Utils)||void 0===r||null===(u=r.browser)||void 0===u?void 0:u.isMobile();function F(t){null!=e&&e.customOpen?null==e||e.customOpen(t):B(t)}x=(e=>{let t={};return t={containerStyles:{display:"flex",justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap",margin:"0px",padding:"0px"},tagContainerStyles:{margin:"0px",display:"flex",justifyContent:"center",padding:"0px",width:"46%"},tagStyles:{height:"auto",padding:"5px",margin:0,width:"100%",margin:"5px"},textStyles:{wordBreak:"break-word",height:"auto",lineHeight:"16px",overflow:"hidden",maxHeight:"34px"},inputStyles:{width:"43%",minHeight:"42px",maxHeight:"42px",top:"5px",left:"5px"},buttonStyles:{height:"auto",minHeight:"40px",width:"43%",maxHeight:"40px",margin:"5px",padding:"0px"},closeIconStyles:{width:"20px"},uploadFile:{minHeight:"50px"}},t})(),null!=e&&e.uploadMessage&&null!=C&&null!==(d=C.current)&&void 0!==d&&d.value&&(C.current.value="",e.onDelete(),D(!1)),l.useEffect(()=>{var t,l;(null==C||null===(t=C.current)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)<=0&&null!==T&&(C.current.value="",e.onDelete())},[null==C||null===(s=C.current)||void 0===s?void 0:s.files]),l.useEffect(()=>{var e,t,l,n;null!=C&&null!==(e=C.current)&&void 0!==e&&null!==(t=e.files)&&void 0!==t&&t[0]?(D(!0),I(null==C||null===(l=C.current)||void 0===l||null===(n=l.files)||void 0===n?void 0:n[0])):D(!1)},[null==e?void 0:e.message]);const B=function(t){try{if(0===(null==t?void 0:t.length))return Promise.resolve();L(!0);const l=Ot(function(){return Promise.resolve(Digit.UploadServices.Filefetch([t],R)).then(function(l){if(L(!1),null!=l&&l.data){const n=l.data[t];n?window.open(n,"_blank"):null!=e&&e.setError?null==e||e.setError(b("CS_FILE_FETCH_ERROR")):console.error(b("CS_FILE_FETCH_ERROR"))}else null!=e&&e.setError?null==e||e.setError(b("CS_FILE_FETCH_ERROR")):console.error(b("CS_FILE_FETCH_ERROR"))})},function(){L(!1),null!=e&&e.setError?null==e||e.setError(b("CS_FILE_FETCH_ERROR")):console.error(b("CS_FILE_FETCH_ERROR"))});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};return n.createElement(l.Fragment,null,!!(null==e?void 0:e.showHint)&&n.createElement("p",{className:"cell-text"},b(null==e?void 0:e.hintText)),!(null!=e&&e.disabled)&&n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width")+" "+(e.disabled?" disabled":""),style:null!==(m=x)&&void 0!==m&&m.uploadFile?null===(v=x)||void 0===v?void 0:v.uploadFile:{}},n.createElement("div",{style:x?null===(p=x)||void 0===p?void 0:p.containerStyles:null},n.createElement(t.ButtonSelector,{theme:"border",label:b("CS_COMMON_CHOOSE_FILE"),style:c({},x?null===(f=x)||void 0===f?void 0:f.buttonStyles:{},e.disabled?{display:"none"}:{}),textStyles:null==e?void 0:e.textStyles,type:e.buttonType}),null==e||null===(E=e.uploadedFiles)||void 0===E?void 0:E.map((l,i)=>{var o;const a=l[1];return n.createElement("div",{className:"tag-container",style:x?null===(o=x)||void 0===o?void 0:o.tagContainerStyles:null},n.createElement(t.RemoveableTag,{extraStyles:x,key:i,text:l[0],onClick:t=>null==e?void 0:e.removeTargetedFile(a,t)}))}),!e.uploadedFile||e.error?n.createElement("h2",{className:"file-upload-status"},b("ES_NO_FILE_SELECTED_LABEL")):n.createElement("div",{style:P?{width:"80%",display:"flex",marginBottom:"10px",justifyContent:"center"}:null===(_=x)||void 0===_?void 0:_.tagContainerStyles},n.createElement(t.SubmitBar,{onSubmit:()=>{F(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")}))),n.createElement("input",{className:e.disabled?"disabled":"input-mirror-selector-button",style:x?c({},null===(g=x)||void 0===g?void 0:g.inputStyles,null==e?void 0:e.inputStyles):c({},null==e?void 0:e.inputStyles),ref:C,type:"file",id:e.id||"document-"+Math.floor(139*(Math.random()||1)),name:"file",multiple:e.multiple,accept:e.accept,disabled:e.disabled,onChange:t=>e.onUpload(t),onClick:e=>{const{target:t={}}=e||{};t.value=""}})),(null==e?void 0:e.disabled)&&(e.uploadedFile?n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width"),style:null!==(h=x)&&void 0!==h&&h.uploadFile?null===(A=x)||void 0===A?void 0:A.uploadFile:{}},n.createElement(t.SubmitBar,{onSubmit:()=>{F(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")})):n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width")+" "+(e.disabled?" disabled":""),style:null!==(S=x)&&void 0!==S&&S.uploadFile?null===(N=x)||void 0===N?void 0:N.uploadFile:{}},n.createElement("h2",{className:"file-upload-status"},b("ES_NO_FILE_SELECTED_LABEL")))),e.iserror&&n.createElement("p",{style:{color:"red"}},e.iserror),(null==e?void 0:e.showHintBelow)&&n.createElement("p",{className:"cell-text"},b(null==e?void 0:e.hintText)),O&&n.createElement(t.Loader,{page:!0}))},Li=e=>{const{t:i,currentStepData:o,Controller:a,control:r,setValue:u,errors:s,reset:m,useFieldArray:v,watch:p,ownerIdList:f,setOwnerIdList:E,ownerPhotoList:_,setOwnerPhotoList:g}=e,h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[A,S]=(d.useDispatch(),l.useState(!1)),N=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return R({key:"true",error:!0,message:i("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{R(null)},3e3),Promise.resolve();const n=Lt(function(){return Ot(function(){return S(!0),Promise.resolve(Digit.UploadServices.Filestorage("CLU",l,h)).then(function(t){var n,o;if(S(!1),(null==t||null===(n=t.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){const n=t.data.files[0].fileStoreId;E(t=>{const i=[...t],o={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Id":"Owner"+(e+1)+" Id",documentUid:n};return e<=(null==i?void 0:i.length)?i[e]=o:i.push(o),i}),R({key:"true",success:!0,message:i("FILE_UPLOAD_SUCCESS")})}else R({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(){S(!1),R({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{R(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},b=e=>{const t=null==_?void 0:_.filter((t,l)=>l!==e);g(t)},C=e=>{const t=null==f?void 0:f.filter((t,l)=>l!==e);E(t)},y=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return R({key:"true",error:!0,message:i("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{R(null)},3e3),Promise.resolve();const n=Lt(function(){return Ot(function(){return S(!0),Promise.resolve(Digit.UploadServices.Filestorage("NOC",l,h)).then(function(t){var n,o;if(S(!1),(null==t||null===(n=t.data)||void 0===n||null===(o=n.files)||void 0===o?void 0:o.length)>0){const n=t.data.files[0].fileStoreId;g(t=>{const i=[...t],o={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Photo":"Owner"+(e+1)+" Photo",documentUid:n};return e<=(null==i?void 0:i.length)?i[e]=o:i.push(o),i}),R({key:"true",success:!0,message:i("FILE_UPLOAD_SUCCESS")})}else R({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(){S(!1),R({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{R(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},{data:D}=Digit.Hooks.obps.useMDMS(h,"common-masters",["GenderType"]);let O=[];D&&D["common-masters"].GenderType.filter(e=>e.active).map(e=>{O.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const L=e=>{if(!e)return null;const t="string"==typeof e?e:null==e?void 0:e.code;return O.find(e=>e.code===t)||null},{fields:T,append:I,remove:w}=v({control:r,name:"owners"});l.useEffect(()=>{console.log("currentStepData1",o);const e=null==o?void 0:o.applicationDetails;if(!e)return;const t=Array.isArray(e.owners)&&e.owners.length?e.owners.map(e=>({mobileNumber:e.mobileNumber||"",ownerOrFirmName:e.ownerOrFirmName||e.name||"",emailId:e.emailId||"",fatherOrHusbandName:e.fatherOrHusbandName||"",propertyId:e.propertyId||"",gender:L(e.gender),dateOfBirth:e.dateOfBirth||e.dob||"",address:e.address||e.permanentAddress||""})):[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:""}];m(c({},e,{owners:t}))},[o,u,I,m]);const[x,R]=l.useState(null),P=window.location.pathname.includes("edit");return console.log("ownerIdList (local)==>",f),console.log("ownerPhotoList (local)==>",_),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},i("NOC_APPLICANT_DETAILS")),n.createElement("div",null,P&&n.createElement(t.CardSectionSubText,{style:{color:"red",margin:"10px 0px"}}," ","To update your Mobile No, Name, Email, Date of Birth, or Gender, please go the Citizen's Edit Profile section"),T.map((e,l)=>{var d,c,m,v,E,g,A,S,D,I,x,F,B,M,k,U,H,W,j,z,V,G,Y,q,K,X,Q,J;return n.createElement("div",{key:e.id,style:{border:"1px solid #ddd",padding:"16px",marginBottom:"12px"}},n.createElement(t.CardSubHeader,null,0===l?i("NOC_PRIMARY_OWNER"):i("Owner")+" "+(l+1)),n.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,cursor:"pointer"},onClick:()=>(e=>{var t,l;C(e),b(e),null==o||null===(t=o.applicationDetails)||void 0===t||null===(l=t.owners)||void 0===l||l.filter((t,l)=>l!==e),w(e)})(l)},!P&&T.length>1&&"❌"),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_MOBILE_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement("div",{style:{display:"flex"}},n.createElement(a,{control:r,name:"owners["+l+"].mobileNumber",rules:{required:i("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:i("INVALID_MOBILE_NUMBER")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i,disabled:P})}),n.createElement("div",{style:{marginTop:"17px"},className:"search-icon",onClick:P?null:()=>function(e){try{const t=(e=>{var t;return null!=(t=p("owners["+e+"].mobileNumber"))?t:""})(e);return/^[6-9]\d{9}$/.test(t)?Promise.resolve(Ot(function(){return Promise.resolve(Digit.UserService.userSearch(h,{userName:t},{})).then(function(t){var l,n,i,o,a;const r=null!=(l=null==t?void 0:t.user)?l:[];if(!r.length)return void R({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"});const d=r[0];u("owners["+e+"].ownerOrFirmName",null!=(n=d.name)?n:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].emailId",null!=(i=d.emailId)?i:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].fatherOrHusbandName",null!=(o=d.fatherOrHusbandName)?o:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].address",null!=(a=d.permanentAddress)?a:"",{shouldValidate:!0,shouldDirty:!0});const s="string"==typeof d.dob?d.dob:"",c=s?s.slice(0,10):"";u("owners["+e+"].dateOfBirth",c,{shouldValidate:!0,shouldDirty:!0});const m=L(d.gender);u("owners["+e+"].gender",m,{shouldValidate:!0,shouldDirty:!0})})},function(){R({key:"true",error:!0,message:i("FILE_UPLOAD_FAILED")})})):(R({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve())}catch(e){return Promise.reject(e)}}(l)}," ",n.createElement(t.SearchIcon,null)," ")),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(d=s.owners)||void 0===d||null===(c=d[l])||void 0===c||null===(m=c.mobileNumber)||void 0===m?void 0:m.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_FIRM_OWNER_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].ownerOrFirmName",rules:{required:i("REQUIRED_FIELD"),maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i,disabled:P})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(v=s.owners)||void 0===v||null===(E=v[l])||void 0===E||null===(g=E.ownerOrFirmName)||void 0===g?void 0:g.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].emailId",rules:{required:i("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:i("INVALID_EMAIL_FORMAT")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i,disabled:P})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(A=s.owners)||void 0===A||null===(S=A[l])||void 0===S||null===(D=S.emailId)||void 0===D?void 0:D.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].fatherOrHusbandName",rules:{pattern:{value:/^[A-Za-z\s]+$/,message:i("ONLY_ENGLISH_LETTERS_ALLOWED")},maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(I=s.owners)||void 0===I||null===(x=I[l])||void 0===x||null===(F=x.fatherOrHusbandName)||void 0===F?void 0:F.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].address",rules:{required:i("REQUIRED_FIELD"),maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(B=s.owners)||void 0===B||null===(M=B[l])||void 0===M||null===(k=M.address)||void 0===k?void 0:k.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_PROPERTY_ID_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].propertyId",rules:{required:i("REQUIRED_FIELD"),maxLength:{value:100,message:i("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(U=s.owners)||void 0===U||null===(H=U[l])||void 0===H||null===(W=H.propertyId)||void 0===W?void 0:W.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_DOB_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].dateOfBirth",rules:{required:i("REQUIRED_FIELD"),validate:e=>{const t=new Date,l=new Date(e),n=t.getFullYear()-l.getFullYear(),o=t.getMonth()-l.getMonth(),a=t.getDate()-l.getDate();return n>=18||18===n&&(o>0||0===o&&a>=0)||i("DOB_MUST_BE_18_YEARS_OLD")}},render:e=>n.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],disabled:P})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(j=s.owners)||void 0===j||null===(z=j[l])||void 0===z||null===(V=z.dateOfBirth)||void 0===V?void 0:V.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_APPLICANT_GENDER_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+l+"].gender",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.RadioButtons,{t:i,options:O,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:P})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==s||null===(G=s.owners)||void 0===G||null===(Y=G[l])||void 0===Y||null===(q=Y.gender)||void 0===q?void 0:q.message)||""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},i("NOC_APPLICANT_PASSPORT_PHOTO"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(Oi,{id:"passport-photo-"+l,onUpload:y(l),onDelete:()=>{b(l)},uploadedFile:null==_||null===(K=_[l])||void 0===K?void 0:K.filestoreId,message:null!=_&&null!==(X=_[l])&&void 0!==X&&X.filestoreId?"1 "+i("FILEUPLOADED"):i("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:"image/*",disabled:P}))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},i("NOC_APPLICANT_ID_PROOF"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(Oi,{id:"id-proof-"+l,onUpload:N(l),onDelete:()=>{C(l)},uploadedFile:null==f||null===(Q=f[l])||void 0===Q?void 0:Q.filestoreId,message:null!=f&&null!==(J=f[l])&&void 0!==J&&J.filestoreId?"1 "+i("FILEUPLOADED"):i("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:".pdf",disabled:P}))))})),n.createElement("div",null,n.createElement("button",{type:"button",onClick:()=>I({mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:""}),style:{cursor:"pointer"}},!P&&"➕ Add Owner")),x&&n.createElement(t.Toast,{error:null==x?void 0:x.error,warning:null==x?void 0:x.warning,label:i(null==x?void 0:x.message),isDleteBtn:!0,onClose:()=>{R(null)}}))},Ti=e=>{var i,o,a,r,u,d,s,c,m,v,p;const{t:f,currentStepData:E,Controller:_,control:g,setValue:h,errors:A}=e,S=window.localStorage.getItem("CITIZEN.CITY"),[N,b]=l.useState(null),[C,y]=l.useState(null),[D,O]=l.useState(null),[L,T]=l.useState(null),I=Digit.UserService.getUser(),w=null==I||null===(i=I.info)||void 0===i||null===(o=i.roles)||void 0===o?void 0:o.find(e=>"BPA_ARCHITECT"===(null==e?void 0:e.code)),{data:x}=Digit.Hooks.obps.useBPAREGSearch(w?"pb.punjab":S,{},{mobileNumber:null==I||null===(a=I.info)||void 0===a?void 0:a.mobileNumber},{cacheTime:0});return l.useEffect(()=>{console.log("currentStepData2",E);const e=null==E?void 0:E.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;h(t,l)})},[E,h]),l.useEffect(()=>{if(x)for(let i=0;i<(null==x||null===(e=x.Licenses)||void 0===e?void 0:e.length);i++){var e,t,l;if("APPROVED"===(null==x||null===(t=x.Licenses)||void 0===t||null===(l=t[i])||void 0===l?void 0:l.status)){var n;b(null==x||null===(n=x.Licenses)||void 0===n?void 0:n[i]);break}}},[x]),l.useEffect(()=>{var e,t,l,n,i,o,a,r;N&&(y(w?null==N||null===(a=N.tradeLicenseDetail)||void 0===a||null===(r=a.additionalDetail)||void 0===r?void 0:r.counsilForArchNo:null==N?void 0:N.licenseNumber),O((null==N||null===(e=N.tradeLicenseDetail)||void 0===e||null===(t=e.owners)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.permanentAddress)||(null==N||null===(n=N.tradeLicenseDetail)||void 0===n||null===(i=n.owners)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.correspondenceAddress)),T(Digit.DateUtils.ConvertEpochToDate(null==N?void 0:N.validTo)))},[N]),l.useEffect(()=>{C&&(h("professionalRegId",C,{shouldValidate:!0,shouldDirty:!1}),h("professionalAddress",D),h("professionalRegIdValidity",L,{shouldValidate:!0,shouldDirty:!1}))},[D,C,h,L]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},f("NOC_PROFESSIONAL_DETAILS")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,""+f("NOC_PROFESSIONAL_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalName",defaultValue:null==I||null===(r=I.info)||void 0===r?void 0:r.name,rules:{required:f("REQUIRED_FIELD"),maxLength:{value:100,message:f("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:f,disabled:"true"})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=A&&A.professionalName?A.professionalName.message:""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+f("NOC_PROFESSIONAL_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalEmailId",defaultValue:null==I||null===(u=I.info)||void 0===u?void 0:u.emailId,rules:{required:f("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:f("INVALID_EMAIL_FORMAT")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:f,disabled:"true"})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==A||null===(d=A.professionalEmailId)||void 0===d?void 0:d.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+f("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalRegId",rules:{required:f("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:f,disabled:"true"})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==A||null===(s=A.professionalRegId)||void 0===s?void 0:s.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+f("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalRegIdValidity",rules:{required:f("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:f,disabled:"true"})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==A||null===(c=A.professionalRegIdValidity)||void 0===c?void 0:c.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+f("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalMobileNumber",defaultValue:null==I||null===(m=I.info)||void 0===m?void 0:m.mobileNumber,rules:{required:f("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:f("INVALID_MOBILE_NUMBER")}},render:e=>n.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:f,disable:"true"})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==A||null===(v=A.professionalMobileNumber)||void 0===v?void 0:v.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+f("NOC_PROFESSIONAL_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(_,{control:g,name:"professionalAddress",rules:{required:f("REQUIRED_FIELD"),maxLength:{value:100,message:f("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:f,disabled:"true",disable:"true"})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==A||null===(p=A.professionalAddress)||void 0===p?void 0:p.message)||""))))},Ii=e=>{var i,o,a,r,u,d,s,m,v,p,f,E,_,g,h,A,S,N,b,C;let y;y=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const D=Digit.ULBService.getStateId(),{t:O,currentStepData:L,Controller:T,control:I,setValue:w,errors:x,errorStyle:R,useFieldArray:P,watch:F}=e,[B,M]=l.useState("0.00"),k=F("netPlotAreaAfterWidening"),U=F("areaLeftForRoadWidening");l.useEffect(()=>{const e=parseFloat(k),t=parseFloat(U),l=((isNaN(e)?0:e)+(isNaN(t)?0:t)).toFixed(2);M(l),w("netTotalArea",l)},[k,U]);const[H,W]=l.useState("0.00"),{fields:j,append:z,remove:V}=P({control:I,name:"floorArea"}),G=F("floorArea"),Y=F("basementArea");l.useEffect(()=>{const e=null==G?void 0:G.reduce((e,t)=>{const l=parseFloat(null==t?void 0:t.value);return e+(isNaN(l)?0:l)},0),t=isNaN(Y)?0:Y,l=(e+parseFloat(t)).toFixed(2);W(l),w("totalFloorArea",l)},[G,Y]);const[q,K]=l.useState((null==L||null===(i=L.siteDetails)||void 0===i?void 0:i.ulbName)||null),[X,Q]=l.useState((null==L||null===(o=L.siteDetails)||void 0===o?void 0:o.ulbType)||""),[J,Z]=l.useState((null==L||null===(a=L.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:$,isLoading:ee}=Digit.Hooks.noc.useBuildingType(D),{data:te,isLoading:le}=Digit.Hooks.noc.useRoadType(D),{data:ne,isLoading:ie}=Digit.Hooks.useTenants(),oe=null==ne?void 0:ne.map(e=>c({},e,{displayName:O(e.i18nKey)}));l.useEffect(()=>{if(q){var e;const t=null==q||null===(e=q.city)||void 0===e?void 0:e.ulbType;Q(t),w("ulbType",t)}},[q,w]);const[ae,re]=l.useState((null==L||null===(r=L.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),ue=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],de=Digit.Hooks.noc.useTenants(),[se,ce]=l.useState(de),{data:me,isLoading:ve}=Digit.Hooks.useCustomMDMS(D,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+y+"')]"}]),[pe,fe]=l.useState((null==L||null===(u=L.siteDetails)||void 0===u?void 0:u.district)||null);return l.useEffect(()=>{if(y&&(null==de?void 0:de.length)>0){const e=de.find(e=>e.code===y);e&&(fe(e),w("district",e))}},[y,de]),l.useEffect(()=>{const e=null==L?void 0:L.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,l]=e;"floorArea"!==t&&w(t,l)}),Array.isArray(e.floorArea))){for(let e=j.length-1;e>=0;e--)V(e);e.floorArea.forEach(e=>{z({value:e.value||""})})}},[L,w,z,V]),n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardSectionHeader,{className:"card-section-header"},O("NOC_SITE_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_PLOT_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"plotNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=x&&x.plotNo?x.plotNo.message:""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},O("NOC_PROPOSED_SITE_ADDRESS"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"proposedSiteAddress",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:200,message:O("MAX_200_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=x&&x.proposedSiteAddress?x.proposedSiteAddress.message:""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ULB_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!ie&&n.createElement(T,{control:I,name:"ulbName",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{K(t),e.onChange(t)},selected:e.value,option:oe,optionKey:"displayName",t:O})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=x&&x.ulbName?x.ulbName.message:""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ULB_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"ulbType",render:e=>n.createElement(t.TextInput,{value:X||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_KHASRA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"khasraNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(d=x.khasraNo)||void 0===d?void 0:d.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_HADBAST_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"hadbastNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(s=x.hadbastNo)||void 0===s?void 0:s.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ROAD_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!le&&n.createElement(T,{control:I,name:"roadType",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:te,optionKey:"name",t:O})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(m=x.roadType)||void 0===m?void 0:m.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"areaLeftForRoadWidening",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(v=x.areaLeftForRoadWidening)||void 0===v?void 0:v.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"netPlotAreaAfterWidening",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(p=x.netPlotAreaAfterWidening)||void 0===p?void 0:p.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_NET_TOTAL_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"netTotalArea",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},defaultValue:B,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disabled:"true"})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(f=x.netTotalArea)||void 0===f?void 0:f.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ROAD_WIDTH_AT_SITE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"roadWidthAtSite",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=x&&x.roadWidthAtSite?x.roadWidthAtSite.message:""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_BUILDING_STATUS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!ee&&n.createElement(T,{control:I,name:"buildingStatus",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{Z(t),e.onChange(t)},selected:e.value,option:$,optionKey:"name",t:O})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(E=x.buildingStatus)||void 0===E?void 0:E.message)||""))),"BUILTUP"===(null==J?void 0:J.code)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"isBasementAreaAvailable",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{re(t),e.onChange(t)},selected:e.value,option:ue,optionKey:"i18nKey",t:O})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(_=x.isBasementAreaAvailable)||void 0===_?void 0:_.message)||""))),"BUILTUP"===(null==J?void 0:J.code)&&"YES"===(null==ae?void 0:ae.code)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_BASEMENT_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"basementArea",rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=x&&x.basementArea?x.basementArea.message:""))),"BUILTUP"===(null==J?void 0:J.code)&&j.map((e,l)=>n.createElement("div",{style:{display:"flex",gap:"10px",flexDirection:"column"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},0===l?"Ground":""+l," Floor Area(sq mt)",n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{key:e.id,className:"field",style:{display:"flex",gap:"10px"}},n.createElement(T,{control:I,name:"floorArea."+l+".value",defaultValue:e.value,rules:{required:O("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:O("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var i,o;return n.createElement(n.Fragment,null,n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}}),(null==x||null===(i=x.floorArea)||void 0===i||null===(o=i[l])||void 0===o?void 0:o.value)&&n.createElement(t.CardLabelError,{className:R},x.floorArea[l].value.message))}}),n.createElement("button",{type:"button",onClick:()=>V(l)},"❌")))),"BUILTUP"===(null==J?void 0:J.code)&&n.createElement("button",{type:"button",onClick:()=>z({value:""})},"➕ Add Floor"),"BUILTUP"===(null==J?void 0:J.code)&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"totalFloorArea",defaultValue:H,render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_WARD_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"wardNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(g=x.wardNo)||void 0===g?void 0:g.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_DISTRICT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"district",rules:{required:O("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{fe(t),e.onChange(t)},selected:e.value,option:se.sort((e,t)=>e.name.localeCompare(t.name)),optionKey:"name",disable:"true",t:O})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(h=x.district)||void 0===h?void 0:h.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_ZONE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!ve&&n.createElement(T,{control:I,name:"zone",rules:{required:O("REQUIRED_FIELD")},render:e=>{var l,i,o;return n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:null==me||null===(l=me.tenant)||void 0===l||null===(i=l.zoneMaster)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.zones,optionKey:"code",t:O})}}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(A=x.zone)||void 0===A?void 0:A.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_VILLAGE_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"villageName",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(S=x.villageName)||void 0===S?void 0:S.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_COLONY_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"colonyName",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(N=x.colonyName)||void 0===N?void 0:N.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_VASIKA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"vasikaNumber",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(b=x.vasikaNumber)||void 0===b?void 0:b.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+O("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(T,{control:I,name:"khewatAndKhatuniNo",rules:{required:O("REQUIRED_FIELD"),maxLength:{value:100,message:O("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==x||null===(C=x.khewatAndKhatuniNo)||void 0===C?void 0:C.message)||"")))),n.createElement(t.BreakLine,null)))},wi=e=>{var i,o,a,r;const{t:u,currentStepData:d,Controller:s,control:c,setValue:m,errors:v}=e,p=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[f,E]=l.useState((null==d||null===(i=d.siteDetails)||void 0===i?void 0:i.specificationBuildingCategory)||null),{data:_,isLoading:g}=Digit.Hooks.noc.useBuildingCategory(p),{data:h,isLoading:A}=Digit.Hooks.noc.useNocType(p),S=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return l.useEffect(()=>{console.log("currentStepData4",d);const e=null==d?void 0:d.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;m(t,l)})},[d,m]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,null,u("NOC_SPECIFICATION_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(s,{control:c,name:"specificationPlotArea",rules:{required:u("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:u("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:u("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextInput,{className:"form-field",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:u})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=v&&v.specificationPlotArea?v.specificationPlotArea.message:""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_BUILDING_CATEGORY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!g&&_.length>0&&n.createElement(s,{control:c,name:"specificationBuildingCategory",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{E(t),e.onChange(t)},selected:e.value,option:_,optionKey:"name",t:u})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=v&&v.specificationBuildingCategory?v.specificationBuildingCategory.message:""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_NOC_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!A&&n.createElement(s,{control:c,name:"specificationNocType",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:h,optionKey:"name",t:u})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==v||null===(o=v.specificationNocType)||void 0===o?void 0:o.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_RESTRICTED_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(s,{control:c,name:"specificationRestrictedArea",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:S,optionKey:"i18nKey",t:u})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==v||null===(a=v.specificationRestrictedArea)||void 0===a?void 0:a.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+u("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(s,{control:c,name:"specificationIsSiteUnderMasterPlan",rules:{required:u("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:S,optionKey:"i18nKey",t:u})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==v||null===(r=v.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.message)||"")))))};function xi(e){var l,o,a,r,u,s,c,m,v,p,f,E,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,x,R,P,F,B,M,k,U,H,W,j,z,V,G,Y,q,K,X,Q,J,Z,$,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,me,ve,pe,fe,Ee,_e,ge;let{currentStepData:he,t:Ae}=e;i.useLocation(),i.useHistory(),d.useDispatch(),console.log("formData in Summary Page",he);const Se={fontSize:"18px",fontWeight:"600",color:"#0b4b66",marginBottom:"12px",marginTop:"20px",borderBottom:"2px solid #0b4b66",paddingBottom:"8px"},Ne={background:"#fafafa",padding:"16px",borderRadius:"4px",marginBottom:"16px",border:"1px solid #e0e0e0"},be={display:"flex",flexDirection:"row",marginBottom:"8px",alignItems:"flex-start"},Ce={fontWeight:"600",minWidth:"200px",marginRight:"16px"},ye=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}}),De=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerPhotos)||[]}),Oe=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerIds)||[]});console.log("coordinates in summary page",ye);const Le=(e,l)=>n.createElement("div",{style:be},n.createElement(t.CardLabel,{style:Ce},e),n.createElement("div",null,l||"NA"));Digit.UserService.getUser();let Te=null==he||null===(l=he.documents)||void 0===l||null===(o=l.documents)||void 0===o?void 0:o.documents;return console.log("documents here in summary",Te),n.createElement("div",{style:{padding:"16px",background:"#fff"}},n.createElement("h2",{style:Se},Ae("OWNER_OWNERPHOTO")),n.createElement("div",{style:Ne},n.createElement(An,{ownerFileStoreId:null==De||null===(a=De.ownerPhotoList)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.filestoreId,ownerName:null==he||null===(u=he.applicationDetails)||void 0===u||null===(s=u.owners)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.ownerOrFirmName})),null===(m=null!=(v=null==he||null===(p=he.applicationDetails)||void 0===p?void 0:p.owners)?v:[])||void 0===m?void 0:m.map((e,t)=>{var l;return n.createElement("div",{key:t,style:Ne},n.createElement("h2",{style:Se},0===t?Ae("NOC_PRIMARY_OWNER"):"Owner "+(t+1)),Le(Ae("NOC_FIRM_OWNER_NAME_LABEL"),null==e?void 0:e.ownerOrFirmName),Le(Ae("NOC_APPLICANT_EMAIL_LABEL"),null==e?void 0:e.emailId),Le(Ae("BPA_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),null==e?void 0:e.fatherOrHusbandName),Le(Ae("NOC_APPLICANT_MOBILE_NO_LABEL"),null==e?void 0:e.mobileNumber),Le(Ae("NOC_APPLICANT_PROPERTY_ID_LABEL"),null==e?void 0:e.propertyId),Le(Ae("NOC_APPLICANT_DOB_LABEL"),(e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t})(null==e?void 0:e.dateOfBirth)),Le(Ae("NOC_APPLICANT_GENDER_LABEL"),null==e||null===(l=e.gender)||void 0===l?void 0:l.code),Le(Ae("NOC_APPLICANT_ADDRESS_LABEL"),null==e?void 0:e.address))}),(null==he||null===(f=he.applicationDetails)||void 0===f?void 0:f.professionalName)&&n.createElement(n.Fragment,null,n.createElement("h2",{style:Se},Ae("NOC_PROFESSIONAL_DETAILS")),n.createElement("div",{style:Ne},Le(Ae("NOC_PROFESSIONAL_NAME_LABEL"),null==he||null===(E=he.applicationDetails)||void 0===E?void 0:E.professionalName),Le(Ae("NOC_PROFESSIONAL_EMAIL_LABEL"),null==he||null===(_=he.applicationDetails)||void 0===_?void 0:_.professionalEmailId),Le(Ae("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),null==he||null===(g=he.applicationDetails)||void 0===g?void 0:g.professionalRegId),Le(Ae("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),null==he||null===(h=he.applicationDetails)||void 0===h?void 0:h.professionalRegIdValidity),Le(Ae("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),null==he||null===(A=he.applicationDetails)||void 0===A?void 0:A.professionalMobileNumber),Le(Ae("NOC_PROFESSIONAL_ADDRESS_LABEL"),null==he||null===(S=he.applicationDetails)||void 0===S?void 0:S.professionalAddress))),n.createElement("h2",{style:Se},Ae("NOC_SITE_DETAILS")),n.createElement("div",{style:Ne},Le(Ae("NOC_PLOT_NO_LABEL"),null==he||null===(N=he.siteDetails)||void 0===N?void 0:N.plotNo),Le(Ae("NOC_PROPOSED_SITE_ADDRESS"),null==he||null===(b=he.siteDetails)||void 0===b?void 0:b.proposedSiteAddress),Le(Ae("NOC_ULB_NAME_LABEL"),null==he||null===(C=he.siteDetails)||void 0===C||null===(y=C.ulbName)||void 0===y?void 0:y.name),Le(Ae("NOC_ULB_TYPE_LABEL"),null==he||null===(D=he.siteDetails)||void 0===D?void 0:D.ulbType),Le(Ae("NOC_KHASRA_NO_LABEL"),null==he||null===(O=he.siteDetails)||void 0===O?void 0:O.khasraNo),Le(Ae("NOC_HADBAST_NO_LABEL"),null==he||null===(L=he.siteDetails)||void 0===L?void 0:L.hadbastNo),Le(Ae("NOC_ROAD_TYPE_LABEL"),null==he||null===(T=he.siteDetails)||void 0===T||null===(I=T.roadType)||void 0===I?void 0:I.name),Le(Ae("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),null==he||null===(w=he.siteDetails)||void 0===w?void 0:w.areaLeftForRoadWidening),Le(Ae("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),null==he||null===(x=he.siteDetails)||void 0===x?void 0:x.netPlotAreaAfterWidening),Le(Ae("NOC_NET_TOTAL_AREA_LABEL"),null==he||null===(R=he.siteDetails)||void 0===R?void 0:R.netTotalArea),Le(Ae("NOC_ROAD_WIDTH_AT_SITE_LABEL"),null==he||null===(P=he.siteDetails)||void 0===P?void 0:P.roadWidthAtSite),Le(Ae("NOC_BUILDING_STATUS_LABEL"),null==he||null===(F=he.siteDetails)||void 0===F||null===(B=F.buildingStatus)||void 0===B?void 0:B.name),(null==he||null===(M=he.siteDetails)||void 0===M?void 0:M.isBasementAreaAvailable)&&Le(Ae("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),null==he||null===(k=he.siteDetails)||void 0===k||null===(U=k.isBasementAreaAvailable)||void 0===U?void 0:U.code),(null==he||null===(H=he.siteDetails)||void 0===H?void 0:H.basementArea)&&Le(Ae("NOC_BASEMENT_AREA_LABEL"),null==he||null===(W=he.siteDetails)||void 0===W?void 0:W.basementArea),"BUILTUP"===(null==he||null===(j=he.siteDetails)||void 0===j||null===(z=j.buildingStatus)||void 0===z?void 0:z.code)&&(null==he||null===(V=he.siteDetails)||void 0===V||null===(G=V.floorArea)||void 0===G?void 0:G.map((e,t)=>Le((e=>{if(0===e)return Ae("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,l=e%100;let n="th";return(l<11||l>13)&&(1===t?n="st":2===t?n="nd":3===t&&(n="rd")),""+e+n+" "+Ae("NOC_FLOOR_AREA_LABEL")})(t),null==e?void 0:e.value))),"BUILTUP"===(null==he||null===(Y=he.siteDetails)||void 0===Y||null===(q=Y.buildingStatus)||void 0===q?void 0:q.code)&&Le(Ae("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),null==he||null===(K=he.siteDetails)||void 0===K?void 0:K.totalFloorArea),Le(Ae("NOC_DISTRICT_LABEL"),null==he||null===(X=he.siteDetails)||void 0===X||null===(Q=X.district)||void 0===Q?void 0:Q.name),Le(Ae("NOC_ZONE_LABEL"),null==he||null===(J=he.siteDetails)||void 0===J||null===(Z=J.zone)||void 0===Z?void 0:Z.name),Le(Ae("NOC_SITE_WARD_NO_LABEL"),null==he||null===($=he.siteDetails)||void 0===$?void 0:$.wardNo),Le(Ae("NOC_SITE_VILLAGE_NAME_LABEL"),null==he||null===(ee=he.siteDetails)||void 0===ee?void 0:ee.villageName),Le(Ae("NOC_SITE_COLONY_NAME_LABEL"),null==he||null===(te=he.siteDetails)||void 0===te?void 0:te.colonyName),Le(Ae("NOC_SITE_VASIKA_NO_LABEL"),null==he||null===(le=he.siteDetails)||void 0===le?void 0:le.vasikaNumber),Le(Ae("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),null==he||null===(ne=he.siteDetails)||void 0===ne?void 0:ne.khewatAndKhatuniNo)),n.createElement("h2",{style:Se},Ae("NOC_SPECIFICATION_DETAILS")),n.createElement("div",{style:Ne},Le(Ae("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),null==he||null===(ie=he.siteDetails)||void 0===ie?void 0:ie.specificationPlotArea),Le(Ae("NOC_BUILDING_CATEGORY_LABEL"),null==he||null===(oe=he.siteDetails)||void 0===oe||null===(ae=oe.specificationBuildingCategory)||void 0===ae?void 0:ae.name),Le(Ae("NOC_NOC_TYPE_LABEL"),null==he||null===(re=he.siteDetails)||void 0===re||null===(ue=re.specificationNocType)||void 0===ue?void 0:ue.name),Le(Ae("NOC_RESTRICTED_AREA_LABEL"),null==he||null===(de=he.siteDetails)||void 0===de||null===(se=de.specificationRestrictedArea)||void 0===se?void 0:se.code),Le(Ae("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),null==he||null===(ce=he.siteDetails)||void 0===ce||null===(me=ce.specificationIsSiteUnderMasterPlan)||void 0===me?void 0:me.code)),n.createElement("h2",{style:Se},Ae("NOC_SITE_COORDINATES_LABEL")),n.createElement("div",{style:Ne},Le(Ae("COMMON_LATITUDE1_LABEL"),null==ye?void 0:ye.Latitude1),Le(Ae("COMMON_LONGITUDE1_LABEL"),null==ye?void 0:ye.Longitude1),Le(Ae("COMMON_LATITUDE2_LABEL"),null==ye?void 0:ye.Latitude2),Le(Ae("COMMON_LONGITUDE2_LABEL"),null==ye?void 0:ye.Longitude2)),n.createElement("h2",{style:Se},Ae("NOC_UPLOADED_OWNER_ID")),n.createElement("div",{style:Ne},(null==Oe||null===(ve=Oe.ownerIdList)||void 0===ve?void 0:ve.length)>0&&n.createElement(gn,{documents:null==Oe?void 0:Oe.ownerIdList})),n.createElement("h2",{style:Se},Ae("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement("div",{style:Ne},(null==he||null===(pe=he.documents)||void 0===pe||null===(fe=pe.documents)||void 0===fe||null===(Ee=fe.documents)||void 0===Ee?void 0:Ee.length)>0&&n.createElement(gn,{documents:null==he||null===(_e=he.documents)||void 0===_e||null===(ge=_e.documents)||void 0===ge?void 0:ge.documents})),n.createElement("h2",{style:Se},Ae("NOC_FEE_DETAILS_LABEL")),n.createElement("div",{style:Ne},he&&n.createElement(hn,{formData:he})))}function Ri(e){var i;let{t:o,document:a,setDocuments:r,setError:u,documents:d,action:m,formData:v,handleSubmit:p,geocoordinates:f,setGeoCoordinates:E,dispatch:_}=e;const g=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],[h,A]=(Digit.ULBService.getCurrentTenantId(),l.useState(g?c({},g,{active:!0===(null==a?void 0:a.active),code:null==g?void 0:g.documentType}):1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{})),[S,N]=l.useState(null),[b,C]=l.useState(()=>(null==g?void 0:g.filestoreId)||null);function y(e){const t=e.target.files[0];N(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),l=s.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&l){const n=x(e).toFixed(6),i=x(l).toFixed(6);t({latitude:n,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){console.log("EXIF parsing failed:",e),t({latitude:null,longitude:null})}})}(t).then(e=>{console.log("Latitude:",e.latitude),console.log("Longitude:",e.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(bi("Latitude1",e.latitude)),_(bi("Longitude1",e.longitude)),E(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(_(bi("Latitude1","")),_(bi("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(_(bi("Latitude2",e.latitude)),_(bi("Longitude2",e.longitude)),E(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(_(bi("Latitude2","")),_(bi("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:D}=a;var O=D;const[L,T]=l.useState(!1),[I,w]=l.useState(!1);function x(e){return e[0]+e[1]/60+e[2]/3600}return l.useEffect(()=>{null!=h&&h.code&&r(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==b?void 0:b.length)||null===b?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==b))||[],{documentType:null==h?void 0:h.code,filestoreId:b,documentUid:b,documentAttachment:b}]})},[b,h]),l.useEffect(()=>{(null==d?void 0:d.length)>0&&(console.log("documents here",d),p())},[d]),l.useEffect(()=>{if("update"===m){var e,t;const l=null==v||null===(e=v.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==a?void 0:a.code))[0],n=O.filter(e=>e.code===(null==l?void 0:l.documentType)).map(e=>{var t;return c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];n?(A(n),C(null==l?void 0:l.fileStoreId)):T(!0)}},[]),l.useEffect(()=>{var e;null!=a&&a.hasDropdown||A({code:null==a?void 0:a.code,i18nKey:null==a||null===(e=a.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),l.useEffect(()=>{!function(){try{u(null);const e=function(){if(S){w(!0);const e=function(){if(S.size>=5242880)w(!1),u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Ot(function(){return C(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",S,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?C(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),u(o("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)}}()},[S]),l.useEffect(()=>{L&&C(null)},[L]),n.createElement("div",{style:{marginBottom:"24px"}},I&&n.createElement(t.Loader,null),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"bpa-doc-required-label"},o(null==a?void 0:a.code.replaceAll(".","_"))," ",(null==a?void 0:a.required)&&n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"bpa-doc-required-field"},n.createElement(Oi,"OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?{id:"noc-doc",onUpload:y,onDelete:()=>{C(null)},uploadedFile:b,message:b?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".jpg, .jpeg, .png"}:{id:"noc-doc",onUpload:y,onDelete:()=>{C(null)},uploadedFile:b,message:b?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".pdf, .jpeg, .jpg, .png"})),n.createElement("p",{style:{padding:"10px",fontSize:"14px"}},o("OWNER.OWNERPHOTO"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)||"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)?"Only .png, .jpeg, .jpg files are accepted with maximum size of 5 MB":"Only .pdf, .png, .jpeg, .jpg files are accepted with maximum size of 5 MB")),"OWNER.SITEPHOTOGRAPHONE"===(null==a?void 0:a.code)&&(null==f?void 0:f.Latitude1)&&(null==f?void 0:f.Longitude1)&&n.createElement("p",{className:"bpa-doc-required-coordinates"},"Latitude: ",f.Latitude1," & Longitude: ",f.Longitude1," "),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null==f?void 0:f.Latitude2)&&(null==f?void 0:f.Longitude2)&&n.createElement("p",{className:"bpa-doc-required-coordinates"},"Latitude: ",f.Latitude2," & Longitude: ",f.Longitude2)))}const Pi=n.memo(function(e){var i,o,a;let{t:r,document:u,setDocuments:d,documents:m,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:f,handleSubmit:E}=e;console.log("documents here",m);const _=(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]);console.log("filteredDocument here",_);const g=Digit.ULBService.getStateId(),[h,A]=l.useState(_?c({},_,{active:!0,code:null==_?void 0:_.documentType,i18nKey:null==_?void 0:_.documentType}):(null==u||null===(i=u.dropdownData)||void 0===i?void 0:i.length)>0?null==u?void 0:u.dropdownData[0]:{}),[S,N]=l.useState(null),[b,C]=l.useState(()=>(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[y,D]=l.useState([]),[O,L]=l.useState([]),[T,I]=l.useState([]||(null==v||null===(o=v.documents)||void 0===o?void 0:o.documents.filter(e=>e.documentType===h.code))),[w,x]=l.useState(null),[R,P]=l.useState(null);function F(e){return e[0]+e[1]/60+e[2]/3600}l.useEffect(()=>{(null==m?void 0:m.length)>0&&E()},[m]),l.useEffect(()=>{O.length>0&&null!=h&&h.code&&(d(e=>{if(null===b||null==(null==b?void 0:b.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId);let l=[];return O&&O.map((e,t)=>{var n,i;l.push({documentType:null==h?void 0:h.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:w,longitude:R},documentUid:e.fileStoreId,fileName:(null===(n=T[t])||void 0===n?void 0:n.name)||"",id:m?null===(i=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===i?void 0:i.id:void 0})}),console.log("newfiles here",l),[...t,...l]}),L([])),null!=h&&h.code&&d(e=>{var t;return null===b||null==(null==b?void 0:b.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,l,n,i,o;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(l=e.documentType)||void 0===l?void 0:l.split(".")[1])==(null==h||null===(n=h.code)||void 0===n?void 0:n.split(".")[0])+"."+(null==h||null===(i=h.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==h?void 0:h.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==b.fileStoreId),{documentType:null==h?void 0:h.code,fileStoreId:b.fileStoreId,documentUid:b.fileStoreId,fileName:(null==S?void 0:S.name)||b.fileName||"document",id:m?null===(t=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[b,h]),l.useEffect(()=>{h.code||null===b||L([...O,b])},[b]);const B=l.useMemo(()=>{var e,t;console.log("uploadFiles here from formData",v);let l=[];return null==v||null===(e=v.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===h.code).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:g}}])),console.log("selectedUplDocs here",l),l},[v]);return n.createElement("div",null,n.createElement(t.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:g,getFormState:function(e){let t,l,n=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{s.getData(e,function(){const e=s.getTag(this,"GPSLatitude"),l=s.getTag(this,"GPSLongitude");if(e&&l){const n=F(e),i=F(l);t({latitude:n,longitude:i})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),x(i.latitude),P(i.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),l=Object.values(t),l=null==v||null===(o=v.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),D(l);let s=[];null==e||e.map((e,t)=>{var l,n,o,a;s.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude},fileStoreId:null==e||null===(l=e[1])||void 0===l||null===(n=l.fileStoreId)||void 0===n?void 0:n.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:m?null===(a=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===a?void 0:a.id:void 0})});const c=[...m.filter(e=>e.documentType!==n),...s];d(c),null===(r=l)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=n,function(e,t){e&&N(e.file),e&&I([...T,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...m.filter(e=>e.documentType!==n)];d(e)}},setuploadedstate:B,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&n.createElement(Tl,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==u?void 0:u.code)&&(sessionStorage.getItem("Latitude")&&sessionStorage.getItem("Longitude")?n.createElement("div",null,n.createElement("p",null,"Latitude: ",sessionStorage.getItem("Latitude")),n.createElement("p",null,"Longitude: ",sessionStorage.getItem("Longitude")),f(!1)," "):n.createElement("div",null,n.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),f(!0)," ")))}),Fi=[{head:"APPLICATION DETAILS",stepLabel:"NOC_APPLICATION_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewNOCStepFormOne",key:"applicationDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SITE DETAILS",stepLabel:"NOC_SITE_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewNOCStepFormTwo",key:"siteDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewNOCStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewNOCStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:null==Ai?void 0:Ai.filter(t=>(null==t?void 0:t.stepNumber)===(null==e?void 0:e.stepNumber))})),Bi=["tenantId","payments","pdfkey","EmpData"],Mi=e=>{var i,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=o.useTranslation(),p=Digit.UserService.getUser().info;return n.createElement(l.Fragment,null,n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICATION_NUMBER")),n.createElement(t.TextInput,{name:"applicationNo",inputRef:u({})})),n.createElement(t.SearchField,null,n.createElement("label",null,v("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:u({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:n.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),n.createElement(t.CardLabelError,null,null==m||null===(i=m.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),n.createElement(t.SearchField,{className:"submit"},n.createElement(t.SubmitBar,{label:v("ES_COMMON_SEARCH"),submit:!0}),n.createElement("p",{style:{marginTop:"24px"},onClick:()=>{c({applicationNo:"",mobileNumber:"",offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",isSubmitSuccessful:"false"}),d("offset",s("offset")-s("limit")),null==e||e.onSubmit({offset:0,limit:10,sortBy:"createdTime",sortOrder:"DESC",mobileNumber:null==p?void 0:p.mobileNumber},!0),null!=e&&e.isMobileView&&e.closeMobilePopupModal()}},v("ES_COMMON_CLEAR_ALL"))))},ki=["currentlyActiveMobileModal"],Ui=["currentlyActiveMobileModal"],Hi=e=>{var i,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:f}=o.useTranslation(),{handleSubmit:E}=a.useFormContext(),[_,g]=l.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),h=()=>{g({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),S=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,i=m(e,ki);const{closeMobilePopupModal:o}=i;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,i,n.createElement(A,null),n.createElement("div",{className:"MobilePopupHeadingWrapper"},n.createElement("h2",null,f("ACTION_TEST_SEARCH_NOC_APPLICATION"),":")),n.createElement(u,{onSubmit:p,handleSubmit:E,isMobileView:!0,closeMobilePopupModal:o}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,Ui)))},[_]);return s?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"searchBox"},n.createElement(t.SearchAction,{text:f("ES_COMMON_SEARCH"),handleActionClick:()=>g({type:"set",payload:"SearchFormComponent"})})),_?n.createElement(t.PopUp,null,n.createElement(S,{onSubmit:e=>{g({type:"remove"}),p(e)},handleSubmit:E,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:_,closeMobilePopupModal:h})):null,null!=v&&null!==(i=v[0])&&void 0!==i&&i.display?n.createElement(t.Card,{style:{marginTop:20}},f(null==v||null===(r=v[0])||void 0===r?void 0:r.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.DetailsCard,{data:d,isTwoDynamicPrefix:!1,linkPrefix:"/digit-ui/citizen/noc/search/application-overview/",serviceRequestIdKey:f("NOC_APPLICATION_NUMBER")}))},Wi=e=>{let{columns:i,SearchFormFieldsComponent:r,onSubmit:u,data:d,isLoading:s,Count:c}=e;const{handleSubmit:m,setValue:v,getValues:p}=a.useFormContext();null==p("offset")&&v("offset",0),null==p("limit")&&v("limit",10);const[f,E]=l.useState(Number(p("offset"))/Number(p("limit"))),{t:_}=o.useTranslation(),g=()=>{v("offset",c&&10*Math.ceil(c/10)-p("limit")),m(u)()},h=()=>{v("offset",0),m(u)()},A=l.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function S(e){v("limit",Number(e.target.value)),m(u)()}function N(){v("offset",Number(p("offset"))+Number(p("limit"))),m(u)()}function b(){v("offset",Number(p("offset"))-Number(p("limit"))),m(u)()}l.useEffect(()=>{null!=p("offset")&&null!=p("limit")&&E(Number(p("offset"))/Number(p("limit")))},[p("offset"),p("limit")]);const C=()=>{return s?n.createElement(t.Loader,null):null!=d&&null!==(e=d[0])&&void 0!==e&&e.display?n.createElement(t.Card,{style:{marginTop:20}},_(null==d||null===(l=d[0])||void 0===l?void 0:l.display).split("\\n").map((e,t)=>n.createElement("p",{key:t,style:{textAlign:"center"}},e))):n.createElement(t.Table,{t:_,data:d,columns:i,getCellProps:e=>({style:{minWidth:e.column.Header===_("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:S,currentPage:f,onNextPage:N,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:g,onFirstPage:h,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]});var e,l};return n.createElement(n.Fragment,null,n.createElement(t.SearchForm,{onSubmit:u,handleSubmit:m},n.createElement(r,{onSubmit:u,handleSubmit:m,isMobileView:!1})),n.createElement(C,null))},ji=e=>{let{t:t,onSubmit:r,data:u,error:d,isLoading:s,Count:c}=e;const[m,v]=l.useState(null),p=a.useForm();l.useEffect(()=>{p.register("offset",0),p.register("limit",10),p.register("sortBy","createdTime"),p.register("sortOrder","DESC")},[p.register]);const f=(()=>{const{t:e}=o.useTranslation();return l.useMemo(()=>[{Header:e("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement("span",{className:"link"},n.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+t.original.applicationNo},t.original.applicationNo)))}},{Header:e("TL_COMMON_TABLE_COL_APP_DATE"),disableSortBy:!0,accessor:t=>e((null==t?void 0:t.date)||"-")},{Header:e("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:t=>e((null==t?void 0:t.applicationStatus)||"-"),disableSortBy:!0}],[])})(),E=window.Digit.Utils.browser.isMobile(),_=l.useMemo(()=>null==u?void 0:u.map(e=>({[t("NOC_APPLICATION_NUMBER")]:(null==e?void 0:e.applicationNo)||"-",[t("TL_COMMON_TABLE_COL_APP_DATE")]:(null==e?void 0:e.date)||"-",[t("PT_COMMON_TABLE_COL_STATUS_LABEL")]:null!=e&&e.applicationStatus?t(""+e.applicationStatus):"-"})),[u]);return n.createElement(a.FormProvider,p,E?n.createElement(Hi,{SearchFormFieldsComponent:Mi,propsMobileInboxCards:_,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(Wi,{columns:f,SearchFormFieldsComponent:Mi,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},zi=e=>{let{matchPath:l}=e;const{t:i}=o.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const d=[{link:l+"/noc/new-application",i18nKey:i("NOC_NEW_APPLICATION")},{link:l+"/noc/my-application",i18nKey:i("NOC_MY_APPLICATION")},{link:l+"/noc/search-application",i18nKey:i("NOC_SEARCH_APPLICATION")}];return n.createElement(t.CitizenHomeCard,{header:i("ACTION_TEST_NOC"),links:d,Icon:()=>n.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},Vi=e=>{let{stateCode:l,userType:o,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:l,moduleCode:"NOC",language:u});return Digit.SessionStorage.set("NOC_TENANTS",a),d?n.createElement(t.Loader,null):"citizen"===o?n.createElement(_i,null):n.createElement(Rt,{path:r,stateCode:l})},Gi={NOCModule:Vi,NOCCard:()=>{var e,a;const{t:r}=o.useTranslation(),u=i.useLocation(),d=Digit.ULBService.getCurrentTenantId();if(!Digit.Utils.NOCAccess())return null;const s={filterForm:{moduleName:"noc-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},searchForm:{},tableForm:{limit:10,offset:0}},{isLoading:m,data:{totalCount:v,nearingSlaCount:p}={}}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},s),config:{enabled:(null==s||null===(e=s.filterForm)||void 0===e||null===(a=e.businessServiceArray)||void 0===a?void 0:a.length)>0}}),E=()=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},n.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),n.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",fill:"white"}));l.useEffect(()=>{"/digit-ui/employee"===u.pathname&&Digit.SessionStorage.del("NOC.INBOX")},[u.pathname]);const _=l.useMemo(()=>({Icon:n.createElement(E,null),moduleName:r("ACTION_TEST_NOC"),kpis:[{count:m?"":v,label:r("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:m?"-":p,label:r("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:v,label:r("ES_COMMON_INBOX"),link:"/digit-ui/employee/noc/inbox"},{label:r("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search"}]}),[m,v]);return Digit.Utils.NOCAccess()?n.createElement(t.EmployeeModuleCard,_):null},NOCLinks:zi,NOCApplicationOverview:()=>{var e,a,r,u,d,s,m,f,E;const{id:_}=i.useParams(),{t:g}=o.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[S,N]=l.useState({}),[b,C]=l.useState(null),y={},[D]=l.useState(()=>(null==y?void 0:y.fileStoreId)||null),[O,L]=l.useState(null),[T,I]=l.useState([]),[w,x]=l.useState([]),[R,P]=l.useState([]),[F,B]=l.useState([]),[M,k]=l.useState([]),[U,H]=l.useState({}),[W,j]=l.useState(()=>[]),[z,V]=l.useState(!1),G=window.Digit.Utils.browser.isMobile(),{data:Y}=Digit.Hooks.obps.useMDMS(A,"NOC",["DocumentTypeMapping"]),{data:q}=Digit.Hooks.obps.useMDMS(A,"common-masters",["DocumentType"]),{isLoading:K,data:X}=Digit.Hooks.noc.useNOCDetails(g,h,{applicationNo:_}),{mutate:Q}=Digit.Hooks.noc.useNOCApplicationActions(h),J=Digit.Hooks.useWorkflowDetails({tenantId:h,id:_,moduleCode:"NOC"});var Z,$;null!=J&&null!==(e=J.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!J.isLoading&&(J.data.actionState.nextActions=[...null==J||null===(r=J.data)||void 0===r?void 0:r.nextActions]),J&&J.data&&!J.isLoading&&(J.data.initialActionState=(null==J||null===(Z=J.data)||void 0===Z?void 0:Z.initialActionState)||c({},null==J||null===($=J.data)||void 0===$?void 0:$.actionState)||{},J.data.actionState=c({},J.data)),l.useEffect(()=>{x([null==X?void 0:X.applicationData])},[null==X?void 0:X.applicationData]),l.useEffect(()=>{var e;P(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),l.useEffect(()=>{var e;B(null==q||null===(e=q["common-masters"])||void 0===e?void 0:e.DocumentType)},[q]),l.useEffect(()=>{sessionStorage.setItem("NewNOCDocs",JSON.stringify(M))},[M]),l.useEffect(()=>{if(null!=w&&w.length&&null!=R&&R.length){let e=[];w.map(t=>{var l,n;const i=R.filter(e=>(null==e?void 0:e.applicationType)===(null==t?void 0:t.applicationType)&&(null==e?void 0:e.nocType)===(null==t?void 0:t.nocType));null!=i&&null!==(l=i[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let l=e.documentType;e.dropdownData=[],F.forEach(t=>{let n=t.code.slice(0,l.length);l===n&&(e.hasDropdown=!0,e.dropdownData.push(t))}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),I(t)}},[w,R,F]),l.useEffect(()=>{var e,t;let l=[];null==w||null===(e=w[0])||void 0===e||null===(t=e.documents)||void 0===t||t.forEach((e,t,n)=>{l.push(null==e?void 0:e.fileStoreId)}),j(null==l?void 0:l.map(e=>e))},[null==w||null===(u=w[0])||void 0===u?void 0:u.documents]),l.useEffect(()=>{null!=W&&W.length&&Digit.UploadServices.Filefetch(W,Digit.ULBService.getStateId()).then(e=>{H(null==e?void 0:e.data)})},[W]);const ee=e=>{let{t:i,nocDataDetails:o,nocDocumentsList:a}=e;if(null!=o&&o.length&&null!=a&&a.length&&null!=(null==o?void 0:o[0])){var r,u,d,s,c,m,f,E,_,g,h,A,S,N,b,C,y,D,I,w;const e="WF_"+(null==o||null===(r=o[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==o||null===(u=o[0])||void 0===u?void 0:u.applicationStatus);return n.createElement(l.Fragment,null,n.createElement("div",{style:{border:"1px solid #D6D5D4",background:"#FAFAFA",boxSizing:"border-box",borderRadius:"4px",padding:"8px",maxWidth:"950px",minWidth:"280px"}},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",fontSize:"20px"}},""+i("NOC_MAIN_"+p(null==a||null===(d=a[0])||void 0===d?void 0:d.code,".","_")+"_LABEL")),n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},n.createElement(t.Row,{className:"border-none",label:""+i("NOC_"+(null==o||null===(s=o[0])||void 0===s?void 0:s.nocType)+"_APPLICATION_LABEL"),text:i(null==o||null===(c=o[0])||void 0===c?void 0:c.applicationNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_STATUS_LABEL"),text:i(e)||"NA",textStyle:"APPROVED"==(null==o||null===(m=o[0])||void 0===m?void 0:m.applicationStatus)||"AUTO_APPROVED"==(null==o||null===(f=o[0])||void 0===f?void 0:f.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_SUBMITED_ON_LABEL"),text:null!=o&&null!==(E=o[0])&&void 0!==E&&null!==(_=E.additionalDetails)&&void 0!==_&&_.SubmittedOn?v(Number(null==o||null===(g=o[0])||void 0===g||null===(h=g.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVAL_NO_LABEL"),text:(null==o||null===(A=o[0])||void 0===A?void 0:A.nocNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?v(Number(null==o||null===(S=o[0])||void 0===S||null===(N=S.auditDetails)||void 0===N?void 0:N.lastModifiedTime)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+i("Documents"),text:""})),null!=o&&null!==(b=o[0])&&void 0!==b&&b.documents&&(null==o||null===(C=o[0])||void 0===C?void 0:C.documents.length)>0?n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==o||null===(y=o[0])||void 0===y||null===(D=y.documents)||void 0===D?void 0:D.map((e,l)=>{var o,r;return n.createElement("a",{target:"_",href:null===(o=U[e.fileStoreId])||void 0===o?void 0:o.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:l},n.createElement("div",{style:{display:"flex",justifyContent:"center"}},n.createElement(t.PDFSvg,null)),n.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",width:"100px",color:"#505A5F"}},i("NOC_MAIN_"+p(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):n.createElement("div",null,n.createElement("p",null,i("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),n.createElement("div",null,(null==J||null===(I=J.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==T?void 0:T.map((e,t)=>n.createElement(vn,{key:t,document:e,t:i,error:O,setError:L,setNocDocuments:k,nocDocuments:M})):null)))}return n.createElement(t.Loader,null)},te=function(e){return void 0===e&&(e=[]),e.map(e=>({title:e.title,belowComponent:()=>n.createElement(l.Fragment,null,n.createElement("div",{style:{maxWidth:"950px"}},n.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},e.values.map(e=>n.createElement(t.Row,{className:"border-none",label:""+g(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return l.useEffect(()=>{if(X){var e;V(!0);const{applicationDetails:t}=X;N(c({},X,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>n.createElement(ee,{t:g,data:X,nocDataDetails:w,nocDocumentsList:T})}]})),V(!1)}},[X,T,w,D,W,U]),n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",null,n.createElement(t.Header,{styles:{fontSize:"32px"}},g("NOC_APP_OVER_VIEW_HEADER"))),n.createElement(mn,{applicationDetails:S,isLoading:K||z,isDataLoading:K,applicationData:null==X?void 0:X.applicationData,mutate:Q,workflowDetails:J,businessService:null!=J&&null!==(d=J.data)&&void 0!==d&&d.applicationBusinessService?null==J||null===(s=J.data)||void 0===s?void 0:s.applicationBusinessService:null==X||null===(m=X.applicationData)||void 0===m?void 0:m.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:b,setShowToast:C,closeToast:()=>{C(null)},timelineStatusPrefix:"WF_"+(null==X||null===(f=X.applicationData)||void 0===f||null===(E=f.additionalDetails)||void 0===E?void 0:E.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:r}=e;const{t:u}=o.useTranslation(),d=window.localStorage.getItem("Employee.tenant-id"),s={mobileNumber:"",applicationNo:""},m={moduleName:"noc-service",applicationStatus:[],businessService:"obpas_noc",locality:[],assignee:"ASSIGNED_TO_ALL",businessServiceArray:f(!0)||[]},v={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("NOC.INBOX"),E=l.useMemo(()=>p||{filterForm:m,searchForm:s,tableForm:v},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[_,g]=l.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{searchForm:t.data})),c({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{filterForm:t.data})),c({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("NOC.INBOX",c({},e,{tableForm:t.data})),c({},e,{tableForm:t.data})}},E),{data:h,isLoading:A}=Digit.Hooks.useBoundaryLocalities(d,"revenue",{},u),{isLoading:S,data:N}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},_)});l.useEffect(()=>{N&&N.revalidate()},[]);const[b,C]=l.useState([]),[y,D]=l.useState([]),[O,L]=l.useState(0);l.useEffect(()=>{N&&(D((null==N?void 0:N.statuses)||[]),C((null==N?void 0:N.table)||[]),L((null==N?void 0:N.totalCount)||0))},[N]);const T={logoIcon:n.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("NOC_NEW_APPLICATION"),link:"/digit-ui/employee/noc/new-application"}]},I=l.useCallback(e=>{let{registerRef:t,searchFormState:l,searchFieldComponents:i}=e;return n.createElement(Sn,{registerRef:t,searchFormState:l,searchFieldComponents:i})},[]),w=l.useCallback(e=>{let{registerRef:t,controlFilterForm:l,setFilterFormValue:i,getFilterFormValue:o}=e;return n.createElement(Nn,{statuses:y,isInboxLoading:S,registerRef:t,controlFilterForm:l,setFilterFormValue:i,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[y,S,h,A]),x={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},v)}),g({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),g({action:"mutateSearchForm",data:s})}},R={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),g({action:"mutateTableForm",data:c({},v)}),g({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:m,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),g({action:"mutateFilterForm",data:m})}},P=(e=>{var t,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:m,totalCount:v,table:p,dispatch:f,onSortingByData:E}=e;const{t:_}=o.useTranslation(),g=l.useMemo(()=>[{Header:_("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement(i.Link,{to:d+"/inbox/application-overview/"+t.original.applicationId},n.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,l;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>n.createElement("span",{className:"cell-text styled-cell"},e))(ci(new Date(null===(l=i.original)||void 0===l?void 0:l.date),"dd/MM/yyyy")):""}},{Header:_("NOC_PRIMARY_OWNER_NAME_LABEL"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:_("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>_(null==e?void 0:e.status),disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:(null===(t=m.tableForm)||void 0===t?void 0:t.offset)/(null===(a=m.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return f({action:"mutateTableForm",data:c({},m.tableForm,{offset:parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=m.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=m.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:v,onSearch:null==m||null===(u=m.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return f({action:"mutateTableForm",data:c({},m.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=m.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>f({action:"mutateTableForm",data:c({},m.tableForm,{offset:0})}),data:p,columns:g}})(c({},{parentRoute:r,onPageSizeChange:e=>{g({action:"mutateTableForm",data:c({},_.tableForm,{limit:e.target.value})})},formState:_,totalCount:O,table:b,dispatch:g,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===n||g({action:"mutateTableForm",data:c({},_.tableForm,{sortBy:t,sortOrder:l?"DESC":"ASC"})})}}})),F=(e=>{let{parentRoute:l,table:i}=e;const{t:r}=o.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:l,status:n,owner:i}=e;return{[r("NOC_APPLICATION_NUMBER")]:t,[r("TL_COMMON_TABLE_COL_APP_DATE")]:ci(new Date(l),"dd/MM/yyyy"),[r("NOC_PRIMARY_OWNER_NAME_LABEL")]:r(i),[r("PT_COMMON_TABLE_COL_STATUS_LABEL")]:r(n)}}),linkPrefix:l+"/inbox/application-overview/",serviceRequestIdKey:r("NOC_APPLICATION_NUMBER"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:l}=a.useFormContext();return n.createElement(t.SearchField,null,n.createElement(a.Controller,{name:"sortOrder",control:l,render:l=>{let{onChange:i,value:o}=l;return n.createElement(t.RadioButtons,{onSelect:e=>{i(e.code)},selectedOption:e.filter(e=>e.code===o)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:b}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;g({action:"mutateTableForm",data:c({},_.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),g({action:"mutateTableForm",data:v})}};return n.createElement(l.Fragment,null,n.createElement(t.Header,null,u("ES_COMMON_INBOX"),O?n.createElement("p",{className:"inbox-count"},O):null),n.createElement(t.InboxComposer,c({isInboxLoading:S,PropsForInboxLinks:T},x,R,B,{propsForInboxTable:P,propsForInboxMobileCards:F,formState:_})))},NOCSearchApplication:yt,NewNOCStepperForm:()=>{i.useHistory();const{t:e}=o.useTranslation(),a=d.useDispatch(),[r,u]=l.useState(null),s=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer).step;return Digit.ULBService.getCurrentTenantId(),l.useEffect(()=>{a({type:"RESET_NOC_NEW_APPLICATION_FORM"})},[]),n.createElement("div",{className:"card"},n.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("NOC_REGISTRATION_APPLICATION")),n.createElement(hi,{stepsList:Di,onSubmit:e=>{console.log("dataGet===",e)},step:s,setStep:e=>{a(Ni(e))}}),r&&n.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var i,r,u;let{config:s,onGoNext:m,onBackClick:v}=e;const p=d.useDispatch(),{t:f}=o.useTranslation(),[E,_]=l.useState(null),[g,h]=l.useState(""),[A,S]=l.useState([]),[N,b]=l.useState([]),C=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),y=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),D=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos});l.useEffect(()=>{ht.isEqual(A,y)||S(null==y?void 0:y.ownerIdList),ht.isEqual(N,D)||b(null==D?void 0:D.ownerPhotoList)},[y,D]);const O=Digit.UserService.getUser(),{control:L,handleSubmit:T,setValue:I,formState:{errors:w},trigger:x,watch:R,reset:P}=a.useForm({defaultValues:{owners:[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:""}]}}),F={Controller:a.Controller,control:L,setValue:I,errors:w,trigger:x,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:P,useFieldArray:a.useFieldArray,watch:R,config:s,ownerIdList:A,setOwnerIdList:S,ownerPhotoList:N,setOwnerPhotoList:b};function B(e){p(Si(s.key,e)),p(yi("ownerIdList",A)),p(Ci("ownerPhotoList",N)),m()}function M(e){v(s.key,e)}const[k,U]=l.useState((null==C||null===(i=C.applicationDetails)||void 0===i?void 0:i.isRegisteredStakeHolder)||!1),H=Digit.ULBService.getStateId(),[W,j]=l.useState(!1),z=null==O||null===(r=O.info)||void 0===r||null===(u=r.roles)||void 0===u?void 0:u.map(e=>e.code),{data:V,isLoading:G}=Digit.Hooks.obps.useMDMS(H,"StakeholderRegistraition","TradeTypetoRoleMapping");return l.useEffect(()=>{if(!G){var e,t;let l=[];null==V||null===(e=V.StakeholderRegistraition)||void 0===e||null===(t=e.TradeTypetoRoleMapping)||void 0===t||t.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{l.push(e)})});const n=null==l?void 0:l.filter((e,t,l)=>l.indexOf(e)===t);null==n||n.map(e=>{null!=z&&z.includes(e)&&U(!0)})}},[G]),l.useEffect(()=>{var e;null!=C&&null!==(e=C.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&I("isRegisteredStakeHolder","true")},[]),n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:T(e=>{x(),function(e){var t,l,n,i,o;const a=null!=(t=null==N?void 0:N.length)?t:0,r=null!=(l=null==A?void 0:A.length)?l:0,u=null!=(n=null==e||null===(i=e.owners)||void 0===i?void 0:i.length)?n:0,d=new Set((null==e||null===(o=e.owners)||void 0===o?void 0:o.map(e=>null==e?void 0:e.mobileNumber))||[]).size!==u;return u!==a?(setTimeout(()=>{_(null)},3e3),_({key:"true",error:!0,message:f("UPLOAD_ALL_OWNER_PHOTOS_LABEL")}),!1):u!==r?(setTimeout(()=>{_(null)},3e3),_({key:"true",error:!0,message:f("UPLOAD_ALL_OWNER_IDS_LABEL")}),!1):!d||(setTimeout(()=>{_(null)},3e3),_({key:"true",error:!0,message:f("DUPLICATE_OWNER_FOUND_LABEL")}),!1)}(e)&&B(e)})},n.createElement("div",{className:"employeeCard"},k?n.createElement(n.Fragment,null,n.createElement(Ti,c({onGoBack:M,goNext:B,currentStepData:C,t:f},F)),n.createElement(Li,c({onGoBack:M,goNext:B,currentStepData:C,t:f},F))):n.createElement(n.Fragment,null,n.createElement(Li,c({onGoBack:M,goNext:B,currentStepData:C,t:f},F)))),n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),E&&n.createElement(t.Toast,{error:null==E?void 0:E.error,warning:null==E?void 0:E.warning,label:f(null==E?void 0:E.message),isDleteBtn:!0,onClose:()=>{_(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:i,onBackClick:r,onGoNext:u}=e;const{t:s}=o.useTranslation(),m=d.useDispatch(),[v,p]=l.useState(null),[f,E]=l.useState(""),{control:_,handleSubmit:g,setValue:h,formState:{errors:A},trigger:S,watch:N}=(Digit.UserService.getUser(),a.useForm({defaultValues:{floorArea:[{value:""}]}})),b=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),y=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos}),D={Controller:a.Controller,control:_,setValue:h,errors:A,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:a.useFieldArray,watch:N};let O;O=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const L=e=>{if(null==e)return NaN;const t=String(e).trim().replace(/,/g,""),l=Number(t);return Number.isNaN(l)?NaN:Number(l.toFixed(5))};function T(e){m(Si(i.key,e)),u()}function I(e){r(i.key,e)}return n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:g(e=>{var t,l,n;S(),function(e){var t,l,n,i,o,a;const r=((e,t)=>{const l=L(e),n=L(t);return!Number.isNaN(l)&&!Number.isNaN(n)&&Math.abs(l-n)<=1e-9})(null==e?void 0:e.netTotalArea,null==e?void 0:e.specificationPlotArea),u=null!=(t="BUILTUP"===(null==e||null===(l=e.buildingStatus)||void 0===l?void 0:l.code))&&t,d=parseFloat(null==e?void 0:e.specificationPlotArea),s=null!=e&&null!==(n=e.floorArea)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.value?parseFloat(null==e||null===(o=e.floorArea)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.value):0;return r?!(u&&s>d&&(setTimeout(()=>{p(null)},3e3),p({key:"true",error:!0,message:"NOC_GROUND_FLOOR_AREA_VALIDATION_LABEL"}),1)):(setTimeout(()=>{p(null)},3e3),p({key:"true",error:!0,message:"NOC_PLOT_AREA_SUM_VALIDATION_MESG_LABEL"}),!1)}(e)&&(m(Si(i.key,e)),null!=b&&null!==(t=b.apiData)&&void 0!==t&&null!==(l=t.Noc)&&void 0!==l&&null!==(n=l[0])&&void 0!==n&&n.applicationNo?u():function(e){try{var t,l,n,i,o,a,r,d,s,v,f,E,_,g,h,A,S,N,b,D,L,T,I;const w={applicationDetails:c({},null==e?void 0:e.applicationDetails),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(t=e.siteDetails)||void 0===t||null===(l=t.ulbName)||void 0===l?void 0:l.name)||"",roadType:(null==e||null===(n=e.siteDetails)||void 0===n||null===(i=n.roadType)||void 0===i?void 0:i.name)||"",buildingStatus:(null==e||null===(o=e.siteDetails)||void 0===o||null===(a=o.buildingStatus)||void 0===a?void 0:a.name)||"",isBasementAreaAvailable:(null==e||null===(r=e.siteDetails)||void 0===r||null===(d=r.isBasementAreaAvailable)||void 0===d?void 0:d.code)||"",district:(null==e||null===(s=e.siteDetails)||void 0===s||null===(v=s.district)||void 0===v?void 0:v.name)||"",zone:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.zone)||void 0===E?void 0:E.name)||"",specificationBuildingCategory:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.specificationBuildingCategory)||void 0===g?void 0:g.name)||"",specificationNocType:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.specificationNocType)||void 0===A?void 0:A.name)||"",specificationRestrictedArea:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.specificationRestrictedArea)||void 0===N?void 0:N.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(b=e.siteDetails)||void 0===b||null===(D=b.specificationIsSiteUnderMasterPlan)||void 0===D?void 0:D.code)||""}),ownerPhotos:Array.isArray(null==y?void 0:y.ownerPhotoList)?y.ownerPhotoList:[],ownerIds:Array.isArray(null==C?void 0:C.ownerIdList)?C.ownerIdList:[]},x=null===(L=null!=(T=null==w||null===(I=w.applicationDetails)||void 0===I?void 0:I.owners)?T:[])||void 0===L?void 0:L.map((e,t)=>{var l,n,i;return{mobileNumber:(null==e?void 0:e.mobileNumber)||"",name:(null==e?void 0:e.ownerOrFirmName)||"",emailId:(null==e?void 0:e.emailId)||"",userName:(null==e?void 0:e.mobileNumber)||"",fatherOrHusbandName:(null==e?void 0:e.fatherOrHusbandName)||"",permanentAddress:(null==e?void 0:e.address)||"",gender:(null==e||null===(l=e.gender)||void 0===l?void 0:l.code)||"",dob:Digit.Utils.pt.convertDateToEpoch((null==e?void 0:e.dateOfBirth)||""),additionalDetails:{ownerPhoto:c({},null==y||null===(n=y.ownerPhotoList)||void 0===n?void 0:n[t]),ownerId:c({},null==C||null===(i=C.ownerIdList)||void 0===i?void 0:i[t])}}}),R={Noc:{applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:O,owners:x,workflow:{action:"INITIATE"},nocDetails:{additionalDetails:w,tenantId:O}}};console.log("final Payload here==>",R);const P=Ot(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:O,details:R})).then(function(e){var t;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?(console.log("success :create api executed successfully !!!"),m(Si("apiData",e)),u()):(console.error("error : create api not executed properly !!!"),p({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})});Promise.resolve(P&&P.then?P.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(c({},b,{siteDetails:c({},e)})))})},n.createElement("div",{className:"employeeCard"},n.createElement(Ii,c({onGoBack:I,goNext:T,currentStepData:b,t:s},D)),n.createElement(wi,c({onGoBack:I,goNext:T,currentStepData:b,t:s},D))),n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:I}),n.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))),v&&n.createElement(t.Toast,{isDleteBtn:!0,error:null==v?void 0:v.error,warning:null==v?void 0:v.warning,label:s(null==v?void 0:v.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:a,t:r}=e;const u=d.useDispatch(),[s,c]=l.useState(!1),[m,v]=l.useState(""),p=Digit.ULBService.getStateId(),{isLoading:f,data:E}=Digit.Hooks.pt.usePropertyMDMS(p,"NOC",["Documents"]),_=d.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.noc.NOCNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}}),g=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}});console.log("coordinates from redux",g);const h=d.useSelector(e=>{var t,l;return null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.formData})||{};return n.createElement(n.Fragment,null,n.createElement(t.FormComposer,{defaultValues:_,config:i.currStepConfig,onSubmit:function(e){var t,l,n,i;const a=function(e){if(!f){var t,l,n,i,o;const a="VACANT"===(null==h||null===(t=h.siteDetails)||void 0===t||null===(l=t.buildingStatus)||void 0===l?void 0:l.code)?null==E||null===(n=E.NOC)||void 0===n?void 0:n.Documents.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==E||null===(i=E.NOC)||void 0===i?void 0:i.Documents,r=(null==e||null===(o=e.documents)||void 0===o?void 0:o.documents)||[],u=a.filter(e=>e.required).map(e=>e.code),d=r.map(e=>e.documentType);return u.filter(e=>!d.includes(e))}}(e);return a.length>0?(v(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),c(!0),void setTimeout(()=>{c(!1),v("")},3e3)):null!=g&&null!==(t=g.Latitude1)&&void 0!==t&&t.trim()&&null!=g&&null!==(l=g.Latitude2)&&void 0!==l&&l.trim()&&null!=g&&null!==(n=g.Longitude1)&&void 0!==n&&n.trim()&&null!=g&&null!==(i=g.Longitude2)&&void 0!==i&&i.trim()?void o():(v(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),c(!0),void setTimeout(()=>{c(!1),v("")},3e3))},onFormValueChange:function(e,t){ht.isEqual(t,_)||u(Si(i.key,t))},label:r(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){a(i.key,e)}}),s&&n.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{c(!1),v("")}}))},NewNOCStepFormFour:e=>{var o,a,r,u,s,m,v,p,f,E,_,g,h,A,S,N;let{config:b,onBackClick:C,t:y}=e;d.useDispatch();const[D,O]=l.useState(null),[L,T]=l.useState(""),[I,w]=l.useState(!1),x=window.location.pathname.includes("edit");console.log("selectedCheckBox",I);const R=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.formData)||{}}),P=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}}),F=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerIds)||[]}),B=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.ownerPhotos)||[]}),M=l.useRef();let k=Digit.UserService.getUser();const U=null==k||null===(o=k.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code),[H,W]=l.useState(!1);Digit.Hooks.useClickOutside(M,()=>{W(!1)},H);const j=i.useHistory();let z;z=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const V=e=>{console.log("formData in parent SummaryPage",R),G(R,e)},G=function(e,t){try{if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return O({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),setTimeout(()=>{O(null)},3e3),Promise.resolve();const l=function(e,t){var l,n,i,o,a,r,u,d,s,m,v,p,f,E,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,M;console.log("nocFormData",e);const k=c({},null==e||null===(l=e.apiData)||void 0===l||null===(n=l.Noc)||void 0===n?void 0:n[0],{workflow:{action:(null==t?void 0:t.action)||""},nocDetails:c({},null==e||null===(i=e.apiData)||void 0===i||null===(o=i.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.nocDetails,{additionalDetails:c({},null==e||null===(r=e.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(s=e.siteDetails)||void 0===s||null===(m=s.ulbName)||void 0===m?void 0:m.name)||"",roadType:(null==e||null===(v=e.siteDetails)||void 0===v||null===(p=v.roadType)||void 0===p?void 0:p.name)||"",buildingStatus:(null==e||null===(f=e.siteDetails)||void 0===f||null===(E=f.buildingStatus)||void 0===E?void 0:E.name)||"",isBasementAreaAvailable:(null==e||null===(_=e.siteDetails)||void 0===_||null===(g=_.isBasementAreaAvailable)||void 0===g?void 0:g.code)||"",district:(null==e||null===(h=e.siteDetails)||void 0===h||null===(A=h.district)||void 0===A?void 0:A.name)||"",zone:(null==e||null===(S=e.siteDetails)||void 0===S||null===(N=S.zone)||void 0===N?void 0:N.name)||"",specificationBuildingCategory:(null==e||null===(b=e.siteDetails)||void 0===b||null===(C=b.specificationBuildingCategory)||void 0===C?void 0:C.name)||"",specificationNocType:(null==e||null===(y=e.siteDetails)||void 0===y||null===(D=y.specificationNocType)||void 0===D?void 0:D.name)||"",specificationRestrictedArea:(null==e||null===(O=e.siteDetails)||void 0===O||null===(L=O.specificationRestrictedArea)||void 0===L?void 0:L.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(T=e.siteDetails)||void 0===T||null===(I=T.specificationIsSiteUnderMasterPlan)||void 0===I?void 0:I.code)||""}),coordinates:c({},P),ownerPhotos:Array.isArray(null==B?void 0:B.ownerPhotoList)?B.ownerPhotoList:[],ownerIds:Array.isArray(null==F?void 0:F.ownerIdList)?F.ownerIdList:[]})}),documents:[]}),U=(null==e||null===(w=e.documents)||void 0===w||null===(M=w.documents)||void 0===M?void 0:M.documents)||[];if(x){var H,W,j;const e=(null==R||null===(H=R.apiData)||void 0===H||null===(W=H.Noc)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.documents)||[],t=new Set(null==e?void 0:e.map(e=>e.documentType)),l=null==e?void 0:e.map(e=>{var t,l;const n=(null==U||null===(t=U.find(t=>t.documentType===e.documentType))||void 0===t?void 0:t.uuid)||(null==U||null===(l=U.find(t=>t.documentType===e.documentType))||void 0===l?void 0:l.documentAttachment);return c({},e,{uuid:n,documentAttachment:n})}),n=(null==U?void 0:U.filter(e=>!t.has(e.documentType)))||[],i=[...l,...null==n?void 0:n.map(e=>({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId}))];console.log("overallDocs",i),i.forEach(e=>{var t;null==k||null===(t=k.documents)||void 0===t||t.push(c({},e))})}else U.forEach(e=>{k.documents.push({uuid:null==e?void 0:e.documentUid,documentType:null==e?void 0:e.documentType,documentAttachment:null==e?void 0:e.filestoreId})});return{Noc:c({},k)}}(e,t);console.log("finalPayload here==>",l);const n=Lt(function(){return Ot(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:z,details:l})).then(function(e){var l,n,i,o,a,r;"successful"===(null==e||null===(l=e.ResponseInfo)||void 0===l?void 0:l.status)?(console.log("success: Update API "),window.location.href.includes("citizen")?"CANCEL"==t.action?(O({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{j.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),j.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(O({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{j.push("/digit-ui/employee/noc/inbox")},3e3)):j.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(o=e.Noc)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.applicationNo),state:{data:e}}))):(console.error("Submission failed, not moving to next step.",null===(r=res)||void 0===r?void 0:r.response),O({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),O({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{O(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function Y(e){C(b.key,e)}console.log("currentStepData in StepFour",R);const q=(null==R||null===(r=R.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.applicationNo)||"";console.log("applicationNo here==>",q);const K=Digit.Hooks.useWorkflowDetails({tenantId:z,id:q,moduleCode:"obpas_noc"});console.log("workflow Details here==>",K);let X=(null==K||null===(m=K.data)||void 0===m||null===(v=m.actionState)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==U?void 0:U.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==K||null===(f=K.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==U?void 0:U.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return console.log("actions here",X),n.createElement(n.Fragment,null,n.createElement(xi,{onGoBack:Y,goNext:V,currentStepData:R,t:y}),n.createElement(t.CheckBox,{label:"I hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+((null==R||null===(_=R.applicationDetails)||void 0===_||null===(g=_.owners)||void 0===g||null===(h=g[0])||void 0===h?void 0:h.ownerOrFirmName)||"NA")+"). I along with the applicant have read the Policy and understand all the terms and conditions of the Policy. We are committed to fulfill/abide by all the terms and conditions of the Policy. The information/documents submitted are true and correct as per record and no part of it is false and nothing has been concealed/misrepresented therein.",onChange:e=>function(e){w(e.target.checked)}(e),value:I,checked:I}),X&&n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:Y}),H&&(null!=K&&null!==(A=K.data)&&void 0!==A&&null!==(S=A.actionState)&&void 0!==S&&S.nextActions||null!=K&&null!==(N=K.data)&&void 0!==N&&N.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:X,optionKey:"action",t:y,onSelect:function(e){V(e)}}):null,I&&n.createElement(t.SubmitBar,{ref:M,label:y("WF_TAKE_ACTION"),onSubmit:()=>W(!H)})),D&&n.createElement(t.Toast,{isDleteBtn:!0,error:null==D?void 0:D.error,warning:null==D?void 0:D.warning,label:y(null==D?void 0:D.message),onClose:()=>{O(null)}}))},NOCApplicantDetails:Li,NOCProfessionalDetails:Ti,NOCSiteDetails:Ii,NOCSpecificationDetails:wi,NOCDocumentsRequired:e=>{var i,o,a,r,u,s,m,v;let{t:p,config:f,onSelect:_,formData:g}=e;Digit.ULBService.getStateId();const[h,A]=l.useState(null==g||null===(i=g.documents)||void 0===i?void 0:i.documents);console.log("documents in childStep three",h);const[S,N]=l.useState(null),[b,C]=l.useState(!0),[y,D]=l.useState(!1),[O,L]=l.useState(null),T=Digit.ULBService.getStateId(),I=d.useDispatch(),{isLoading:w,data:x}=Digit.Hooks.pt.usePropertyMDMS(T,"NOC",["Documents"]),R=d.useSelector(function(e){var t,l;return(null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.coordinates)||{}});l.useEffect(()=>{Object.keys(R).length>0&&L(R)},[R]),console.log("coordinates (from redux)",R),console.log("geocoordinates",O);const P=d.useSelector(e=>{var t,l;return null==e||null===(t=e.noc)||void 0===t||null===(l=t.NOCNewApplicationFormReducer)||void 0===l?void 0:l.formData})||{},F="VACANT"===(null==P||null===(o=P.siteDetails)||void 0===o||null===(a=o.buildingStatus)||void 0===a?void 0:a.code)?null==x||null===(r=x.NOC)||void 0===r||null===(u=r.Documents)||void 0===u?void 0:u.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==x||null===(s=x.NOC)||void 0===s?void 0:s.Documents,B=()=>{let e;e=c({},g.documents,{documents:h}),_(f.key,e)};l.useEffect(()=>{var e,t;let l=0;null==x||null===(e=x.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==h||h.map(l=>{e.required&&null!=l&&l.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(l+=1)}),C("0"!=l&&0!=l||!((null==h?void 0:h.length)>0))},[h,y]),l.useEffect(()=>{var e,t;"VACANT"===(null==P||null===(e=P.siteDetails)||void 0===e||null===(t=e.buildingStatus)||void 0===t?void 0:t.code)&&A(e=>null==e?void 0:e.filter(e=>"OWNER.BUILDINGDRAWING"!==e.documentType))},[null==P||null===(m=P.siteDetails)||void 0===m||null===(v=m.buildingStatus)||void 0===v?void 0:v.code]);const M={value:{workflowDocs:null==h?void 0:h.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:k}=Digit.Hooks.noc.useNOCDocumentSearch(M),U=null==h?void 0:h.map(e=>({code:e.documentType,link:E(null==k?void 0:k.pdfFiles,e.filestoreId)}));return n.createElement("div",null,w?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:p,config:f,onSelect:B,onSkip:()=>_(),isDisabled:b,onAdd:function(){}},null==F?void 0:F.map((e,t)=>{var l;return n.createElement(Ri,{key:t,document:e,t:p,error:S,setError:N,setDocuments:A,documents:h,setCheckRequiredFields:D,handleSubmit:B,geocoordinates:O,setGeoCoordinates:L,dispatch:I,previewLink:null==U||null===(l=U.find(t=>t.code===e.code))||void 0===l?void 0:l.link})}),S&&n.createElement(t.Toast,{label:S,isDleteBtn:!0,onClose:()=>N(null),error:!0})))},NOCSummary:xi,NOCDocumentWithLatLong:e=>{var i,o,a;let{t:r,config:u,onSelect:d,formData:s}=e;const m=Digit.ULBService.getStateId(),[v,p]=l.useState((null==s||null===(i=s.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=l.useState(null),[_,g]=l.useState(!0),[h,A]=l.useState(!1),[S,N]=l.useState(!1),b=gt((null==s?void 0:s.PrevStateDocuments)||[]),{isLoading:C,data:y}=Digit.Hooks.pt.usePropertyMDMS(m,"NOC",["Documents"]),D=()=>{let e;e=c({},s.documents,{documents:v}),d(u.key,e)};return l.useEffect(()=>{var e,t;const l=null==y||null===(e=y.NOC)||void 0===e||null===(t=e.Documents)||void 0===t?void 0:t.filter(e=>e.required).map(e=>e.code),n=null==l?void 0:l.filter(e=>v.reduce((t,l)=>{var n,i,o,a;return e==(null==l||null===(n=l.documentType)||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i[0])+"."+(null==l||null===(o=l.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));g(!((null==n?void 0:n.length)==(null==l?void 0:l.length)&&(null==v?void 0:v.length)>0))},[v,h]),n.createElement("div",null,C?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:r,config:u,onSelect:D,onSkip:()=>d(),onAdd:function(){}},null==y||null===(o=y.NOC)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,t)=>n.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},n.createElement(Pi,{key:t,document:e,t:r,error:f,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:A,formData:s,beforeUploadDocuments:b||[],isNextButtonDisabled:S,setIsNextButtonDisabled:N,handleSubmit:D}))),f&&n.createElement(t.Toast,{label:f,onClose:()=>E(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=s&&s.applicationNo?n.createElement(t.CitizenInfoLabel,{info:r("CS_FILE_APPLICATION_INFO_LABEL"),text:r("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==s?void 0:s.applicationNo)+" "+r("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCResponseCitizen:e=>{var l,a,r;const u=i.useLocation(),{pathname:d,state:s}=u,{t:c}=o.useTranslation(),m=i.useHistory(),v=null==s||null===(l=s.data)||void 0===l||null===(a=l.Noc)||void 0===a?void 0:a[0];console.log("nocData here",v),window.localStorage.getItem("CITIZEN.CITY");const{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{},_=d.split("/").pop();return n.createElement("div",null,n.createElement(t.Card,null,n.createElement(t.Banner,{message:c("NOC_APPLICATION_"+(null==v||null===(r=v.workflow)||void 0===r?void 0:r.action)+"_SUCCESS_HEADER"),applicationNumber:_,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(p(null==v?void 0:v.nocType,".","_")+"_APPLICATION_NUMBER"),successful:"REJECTED"!=(null==v?void 0:v.applicationStatus),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),"REJECTED"!==(null==v?void 0:v.applicationStatus)?n.createElement("div",null,n.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:c("COMMON_DOWNLOAD"),onSubmit:function(){try{const e=Ot(function(){var e,t,l,n;const i=v,o=null==i||null===(e=i.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==o?void 0:o.ulbType,r=(null==o||null===(l=o.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==o?void 0:o.ulbName),u=E.find(e=>e.code===i.tenantId);return Promise.resolve(It(i,u,a,r,c)).then(function(e){Digit.Utils.pdf.generateFormatted(e)})},function(e){console.log("Eroor Occurred !!!",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}})):null,n.createElement(t.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{m.push("/digit-ui/citizen")}}),n.createElement(t.SubmitBar,{label:c("CORE_COMMON_GO_TO_NOC"),onSubmit:()=>{m.push("/digit-ui/citizen/noc-home")}}))))},NOCCitizenMyApplications:e=>{var a,r,u;const{t:d}=o.useTranslation(),s=(i.useHistory(),(null===(a=Digit.UserService.getUser())||void 0===a?void 0:a.info)||{}),m=window.localStorage.getItem("CITIZEN.CITY"),{isLoading:v,data:p}=Digit.Hooks.noc.useNOCCitizenSearchApplication(c({},{sortBy:"createdTime",offset:0,sortOrder:"DESC",mobileNumber:""},{mobileNumber:(null==s?void 0:s.mobileNumber)||""}),m);console.log("data herein NOC==>",p);const f=["CS_CF_VIEW","CS_CF_TRACK","TL_VIEW_DETAILS"];return l.useEffect(()=>{p&&p.revalidate()},[]),v?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"applications-list-container"},n.createElement(t.Header,null,""+d("NOC_MY_APPLICATION")),0===(null==p||null===(r=p.data)||void 0===r?void 0:r.length)&&n.createElement(t.Card,{style:{textAlign:"center"}},d("NO_APPLICATIONS_MSG")),null==p||null===(u=p.data)||void 0===u?void 0:u.map((e,l)=>{var o;const a=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"Applications"!==t}));return n.createElement("div",{key:"card-"+l},n.createElement(t.Card,null,Object.keys(a).filter(e=>null!==a[e]).map(e=>n.createElement(t.KeyNote,{keyValue:d(e),note:d(a[e])})),n.createElement(i.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(o=e.Applications)||void 0===o?void 0:o.applicationNo)},n.createElement(t.SubmitBar,{label:d(f[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,d,s,v,p,f,E,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,x,R,P,F,B,M,k,U,H,W,j,z,V,G,Y,q,K,X,Q,J,Z,$,ee,te,le;const ne=function(e){let{tenantId:t,payments:l,pdfkey:n,EmpData:i}=e;m(e,Bi);try{var o;const e=null==me||null===(o=me.Noc)||void 0===o?void 0:o[0];return Promise.resolve(Lt(function(){return Ot(function(){if(Ee(!0),!e)throw new Error("Noc Application data is missing");return Promise.resolve(function(e,t,l){try{var n,i,o;const r=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),u=(null==e||null===(n=e.nocDetails)||void 0===n?void 0:n.additionalDetails)||{},d=(null==u?void 0:u.siteDetails)||{},s=null!=u&&u.SubmittedOn?null===(i=new Date(Number(null==u?void 0:u.SubmittedOn)))||void 0===i?void 0:i.toLocaleDateString("en-GB"):"";let m=[],v=(null==d?void 0:d.basementArea)||"NA",p=(null==d?void 0:d.totalFloorArea)||"NA";var a;m="Built Up"===(null==d?void 0:d.buildingStatus)?null===(a=(null==d?void 0:d.floorArea)||[])||void 0===a?void 0:a.map((e,t)=>c({},e,{floorNo:"Floor No "+(t+1)})):[{floorNo:"Floor No NA",value:"NA"}];const f=["NOC_SANCTION_THREE","NOC_SANCTION_FOUR","NOC_SANCTION_FIVE","NOC_SANCTION_SIX","NOC_SANCTION_SEVEN","NOC_SANCTION_EIGHT"],E="Provisional"===(null==d?void 0:d.specificationNocType)?f:f.slice(1),_=null==E?void 0:E.map((e,l)=>({number:3+l,text:t(e)}));return Promise.resolve({Noc:[c({},e,{nocDetails:c({},e.nocDetails,{additionalDetails:c({},null===(o=e.nocDetails)||void 0===o?void 0:o.additionalDetails,{SubmittedOn:s,siteDetails:c({},d,{floorArea:m,basementArea:v,totalFloorArea:p})})}),currentDate:r,sanctionTerms:_},l)]})}catch(e){return Promise.reject(e)}}(e,oe,i)).then(function(e){return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},l,{Noc:e.Noc})]},n)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})})},function(e){console.error("Sanction Letter download error:",e)})},function(e,t){if(Ee(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}},{id:ie}=i.useParams(),{t:oe}=o.useTranslation(),ae=i.useHistory(),re=window.localStorage.getItem("CITIZEN.CITY"),[ue,de]=l.useState({}),{isLoading:se,data:ce}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:ie},re),me=null==ce?void 0:ce.resData,{data:ve}=Digit.Hooks.useStore.getInitData(),{tenants:pe}=ve||{},[fe,Ee]=l.useState(!1);let _e=Digit.UserService.getUser();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};_e=null==t?void 0:t.value}const ge=null===(e=_e)||void 0===e||null===(a=e.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);l.useEffect(()=>{var e;const t=null==me||null===(e=me.Noc)||void 0===e?void 0:e[0];if(t){var l,n,i,o,a,r,u,d;const e=null==t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.applicationDetails,s=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,c=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,m=(null==t?void 0:t.documents)||[],v=(null==t||null===(u=t.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.ownerPhotos)||[];de({applicantDetails:e?[e]:[],siteDetails:s?[s]:[],coordinates:c?[c]:[],Documents:m.length>0?m:[],ownerPhotoList:v})}},[null==me?void 0:me.Noc]);const{data:he,isLoading:Ae}=Digit.Hooks.useRecieptSearch({tenantId:re,businessService:"obpas_noc",consumerCodes:ie,isEmployee:!1},{enabled:!!ie}),Se=[];let Ne=((e,t)=>{var l,n,i,o,a,r,u;const d=Digit.Hooks.useWorkflowDetails({tenantId:e,id:t,moduleCode:"obpas_noc",role:"EMPLOYEE"}),s=null==d||null===(l=d.data)||void 0===l||null===(n=l.processInstances)||void 0===n?void 0:n.find(e=>"APPROVE"===(null==e?void 0:e.action)),c=null==s||null===(i=s.assigner)||void 0===i?void 0:i.userName,m=Digit.Hooks.useEmployeeSearch(e,{codes:c,isActive:!0},{enabled:!(!c||null!=d&&d.isLoading)});console.log("employeeData",m);const v=null==m||null===(o=m.data)||void 0===o||null===(a=o.Employees)||void 0===a?void 0:a[0],p=null==v||null===(r=v.assignments)||void 0===r?void 0:r[0];return{officer:v?{code:null==v?void 0:v.code,id:null==v?void 0:v.id,name:null==v||null===(u=v.user)||void 0===u?void 0:u.name,department:null==p?void 0:p.department,designation:null==p?void 0:p.designation}:null}})(re,ie);"APPROVED"===(null==me||null===(u=me.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.applicationStatus)&&(Se.push({label:oe("DOWNLOAD_CERTIFICATE"),onClick:function(){try{var e;const t=null==me||null===(e=me.Noc)||void 0===e?void 0:e[0],l=pe.find(e=>e.code===t.tenantId);return Promise.resolve(It(t,l,oe)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),he&&(null==he?void 0:he.Payments.length)>0&&!Ae&&(Se.push({label:oe("PDF_STATIC_LABEL_WS_CONSOLIDATED_SANCTION_LETTER"),onClick:()=>{var e;return ne({tenantId:null==he||null===(e=he.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==he?void 0:he.Payments[0],pdfkey:"noc-sanctionletter",EmpData:Ne})}}),Se.push({label:oe("CHB_FEE_RECEIPT"),onClick:()=>{var e;return ne({tenantId:null==he||null===(e=he.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==he?void 0:he.Payments[0],pdfkey:"noc-receipt",EmpData:Ne})}})));const be=e=>{if(0===e)return oe("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,l=e%100;let n="th";return(l<11||l>13)&&(1===t?n="st":2===t?n="nd":3===t&&(n="rd")),""+e+n+" "+oe("NOC_FLOOR_AREA_LABEL")},[Ce,ye]=l.useState(null),[De,Oe]=l.useState(!1),[Le,Te]=l.useState(null),[Ie,we]=l.useState(!1),xe=l.useRef();Digit.Hooks.useClickOutside(xe,()=>{Oe(!1)},De);const Re=Digit.Hooks.useWorkflowDetails({tenantId:re,id:ie,moduleCode:"obpas_noc"});var Pe,Fe;null!=Re&&null!==(s=Re.data)&&void 0!==s&&null!==(v=s.actionState)&&void 0!==v&&v.nextActions&&!Re.isLoading&&(Re.data.actionState.nextActions=[...null==Re||null===(p=Re.data)||void 0===p?void 0:p.nextActions]),Re&&Re.data&&!Re.isLoading&&(Re.data.initialActionState=(null==Re||null===(Pe=Re.data)||void 0===Pe?void 0:Pe.initialActionState)||c({},null==Re||null===(Fe=Re.data)||void 0===Fe?void 0:Fe.actionState)||{},Re.data.actionState=c({},Re.data)),l.useEffect(()=>{Re&&Re.revalidate(),ce&&ce.revalidate()},[]);let Be=(null==Re||null===(f=Re.data)||void 0===f||null===(E=f.actionState)||void 0===E||null===(_=E.nextActions)||void 0===_?void 0:_.filter(e=>(null==ge?void 0:ge.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==Re||null===(g=Re.data)||void 0===g||null===(h=g.nextActions)||void 0===h?void 0:h.filter(e=>(null==ge?void 0:ge.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));console.log("actions here",Be);const Me=e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t};return se?n.createElement(t.Loader,null):(console.log("displayData=>",ue),n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},oe("NDC_APP_OVER_VIEW_HEADER")),fe&&n.createElement(t.Loader,null),Se&&Se.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>we(!Ie),displayOptions:Ie,options:Se})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("OWNER_OWNERPHOTO")),n.createElement(An,{ownerFileStoreId:null==ue||null===(A=ue.ownerPhotoList)||void 0===A||null===(S=A[0])||void 0===S?void 0:S.filestoreId,ownerName:null==ue||null===(N=ue.applicantDetails)||void 0===N||null===(b=N[0])||void 0===b||null===(C=b.owners)||void 0===C||null===(y=C[0])||void 0===y?void 0:y.ownerOrFirmName})),null==ue||null===(D=ue.applicantDetails)||void 0===D||null===(O=D[0])||void 0===O||null===(L=O.owners)||void 0===L?void 0:L.map((e,l)=>{var i;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?oe("NOC_PRIMARY_OWNER"):"OWNER "+(l+1)),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:oe("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_APPLICANT_DOB_LABEL"),text:Me(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.gender)||void 0===i?void 0:i.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.propertyId)||"N/A"})))))}),(null==ue||null===(T=ue.applicantDetails)||void 0===T?void 0:T.some(e=>{var t,l;return(null==e||null===(t=e.professionalName)||void 0===t||null===(l=t.trim())||void 0===l?void 0:l.length)>0}))&&(null==ue||null===(I=ue.applicantDetails)||void 0===I?void 0:I.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("NOC_PROFESSIONAL_DETAILS")),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:oe("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),text:(null==e?void 0:e.professionalRegIdValidity)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("NOC_SITE_DETAILS")),null==ue||null===(w=ue.siteDetails)||void 0===w?void 0:w.map((e,l)=>{var i,o,a,r,u,d,s;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:oe("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),(null==e?void 0:e.isBasementAreaAvailable)&&n.createElement(t.Row,{label:oe("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:oe("NOC_BASEMENT_AREA_LABEL"),text:e.basementArea||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,l)=>n.createElement(t.Row,{label:be(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:oe("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),n.createElement(t.Row,{label:oe("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("NOC_SPECIFICATION_DETAILS")),null==ue||null===(x=ue.siteDetails)||void 0===x?void 0:x.map((e,l)=>{var i,o,a,r;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:oe("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),n.createElement(t.Row,{label:oe("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("NOC_SITE_COORDINATES_LABEL")),null==ue||null===(R=ue.coordinates)||void 0===R?void 0:R.map((e,l)=>n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:oe("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),n.createElement(t.Row,{label:oe("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),n.createElement(t.Row,{label:oe("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),n.createElement(t.Row,{label:oe("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==me||null===(P=me.Noc)||void 0===P||null===(F=P[0])||void 0===F||null===(B=F.nocDetails)||void 0===B||null===(M=B.additionalDetails)||void 0===M||null===(k=M.ownerIds)||void 0===k?void 0:k.length)>0&&n.createElement(gn,{documents:null==me||null===(U=me.Noc)||void 0===U||null===(H=U[0])||void 0===H||null===(W=H.nocDetails)||void 0===W||null===(j=W.additionalDetails)||void 0===j?void 0:j.ownerIds}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==ue||null===(z=ue.Documents)||void 0===z?void 0:z.length)>0&&n.createElement(gn,{documents:ue.Documents}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,oe("NOC_FEE_DETAILS_LABEL")),(null==me||null===(V=me.Noc)||void 0===V||null===(G=V[0])||void 0===G?void 0:G.nocDetails)&&n.createElement(hn,{formData:{apiData:c({},me),applicationDetails:c({},null==me||null===(Y=me.Noc)||void 0===Y||null===(q=Y[0])||void 0===q||null===(K=q.nocDetails)||void 0===K||null===(X=K.additionalDetails)||void 0===X?void 0:X.applicationDetails),siteDetails:c({},null==me||null===(Q=me.Noc)||void 0===Q||null===(J=Q[0])||void 0===J||null===(Z=J.nocDetails)||void 0===Z||null===($=Z.additionalDetails)||void 0===$?void 0:$.siteDetails)}})),n.createElement(on,{workflowDetails:Re,t:oe}),Be&&Be.length>0&&n.createElement(t.ActionBar,null,De&&(null!=Re&&null!==(ee=Re.data)&&void 0!==ee&&null!==(te=ee.actionState)&&void 0!==te&&te.nextActions||null!=Re&&null!==(le=Re.data)&&void 0!==le&&le.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:Be,optionKey:"action",t:oe,onSelect:function(e){var t,l;console.log("selected action",e);const n=null==me||null===(t=me.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,i={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?ae.push("/digit-ui/citizen/noc/edit-application/"+n):"DRAFT"==(null==e?void 0:e.action)?(ye({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{ye(null)},3e3)):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?function(e){try{var t,l;const n=c({},(null==me||null===(t=me.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(l=e.Licenses)||void 0===l?void 0:l[0];n.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},n)},a=Lt(function(){return Ot(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:re,details:o})).then(function(e){var t,l,n;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==i?void 0:i.action)?(ye({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),Re.revalidate(),Te(null)):(console.log("We are calling citizen response page"),ae.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo),state:{data:e}})):(ye({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Te(null))})},function(){ye({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{ye(null)},3e3),e)throw t;return t});Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(i):"PAY"==(null==e?void 0:e.action)?ae.push("/digit-ui/citizen/payment/collect/obpas_noc/"+n+"/"+re+"?tenantId="+re):Te(e)}}):null,n.createElement(t.SubmitBar,{ref:xe,label:oe("WF_TAKE_ACTION"),onSubmit:()=>Oe(!De)})),Ce&&n.createElement(t.Toast,{error:null==Ce?void 0:Ce.error,warning:null==Ce?void 0:Ce.warning,label:oe(null==Ce?void 0:Ce.message),isDleteBtn:!0,onClose:()=>{ye(null)}})))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,d,s,m,v,p,f,E,_,g,h,A,S,N,b,C,y,D,O,L,T,I,w,x,R,P,F,B,M,k,U,H,W,j,z,V,G,Y,q,K,X,Q,J,Z,$,ee;const{id:te}=i.useParams(),{t:le}=o.useTranslation(),ne=window.localStorage.getItem("Employee.tenant-id"),ie=i.useHistory(),oe=null==ne?void 0:ne.split(".")[0],[ae,re]=l.useState(null),[ue,de]=l.useState(null),[se,ce]=l.useState(null),[me,ve]=l.useState(null),[pe,fe]=l.useState({}),[Ee,_e]=l.useState(!1),[ge,he]=l.useState([]),[Ae,Se]=l.useState(!1),[Ne,be]=l.useState([]),{isLoading:Ce,data:ye}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:te},ne),De=null==ye?void 0:ye.resData;console.log("applicationDetails here==>",De);const Oe=Digit.Hooks.useWorkflowDetails({tenantId:ne,id:te,moduleCode:"obpas_noc"});var Le,Te;console.log("workflowDetails here=>",Oe),null!=Oe&&null!==(e=Oe.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Oe.isLoading&&(Oe.data.actionState.nextActions=[...null==Oe||null===(r=Oe.data)||void 0===r?void 0:r.nextActions]),Oe&&Oe.data&&!Oe.isLoading&&(Oe.data.initialActionState=(null==Oe||null===(Le=Oe.data)||void 0===Le?void 0:Le.initialActionState)||c({},null==Oe||null===(Te=Oe.data)||void 0===Te?void 0:Te.actionState)||{},Oe.data.actionState=c({},Oe.data)),l.useEffect(()=>{let e=null;try{return Se(!0),Promise.resolve(Digit.WorkflowService.init(ne,"obpas_noc")).then(function(t){var l,n,i;e=t,Se(!1),be(null===(l=e)||void 0===l||null===(n=l.BusinessServices)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.states)})}catch(e){Promise.reject(e)}},[ne]);const[Ie,we]=l.useState(!1),[xe,Re]=l.useState(null),[Pe,Fe]=l.useState(!1),Be=()=>{re(null)};let Me=Digit.UserService.getUser();const ke=l.useRef();if(Digit.Hooks.useClickOutside(ke,()=>{we(!1)},Ie),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};Me=null==t?void 0:t.value}const Ue=null===(u=Me)||void 0===u||null===(d=u.info)||void 0===d||null===(s=d.roles)||void 0===s?void 0:s.map(e=>e.code);l.useEffect(()=>{Oe&&Oe.revalidate(),ye&&ye.revalidate()},[]);let He=(null==Oe||null===(m=Oe.data)||void 0===m||null===(v=m.actionState)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==Ue?void 0:Ue.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==Oe||null===(f=Oe.data)||void 0===f||null===(E=f.nextActions)||void 0===E?void 0:E.filter(e=>(null==Ue?void 0:Ue.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));console.log("actions here",He),l.useEffect(()=>{var e;const t=null==De||null===(e=De.Noc)||void 0===e?void 0:e[0];if(t){var l,n,i,o,a,r,u,d;const e=null==t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.applicationDetails,s=null==t||null===(i=t.nocDetails)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.siteDetails,c=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,m=(null==t?void 0:t.documents)||[],v=(null==t||null===(u=t.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.ownerPhotos)||[];fe({applicantDetails:e?[e]:[],siteDetails:s?[s]:[],coordinates:c?[c]:[],Documents:m.length>0?m:[],ownerPhotoList:v})}},[null==De?void 0:De.Noc]);const We=function(e){try{var t,l;const n=c({},(null==De||null===(t=De.Noc)||void 0===t?void 0:t[0])||{},{workflow:{}}),i=null==e||null===(l=e.Licenses)||void 0===l?void 0:l[0];n.workflow={action:i.action,assignes:null==i?void 0:i.assignee,comment:null==i?void 0:i.comment,documents:null==i?void 0:i.wfDocuments};const o={Noc:c({},n)};console.log("final Payload ",o);const a=Lt(function(){return Ot(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:ne,details:o})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==i?void 0:i.action))re({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),Oe.revalidate(),Re(null),setTimeout(()=>{ie.push("/digit-ui/employee/noc/inbox")},3e3);else if("APPLY"===(null==i?void 0:i.action)||"RESUBMIT"===(null==i?void 0:i.action)||"DRAFT"===(null==i?void 0:i.action)){var l,n;console.log("We are calling employee response page"),ie.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(l=e.Noc)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo),state:{data:e}})}else re({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),Oe.revalidate(),Re(null),setTimeout(()=>{ie.push("/digit-ui/employee/noc/inbox")},3e3);else re({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),Re(null)})},function(){re({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{re(null)},3e3),e)throw t;return t});return Promise.resolve(a&&a.then?a.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},je=e=>{if(0===e)return le("NOC_GROUND_FLOOR_AREA_LABEL");const t=e%10,l=e%100;let n="th";return(l<11||l>13)&&(1===t?n="st":2===t?n="nd":3===t&&(n="rd")),""+e+n+" "+le("NOC_FLOOR_AREA_LABEL")},ze=e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t};return console.log("displayData here",pe),n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px"}},n.createElement(t.Header,{styles:{fontSize:"32px"}},le("NDC_APP_OVER_VIEW_HEADER"))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("OWNER_OWNERPHOTO")),n.createElement(An,{ownerFileStoreId:null==pe||null===(_=pe.ownerPhotoList)||void 0===_||null===(g=_[0])||void 0===g?void 0:g.filestoreId,ownerName:null==pe||null===(h=pe.applicantDetails)||void 0===h||null===(A=h[0])||void 0===A||null===(S=A.owners)||void 0===S||null===(N=S[0])||void 0===N?void 0:N.ownerOrFirmName})),null==pe||null===(b=pe.applicantDetails)||void 0===b||null===(C=b[0])||void 0===C||null===(y=C.owners)||void 0===y?void 0:y.map((e,l)=>{var i;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?le("NOC_PRIMARY_OWNER"):"OWNER "+(l+1)),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:le("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:le("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:le("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:le("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:le("NOC_APPLICANT_DOB_LABEL"),text:ze(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:le("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.gender)||void 0===i?void 0:i.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:le("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"}),n.createElement(t.Row,{label:le("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==e?void 0:e.propertyId)||"N/A"})))))}),(null==pe||null===(D=pe.applicantDetails)||void 0===D?void 0:D.some(e=>{var t,l;return(null==e||null===(t=e.professionalName)||void 0===t||null===(l=t.trim())||void 0===l?void 0:l.length)>0}))&&(null==pe||null===(O=pe.applicantDetails)||void 0===O?void 0:O.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("NOC_PROFESSIONAL_DETAILS")),n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:le("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:le("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:le("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:le("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:le("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("NOC_SITE_DETAILS")),null==pe||null===(L=pe.siteDetails)||void 0===L?void 0:L.map((e,l)=>{var i,o,a,r,u,d,s;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:le("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:le("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:le("NOC_ULB_NAME_LABEL"),text:(null==e||null===(i=e.ulbName)||void 0===i?void 0:i.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:le("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:le("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:le("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:le("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(o=e.roadType)||void 0===o?void 0:o.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:le("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:le("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:le("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:le("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:le("NOC_BUILDING_STATUS_LABEL"),text:(null==e||null===(a=e.buildingStatus)||void 0===a?void 0:a.name)||(null==e?void 0:e.buildingStatus)||"N/A"}),(null==e?void 0:e.isBasementAreaAvailable)&&n.createElement(t.Row,{label:le("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==e||null===(r=e.isBasementAreaAvailable)||void 0===r?void 0:r.code)||(null==e?void 0:e.isBasementAreaAvailable)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:le("NOC_BASEMENT_AREA_LABEL"),text:(null==e?void 0:e.basementArea)||"N/A"}),"Built Up"==(null==e?void 0:e.buildingStatus)&&(null==e||null===(u=e.floorArea)||void 0===u?void 0:u.map((e,l)=>n.createElement(t.Row,{label:je(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:le("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==e?void 0:e.totalFloorArea)||"N/A"}),n.createElement(t.Row,{label:le("NOC_DISTRICT_LABEL"),text:(null==e||null===(d=e.district)||void 0===d?void 0:d.name)||(null==e?void 0:e.district)||"N/A"}),n.createElement(t.Row,{label:le("NOC_ZONE_LABEL"),text:(null==e||null===(s=e.zone)||void 0===s?void 0:s.name)||(null==e?void 0:e.zone)||"N/A"}),n.createElement(t.Row,{label:le("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:le("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:le("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:le("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:le("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==e?void 0:e.khewatAndKhatuniNo)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("NOC_SPECIFICATION_DETAILS")),null==pe||null===(T=pe.siteDetails)||void 0===T?void 0:T.map((e,l)=>{var i,o,a,r;return n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:le("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:le("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(i=e.specificationBuildingCategory)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:le("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(o=e.specificationNocType)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:le("NOC_RESTRICTED_AREA_LABEL"),text:(null==e||null===(a=e.specificationRestrictedArea)||void 0===a?void 0:a.code)||(null==e?void 0:e.specificationRestrictedArea)||"N/A"}),n.createElement(t.Row,{label:le("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==e||null===(r=e.specificationIsSiteUnderMasterPlan)||void 0===r?void 0:r.code)||(null==e?void 0:e.specificationIsSiteUnderMasterPlan)||"N/A"})))})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("NOC_SITE_COORDINATES_LABEL")),null==pe||null===(I=pe.coordinates)||void 0===I?void 0:I.map((e,l)=>n.createElement("div",{key:l,style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:le("COMMON_LATITUDE1_LABEL"),text:(null==e?void 0:e.Latitude1)||"N/A"}),n.createElement(t.Row,{label:le("COMMON_LONGITUDE1_LABEL"),text:(null==e?void 0:e.Longitude1)||"N/A"}),n.createElement(t.Row,{label:le("COMMON_LATITUDE2_LABEL"),text:(null==e?void 0:e.Latitude2)||"N/A"}),n.createElement(t.Row,{label:le("COMMON_LONGITUDE2_LABEL"),text:(null==e?void 0:e.Longitude2)||"N/A"}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==De||null===(w=De.Noc)||void 0===w||null===(x=w[0])||void 0===x||null===(R=x.nocDetails)||void 0===R||null===(P=R.additionalDetails)||void 0===P||null===(F=P.ownerIds)||void 0===F?void 0:F.length)>0&&n.createElement(gn,{documents:null==De||null===(B=De.Noc)||void 0===B||null===(M=B[0])||void 0===M||null===(k=M.nocDetails)||void 0===k||null===(U=k.additionalDetails)||void 0===U?void 0:U.ownerIds}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==pe||null===(H=pe.Documents)||void 0===H?void 0:H.length)>0&&n.createElement(gn,{documents:pe.Documents}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,le("NOC_FEE_DETAILS_LABEL")),(null==De||null===(W=De.Noc)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.nocDetails)&&n.createElement(hn,{formData:{apiData:c({},De),applicationDetails:c({},null==De||null===(z=De.Noc)||void 0===z||null===(V=z[0])||void 0===V||null===(G=V.nocDetails)||void 0===G||null===(Y=G.additionalDetails)||void 0===Y?void 0:Y.applicationDetails),siteDetails:c({},null==De||null===(q=De.Noc)||void 0===q||null===(K=q[0])||void 0===K||null===(X=K.nocDetails)||void 0===X||null===(Q=X.additionalDetails)||void 0===Q?void 0:Q.siteDetails)}})),n.createElement(on,{workflowDetails:Oe,t:le}),(null==He?void 0:He.length)>0&&n.createElement(t.ActionBar,null,Ie&&(null!=Oe&&null!==(J=Oe.data)&&void 0!==J&&null!==(Z=J.actionState)&&void 0!==Z&&Z.nextActions||null!=Oe&&null!==($=Oe.data)&&void 0!==$&&$.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:He,optionKey:"action",t:le,onSelect:function(e){var t,l,n,i,o;console.log("selected action",e);const a=null==De||null===(t=De.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,r=null==e||null===(n=e.state)||void 0===n||null===(i=n.actions)||void 0===i?void 0:i.filter(t=>t.action==(null==e?void 0:e.action)),u=null==Ne?void 0:Ne.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=r[0])||void 0===t?void 0:t.nextState)});he(null==u||null===(o=u[0])||void 0===o?void 0:o.actions);const d={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?ie.push("/digit-ui/employee/noc/edit-application/"+a):"DRAFT"==(null==e?void 0:e.action)?(re({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{re(null)},3e3)):"APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action)?We(d):"PAY"==(null==e?void 0:e.action)?ie.push("/digit-ui/employee/payment/collect/obpas_noc/"+a+"/"+ne+"?tenantId="+ne):(Fe(!0),Re(e))}}):null,n.createElement(t.SubmitBar,{ref:ke,label:le("WF_TAKE_ACTION"),onSubmit:()=>we(!Ie)})),Pe?n.createElement(_n,{t:le,action:xe,tenantId:ne,state:oe,getEmployees:ge,id:te,applicationDetails:De,applicationData:null==De?void 0:De.Noc,closeModal:()=>{Re(null),Fe(!1)},submitAction:We,actionData:null==Oe||null===(ee=Oe.data)||void 0===ee?void 0:ee.timeline,workflowDetails:Oe,showToast:ae,setShowToast:re,closeToast:Be,errors:ue,showErrorToast:se,errorOne:me,closeToastOne:()=>{ce(null)}}):null,ae&&n.createElement(t.Toast,{error:null==ae?void 0:ae.error,warning:null==ae?void 0:ae.warning,label:le(null==ae?void 0:ae.message),isDleteBtn:!0,onClose:Be}),(Ce||Ae)&&n.createElement(t.Loader,{page:!0}))},NewNOCEditApplication:()=>{var e,a,r,u,s,m,v,p,f,E,_,g,h,A,S,N,b,C;const{id:y}=i.useParams(),{t:D}=(i.useHistory(),o.useTranslation()),O=d.useDispatch(),[L,T]=l.useState(null),I=d.useSelector(e=>e.noc.NOCNewApplicationFormReducer),w=I.formData,x=I.step;let R;R=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY"),console.log("tenantId here",R);const{isLoading:P,data:F}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:y},R),B=null==F?void 0:F.resData;console.log("applicationDetails here==>",B);const M=(null==B||null===(e=B.Noc)||void 0===e?void 0:e[0])||{},k=(null==M||null===(a=M.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.applicationDetails)||{},U=(null==M||null===(u=M.nocDetails)||void 0===u||null===(s=u.additionalDetails)||void 0===s?void 0:s.siteDetails)||{},H=(null==M||null===(m=M.documents)||void 0===m?void 0:m.filter(e=>(null==e?void 0:e.documentUid)||(null==e?void 0:e.documentType)))||[],W=(null==M||null===(v=M.nocDetails)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.coordinates)||{},j=(null==M||null===(f=M.nocDetails)||void 0===f||null===(E=f.additionalDetails)||void 0===E?void 0:E.ownerPhotos)||[],z=(null==M||null===(_=M.nocDetails)||void 0===_||null===(g=_.additionalDetails)||void 0===g?void 0:g.ownerIds)||[],V=Digit.ULBService.getStateId(),{data:G,isLoading:Y}=Digit.Hooks.noc.useBuildingType(V),{data:q}=Digit.Hooks.noc.useRoadType(V),{data:K}=Digit.Hooks.noc.useBuildingCategory(V),{data:X,isLoading:Q}=Digit.Hooks.noc.useNocType(V),{data:J,isLoading:Z}=Digit.Hooks.useTenants(),[$,ee]=l.useState(Digit.Hooks.noc.useTenants()),te=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],le=null==J?void 0:J.map(e=>c({},e,{displayName:D(e.i18nKey)})),{data:ne}=Digit.Hooks.obps.useMDMS(V,"common-masters",["GenderType"]);ne&&(null===(h=ne["common-masters"])||void 0===h||null===(A=h.GenderType)||void 0===A||null===(S=A.filter(e=>e.active))||void 0===S||S.map(e=>{}));const[ie,oe]=l.useState(null),{data:ae,isLoading:re}=Digit.Hooks.useCustomMDMS(V,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+R+"')]"}]),ue=(null==ae||null===(N=ae.tenant)||void 0===N||null===(b=N.zoneMaster)||void 0===b||null===(C=b[0])||void 0===C?void 0:C.zones)||[];return console.log("zoneOptions==>",ue),l.useEffect(()=>{if(O({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!P&&!Y&&null!=M&&M.nocDetails&&!Z&&!re&&!Q){const e={documents:{documents:null==H?void 0:H.map(e=>({documentType:(null==e?void 0:e.documentType)||"",uuid:(null==e?void 0:e.uuid)||"",documentUid:(null==e?void 0:e.documentUid)||"",documentAttachment:(null==e?void 0:e.documentAttachment)||"",filestoreId:(null==e?void 0:e.uuid)||""}))}};Object.entries(W).forEach(e=>{let[t,l]=e;O(bi(t,l))}),O(yi("ownerIdList",z)),O(Ci("ownerPhotoList",j));const t=c({},k),l=null==$?void 0:$.find(e=>{var t;return e.name===(null==U||null===(t=U.district)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.district)});oe(l);const n=c({},U,{ulbName:null==le?void 0:le.find(e=>{var t;return e.name===(null==U||null===(t=U.ulbName)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.ulbName)}),roadType:null==q?void 0:q.find(e=>{var t;return e.name===(null==U||null===(t=U.roadType)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.roadType)}),buildingStatus:null==G?void 0:G.find(e=>{var t;return e.name===(null==U||null===(t=U.buildingStatus)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.buildingStatus)}),isBasementAreaAvailable:null==te?void 0:te.find(e=>{var t;return e.code===(null==U||null===(t=U.isBasementAreaAvailable)||void 0===t?void 0:t.code)||e.code===(null==U?void 0:U.isBasementAreaAvailable)}),district:l,zone:null==ue?void 0:ue.find(e=>{var t;return e.name===(null==U||null===(t=U.zone)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.zone)}),specificationBuildingCategory:null==K?void 0:K.find(e=>{var t;return e.name===(null==U||null===(t=U.specificationBuildingCategory)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.specificationBuildingCategory)}),specificationNocType:null==X?void 0:X.find(e=>{var t;return e.name===(null==U||null===(t=U.specificationNocType)||void 0===t?void 0:t.name)||e.name===(null==U?void 0:U.specificationNocType)}),specificationRestrictedArea:null==te?void 0:te.find(e=>{var t;return e.code===(null==U||null===(t=U.specificationRestrictedArea)||void 0===t?void 0:t.code)||e.code===(null==U?void 0:U.specificationRestrictedArea)}),specificationIsSiteUnderMasterPlan:null==te?void 0:te.find(e=>{var t;return e.code===(null==U||null===(t=U.specificationIsSiteUnderMasterPlan)||void 0===t?void 0:t.code)||e.code===(null==U?void 0:U.specificationIsSiteUnderMasterPlan)})});O(Si("applicationDetails",t)),O(Si("siteDetails",n)),O(Si("documents",e)),O(Si("apiData",B))}},[P,B,Y,re,Q]),P||!w.applicationDetails?n.createElement("div",null,n.createElement(t.Loader,null)):n.createElement("div",{className:"card"},n.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},D("NOC_REGISTRATION_APPLICATION")),n.createElement(hi,{stepsList:Fi,onSubmit:e=>{},step:x,setStep:e=>{O(Ni(e))}}),L&&n.createElement(t.Toast,{error:L.key,label:D(L.label),onClose:()=>{T(null)},isDleteBtn:"true"}))},NOCCitizenSearchApplication:()=>{const{t:e}=o.useTranslation(),i=Digit.UserService.getUser().info;let a;a=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const r={offset:0,limit:10,tenantId:a,mobileNumber:null==i?void 0:i.mobileNumber},[u,d]=l.useState(r),s=window.Digit.Utils.browser.isMobile(),[c,m]=l.useState([{display:"ES_COMMON_NO_DATA"}]),[v,p]=l.useState(0),{data:f,isLoading:E,error:_}=Digit.Hooks.noc.useNOCSearchApplicationByIdOrMobile(u,a,{});return l.useEffect(()=>{var e;null==f?m([{display:"ES_COMMON_NO_DATA"}]):(null==f||null===(e=f.data)||void 0===e?void 0:e.length)>0&&(m(null==f?void 0:f.data),p(null==f?void 0:f.totalCount))},[f]),n.createElement("div",null,n.createElement(t.CardHeader,{styles:s?{fontSize:"32px",fontWeight:"700",paddingLeft:"10px"}:{fontSize:"32px",fontWeight:"700"}},e("ACTION_TEST_SEARCH_NOC_APPLICATION")),n.createElement(ji,{t:e,tenantId:a,onSubmit:function(e,t){console.log("_data==>",e);let l=gt(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),d(l)},isLoading:E,Count:v,error:_,data:c}))}};exports.NOCLinks=zi,exports.NOCModule=Vi,exports.NOCReducers=()=>u.combineReducers({NOCNewApplicationFormReducer:pi}),exports.initNOCComponents=()=>{Object.entries(Gi).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};