@mseva/digit-ui-module-noc 1.0.49 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/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),o=require("react-router-dom"),i=require("react-i18next"),a=require("react-hook-form"),r=require("react-query"),u=e(require("exif-js")),d=require("redux"),s=require("react-redux");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(),o=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,n+"/"+l+"/"+o}return null},p=(e,t)=>{var l,n,o,i,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===(o=s.assigner)||void 0===o?void 0:o.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===(i=m.data)||void 0===i||null===(a=i.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}},E=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=[],o=Digit.UserService.getUser().info.roles;return l.map((t,i)=>{let{roles:a}=t;a.map(t=>{o.map(o=>{var a;o.code===t&&n.push(e?null==l||null===(a=l[i])||void 0===a?void 0:a.code:null==l?void 0:l[i])})})}),n},g=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",o=(null==n?void 0:n.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i},h=e=>{switch(e){case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6789][0-9]{9}$/i;case"Amount":return/^[0-9]{0,8}$/i;case"NonZeroAmount":return/^[1-9][0-9]{0,7}$/i;case"DecimalNumber":return/^\d{0,8}(\.\d{1,2})?$/i;case"Email":return/^(?=^.{1,64}$)((([^<>()\[\]\\.,;:\s$*@'"]+(\.[^<>()\[\]\\.,;:\s@'"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))$/i;case"Address":return/^[^\$\"<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,500}$/i;case"PAN":return/^[A-Za-z]{5}\d{4}[A-Za-z]{1}$/i;case"TradeName":return/^[-@.\/#&+\w\s]*$/;case"Date":return/^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/i;case"UOMValue":return/^(0)*[1-9][0-9]{0,5}$/i;case"OperationalArea":case"NoOfEmp":return/^(0)*[1-9][0-9]{0,6}$/i;case"GSTNo":return/^\d{2}[A-Z]{5}\d{4}[A-Z]{1}\d[Z]{1}[A-Z\d]{1}$/i;case"DoorHouseNo":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,50}$/i;case"BuildingStreet":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,64}$/i;case"Pincode":return/^[1-9][0-9]{5}$/i;case"Landline":return/^[0-9]{11}$/i;case"PropertyID":return/^[a-zA-z0-9\s\\/\-]$/i;case"ElectricityConnNo":return/^.{1,15}$/i;case"DocumentNo":return/^[0-9]{1,15}$/i;case"eventName":return/^[^\$\"<>?\\\\~`!@#$%^()+={}\[\]*,.:;“”]{1,65}$/i;case"eventDescription":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,500}$/i;case"cancelChallan":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,100}$/i;case"FireNOCNo":return/^[a-zA-Z0-9-]*$/i;case"consumerNo":return/^[a-zA-Z0-9/-]*$/i;case"AadharNo":return/^([0-9]){12}$/;case"ChequeNo":return/^(?!0{6})[0-9]{6}$/;case"Comments":return/^[^\$"'<>?\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,}$/i;case"OldLicenceNo":return/^[a-zA-Z0-9-/]{0,64}$/}},A=e=>{if(!e)return"";const t=e.split("-");if(3!==t.length)return e;const[l,n,o]=t;return 2===l.length&&4===o.length?e:4===l.length?o+"-"+n+"-"+l:4===o.length&&2===l.length&&2===n.length?n+"-"+l+"-"+o:e},N=e=>{if(!e)return"";if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const[t,l,n]=e.split("-");return n+"-"+l+"-"+t};var S=function(e,t){return e===t||e!=e&&t!=t},b=function(e,t){for(var l=e.length;l--;)if(S(e[l][0],t))return l;return-1},y=Array.prototype.splice;function C(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])}}C.prototype.clear=function(){this.__data__=[],this.size=0},C.prototype.delete=function(e){var t=this.__data__,l=b(t,e);return!(l<0||(l==t.length-1?t.pop():y.call(t,l,1),--this.size,0))},C.prototype.get=function(e){var t=this.__data__,l=b(t,e);return l<0?void 0:t[l][1]},C.prototype.has=function(e){return b(this.__data__,e)>-1},C.prototype.set=function(e,t){var l=this.__data__,n=b(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var D=C,O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function T(e,t){return e(t={exports:{}},t.exports),t.exports}var L,I="object"==typeof O&&O&&O.Object===Object&&O,w="object"==typeof self&&self&&self.Object===Object&&self,P=I||w||Function("return this")(),R=P.Symbol,x=Object.prototype,B=x.hasOwnProperty,F=x.toString,M=R?R.toStringTag:void 0,k=Object.prototype.toString,U=R?R.toStringTag:void 0,H=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=B.call(e,M),l=e[M];try{e[M]=void 0;var n=!0}catch(e){}var o=F.call(e);return n&&(t?e[M]=l:delete e[M]),o}(e):function(e){return k.call(e)}(e)},W=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},j=function(e){if(!W(e))return!1;var t=H(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},z=P["__core-js_shared__"],V=(L=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",G=Function.prototype.toString,Y=function(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""},q=/^\[object .+?Constructor\]$/,K=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!W(e)||(t=e,V&&V in t))&&(j(e)?K:q).test(Y(e));var t}(l)?l:void 0},X=$(P,"Map"),Z=$(Object,"create"),J=Object.prototype.hasOwnProperty,Q=Object.prototype.hasOwnProperty;function ee(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])}}ee.prototype.clear=function(){this.__data__=Z?Z(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(Z){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return J.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return Z?void 0!==t[e]:Q.call(t,e)},ee.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=Z&&void 0===t?"__lodash_hash_undefined__":t,this};var te=ee,le=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 ne(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])}}ne.prototype.clear=function(){this.size=0,this.__data__={hash:new te,map:new(X||D),string:new te}},ne.prototype.delete=function(e){var t=le(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return le(this,e).get(e)},ne.prototype.has=function(e){return le(this,e).has(e)},ne.prototype.set=function(e,t){var l=le(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var oe=ne;function ie(e){var t=this.__data__=new D(e);this.size=t.size}ie.prototype.clear=function(){this.__data__=new D,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var l=this.__data__;if(l instanceof D){var n=l.__data__;if(!X||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new oe(n)}return l.set(e,t),this.size=l.size,this};var ae=ie,re=function(){try{var e=$(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ue=function(e,t,l){"__proto__"==t&&re?re(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},de=Object.prototype.hasOwnProperty,se=function(e,t,l){var n=e[t];de.call(e,t)&&S(n,l)&&(void 0!==l||t in e)||ue(e,t,l)},ce=function(e,t,l,n){var o=!l;l||(l={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),o?ue(l,r,u):se(l,r,u)}return l},me=function(e){return null!=e&&"object"==typeof e},ve=function(e){return me(e)&&"[object Arguments]"==H(e)},pe=Object.prototype,Ee=pe.hasOwnProperty,fe=pe.propertyIsEnumerable,ge=ve(function(){return arguments}())?ve:function(e){return me(e)&&Ee.call(e,"callee")&&!fe.call(e,"callee")},_e=Array.isArray,he=function(){return!1},Ae=T(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,o=n&&n.exports===l?P.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||he}),Ne=/^(?:0|[1-9]\d*)$/,Se=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&Ne.test(e))&&e>-1&&e%1==0&&e<t},be=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ye={};ye["[object Float32Array]"]=ye["[object Float64Array]"]=ye["[object Int8Array]"]=ye["[object Int16Array]"]=ye["[object Int32Array]"]=ye["[object Uint8Array]"]=ye["[object Uint8ClampedArray]"]=ye["[object Uint16Array]"]=ye["[object Uint32Array]"]=!0,ye["[object Arguments]"]=ye["[object Array]"]=ye["[object ArrayBuffer]"]=ye["[object Boolean]"]=ye["[object DataView]"]=ye["[object Date]"]=ye["[object Error]"]=ye["[object Function]"]=ye["[object Map]"]=ye["[object Number]"]=ye["[object Object]"]=ye["[object RegExp]"]=ye["[object Set]"]=ye["[object String]"]=ye["[object WeakMap]"]=!1;var Ce=function(e){return function(t){return e(t)}},De=T(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,o=n&&n.exports===l&&I.process,i=function(){try{return n&&n.require&&n.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Oe=De&&De.isTypedArray,Te=Oe?Ce(Oe):function(e){return me(e)&&be(e.length)&&!!ye[H(e)]},Le=Object.prototype.hasOwnProperty,Ie=function(e,t){var l=_e(e),n=!l&&ge(e),o=!l&&!n&&Ae(e),i=!l&&!n&&!o&&Te(e),a=l||n||o||i,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&&!Le.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||Se(d,u))||r.push(d);return r},we=Object.prototype,Pe=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||we)},Re=function(e,t){return function(l){return e(t(l))}},xe=Re(Object.keys,Object),Be=Object.prototype.hasOwnProperty,Fe=function(e){return null!=e&&be(e.length)&&!j(e)},Me=function(e){return Fe(e)?Ie(e):function(e){if(!Pe(e))return xe(e);var t=[];for(var l in Object(e))Be.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},ke=Object.prototype.hasOwnProperty,Ue=function(e){return Fe(e)?Ie(e,!0):function(e){if(!W(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Pe(e),l=[];for(var n in e)("constructor"!=n||!t&&ke.call(e,n))&&l.push(n);return l}(e)},He=T(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,o=n&&n.exports===l?P.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=i?i(l):new e.constructor(l);return e.copy(n),n}}),We=function(){return[]},je=Object.prototype.propertyIsEnumerable,ze=Object.getOwnPropertySymbols,Ve=ze?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,o=null==t?0:t.length,i=0,a=[];++n<o;){var r=t[n];je.call(e,r)&&(a[i++]=r)}return a}(ze(e)))}:We,Ge=function(e,t){for(var l=-1,n=t.length,o=e.length;++l<n;)e[o+l]=t[l];return e},Ye=Re(Object.getPrototypeOf,Object),qe=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ge(t,Ve(e)),e=Ye(e);return t}:We,Ke=function(e,t,l){var n=t(e);return _e(e)?n:Ge(n,l(e))},$e=function(e){return Ke(e,Me,Ve)},Xe=function(e){return Ke(e,Ue,qe)},Ze=$(P,"DataView"),Je=$(P,"Promise"),Qe=$(P,"Set"),et=$(P,"WeakMap"),tt=Y(Ze),lt=Y(X),nt=Y(Je),ot=Y(Qe),it=Y(et),at=H;(Ze&&"[object DataView]"!=at(new Ze(new ArrayBuffer(1)))||X&&"[object Map]"!=at(new X)||Je&&"[object Promise]"!=at(Je.resolve())||Qe&&"[object Set]"!=at(new Qe)||et&&"[object WeakMap]"!=at(new et))&&(at=function(e){var t=H(e),l="[object Object]"==t?e.constructor:void 0,n=l?Y(l):"";if(n)switch(n){case tt:return"[object DataView]";case lt:return"[object Map]";case nt:return"[object Promise]";case ot:return"[object Set]";case it:return"[object WeakMap]"}return t});var rt=at,ut=Object.prototype.hasOwnProperty,dt=P.Uint8Array,st=function(e){var t=new e.constructor(e.byteLength);return new dt(t).set(new dt(e)),t},ct=/\w*$/,mt=R?R.prototype:void 0,vt=mt?mt.valueOf:void 0,pt=Object.create,Et=function(){function e(){}return function(t){if(!W(t))return{};if(pt)return pt(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),ft=De&&De.isMap,gt=ft?Ce(ft):function(e){return me(e)&&"[object Map]"==rt(e)},_t=De&&De.isSet,ht=_t?Ce(_t):function(e){return me(e)&&"[object Set]"==rt(e)},At={};At["[object Arguments]"]=At["[object Array]"]=At["[object ArrayBuffer]"]=At["[object DataView]"]=At["[object Boolean]"]=At["[object Date]"]=At["[object Float32Array]"]=At["[object Float64Array]"]=At["[object Int8Array]"]=At["[object Int16Array]"]=At["[object Int32Array]"]=At["[object Map]"]=At["[object Number]"]=At["[object Object]"]=At["[object RegExp]"]=At["[object Set]"]=At["[object String]"]=At["[object Symbol]"]=At["[object Uint8Array]"]=At["[object Uint8ClampedArray]"]=At["[object Uint16Array]"]=At["[object Uint32Array]"]=!0,At["[object Error]"]=At["[object Function]"]=At["[object WeakMap]"]=!1;var Nt=function e(t,l,n,o,i,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=i?n(t,o,i,a):n(t)),void 0!==r)return r;if(!W(t))return t;var c=_e(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&ut.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=rt(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(Ae(t))return He(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!i){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||Pe(e)?{}:Et(Ye(e))}(t),!u)return d?function(e,t){return ce(e,qe(e),t)}(t,function(e,t){return e&&ce(t,Ue(t),e)}(r,t)):function(e,t){return ce(e,Ve(e),t)}(t,function(e,t){return e&&ce(t,Me(t),e)}(r,t))}else{if(!At[m])return i?t:{};r=function(e,t,l){var n,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return st(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var l=t?st(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?st(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(n=e).constructor(n.source,ct.exec(n))).lastIndex=n.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return vt?Object(vt.call(e)):{}}}(t,m,u)}}a||(a=new ae);var p=a.get(t);if(p)return p;a.set(t,r),ht(t)?t.forEach(function(o){r.add(e(o,l,n,o,t,a))}):gt(t)&&t.forEach(function(o,i){r.set(i,e(o,l,n,i,t,a))});var E=c?void 0:(s?d?Xe:$e:d?Ue:Me)(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(o,i){E&&(o=t[i=o]),se(r,i,e(o,l,n,i,t,a))}),r},St=function(e){return Nt(e,5)},bt=T(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[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]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",N="[object DataView]",S="[object Float32Array]",b="[object Float64Array]",y="[object Int8Array]",C="[object Int16Array]",D="[object Int32Array]",T="[object Uint8Array]",L="[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,B=/[&<>"']/g,F=RegExp(x.source),M=RegExp(B.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?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^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]",ge="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Se="(?:"+Ee+"|"+fe+")",be="(?:"+Ne+"|"+fe+")",ye="(?:"+ve+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+ye+"(?:\\u200d(?:"+[_e,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+ye+")*",De="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+Ce,Oe="(?:"+[_e+ve+"?",ve,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Te=RegExp("['’]","g"),Le=RegExp(ve,"g"),Ie=RegExp(ge+"(?="+ge+")|"+Oe+Ce,"g"),we=RegExp([Ne+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,Ne,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,Ne+Se,"$"].join("|")+")",Ne+"?"+Se+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ne+"+(?:['’](?: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"],Be=-1,Fe={};Fe[S]=Fe[b]=Fe[y]=Fe[C]=Fe[D]=Fe[T]=Fe["[object Uint8ClampedArray]"]=Fe[L]=Fe[I]=!0,Fe[i]=Fe[a]=Fe[A]=Fe[r]=Fe[N]=Fe[u]=Fe[d]=Fe[s]=Fe[m]=Fe[v]=Fe[p]=Fe[E]=Fe[f]=Fe[g]=Fe[h]=!1;var Me={};Me[i]=Me[a]=Me[A]=Me[N]=Me[r]=Me[u]=Me[S]=Me[b]=Me[y]=Me[C]=Me[D]=Me[m]=Me[v]=Me[p]=Me[E]=Me[f]=Me[g]=Me[_]=Me[T]=Me["[object Uint8ClampedArray]"]=Me[L]=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 O&&O&&O.Object===Object&&O,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){}}(),$e=Ke&&Ke.isArrayBuffer,Xe=Ke&&Ke.isDate,Ze=Ke&&Ke.isMap,Je=Ke&&Ke.isRegExp,Qe=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 o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];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 ot(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function it(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,o=0,i=[];++l<n;){var a=e[l];t(a,l,e)&&(i[o++]=a)}return i}function rt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,l){for(var n=-1,o=null==e?0:e.length;++n<o;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,o=Array(n);++l<n;)o[l]=t(e[l],l,e);return o}function st(e,t){for(var l=-1,n=t.length,o=e.length;++l<n;)e[o+l]=t[l];return e}function ct(e,t,l,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(l=e[++o]);++o<i;)l=t(l,e[o],o,e);return l}function mt(e,t,l,n){var o=null==e?0:e.length;for(n&&o&&(l=e[--o]);o--;)l=t(l,e[o],o,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=Nt("length");function Et(e,t,l){var n;return l(e,function(e,l,o){if(t(e,l,o))return n=l,!1}),n}function ft(e,t,l,n){for(var o=e.length,i=l+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function gt(e,t,l){return t==t?function(e,t,l){for(var n=l-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,ht,l)}function _t(e,t,l,n){for(var o=l-1,i=e.length;++o<i;)if(n(e[o],t))return o;return-1}function ht(e){return e!=e}function At(e,t){var l=null==e?0:e.length;return l?yt(e,t)/l:NaN}function Nt(e){return function(t){return null==t?void 0:t[e]}}function St(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,l,n,o){return o(e,function(e,o,i){l=n?(n=!1,e):t(l,e,o,i)}),l}function yt(e,t){for(var l,n=-1,o=e.length;++n<o;){var i=t(e[n]);void 0!==i&&(l=void 0===l?i:l+i)}return l}function Ct(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 Tt(e,t){return dt(t,function(t){return e[t]})}function Lt(e,t){return e.has(t)}function It(e,t){for(var l=-1,n=e.length;++l<n&>(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length;l--&>(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=St({"À":"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=St({"&":"&","<":"<",">":">",'"':""","'":"'"});function Bt(e){return"\\"+ke[e]}function Ft(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,o=e.length,i=0,a=[];++l<o;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[i++]=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 Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Ft(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=St({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var O=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,q=t.Date,se=t.Error,ce=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,ge=O.prototype,_e=ve.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Ne=_e.hasOwnProperty,Se=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ye=_e.toString,Ce=Ae.call(ve),De=ze._,Oe=pe("^"+Ae.call(Ne).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?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=_e.propertyIsEnumerable,qe=ge.splice,Ke=Pe?Pe.isConcatSpreadable:void 0,pt=Pe?Pe.iterator:void 0,St=Pe?Pe.toStringTag:void 0,qt=function(){try{var e=Jo(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,$t=q&&q.now!==ze.Date.now&&q.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Zt=me.ceil,Jt=me.floor,Qt=ve.getOwnPropertySymbols,el=Ie?Ie.isBuffer:void 0,tl=t.isFinite,ll=ge.join,nl=kt(ve.keys,ve),ol=me.max,il=me.min,al=q.now,rl=t.parseInt,ul=me.random,dl=ge.reverse,sl=Jo(t,"DataView"),cl=Jo(t,"Map"),ml=Jo(t,"Promise"),vl=Jo(t,"Set"),pl=Jo(t,"WeakMap"),El=Jo(ve,"create"),fl=pl&&new pl,gl={},_l=Oi(sl),hl=Oi(cl),Al=Oi(ml),Nl=Oi(vl),Sl=Oi(pl),bl=Pe?Pe.prototype:void 0,yl=bl?bl.valueOf:void 0,Cl=bl?bl.toString:void 0;function Dl(e){if(Va(e)&&!Ra(e)&&!(e instanceof Il)){if(e instanceof Ll)return e;if(Ne.call(e,"__wrapped__"))return Ti(e)}return new Ll(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 Tl(){}function Ll(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 Bl(e){var t=this.__data__=new Pl(e);this.size=t.size}function Fl(e,t){var l=Ra(e),n=!l&&Pa(e),o=!l&&!n&&Ma(e),i=!l&&!n&&!o&&Ja(e),a=l||n||o||i,r=a?Ct(e.length,Ee):[],u=r.length;for(var d in e)!t&&!Ne.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ii(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 Si(fo(e),ql(t,0,e.length))}function Ul(e){return Si(fo(e))}function Hl(e,t,l){(void 0!==l&&!La(e[t],l)||void 0===l&&!(t in e))&&Gl(e,t,l)}function Wl(e,t,l){var n=e[t];Ne.call(e,t)&&La(n,l)&&(void 0!==l||t in e)||Gl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(La(e[l][0],t))return l;return-1}function zl(e,t,l,n){return Jl(e,function(e,o,i){t(n,e,l(e),i)}),n}function Vl(e,t){return e&&go(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,o=O(n),i=null==e;++l<n;)o[l]=i?void 0:Er(e,t[l]);return o}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,o,a){var d,h=1&t,O=2&t,w=4&t;if(l&&(d=o?l(e,n,o,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]&&Ne.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return fo(e,d)}else{var R=ti(e),x=R==s||R==c;if(Ma(e))return so(e,h);if(R==p||R==i||x&&!o){if(d=O||x?{}:ni(e),!h)return O?function(e,t){return go(e,ei(e),t)}(e,function(e,t){return e&&go(t,Nr(t),e)}(d,e)):function(e,t){return go(e,Qo(e),t)}(e,Vl(d,e))}else{if(!Me[R])return o?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case A:return co(e);case r:case u:return new n(+e);case N:return function(e,t){var l=t?co(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case S:case b:case y:case C:case D:case T:case"[object Uint8ClampedArray]":case L:case I:return mo(e,l);case m:return new n;case v:case g: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 _:return yl?ve(yl.call(e)):{}}}(e,R,h)}}a||(a=new Bl);var B=a.get(e);if(B)return B;a.set(e,d),$a(e)?e.forEach(function(n){d.add(Kl(n,t,l,n,e,a))}):Ga(e)&&e.forEach(function(n,o){d.set(o,Kl(n,t,l,o,e,a))});var F=P?void 0:(w?O?Go:Vo:O?Nr:Ar)(e);return nt(F||e,function(n,o){F&&(n=e[o=n]),Wl(d,o,Kl(n,t,l,o,e,a))}),d}function $l(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var o=l[n],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new fe(l);return _i(function(){e.apply(void 0,n)},t)}function Zl(e,t,l,n){var o=-1,i=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Ot(l))),n?(i=ut,a=!1):t.length>=200&&(i=Lt,a=!1,t=new xl(t));e:for(;++o<r;){var s=e[o],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 i(t,c,n)||u.push(s)}return u}Dl.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Dl}},(Dl.prototype=Tl.prototype).constructor=Dl,(Ll.prototype=Ol(Tl.prototype)).constructor=Ll,(Il.prototype=Ol(Tl.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 Ne.call(t,e)?t[e]:void 0},wl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:Ne.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():qe.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=Xo(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return Xo(this,e).get(e)},Rl.prototype.has=function(e){return Xo(this,e).has(e)},Rl.prototype.set=function(e,t){var l=Xo(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)},Bl.prototype.clear=function(){this.__data__=new Pl,this.size=0},Bl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},Bl.prototype.get=function(e){return this.__data__.get(e)},Bl.prototype.has=function(e){return this.__data__.has(e)},Bl.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 Jl=Ao(rn),Ql=Ao(un,!0);function en(e,t){var l=!0;return Jl(e,function(e,n,o){return l=!!t(e,n,o)}),l}function tn(e,t,l){for(var n=-1,o=e.length;++n<o;){var i=e[n],a=t(i);if(null!=a&&(void 0===r?a==a&&!Za(a):l(a,r)))var r=a,u=i}return u}function ln(e,t){var l=[];return Jl(e,function(e,n,o){t(e,n,o)&&l.push(e)}),l}function nn(e,t,l,n,o){var i=-1,a=e.length;for(l||(l=oi),o||(o=[]);++i<a;){var r=e[i];t>0&&l(r)?t>1?nn(r,t-1,l,n,o):st(o,r):n||(o[o.length]=r)}return o}var on=No(),an=No(!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=io(t,e)).length;null!=e&&l<n;)e=e[Di(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]":St&&St in ve(e)?function(e){var t=Ne.call(e,St),l=e[St];try{e[St]=void 0;var n=!0}catch(e){}var o=ye.call(e);return n&&(t?e[St]=l:delete e[St]),o}(e):function(e){return ye.call(e)}(e)}function vn(e,t){return e>t}function pn(e,t){return null!=e&&Ne.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,o=e[0].length,i=e.length,a=i,r=O(i),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Ot(t))),u=il(s.length,u),r[a]=!l&&(t||o>=120&&s.length>=120)?new xl(a&&s):void 0}s=e[0];var c=-1,m=r[0];e:for(;++c<o&&d.length<u;){var v=s[c],p=t?t(v):v;if(v=l||0!==v?v:0,!(m?Lt(m,p):n(d,p,l))){for(a=i;--a;){var E=r[a];if(!(E?Lt(E,p):n(e[a],p,l)))continue e}m&&m.push(p),d.push(v)}}return d}function gn(e,t,l){var n=null==(e=pi(e,t=io(t,e)))?e:e[Di(Ui(t))];return null==n?void 0:tt(n,e,l)}function _n(e){return Va(e)&&mn(e)==i}function hn(e,t,l,n,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,l,n,o,s){var c=Ra(e),h=Ra(t),S=c?a:ti(e),b=h?a:ti(t),y=(S=S==i?p:S)==p,C=(b=b==i?p:b)==p,D=S==b;if(D&&Ma(e)){if(!Ma(t))return!1;c=!0,y=!1}if(D&&!y)return s||(s=new Bl),c||Ja(e)?jo(e,t,l,n,o,s):function(e,t,l,n,o,i,a){switch(l){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!i(new ke(e),new ke(t)));case r:case u:case v:return La(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case g: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=jo(s(e),s(t),n,o,i,a);return a.delete(e),p;case _:if(yl)return yl.call(e)==yl.call(t)}return!1}(e,t,S,l,n,o,s);if(!(1&l)){var O=y&&Ne.call(e,"__wrapped__"),T=C&&Ne.call(t,"__wrapped__");if(O||T){var L=O?e.value():e,I=T?t.value():t;return s||(s=new Bl),o(L,I,l,n,s)}}return!!D&&(s||(s=new Bl),function(e,t,l,n,o,i){var a=1&l,r=Vo(e),u=r.length;if(u!=Vo(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Ne.call(t,s)))return!1}var c=i.get(e),m=i.get(t);if(c&&m)return c==t&&m==e;var v=!0;i.set(e,t),i.set(t,e);for(var p=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var g=a?n(f,E,s,t,e,i):n(E,f,s,e,t,i);if(!(void 0===g?E===f||o(E,f,l,n,i):g)){v=!1;break}p||(p="constructor"==s)}if(v&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(v=!1)}return i.delete(e),i.delete(t),v}(e,t,l,n,o,s))}(e,t,l,n,hn,o))}function An(e,t,l,n){var o=l.length,i=o,a=!n;if(null==e)return!i;for(e=ve(e);o--;){var r=l[o];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){var u=(r=l[o])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Bl;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 Nn(e){return!(!za(e)||(t=e,be&&be in t))&&(Ha(e)?Oe:oe).test(Oi(e));var t}function Sn(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(!si(e))return nl(e);var t=[];for(var l in ve(e))Ne.call(e,l)&&"constructor"!=l&&t.push(l);return t}function yn(e,t){return e<t}function Cn(e,t){var l=-1,n=Ba(e)?O(e.length):[];return Jl(e,function(e,o,i){n[++l]=t(e,o,i)}),n}function Dn(e){var t=Zo(e);return 1==t.length&&t[0][2]?mi(t[0][0],t[0][1]):function(l){return l===e||An(l,e,t)}}function On(e,t){return ri(e)&&ci(t)?mi(Di(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?fr(l,e):hn(t,n,3)}}function Tn(e,t,l,n,o){e!==t&&on(t,function(i,a){if(o||(o=new Bl),za(i))!function(e,t,l,n,o,i,a){var r=fi(e,l),u=fi(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=i?i(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&&Ja(u);s=u,m||v||p?Ra(r)?s=r:Fa(r)?s=fo(r):v?(c=!1,s=so(u,!0)):p?(c=!1,s=mo(u,!0)):s=[]:qa(u)||Pa(u)?(s=r,Pa(r)?s=ar(r):za(r)&&!Ha(r)||(s=ni(u))):c=!1}c&&(a.set(u,s),o(s,u,n,i,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,Tn,n,o);else{var r=n?n(fi(e,a),i,a+"",e,t,o):void 0;void 0===r&&(r=i),Hl(e,a,r)}},Nr)}function Ln(e,t){var l=e.length;if(l)return ii(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($o())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,o=e.criteria,i=t.criteria,a=o.length,r=l.length;++n<a;){var u=vo(o[n],i[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}(Cn(e,function(e,l,o){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function wn(e,t,l){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],r=sn(e,a);l(r,a)&&Un(i,io(a,e),r)}return i}function Pn(e,t,l,n){var o=n?_t:gt,i=-1,a=t.length,r=e;for(e===t&&(t=fo(t)),l&&(r=dt(e,Ot(l)));++i<a;)for(var u=0,d=t[i],s=l?l(d):d;(u=o(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 o=t[l];if(l==n||o!==i){var i=o;ii(o)?qe.call(e,o,1):Zn(e,o)}}return e}function xn(e,t){return e+Jt(ul()*(t-e+1))}function Bn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Jt(t/2))&&(e+=e)}while(t);return l}function Fn(e,t){return hi(vi(e,t,Yr),e+"")}function Mn(e){return Ml(Lr(e))}function kn(e,t){var l=Lr(e);return Si(l,ql(t,0,l.length))}function Un(e,t,l,n){if(!za(e))return e;for(var o=-1,i=(t=io(t,e)).length,a=i-1,r=e;null!=r&&++o<i;){var u=Di(t[o]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=za(s)?s:ii(t[o+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=fl?function(e,t){return fl.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 Si(Lr(e))}function zn(e,t,l){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(l=l>o?o:l)<0&&(l+=o),o=t>l?0:l-t>>>0,t>>>=0;for(var i=O(o);++n<o;)i[n]=e[n+t];return i}function Vn(e,t){var l;return Jl(e,function(e,n,o){return!(l=t(e,n,o))}),!!l}function Gn(e,t,l){var n=0,o=null==e?n:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;n<o;){var i=n+o>>>1,a=e[i];null!==a&&!Za(a)&&(l?a<=t:a<t)?n=i+1:o=i}return o}return Yn(e,t,Yr,l)}function Yn(e,t,l,n){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Za(t),d=void 0===t;o<i;){var s=Jt((o+i)/2),c=l(e[s]),m=void 0!==c,v=null===c,p=c==c,E=Za(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?o=s+1:i=s}return il(i,4294967294)}function qn(e,t){for(var l=-1,n=e.length,o=0,i=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!La(r,u)){var u=r;i[o++]=0===a?0:a}}return i}function Kn(e){return"number"==typeof e?e:Za(e)?NaN:+e}function $n(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,$n)+"";if(Za(e))return Cl?Cl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,o=rt,i=e.length,a=!0,r=[],u=r;if(l)a=!1,o=ut;else if(i>=200){var d=t?null:Fo(e);if(d)return Ht(d);a=!1,o=Lt,u=new xl}else u=t?[]:r;e:for(;++n<i;){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 o(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Zn(e,t){return null==(e=pi(e,t=io(t,e)))||delete e[Di(Ui(t))]}function Jn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Qn(e,t,l,n){for(var o=e.length,i=n?o:-1;(n?i--:++i<o)&&t(e[i],i,e););return l?zn(e,n?0:i,n?i+1:o):zn(e,n?i+1:0,n?o:i)}function eo(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 to(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var o=-1,i=O(n);++o<n;)for(var a=e[o],r=-1;++r<n;)r!=o&&(i[o]=Zl(i[o]||a,e[r],t,l));return Xn(nn(i,1),t,l)}function lo(e,t,l){for(var n=-1,o=e.length,i=t.length,a={};++n<o;)l(a,e[n],n<i?t[n]:void 0);return a}function no(e){return Fa(e)?e:[]}function oo(e){return"function"==typeof e?e:Yr}function io(e,t){return Ra(e)?e:ri(e,t)?[e]:Ci(rr(e))}var ao=Fn;function ro(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:zn(e,t,l)}var uo=Kt||function(e){return ze.clearTimeout(e)};function so(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 co(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function mo(e,t){var l=t?co(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function vo(e,t){if(e!==t){var l=void 0!==e,n=null===e,o=e==e,i=Za(e),a=void 0!==t,r=null===t,u=t==t,d=Za(t);if(!r&&!d&&!i&&e>t||i&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!o)return 1;if(!n&&!i&&!d&&e<t||d&&l&&o&&!n&&!i||r&&l&&o||!a&&o||!u)return-1}return 0}function po(e,t,l,n){for(var o=-1,i=e.length,a=l.length,r=-1,u=t.length,d=ol(i-a,0),s=O(u+d),c=!n;++r<u;)s[r]=t[r];for(;++o<a;)(c||o<i)&&(s[l[o]]=e[o]);for(;d--;)s[r++]=e[o++];return s}function Eo(e,t,l,n){for(var o=-1,i=e.length,a=-1,r=l.length,u=-1,d=t.length,s=ol(i-r,0),c=O(s+d),m=!n;++o<s;)c[o]=e[o];for(var v=o;++u<d;)c[v+u]=t[u];for(;++a<r;)(m||o<i)&&(c[v+l[a]]=e[o++]);return c}function fo(e,t){var l=-1,n=e.length;for(t||(t=O(n));++l<n;)t[l]=e[l];return t}function go(e,t,l,n){var o=!l;l||(l={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),o?Gl(l,r,u):Wl(l,r,u)}return l}function _o(e,t){return function(l,n){var o=Ra(l)?lt:zl,i=t?t():{};return o(l,e,$o(n,2),i)}}function ho(e){return Fn(function(t,l){var n=-1,o=l.length,i=o>1?l[o-1]:void 0,a=o>2?l[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ai(l[0],l[1],a)&&(i=o<3?void 0:i,o=1),t=ve(t);++n<o;){var r=l[n];r&&e(t,r,n,i)}return t})}function Ao(e,t){return function(l,n){if(null==l)return l;if(!Ba(l))return e(l,n);for(var o=l.length,i=t?o:-1,a=ve(l);(t?i--:++i<o)&&!1!==n(a[i],i,a););return l}}function No(e){return function(t,l,n){for(var o=-1,i=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++o];if(!1===l(i[u],u,i))break}return t}}function So(e){return function(t){var l=Ft(t=rr(t))?zt(t):void 0,n=l?l[0]:t.charAt(0),o=l?ro(l,1).join(""):t.slice(1);return n[e]()+o}}function bo(e){return function(t){return ct(Hr(Pr(t).replace(Te,"")),e,"")}}function yo(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 Co(e){return function(t,l,n){var o=ve(t);if(!Ba(t)){var i=$o(l,3);t=Ar(t),l=function(e){return i(o[e],e,o)}}var a=e(t,l,n);return a>-1?o[i?t[a]:a]:void 0}}function Do(e){return zo(function(t){var n=t.length,o=n,i=Ll.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new fe(l);if(i&&!r&&"wrapper"==qo(a))var r=new Ll([],!0)}for(o=r?o:n;++o<n;){var u=qo(a=t[o]),d="wrapper"==u?Yo(a):void 0;r=d&&ui(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[qo(d[0])].apply(r,d[3]):1==a.length&&ui(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 o=0,i=n?t[o].apply(this,e):l;++o<n;)i=t[o].call(this,i);return i}})}function Oo(e,t,l,n,o,i,a,r,u,d){var s=128&t,c=1&t,m=2&t,v=24&t,p=512&t,E=m?void 0:yo(e);return function f(){for(var g=arguments.length,_=O(g),h=g;h--;)_[h]=arguments[h];if(v)var A=Ko(f),N=Pt(_,A);if(n&&(_=po(_,n,o,v)),i&&(_=Eo(_,i,a,v)),g-=N,v&&g<d){var S=Ut(_,A);return xo(e,t,Oo,f.placeholder,l,_,S,r,u,d-g)}var b=c?l:this,y=m?b[e]:e;return g=_.length,r?_=Ei(_,r):p&&g>1&&_.reverse(),s&&u<g&&(_.length=u),this&&this!==ze&&this instanceof f&&(y=E||yo(y)),y.apply(b,_)}}function To(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,o,i){t(n,l(e),o,i)}),n}(l,e,t(n),{})}}function Lo(e,t){return function(l,n){var o;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(o=l),void 0!==n){if(void 0===o)return n;"string"==typeof l||"string"==typeof n?(l=$n(l),n=$n(n)):(l=Kn(l),n=Kn(n)),o=e(l,n)}return o}}function Io(e){return zo(function(t){return t=dt(t,Ot($o())),Fn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function wo(e,t){var l=(t=void 0===t?" ":$n(t)).length;if(l<2)return l?Bn(t,e):t;var n=Bn(t,Zt(e/jt(t)));return Ft(t)?ro(zt(n),0,e).join(""):n.slice(0,e)}function Po(e){return function(t,l,n){return n&&"number"!=typeof n&&ai(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 o=-1,i=ol(Zt((t-e)/(l||1)),0),a=O(i);i--;)a[n?i:++o]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function Ro(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=ir(t),l=ir(l)),e(t,l)}}function xo(e,t,l,n,o,i,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,o,s?i:void 0,s?a:void 0,s?void 0:i,s?void 0:a,r,u,d],m=l.apply(void 0,c);return ui(e)&&gi(m,c),m.placeholder=n,Ai(m,e,t)}function Bo(e){var t=me[e];return function(e,l){if(e=ir(e),(l=null==l?0:il(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 Fo=vl&&1/Ht(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:Zr;function Mo(e){return function(t){var l=ti(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 ko(e,t,o,i,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=i?i.length:0;if(c||(t&=-97,i=a=void 0),u=void 0===u?u:ol(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var m=i,v=a;i=a=void 0}var p=s?void 0:Yo(e),E=[e,t,o,i,a,m,v,r,u,d];if(p&&function(e,t){var l=e[1],o=t[1],i=l|o;if(!(i<131||128==o&&8==l||128==o&&256==l&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==l))return e;1&o&&(e[2]=t[2],i|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?po(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?Eo(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&o&&(e[8]=null==e[8]?t[8]:il(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(E,p),e=E[0],t=E[1],o=E[2],i=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:ol(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=yo(e);return function o(){for(var i=arguments.length,a=O(i),r=i,u=Ko(o);r--;)a[r]=arguments[r];var d=i<3&&a[0]!==u&&a[i-1]!==u?[]:Ut(a,u);if((i-=d.length)<l)return xo(e,t,Oo,o.placeholder,void 0,a,d,void 0,void 0,l-i);var s=this&&this!==ze&&this instanceof o?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Oo.apply(void 0,E):function(e,t,l,n){var o=1&t,i=yo(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=O(d+r),c=this&&this!==ze&&this instanceof t?i:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,o?l:this,s)}}(e,t,o,i);else var f=function(e,t,l){var n=1&t,o=yo(e);return function t(){var i=this&&this!==ze&&this instanceof t?o:e;return i.apply(n?l:this,arguments)}}(e,t,o);return Ai((p?Hn:gi)(f,E),e,t)}function Uo(e,t,l,n){return void 0===e||La(e,_e[l])&&!Ne.call(n,l)?t:e}function Ho(e,t,l,n,o,i){return za(e)&&za(t)&&(i.set(t,e),Tn(e,t,void 0,Ho,i),i.delete(t)),e}function Wo(e){return qa(e)?void 0:e}function jo(e,t,l,n,o,i){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=i.get(e),s=i.get(t);if(d&&s)return d==t&&s==e;var c=-1,m=!0,v=2&l?new xl:void 0;for(i.set(e,t),i.set(t,e);++c<r;){var p=e[c],E=t[c];if(n)var f=a?n(E,p,c,t,e,i):n(p,E,c,e,t,i);if(void 0!==f){if(f)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Lt(v,t)&&(p===e||o(p,e,l,n,i)))return v.push(t)})){m=!1;break}}else if(p!==E&&!o(p,E,l,n,i)){m=!1;break}}return i.delete(e),i.delete(t),m}function zo(e){return hi(vi(e,void 0,xi),e+"")}function Vo(e){return cn(e,Ar,Qo)}function Go(e){return cn(e,Nr,ei)}var Yo=fl?function(e){return fl.get(e)}:Zr;function qo(e){for(var t=e.name+"",l=gl[t],n=Ne.call(gl,t)?l.length:0;n--;){var o=l[n],i=o.func;if(null==i||i==e)return o.name}return t}function Ko(e){return(Ne.call(Dl,"placeholder")?Dl:e).placeholder}function $o(){var e=Dl.iteratee||qr;return e=e===qr?Sn:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(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 Zo(e){for(var t=Ar(e),l=t.length;l--;){var n=t[l],o=e[n];t[l]=[n,o,ci(o)]}return t}function Jo(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return Nn(l)?l:void 0}var Qo=Qt?function(e){return null==e?[]:(e=ve(e),at(Qt(e),function(t){return Ge.call(e,t)}))}:ou,ei=Qt?function(e){for(var t=[];e;)st(t,Qo(e)),e=je(e);return t}:ou,ti=mn;function li(e,t,l){for(var n=-1,o=(t=io(t,e)).length,i=!1;++n<o;){var a=Di(t[n]);if(!(i=null!=e&&l(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&ja(o)&&ii(a,o)&&(Ra(e)||Pa(e))}function ni(e){return"function"!=typeof e.constructor||si(e)?{}:Ol(je(e))}function oi(e){return Ra(e)||Pa(e)||!!(Ke&&e&&e[Ke])}function ii(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 ai(e,t,l){if(!za(l))return!1;var n=typeof t;return!!("number"==n?Ba(l)&&ii(t,l.length):"string"==n&&t in l)&&La(l[t],e)}function ri(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Za(e))||j.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ui(e){var t=qo(e),l=Dl[t];if("function"!=typeof l||!(t in Il.prototype))return!1;if(e===l)return!0;var n=Yo(l);return!!n&&e===n[0]}(sl&&ti(new sl(new ArrayBuffer(1)))!=N||cl&&ti(new cl)!=m||ml&&"[object Promise]"!=ti(ml.resolve())||vl&&ti(new vl)!=f||pl&&ti(new pl)!=h)&&(ti=function(e){var t=mn(e),l=t==p?e.constructor:void 0,n=l?Oi(l):"";if(n)switch(n){case _l:return N;case hl:return m;case Al:return"[object Promise]";case Nl:return f;case Sl:return h}return t});var di=he?Ha:iu;function si(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function ci(e){return e==e&&!za(e)}function mi(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vi(e,t,l){return t=ol(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=ol(n.length-t,0),a=O(i);++o<i;)a[o]=n[t+o];o=-1;for(var r=O(t+1);++o<t;)r[o]=n[o];return r[t]=l(a),tt(e,this,r)}}function pi(e,t){return t.length<2?e:sn(e,zn(t,0,-1))}function Ei(e,t){for(var l=e.length,n=il(t.length,l),o=fo(e);n--;){var i=t[n];e[n]=ii(i,l)?o[i]:void 0}return e}function fi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var gi=Ni(Hn),_i=Xt||function(e,t){return ze.setTimeout(e,t)},hi=Ni(Wn);function Ai(e,t,l){var n=t+"";return hi(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(o,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(X):[]}(n),l)))}function Ni(e){var t=0,l=0;return function(){var n=al(),o=16-(n-l);if(l=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Si(e,t){var l=-1,n=e.length,o=n-1;for(t=void 0===t?n:t;++l<t;){var i=xn(l,o),a=e[i];e[i]=e[l],e[l]=a}return e.length=t,e}var bi,yi,Ci=(bi=ba(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,l,n,o){t.push(n?o.replace(Q,"$1"):l||e)}),t},function(e){return 500===yi.size&&yi.clear(),e}),yi=bi.cache,bi);function Di(e){if("string"==typeof e||Za(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Oi(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ti(e){if(e instanceof Il)return e.clone();var t=new Ll(e.__wrapped__,e.__chain__);return t.__actions__=fo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Li=Fn(function(e,t){return Fa(e)?Zl(e,nn(t,1,Fa,!0)):[]}),Ii=Fn(function(e,t){var l=Ui(t);return Fa(l)&&(l=void 0),Fa(e)?Zl(e,nn(t,1,Fa,!0),$o(l,2)):[]}),wi=Fn(function(e,t){var l=Ui(t);return Fa(l)&&(l=void 0),Fa(e)?Zl(e,nn(t,1,Fa,!0),void 0,l):[]});function Pi(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=null==l?0:nr(l);return o<0&&(o=ol(n+o,0)),ft(e,$o(t,3),o)}function Ri(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return void 0!==l&&(o=nr(l),o=l<0?ol(n+o,0):il(o,n-1)),ft(e,$o(t,3),o,!0)}function xi(e){return null!=e&&e.length?nn(e,1):[]}function Bi(e){return e&&e.length?e[0]:void 0}var Fi=Fn(function(e){var t=dt(e,no);return t.length&&t[0]===e[0]?fn(t):[]}),Mi=Fn(function(e){var t=Ui(e),l=dt(e,no);return t===Ui(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,$o(t,2)):[]}),ki=Fn(function(e){var t=Ui(e),l=dt(e,no);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Ui(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Hi=Fn(Wi);function Wi(e,t){return e&&e.length&&t&&t.length?Pn(e,t):e}var ji=zo(function(e,t){var l=null==e?0:e.length,n=Yl(e,t);return Rn(e,dt(t,function(e){return ii(e,l)?+e:e}).sort(vo)),n});function zi(e){return null==e?e:dl.call(e)}var Vi=Fn(function(e){return Xn(nn(e,1,Fa,!0))}),Gi=Fn(function(e){var t=Ui(e);return Fa(t)&&(t=void 0),Xn(nn(e,1,Fa,!0),$o(t,2))}),Yi=Fn(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Fa,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Fa(e))return t=ol(e.length,t),!0}),Ct(t,function(t){return dt(e,Nt(t))})}function Ki(e,t){if(!e||!e.length)return[];var l=qi(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var $i=Fn(function(e,t){return Fa(e)?Zl(e,t):[]}),Xi=Fn(function(e){return to(at(e,Fa))}),Zi=Fn(function(e){var t=Ui(e);return Fa(t)&&(t=void 0),to(at(e,Fa),$o(t,2))}),Ji=Fn(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,to(at(e,Fa),void 0,t)}),Qi=Fn(qi),ea=Fn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Ki(e,l)});function ta(e){var t=Dl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=zo(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,o=function(t){return Yl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Il&&ii(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[o],thisArg:void 0}),new Ll(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),oa=_o(function(e,t,l){Ne.call(e,l)?++e[l]:Gl(e,l,1)}),ia=Co(Pi),aa=Co(Ri);function ra(e,t){return(Ra(e)?nt:Jl)(e,$o(t,3))}function ua(e,t){return(Ra(e)?ot:Ql)(e,$o(t,3))}var da=_o(function(e,t,l){Ne.call(e,l)?e[l].push(t):Gl(e,l,[t])}),sa=Fn(function(e,t,l){var n=-1,o="function"==typeof t,i=Ba(e)?O(e.length):[];return Jl(e,function(e){i[++n]=o?tt(t,e,l):gn(e,t,l)}),i}),ca=_o(function(e,t,l){Gl(e,l,t)});function ma(e,t){return(Ra(e)?dt:Cn)(e,$o(t,3))}var va=_o(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),pa=Fn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&ai(e,t[0],t[1])?t=[]:l>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),In(e,nn(t,1),[])}),Ea=$t||function(){return ze.Date.now()};function fa(e,t,l){return t=l?void 0:t,ko(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(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 _a=Fn(function(e,t,l){var n=1;if(l.length){var o=Ut(l,Ko(_a));n|=32}return ko(e,n,t,l,o)}),ha=Fn(function(e,t,l){var n=3;if(l.length){var o=Ut(l,Ko(ha));n|=32}return ko(t,n,e,l,o)});function Aa(e,t,n){var o,i,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=o,n=i;return o=i=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=_i(g,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 g(){var e=Ea();if(f(e))return _(e);u=_i(g,function(e){var l=t-(e-d);return m?il(l,a-(e-s)):l}(e))}function _(e){return u=void 0,v&&o?p(e):(o=i=void 0,r)}function h(){var e=Ea(),l=f(e);if(o=arguments,i=this,d=e,l){if(void 0===u)return E(d);if(m)return uo(u),u=_i(g,t),p(d)}return void 0===u&&(u=_i(g,t)),r}return t=ir(t)||0,za(n)&&(c=!!n.leading,a=(m="maxWait"in n)?ol(ir(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),h.cancel=function(){void 0!==u&&uo(u),s=0,o=d=i=u=void 0},h.flush=function(){return void 0===u?r:_(Ea())},h}var Na=Fn(function(e,t){return Xl(e,1,t)}),Sa=Fn(function(e,t,l){return Xl(e,ir(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,o=t?t.apply(this,l):l[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,l);return n.cache=i.set(o,a)||i,a};return n.cache=new(ba.Cache||Rl),n}function ya(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 Ca=ao(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Ot($o())):dt(nn(t,1),Ot($o()))).length;return Fn(function(n){for(var o=-1,i=il(n.length,l);++o<i;)n[o]=t[o].call(this,n[o]);return tt(e,this,n)})}),Da=Fn(function(e,t){return ko(e,32,void 0,t,Ut(t,Ko(Da)))}),Oa=Fn(function(e,t){return ko(e,64,void 0,t,Ut(t,Ko(Oa)))}),Ta=zo(function(e,t){return ko(e,256,void 0,void 0,void 0,t)});function La(e,t){return e===t||e!=e&&t!=t}var Ia=Ro(vn),wa=Ro(function(e,t){return e>=t}),Pa=_n(function(){return arguments}())?_n:function(e){return Va(e)&&Ne.call(e,"callee")&&!Ge.call(e,"callee")},Ra=O.isArray,xa=$e?Ot($e):function(e){return Va(e)&&mn(e)==A};function Ba(e){return null!=e&&ja(e.length)&&!Ha(e)}function Fa(e){return Va(e)&&Ba(e)}var Ma=el||iu,ka=Xe?Ot(Xe):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=Ze?Ot(Ze):function(e){return Va(e)&&ti(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=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Ae.call(l)==Ce}var Ka=Je?Ot(Je):function(e){return Va(e)&&mn(e)==E},$a=Qe?Ot(Qe):function(e){return Va(e)&&ti(e)==f};function Xa(e){return"string"==typeof e||!Ra(e)&&Va(e)&&mn(e)==g}function Za(e){return"symbol"==typeof e||Va(e)&&mn(e)==_}var Ja=et?Ot(et):function(e){return Va(e)&&ja(e.length)&&!!Fe[mn(e)]},Qa=Ro(yn),er=Ro(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Ba(e))return Xa(e)?zt(e):fo(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=ti(e);return(t==m?Mt:t==f?Ht:Lr)(e)}function lr(e){return e?(e=ir(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 or(e){return e?ql(nr(e),0,4294967295):0}function ir(e){if("number"==typeof e)return e;if(Za(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||ie.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return go(e,Nr(e))}function rr(e){return null==e?"":$n(e)}var ur=ho(function(e,t){if(si(t)||Ba(t))go(t,Ar(t),e);else for(var l in t)Ne.call(t,l)&&Wl(e,l,t[l])}),dr=ho(function(e,t){go(t,Nr(t),e)}),sr=ho(function(e,t,l,n){go(t,Nr(t),e,n)}),cr=ho(function(e,t,l,n){go(t,Ar(t),e,n)}),mr=zo(Yl),vr=Fn(function(e,t){e=ve(e);var l=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(n=1);++l<n;)for(var i=t[l],a=Nr(i),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||La(s,_e[d])&&!Ne.call(e,d))&&(e[d]=i[d])}return e}),pr=Fn(function(e){return e.push(void 0,Ho),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&&li(e,t,En)}var gr=To(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=ye.call(t)),e[t]=l},zr(Yr)),_r=To(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=ye.call(t)),Ne.call(e,t)?e[t].push(l):e[t]=[l]},$o),hr=Fn(gn);function Ar(e){return Ba(e)?Fl(e):bn(e)}function Nr(e){return Ba(e)?Fl(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=si(e),l=[];for(var n in e)("constructor"!=n||!t&&Ne.call(e,n))&&l.push(n);return l}(e)}var Sr=ho(function(e,t,l){Tn(e,t,l)}),br=ho(function(e,t,l,n){Tn(e,t,l,n)}),yr=zo(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=io(t,e),n||(n=t.length>1),t}),go(e,Go(e),l),n&&(l=Kl(l,7,Wo));for(var o=t.length;o--;)Zn(l,t[o]);return l}),Cr=zo(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(Go(e),function(e){return[e]});return t=$o(t),wn(e,l,function(e,l){return t(e,l[0])})}var Or=Mo(Ar),Tr=Mo(Nr);function Lr(e){return null==e?[]:Tt(e,Ar(e))}var Ir=bo(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(Le,"")}var Rr=bo(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),xr=bo(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Br=So("toLowerCase"),Fr=bo(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),Mr=bo(function(e,t,l){return e+(l?" ":"")+Ur(t)}),kr=bo(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=So("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(Z)||[]}(e):e.match(t)||[]}var Wr=Fn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),jr=zo(function(e,t){return nt(t,function(t){t=Di(t),Gl(e,t,_a(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=Do(),Gr=Do(!0);function Yr(e){return e}function qr(e){return Sn("function"==typeof e?e:Kl(e,1))}var Kr=Fn(function(e,t){return function(l){return gn(l,e,t)}}),$r=Fn(function(e,t){return function(l){return gn(e,l,t)}});function Xr(e,t,l){var n=Ar(t),o=dn(t,n);null!=l||za(t)&&(o.length||!n.length)||(l=t,t=e,e=this,o=dn(t,Ar(t)));var i=!(za(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(o,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(i||t){var l=e(this.__wrapped__),o=l.__actions__=fo(this.__actions__);return o.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Zr(){}var Jr=Io(dt),Qr=Io(it),eu=Io(vt);function tu(e){return ri(e)?Nt(Di(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=Po(),nu=Po(!0);function ou(){return[]}function iu(){return!1}var au,ru=Lo(function(e,t){return e+t},0),uu=Bo("ceil"),du=Lo(function(e,t){return e/t},1),su=Bo("floor"),cu=Lo(function(e,t){return e*t},1),mu=Bo("round"),vu=Lo(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=ga,Dl.bind=_a,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?ai(e,t,l):void 0===t)?1:ol(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var o=0,i=0,a=O(Zt(n/t));o<n;)a[i++]=zn(e,o,o+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,o=[];++t<l;){var i=e[t];i&&(o[n++]=i)}return o},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=O(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?fo(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=$o();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Fn(function(l){for(var n=-1;++n<t;){var o=e[n];if(tt(o[0],this,l))return tt(o[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=Ar(e);return function(l){return $l(l,e,t)}}(Kl(e,1))},Dl.constant=zr,Dl.countBy=oa,Dl.create=function(e,t){var l=Ol(e);return null==t?l:Vl(l,t)},Dl.curry=function e(t,l,n){var o=ko(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return o.placeholder=e.placeholder,o},Dl.curryRight=function e(t,l,n){var o=ko(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return o.placeholder=e.placeholder,o},Dl.debounce=Aa,Dl.defaults=vr,Dl.defaultsDeep=pr,Dl.defer=Na,Dl.delay=Sa,Dl.difference=Li,Dl.differenceBy=Ii,Dl.differenceWith=wi,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?Qn(e,$o(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?Qn(e,$o(t,3),!0):[]},Dl.fill=function(e,t,l,n){var o=null==e?0:e.length;return o?(l&&"number"!=typeof l&&ai(e,t,l)&&(l=0,n=o),function(e,t,l,n){var o=e.length;for((l=nr(l))<0&&(l=-l>o?0:o+l),(n=void 0===n||n>o?o:nr(n))<0&&(n+=o),n=l>n?0:or(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(Ra(e)?at:ln)(e,$o(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=xi,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 ko(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 o=e[t];n[o[0]]=o[1]}return n},Dl.functions=function(e){return null==e?[]:dn(e,Ar(e))},Dl.functionsIn=function(e){return null==e?[]:dn(e,Nr(e))},Dl.groupBy=da,Dl.initial=function(e){return null!=e&&e.length?zn(e,0,-1):[]},Dl.intersection=Fi,Dl.intersectionBy=Mi,Dl.intersectionWith=ki,Dl.invert=gr,Dl.invertBy=_r,Dl.invokeMap=sa,Dl.iteratee=qr,Dl.keyBy=ca,Dl.keys=Ar,Dl.keysIn=Nr,Dl.map=ma,Dl.mapKeys=function(e,t){var l={};return t=$o(t,3),rn(e,function(e,n,o){Gl(l,t(e,n,o),e)}),l},Dl.mapValues=function(e,t){var l={};return t=$o(t,3),rn(e,function(e,n,o){Gl(l,n,t(e,n,o))}),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=Sr,Dl.mergeWith=br,Dl.method=Kr,Dl.methodOf=$r,Dl.mixin=Xr,Dl.negate=ya,Dl.nthArg=function(e){return e=nr(e),Fn(function(t){return Ln(t,e)})},Dl.omit=yr,Dl.omitBy=function(e,t){return Dr(e,ya($o(t)))},Dl.once=function(e){return ga(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=Jr,Dl.overArgs=Ca,Dl.overEvery=Qr,Dl.overSome=eu,Dl.partial=Da,Dl.partialRight=Oa,Dl.partition=va,Dl.pick=Cr,Dl.pickBy=Dr,Dl.property=tu,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Hi,Dl.pullAll=Wi,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?Pn(e,t,$o(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=ji,Dl.range=lu,Dl.rangeRight=nu,Dl.rearg=Ta,Dl.reject=function(e,t){return(Ra(e)?at:ln)(e,ya($o(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,o=[],i=e.length;for(t=$o(t,3);++n<i;){var a=e[n];t(a,n,e)&&(l.push(a),o.push(n))}return Rn(e,o),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Fn(e,t=void 0===t?t:nr(t))},Dl.reverse=zi,Dl.sampleSize=function(e,t,l){return t=(l?ai(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&&ai(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,$o(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&ai(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=$n(t))&&Ft(e)?ro(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:ol(nr(t),0),Fn(function(l){var n=l[t],o=ro(l,0,t);return n&&st(o,n),tt(e,this,o)})},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?Qn(e,$o(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?Qn(e,$o(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new fe(l);return za(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Aa(e,t,{leading:o,maxWait:t,trailing:i})},Dl.thru=la,Dl.toArray=tr,Dl.toPairs=Or,Dl.toPairsIn=Tr,Dl.toPath=function(e){return Ra(e)?dt(e,Di):Za(e)?[e]:fo(Ci(rr(e)))},Dl.toPlainObject=ar,Dl.transform=function(e,t,l){var n=Ra(e),o=n||Ma(e)||Ja(e);if(t=$o(t,4),null==l){var i=e&&e.constructor;l=o?n?new i:[]:za(e)&&Ha(i)?Ol(je(e)):{}}return(o?nt:rn)(e,function(e,n,o){return t(l,e,n,o)}),l},Dl.unary=function(e){return fa(e,1)},Dl.union=Vi,Dl.unionBy=Gi,Dl.unionWith=Yi,Dl.uniq=function(e){return e&&e.length?Xn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Xn(e,$o(t,2)):[]},Dl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Dl.unset=function(e,t){return null==e||Zn(e,t)},Dl.unzip=qi,Dl.unzipWith=Ki,Dl.update=function(e,t,l){return null==e?e:Jn(e,t,oo(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Jn(e,t,oo(l),n)},Dl.values=Lr,Dl.valuesIn=function(e){return null==e?[]:Tt(e,Nr(e))},Dl.without=$i,Dl.words=Hr,Dl.wrap=function(e,t){return Da(oo(t),e)},Dl.xor=Xi,Dl.xorBy=Zi,Dl.xorWith=Ji,Dl.zip=Qi,Dl.zipObject=function(e,t){return lo(e||[],t||[],Wl)},Dl.zipObjectDeep=function(e,t){return lo(e||[],t||[],Un)},Dl.zipWith=ea,Dl.entries=Or,Dl.entriesIn=Tr,Dl.extend=dr,Dl.extendWith=sr,Xr(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=ir(l))==l?l:0),void 0!==t&&(t=(t=ir(t))==t?t:0),ql(ir(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||$l(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=$n(t);var n=e.length,o=l=void 0===l?n:ql(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,o)==t},Dl.eq=La,Dl.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(B,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)?it:en;return l&&ai(e,t,l)&&(t=void 0),n(e,$o(t,3))},Dl.find=ia,Dl.findIndex=Pi,Dl.findKey=function(e,t){return Et(e,$o(t,3),rn)},Dl.findLast=aa,Dl.findLastIndex=Ri,Dl.findLastKey=function(e,t){return Et(e,$o(t,3),un)},Dl.floor=su,Dl.forEach=ra,Dl.forEachRight=ua,Dl.forIn=function(e,t){return null==e?e:on(e,$o(t,3),Nr)},Dl.forInRight=function(e,t){return null==e?e:an(e,$o(t,3),Nr)},Dl.forOwn=function(e,t){return e&&rn(e,$o(t,3))},Dl.forOwnRight=function(e,t){return e&&un(e,$o(t,3))},Dl.get=Er,Dl.gt=Ia,Dl.gte=wa,Dl.has=function(e,t){return null!=e&&li(e,t,pn)},Dl.hasIn=fr,Dl.head=Bi,Dl.identity=Yr,Dl.includes=function(e,t,l,n){e=Ba(e)?e:Lr(e),l=l&&!n?nr(l):0;var o=e.length;return l<0&&(l=ol(o+l,0)),Xa(e)?l<=o&&e.indexOf(t,l)>-1:!!o&>(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=null==l?0:nr(l);return o<0&&(o=ol(n+o,0)),gt(e,t,o)},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>=il(t,l)&&e<ol(t,l)}(e=ir(e),t,l)},Dl.invoke=hr,Dl.isArguments=Pa,Dl.isArray=Ra,Dl.isArrayBuffer=xa,Dl.isArrayLike=Ba,Dl.isArrayLikeObject=Fa,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(Ba(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Ja(e)||Pa(e)))return!e.length;var t=ti(e);if(t==m||t==f)return!e.size;if(si(e))return!bn(e).length;for(var l in e)if(Ne.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,Zo(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,An(e,t,Zo(t),l)},Dl.isNaN=function(e){return Ya(e)&&e!=+e},Dl.isNative=function(e){if(di(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nn(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=$a,Dl.isString=Xa,Dl.isSymbol=Za,Dl.isTypedArray=Ja,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return Va(e)&&ti(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=Ui,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=n;return void 0!==l&&(o=(o=nr(l))<0?ol(n+o,0):il(o,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,o):ft(e,ht,o,!0)},Dl.lowerCase=xr,Dl.lowerFirst=Br,Dl.lt=Qa,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,$o(t,2),vn):void 0},Dl.mean=function(e){return At(e,Yr)},Dl.meanBy=function(e,t){return At(e,$o(t,2))},Dl.min=function(e){return e&&e.length?tn(e,Yr,yn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,$o(t,2),yn):void 0},Dl.stubArray=ou,Dl.stubFalse=iu,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?Ln(e,nr(t)):void 0},Dl.noConflict=function(){return ze._===this&&(ze._=De),this},Dl.noop=Zr,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 o=(t-n)/2;return wo(Jt(o),l)+e+wo(Zt(o),l)},Dl.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?e+wo(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?wo(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&&ai(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 o=ul();return il(e+o*(t-e+Ue("1e-"+((o+"").length-1))),t)}return xn(e,t)},Dl.reduce=function(e,t,l){var n=Ra(e)?ct:bt,o=arguments.length<3;return n(e,$o(t,4),l,o,Jl)},Dl.reduceRight=function(e,t,l){var n=Ra(e)?mt:bt,o=arguments.length<3;return n(e,$o(t,4),l,o,Ql)},Dl.repeat=function(e,t,l){return t=(l?ai(e,t,l):void 0===t)?1:nr(t),Bn(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,o=(t=io(t,e)).length;for(o||(o=1,e=void 0);++n<o;){var i=null==e?void 0:e[Di(t[n])];void 0===i&&(n=o,i=l),e=Ha(i)?i.call(e):i}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(Ba(e))return Xa(e)?jt(e):e.length;var t=ti(e);return t==m||t==f?e.size:bn(e).length},Dl.snakeCase=Fr,Dl.some=function(e,t,l){var n=Ra(e)?vt:Vn;return l&&ai(e,t,l)&&(t=void 0),n(e,$o(t,3))},Dl.sortedIndex=function(e,t){return Gn(e,t)},Dl.sortedIndexBy=function(e,t,l){return Yn(e,t,$o(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Gn(e,t);if(n<l&&La(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,$o(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Gn(e,t,!0)-1;if(La(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=$n(t),e.slice(l,l+t.length)==t},Dl.subtract=vu,Dl.sum=function(e){return e&&e.length?yt(e,Yr):0},Dl.sumBy=function(e,t){return e&&e.length?yt(e,$o(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&ai(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,Uo);var o,i,a=sr({},t.imports,n.imports,Uo),r=Ar(a),u=Tt(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="+(Ne.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(m,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,Bt),l&&(o=!0,c+="' +\n__e("+l+") +\n'"),r&&(i=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Ne.call(t,"variable")&&t.variable;if(p){if(J.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(i?c.replace(w,""):c).replace(P,"$1").replace(R,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var 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=il(e,4294967295);e-=4294967295;for(var o=Ct(n,t=$o(t));++l<e;)t(l);return o},Dl.toFinite=lr,Dl.toInteger=nr,Dl.toLength=or,Dl.toLower=function(e){return rr(e).toLowerCase()},Dl.toNumber=ir,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=$n(t)))return e;var n=zt(e),o=zt(t);return ro(n,It(n,o),wt(n,o)+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=$n(t)))return e;var n=zt(e);return ro(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=$n(t)))return e;var n=zt(e);return ro(n,It(n,zt(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if(za(t)){var o="separator"in t?t.separator:o;l="length"in t?nr(t.length):l,n="omission"in t?$n(t.omission):n}var i=(e=rr(e)).length;if(Ft(e)){var a=zt(e);i=a.length}if(l>=i)return e;var r=l-jt(n);if(r<1)return n;var u=a?ro(a,0,r).join(""):e.slice(0,r);if(void 0===o)return u+n;if(a&&(r+=u.length-r),Ka(o)){if(e.slice(r).search(o)){var d,s=u;for(o.global||(o=pe(o.source,rr(te.exec(o))+"g")),o.lastIndex=0;d=o.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf($n(o),r)!=r){var m=u.lastIndexOf(o);m>-1&&(u=u.slice(0,m))}return u+n},Dl.unescape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,Gt):e},Dl.uniqueId=function(e){var t=++Se;return rr(e)+t},Dl.upperCase=kr,Dl.upperFirst=Ur,Dl.each=ra,Dl.eachRight=ua,Dl.first=Bi,Xr(Dl,(au={},rn(Dl,function(e,t){Ne.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:ol(nr(l),0);var n=this.__filtered__&&!t?new Il(this):this.clone();return n.__filtered__?n.__takeCount__=il(l,n.__takeCount__):n.__views__.push({size:il(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:$o(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=Fn(function(e,t){return"function"==typeof e?new Il(this):this.map(function(l){return gn(l,e,t)})}),Il.prototype.reject=function(e){return this.filter(ya($o(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),o=Dl[n?"take"+("last"==t?"Right":""):t],i=n||/^find/.test(t);o&&(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=o.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=i&&!c,p=r&&!m;if(!i&&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 Ll(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=ge[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 o=this.value();return t.apply(Ra(o)?o:[],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+"";Ne.call(gl,n)||(gl[n]=[]),gl[n].push({name:t,func:l})}}),gl[Oo(void 0,2).name]=[{name:"wrapper",func:void 0}],Il.prototype.clone=function(){var e=new Il(this.__wrapped__);return e.__actions__=fo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fo(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,o=l?e.length:0,i=function(e,t,l){for(var n=-1,o=l.length;++n<o;){var i=l[n],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=il(t,e+a);break;case"takeRight":e=ol(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,r=i.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,m=0,v=il(u,this.__takeCount__);if(!l||!n&&o==u&&v==u)return eo(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var E=-1,f=e[d+=t];++E<c;){var g=s[E],_=g.type,h=(0,g.iteratee)(f);if(2==_)f=h;else if(!h){if(1==_)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 Ll(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 Tl;){var n=Ti(l);n.__index__=0,n.__values__=void 0,t?o.__wrapped__=n:t=n;var o=n;l=l.__wrapped__}return o.__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:[zi],thisArg:void 0}),new Ll(t,this.__chain__)}return this.thru(zi)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return eo(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(O)});const yt=e=>{var o,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=i.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===(o=m.errors)||void 0===o||null===(r=o.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"))))},Ct=["currentlyActiveMobileModal"],Dt=["currentlyActiveMobileModal"],Ot=e=>{var o,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:E}=i.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=()=>{_({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),N=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,o=m(e,Ct);const{closeMobilePopupModal:i}=o;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,o,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:i}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,Dt)))},[g]);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:()=>_({type:"set",payload:"SearchFormComponent"})})),g?n.createElement(t.PopUp,null,n.createElement(N,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:f,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=v&&null!==(o=v[0])&&void 0!==o&&o.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")}))},Tt=e=>{let{columns:o,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:g}=i.useTranslation(),_=()=>{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 N(e){v("limit",Number(e.target.value)),m(u)()}function S(){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 y=()=>{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}},g(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:g,data:d,columns:o,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:N,currentPage:E,onNextPage:S,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,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(y,null))},Lt=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}=i.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(o.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(),g=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(Ot,{SearchFormFieldsComponent:yt,propsMobileInboxCards:g,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(Tt,{columns:E,SearchFormFieldsComponent:yt,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},It=e=>{const{t:o}=i.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:g,error:_}=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"}},o("ACTION_TEST_SEARCH_NOC_APPLICATION")),n.createElement(Lt,{t:o,tenantId:r,onSubmit:function(e,t){console.log("_data==>",e);let l=St(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),s(l)},isLoading:g,Count:p,error:_,data:m}))};function wt(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function Pt(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 Rt=(e,t)=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const l=e%10,n=e%100;let o="th";return(n<11||n>13)&&(1===l?o="st":2===l?o="nd":3===l&&(o="rd")),""+e+o+" "+t("NOC_FLOOR_AREA_LABEL")},xt=function(e,t,l,n,o){try{var i,a,r,u;const d=Digit.ULBService.getStateId(),s=e||{};console.log("appData here in DownloadACK",s);let c=[],m="";const v=(null==s||null===(i=s.nocDetails)||void 0===i||null===(a=i.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 i,a,r,u,d;const v=null==e||null===(i=e.data)||void 0===i||null===(a=i.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,o,i,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===(o=n.applicationDetails)||void 0===o?void 0:o.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.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===(g=e.nocDetails)||void 0===g||null===(_=g.additionalDetails)||void 0===_||null===(h=_.applicationDetails)||void 0===h?void 0:h.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:A}})(s,o));const p=(null==s?void 0:s.applicationNo)||"NA",E=o("LOCAL_GOVERNMENT_PUNJAB"),f=null==t?void 0:t.contactNumber,_=null==t?void 0:t.emailId,h=null==t?void 0:t.code,A=((e,t)=>{var l,n,o,i,a,r,u,d,s,c,m,v,p,E,f,g,_,h,A,N,S,b,y,C,D,O,T,L,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===(o=n.siteDetails)||void 0===o?void 0:o.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.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===(g=f.additionalDetails)||void 0===g||null===(_=g.siteDetails)||void 0===_?void 0:_.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===(N=A.siteDetails)||void 0===N||null===(S=N.specificationRestrictedArea)||void 0===S?void 0:S.code)||(null==e||null===(b=e.nocDetails)||void 0===b||null===(y=b.additionalDetails)||void 0===y||null===(C=y.siteDetails)||void 0===C?void 0:C.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===(T=O.siteDetails)||void 0===T||null===(L=T.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.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,o),N=((e,t)=>{var l,n,o,i,a,r,u,d,s,c,m,v,p,E,f,g,_,h,A,N,S,b,y,C,D,O,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne,Se,be,ye,Ce,De,Oe,Te,Le,Ie,we,Pe,Re,xe,Be,Fe;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===(o=n.siteDetails)||void 0===o?void 0:o.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.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===(g=f.siteDetails)||void 0===g?void 0:g.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(h=_.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===(N=e.nocDetails)||void 0===N||null===(S=N.additionalDetails)||void 0===S||null===(b=S.siteDetails)||void 0===b?void 0:b.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(y=e.nocDetails)||void 0===y||null===(C=y.additionalDetails)||void 0===C||null===(D=C.siteDetails)||void 0===D||null===(O=D.roadType)||void 0===O?void 0:O.name)||(null==e||null===(T=e.nocDetails)||void 0===T||null===(L=T.additionalDetails)||void 0===L||null===(I=L.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===(B=x.additionalDetails)||void 0===B||null===(F=B.siteDetails)||void 0===F?void 0:F.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===($=K.siteDetails)||void 0===$?void 0:$.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(X=e.nocDetails)||void 0===X||null===(Z=X.additionalDetails)||void 0===Z||null===(J=Z.siteDetails)||void 0===J||null===(Q=J.zone)||void 0===Q?void 0:Q.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===(oe=ne.additionalDetails)||void 0===oe||null===(ie=oe.siteDetails)||void 0===ie?void 0:ie.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===(ge=fe.siteDetails)||void 0===ge?void 0:ge.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(_e=e.nocDetails)||void 0===_e||null===(he=_e.additionalDetails)||void 0===he||null===(Ae=he.siteDetails)||void 0===Ae||null===(Ne=Ae.buildingStatus)||void 0===Ne?void 0:Ne.name)||(null==e||null===(Se=e.nocDetails)||void 0===Se||null===(be=Se.additionalDetails)||void 0===be||null===(ye=be.siteDetails)||void 0===ye?void 0:ye.buildingStatus)||"N/A"}];var ke,Ue,He,We,je,ze,Ve,Ge,Ye,qe,Ke,$e,Xe,Ze,Je,Qe,et;return null!=e&&null!==(Ce=e.nocDetails)&&void 0!==Ce&&null!==(De=Ce.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!==(Te=e.nocDetails)&&void 0!==Te&&null!==(Le=Te.additionalDetails)&&void 0!==Le&&null!==(Ie=Le.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===(Pe=we.additionalDetails)||void 0===Pe||null===(Re=Pe.siteDetails)||void 0===Re?void 0:Re.buildingStatus)&&(null==e||null===(Ke=e.nocDetails)||void 0===Ke||null===($e=Ke.additionalDetails)||void 0===$e||null===(Xe=$e.siteDetails)||void 0===Xe||null===(Ze=Xe.floorArea)||void 0===Ze||Ze.map((e,l)=>Me.push({title:Rt(l,t),value:null==e?void 0:e.value}))),"Built Up"==(null==e||null===(xe=e.nocDetails)||void 0===xe||null===(Be=xe.additionalDetails)||void 0===Be||null===(Fe=Be.siteDetails)||void 0===Fe?void 0:Fe.buildingStatus)&&Me.push({title:t("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),value:(null==e||null===(Je=e.nocDetails)||void 0===Je||null===(Qe=Je.additionalDetails)||void 0===Qe||null===(et=Qe.siteDetails)||void 0===et?void 0:et.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:Me}})(s,o),S=((e,t)=>{var l,n,o,i;return(null!=(l=null==e||null===(n=e.nocDetails)||void 0===n||null===(o=n.additionalDetails)||void 0===o||null===(i=o.applicationDetails)||void 0===i?void 0:i.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,o),b=((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,o);return Promise.resolve(function(e,t){try{var l;function n(e){return console.log("res here==>",e),{title:t("BPA_TITILE_DOCUMENT_UPLOADED"),values:(null==o?void 0:o.length)>0?o.map((l,n)=>{const o=g(null==e?void 0:e.data,null==l?void 0:l.uuid);return{title:n+1+". "+(t(null==l?void 0:l.documentType.replace(/\./g,"_"))||t("CS_NA")),value:" ",link:o||""}}):[{title:t("PT_NO_DOCUMENTS"),value:"NA"}]}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.filter(e=>"OWNER.SITEPHOTOGRAPHONE"!==(null==e?void 0:e.documentType)&&"OWNER.SITEPHOTOGRAPHTWO"!==(null==e?void 0:e.documentType)),i=null==o?void 0:o.map(e=>null==e?void 0:e.uuid),a=(null==i?void 0:i.length)>0;return Promise.resolve(a?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(n):n(a))}catch(e){return Promise.reject(e)}}(s,o)).then(function(e){return Promise.resolve(function(e,t){try{var l;function n(l){var n,i;const a=(null==e||null===(n=e.nocDetails)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.coordinates)||{},r=(null==o?void 0:o.length)>0?o.map(e=>{const n=g(null==l?void 0:l.data,null==e?void 0:e.uuid);let o="N/A",i="N/A";return"OWNER.SITEPHOTOGRAPHONE"===e.documentType&&(o=(null==a?void 0:a.Latitude1)||"N/A",i=(null==a?void 0:a.Longitude1)||"N/A"),"OWNER.SITEPHOTOGRAPHTWO"===e.documentType&&(o=(null==a?void 0:a.Latitude2)||"N/A",i=(null==a?void 0:a.Longitude2)||"N/A"),{title:(t(e.documentType.replace(/\./g,"_"))||t("CS_NA"))+" (Lat: "+o+", Long: "+i+")",value:" ",link:n||""}}):[{title:t("CS_NO_DOCUMENTS_UPLOADED"),value:"NA"}];return{title:t("BPA_LOC_SITE_PHOTOGRAPH_PREVIEW"),isAttachments:!0,values:r}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),i=null==o?void 0:o.map(e=>null==e?void 0:e.uuid),a=(null==i?void 0:i.length)>0;return Promise.resolve(a?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(n):n(a))}catch(e){return Promise.reject(e)}}(s,o)).then(function(t){return{t:o,tenantId:h,name:"NOC Application",email:_,phoneNumber:f,heading:E,applicationNumber:p,details:[b,...c,...S,N,A,e,t],imageURL:m,ulbType:l,ulbName:n}})})})}catch(e){return Promise.reject(e)}},Bt=e=>{var l,a,r;const u=o.useLocation(),{pathname:d,state:s}=u,{t:c}=i.useTranslation(),m=o.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:p}=Digit.Hooks.useStore.getInitData(),{tenants:f}=p||{},g=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:g,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(E(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=wt(function(){var e,t,l,n;const o=v,i=null==o||null===(e=o.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==i?void 0:i.ulbType,r=(null==i||null===(l=i.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==i?void 0:i.ulbName),u=f.find(e=>e.code===o.tenantId);return Promise.resolve(xt(o,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")}}))))},Ft=e=>{let{location:l}=e;const{t:o}=i.useTranslation(),a=[{path:"/digit-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:o("ES_COMMON_INBOX"),show:!(!l.pathname.includes("noc/inbox")&&!l.pathname.includes("noc/new-application"))},{path:"/digit-ui/employee/noc/search/application",content:o("ES_COMMON_SEARCH_APPLICATION"),show:!!l.pathname.includes("noc/search/application")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:o("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!l.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:o("ES_COMMON_APPLICATION_SEARCH"),show:!!l.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:o("NOC_APP_OVER_VIEW_HEADER"),show:!!l.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return n.createElement(t.BreadCrumb,{crumbs:a})},Mt=e=>{var a,r,u,d,s,m,v,p,E,f,g,_;let{path:h}=e;const A=o.useLocation(),N=(i.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),S=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NOCInbox"),b=(null===(s=Digit)||void 0===s||null===(m=s.ComponentRegistryService)||void 0===m||m.getComponent("NewNOCStepperForm"),null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview")),y=(null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f||f.getComponent("NewNOCEditApplication"),null===(g=Digit)||void 0===g||null===(_=g.ComponentRegistryService)||void 0===_?void 0:_.getComponent("NOCCitizenApplicationOverview")),C=window.location.href.includes("/response"),D=window.Digit.Utils.browser.isMobile();return n.createElement(l.Fragment,null,C?null:n.createElement("div",{style:window.location.href.includes("application-overview")||D?{marginLeft:"10px"}:{}},n.createElement(Ft,{location:A})),n.createElement(o.Switch,null,n.createElement(t.PrivateRoute,{path:h+"/inbox/application-overview/:id",component:b}),n.createElement(t.PrivateRoute,{path:h+"/search/application-overview/:id",component:N}),n.createElement(t.PrivateRoute,{path:h+"/inbox",component:e=>n.createElement(S,c({},e,{parentRoute:h}))}),n.createElement(t.PrivateRoute,{path:h+"/search",component:e=>n.createElement(It,c({},e,{parentRoute:h}))}),n.createElement(t.PrivateRoute,{path:h+"/response/:id",component:Bt}),n.createElement(t.PrivateRoute,{path:h+"/search/application",component:y})))},kt=e=>{const[t,o]=l.useState(e.selectedVal?e.selectedVal:"");return l.useEffect(()=>{e.keepNull?o(""):e.selectedVal?o(e.selectedVal):(o(""),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||(o(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,o,i,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===(o=n.parentElement)||void 0===o||null===(i=o.children)||void 0===i||null===(a=i.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,N,S,b,y,C,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===(g=f.parentElement)||void 0===g||null===(_=g.children)||void 0===_||null===(h=_.namedItem("jk-dropdown-unique"))||void 0===h||null===(A=h.scrollTo)||void 0===A||A.call(h,1e5,1e5):(null==e||null===(N=e.addProps)||void 0===N?void 0:N.currentIndex)>2&&(null==t||null===(S=t.target)||void 0===S||null===(b=S.parentElement)||void 0===b||null===(y=b.parentElement)||void 0===y||null===(C=y.children)||void 0===C||null===(D=C.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"})})},Ut=e=>e,Ht=e=>{var o,i,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,N=e.t||Ut;function S(){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 y(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 C=e.option&&(null===(o=e.option)||void 0===o?void 0:o.filter(t=>{var l,n;return(null===(l=N(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===(i=e.option)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.label)&&(C=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:S},e.customSelector,e.showArrow&&n.createElement(t.ArrowDown,{onClick:S,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(kt,{autoComplete:e.autoComplete,setFilter:function(e){p(e)},forceSet:E,setforceSet:f,setOptionIndex:_,keepNull:e.keepNull,selectedVal:s?e.t?e.isMultiSelectEmp?s+" "+N("BPA_SELECTED_TEXT"):e.t(e.optionKey?s[e.optionKey]:s):e.optionKey?s[e.optionKey]:s:null,filterVal:v,addProps:{length:C.length,currentIndex:g,selectOption:function(e){y(C[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:S,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},C&&C.map((t,l)=>(console.log("option",t),n.createElement("div",{className:"cp profile-dropdown--item display: flex ",style:l===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},key:l,onClick:()=>y(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),")")))),C&&0===C.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===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},onClick:()=>y(e)},e))):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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:_}=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({}),[N,S]=l.useState({}),[b,y]=l.useState([]),[C,D]=l.useState(null),[O,T]=l.useState(null),[L,I]=l.useState(null),[w,P]=l.useState(null),[R,x]=l.useState([]),[B,F]=l.useState(null),[M,k]=l.useState(!1);function U(e){T(e.target.files[0])}return l.useEffect(()=>{var e;_&&_["egf-master"]&&x(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),l.useEffect(()=>{var e;y(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=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",O,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?I(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.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:o,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+o.action+"_APPLICATION",submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:l("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:n.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:B,setSelectedFinancialYear:F}):(e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(m||"WF_ROLE_"+(null===(l=i.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:C,setSelectedApprover:D,selectFile:U,uploadedFile:L,setUploadedFile:I,businessService:v}))},[r,b,R,B,L]),r&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Wt,{label:a(h.label.heading)}),headerBarEnd:n.createElement(zt,{onClick:d}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!B:f||(null==r?void 0:r.docUploadRequired)&&!L,formId:"modal-action"},g?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:h.form,className:"BPAemployeeCard bpa-workflow-modal-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==B?void 0:B.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||!C?[]:[C],L&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==O?void 0:O.name,fileStoreId:L}]),s({Property:c({},m,{workflow:t})})}},defaultValues:N,formId:"modal-action"})):n.createElement(t.Loader,null)},Gt=e=>n.createElement("h1",{className:"heading-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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,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({}),[N,S]=l.useState([]),[b,y]=l.useState({}),[C,D]=l.useState(null),[O,T]=l.useState(null),[L,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:B}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function F(e){D(e.target.files[0])}return l.useEffect(()=>{if(p&&B){var e;const t=B["common-masters"].Department;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var l,n,o;const i=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)===i);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),l.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",C,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?T(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.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)}}()},[C]),l.useEffect(()=>{r&&_((e=>{let{t:l,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"CANCEL"===(null==o?void 0:o.action)?"WF_CANCEL_LICENSE":"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.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:i,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:N,selectedApprover:b,setSelectedApprover:y,selectFile:F,uploadedFile:O,setUploadedFile:T,businessService:v}))},[r,N,w,R,O]),r&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Gt,{label:a(g.label.heading)}),headerBarEnd:n.createElement(qt,{onClick:d}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:g.form,className:"BPAemployeeCard bpa-workflow-modal-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==C?void 0:C.name,fileStoreId:O}]:null}),s({Licenses:[m]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},$t=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Xt=()=>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(Xt,null)),Jt=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)});console.log(p,"DEKHO");const[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState({}),[y,C]=l.useState(null),[D,O]=l.useState(null),[T,L]=l.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t,l,n,o,i,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===(o=e.user)||void 0===o?void 0:o.name)+" ("+(a(null==e||null===(i=e.assignments)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.designation)||"N/A")+")"}}))},[p]),l.useEffect(()=>{!function(){try{L(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",y,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).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?O(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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)}}()},[y]),l.useEffect(()=>{r&&g((e=>{let{t:l,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)||(v=!1),o.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?l("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:v?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?n.createElement(Ht,{option:i,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:S,setSelectedApprover:b,selectFile:w,uploadedFile:D,setUploadedFile:O,businessService:v,error:T}))},[r,A,D,T]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement($t,{label:a(f.label.heading)}),headerBarEnd:n.createElement(Zt,{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!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]:null}),console.log("action",r),console.log("applicationData",m),s({Licenses:[m]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},Qt=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,i,a,u,d,s,m,v,p,E,f,g,_,h,A,N,S,b;let{t:y,action:C,tenantId:D,closeModal:O,submitAction:T,applicationDetails:L,applicationData:I,businessService:w,workflowDetails:P,blockReason:R}=e;console.log("applicationData_BPAACTIONMODAL",I);const x=[...new Set(null==P||null===(o=P.data)||void 0===o||null===(i=o.initialActionState)||void 0===i||null===(a=i.nextActions)||void 0===a||null===(u=a.find(e=>(null==e?void 0:e.action)===(null==C?void 0:C.action)))||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.flatMap(e=>e.roles||[]))];console.log("workflowDetails_BPAACTIONMODAL",P,x,C),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:B,isLoading:F}=Digit.Hooks.useEmployeeSearch(D,{roles:null==x?void 0:x.map(e=>({code:e})),zones:null===(g=I)||void 0===g||null===(_=g.additionalDetails)||void 0===_?void 0:_.zonenumber,categories:null===(h=I)||void 0===h||null===(A=h.additionalDetails)||void 0===A?void 0:A.categories,subcategories:null===(N=I)||void 0===N||null===(S=N.additionalDetails)||void 0===S?void 0:S.subcategories,assignedtenattids:null===(b=I)||void 0===b?void 0:b.tenantId,isActive:!0},{enabled:!(null!=C&&C.isTerminateState)});console.log("approverData",B),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]=l.useState(null),[Z,J]=l.useState(null),[Q,ee]=l.useState(null),[te,le]=l.useState(null),ne=!!Digit.Utils.browser.isMobile();function oe(e){X(e.target.files[0])}l.useEffect(()=>{var e;j(null==B||null===(e=B.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}}))},[B]),l.useEffect(()=>{!function(){try{ee(null);const e=function(){if($){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if($.size>=5242880)ee(y("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=$&&$.type&&!e.test(null==$?void 0:$.type))ee(y("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",$,Digit.ULBService.getStateId()||(null==D?void 0:D.split(".")[0]))).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?J(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):ee(y("CS_FILE_UPLOAD_ERROR"))})},function(){ee(y("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[$]);const ie=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=[],o=[];var i,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),o=o.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)=>{o.push({docs:ie(e.Documents),date:e.InspectionDate,questions:ae(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",o),o=o.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",o)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},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}))),C&&k((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectedBlockReason:d,setBlockReason:s,selectFile:c,uploadedFile:m,setUploadedFile:v,assigneeLabel:p,businessService:E,error:f,blockReasonFiltered:g}=e,_=!1;return"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SKIP_PAYMENT"!=i.action&&"SEND_BACK_TO_CITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(_=!0),console.log("actionInModal",i),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+E+"_"+(null==i?void 0:i.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:i.isTerminateState||_||"BLOCK"==(null==i?void 0:i.action)||"VERIFY"==(null==i?void 0:i.action)||"SEND_FOR_INSPECTION_REPORT"==(null==i?void 0:i.action)||"ESIGN"==(null==i?void 0:i.action)?null:o(p||"WF_ROLE_"+(null===(l=i.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:i.isTerminateState||_||"BLOCK"==(null==i?void 0:i.action)||"VERIFY"==(null==i?void 0:i.action)||"SEND_FOR_INSPECTION_REPORT"==(null==i?void 0:i.action)||"ESIGN"==(null==i?void 0:i.action)?null:n.createElement(Ht,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r,t:o})},{label:"BLOCK"==(null==i?void 0:i.action)?o("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==i?void 0:i.action)?n.createElement(t.Dropdown,{option:g,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:d,isMandatory:!0}):null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{v(null)},message:m?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:f})}]}]}})({t:y,action:C,approvers:W,selectedApprover:G,setSelectedApprover:Y,selectedBlockReason:q,setBlockReason:K,selectFile:oe,uploadedFile:Z,setUploadedFile:J,businessService:w,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Q,blockReasonFiltered:z}))},[C,W,te,Z,Q]),C&&M.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Qt,{label:y(M.label.heading)}),headerBarEnd:n.createElement(tl,{onClick:O}),actionCancelLabel:y(M.label.cancel),actionCancelOnSubmit:O,actionSaveLabel:y(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"}:{}},F?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:M.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,o,i,a,r,u,d,s,m,v,p,E,f,g,_,h,A,N,S,b,D,w,R,x,B,F,M,k,U,H,W,j,z,V,Y,K,X,J,Q,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==C?void 0:C.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===(o=e.comments)||void 0===o?void 0:o.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==P||null===(i=P.data)||void 0===i||null===(a=i.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===(g=f.state)||void 0===g?void 0:g.applicationStatus)?[null==P||null===(_=P.data)||void 0===_||null===(h=_.processInstances)||void 0===h||null===(A=h[0])||void 0===A||null===(N=A.assigner)||void 0===N?void 0:N.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,varificationDocuments:Z?[{documentType:(null==C?void 0:C.action)+" DOC",fileName:null==$?void 0:$.name,fileStoreId:Z}]:null},action:null==C?void 0:C.action,riskType:null===(S=I)||void 0===S||null===(b=S.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===(B=P.data)||void 0===B||null===(F=B.processInstances)||void 0===F||null===(M=F[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:Z?[{documentType:(null==C?void 0:C.action)+" DOC",fileName:null==$?void 0:$.name,fileStoreId:Z}]: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===(X=K.selfCertificationCharges)||void 0===X?void 0:X.BPA_WATER_CHARGES)+parseInt(null===(J=I)||void 0===J||null===(Q=J.additionalDetails)||void 0===Q||null===(ee=Q.selfCertificationCharges)||void 0===ee?void 0:ee.BPA_GAUSHALA_CHARGES_CESS))O(),alert(y("Enterd Less Adjustment amount is invalid"));else{var te,le;const e=null==L||null===(te=L.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,o,i,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(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 o=[];e&&e.map(e=>{var t,i,a,r,u,d,s,c,m,v,p,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(i=t.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(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)&&o.push(e)}),T({BPA:I},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:U,formId:"modal-action"})):n.createElement(t.Loader,null)},nl=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ol=()=>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"})),il=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(ol,null)),al=e=>{var i,a,u,d,s,m,v;let{t:p,action:E,tenantId:f,closeModal:g,submitAction:_,applicationData:h,businessService:A}=e;const{data:N,isLoading:S}=Digit.Hooks.useEmployeeSearch(f,{roles:null===(i=workflowDetails)||void 0===i||null===(a=i.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,y]=(r.useQueryClient(),l.useState({})),[C,D]=l.useState({}),[O,T]=l.useState([]),[L,I]=l.useState({}),[w,P]=l.useState(null),[R,x]=l.useState(null),[B,F]=l.useState(null),M=!!Digit.Utils.browser.isMobile();function k(e){P(e.target.files[0])}return o.useHistory(),l.useEffect(()=>{var e;T(null==N||null===(e=N.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[N]),l.useEffect(()=>{!function(){try{F(null);const e=function(){if(w){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(w.size>=5242880)F(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=w&&w.type&&!e.test(null==w?void 0:w.type))F(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(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,o;(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===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):F(p("CS_FILE_UPLOAD_ERROR"))})},function(){F(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&&y((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,E=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(E=!0);let f=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(f=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||f?null:o(m||"WF_ROLE_"+(null===(l=i.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:i.isTerminateState||f?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:E,approvers:O,selectedApprover:L,setSelectedApprover:I,selectFile:k,uploadedFile:R,setUploadedFile:x,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:B}))},[E,O,R,B]),E&&b.form?n.createElement(t.Modal,{headerBarMain:n.createElement(nl,{label:p(b.label.heading)}),headerBarEnd:n.createElement(il,{onClick:g}),actionCancelLabel:p(b.label.cancel),actionCancelOnSubmit:g,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"}:{}},S?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:b.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(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]:[];o.map((e,t)=>{i.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!=L&&L.uuid?[null==L?void 0:L.uuid]:null,documents:R?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==w?void 0:w.name,fileStoreId:R}]:null},documents:i}),_({Noc:h},!1,{isNoc:!0})},defaultValues:C,formId:"modal-action"})):n.createElement(t.Loader,null)},rl=e=>n.createElement("h1",{className:"heading-m"},e.label),ul=()=>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(ul,null)),sl=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}},cl=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState({}),[y,C]=l.useState(null),[D,O]=l.useState(null),[T,L]=l.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function P(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",y,Digit.ULBService.getCurrentTenantId())).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?O(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(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)}}()},[y]),l.useEffect(()=>{var e,l,o,i;"DisconnectWSConnection"==(null===(e=m)||void 0===e||null===(l=e.processInstance)||void 0===l?void 0:l.businessService)||"DisconnectSWConnection"==(null===(o=m)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?r&&g((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:m,businessService:v,error:p}=e,E=!0,f=!1;return(null!=i&&null!==(l=i.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(E=!1),i.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:E?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?o("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:o("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:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("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 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:S,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v,error:T})):r&&g((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,p=!0;return(null!=i&&null!==(l=i.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?o("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:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("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 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:S,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v,error:T}))},[r,A,D,T]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(rl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(dl,{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,className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,o,i,a,d,v,p,E;if(null!==(t=m)&&void 0!==t&&t.isBillAmend){var f,g,_,h,A,N,b,C,O;const t=c({},null===(f=m)||void 0===f||null===(g=f.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),l=c({},null===(_=m)||void 0===_?void 0:_.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!==(N=m)&&void 0!==N&&null!==(b=N.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=m)&&void 0!==C&&null!==(O=C.applicationType)&&void 0!==O&&O.includes("WATER")?"WS":"SW",assignes:null!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.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!=S&&S.uuid?[null==S?void 0:S.uuid]:[],assignes:null!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],wfDocuments:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.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!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]:[]})}),null!=e&&e.date&&null!==(n=m)&&void 0!==n&&null!==(o=n.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=St(null==e?void 0:e.date);m.disconnectionExecutionDate=sl(t)}else if(null!=e&&e.date){const t=St(null==e?void 0:e.date);m.connectionExecutionDate=sl(t)}var T;if("DisconnectWSConnection"==(null===(i=m)||void 0===i||null===(a=i.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===(T=m)||void 0===T?void 0:T.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 L,I,w,P,R,x,B,F,M,k,U,H,W;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(L=t.value)&&void 0!==L&&L.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!==(B=t.value)&&void 0!==B&&B.adhocRebate&&(m.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.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:_,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 o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState(null),[y,C]=l.useState(null),[D,O]=l.useState(null),[T,L]=l.useState(null),[I,w]=l.useState(!1);function P(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,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?O(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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: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:S,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v}))},[r,A,D]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ml,{label:a(f.label.heading)}),headerBarEnd:n.createElement(pl,{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,className:"BPAemployeeCard bpa-workflow-modal-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||!S?[]:[S],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]),s({PetRegistrationApplications:[c({},m,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},fl=e=>n.createElement("h1",{className:"heading-m"},e.label),gl=()=>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"})),_l=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(gl,null)),hl=e=>{var o,i,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===(o=E.TradeLicense)||void 0===o?void 0:o.TradeType),console.log("applicationData",m);const[g,_]=l.useState({}),[h,A]=l.useState({}),[N,S]=l.useState([]),[b,y]=l.useState(""),[C,D]=l.useState([]),[O,T]=l.useState(null),L=null===(i=m)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",L);const I=l.useMemo(()=>{var e;if(f||!E||!L.length)return[];const t=new Set(L.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,L]);return console.log("years",I),l.useEffect(()=>{u&&_((e=>{let{t:l,action:o,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:l("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:y,businessService:v}))},[u,I,C,O]),u&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(fl,{label:r(g.label.heading)}),headerBarEnd:n.createElement(_l,{onClick:d}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:g.form,className:"BPAemployeeCard bpa-workflow-modal-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],o="20"+Number(n)+"-"+(Number(n)+1);m=c({},m,{financialYear:o,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)},Al=e=>n.createElement("h1",{className:"heading-m"},e.label),Nl=()=>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(Nl,null)),bl=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState(null),[y,C]=l.useState(null),[D,O]=l.useState(null),[T,L]=l.useState(null),[I,w]=l.useState(!1);function P(e){w(!0),C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",y,u)).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?O(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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)}}()},[y]),console.log("actyhdesh,jhfsefsef",r,m),l.useEffect(()=>{g((e=>{let{t:l,action:o,selectFile:i,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==o?void 0:o.action)+"_APPLICATION",submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label: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")+(o.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,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:S,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(Al,{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){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!=S&&S.uuid?[null==S?void 0:S.uuid]:null};D&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:D}]),s({streetVendingDetail:c({},m,{workflow:l})})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},yl=e=>n.createElement("h1",{className:"heading-m"},e.label),Cl=()=>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(Cl,null)),Ol=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState(null),[y,C]=l.useState(null),[D,O]=l.useState(null),[T,L]=l.useState(null),[I,w]=l.useState(!1);function P(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",y,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?O(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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:o,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==o?void 0:o.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:l("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("ES_CHB_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,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:S,setSelectedApprover:b,selectFile:P,uploadedFile:D,setUploadedFile:O,businessService:v}))},[r,A,D]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(yl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(Dl,{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,className:"BPAemployeeCard bpa-workflow-modal-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==y?void 0:y.name,filestoreId:D}]),s({hallsBookingApplication:[c({},m,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},Tl=e=>n.createElement("h1",{className:"heading-m"},e.label),Ll=()=>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"})),Il=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Ll,null)),wl=e=>{var i,a,r;let{t:u,action:d,tenantId:s,closeModal:m,submitAction:v,applicationData:p,businessService:E,moduleCode:f}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(i=d.roles)||void 0===i||null===(a=i[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)}),_=o.useHistory(),[h,A]=l.useState({}),[N,S]=l.useState({}),[b,y]=l.useState([]),[C,D]=l.useState(null),[O,T]=l.useState(null);return l.useEffect(()=>{var e;y(null==g||null===(e=g.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[g]),l.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?_.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:C,setSelectedApprover:D,uploadedFile:O,setUploadedFile:T,businessService:E}))},[d,b,O]),d&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Tl,{label:u(h.label.heading)}),headerBarEnd:n.createElement(Il,{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,className:"BPAemployeeCard bpa-workflow-modal-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:N,formId:"modal-action"})):n.createElement(t.Loader,null)},Pl=e=>null!=e&&e.businessService.includes("PT")?n.createElement(Vt,e):null!=e&&e.businessService.includes("ptr")?n.createElement(El,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?n.createElement(Kt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?n.createElement(hl,e):null!=e&&e.moduleCode.includes("BPAREG")?n.createElement(Jt,e):null!=e&&e.moduleCode.includes("BPA")?n.createElement(ll,e):null!=e&&e.moduleCode.includes("NOC")?n.createElement(al,e):null!=e&&e.moduleCode.includes("WS")?n.createElement(cl,e):null!=e&&e.businessService.includes("street-vending")?n.createElement(bl,e):null!=e&&e.businessService.includes("chb")?n.createElement(Ol,e):null!=e&&e.businessService.includes("asset-create")?n.createElement(wl,e):void 0;function Rl(e){let{documents:l,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=i.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,o)=>{var i,s,c;return n.createElement(n.Fragment,{key:o},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===(i=e.values)||void 0===i?void 0:i.map((l,o)=>{var i;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:o},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!==(i=l.documentType)&&void 0!==i&&i.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:o},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)!=o+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 i;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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>n.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.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 xl=e=>{var t,o;let{t:i,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===(o=a.documents)||void 0===o?void 0:o.documents)||[]),[E,f]=l.useState(null),[g,_]=l.useState([]),[h,A]=l.useState(!0),[N,S]=l.useState(!1),[b,y]=l.useState(!1),{isLoading:C,data:D}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:O,data:T}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return l.useEffect(()=>{var e,t,l,n;let o=[];var i,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==D||null===(i=D.BPA)||void 0===i||null===(a=i.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=o)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==T||null===(t=T["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,i.length);i===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===(o=n.values)||void 0===o||o.map(t=>{var l,n;i===(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)),_(d)},[!C,!O]),l.useEffect(()=>{let e=0;g.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,N]),l.useEffect(()=>{y("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),n.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>n.createElement("div",{style:{padding:"20px"}},n.createElement(Bl,{key:t,index:t,document:e,t:i,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:S,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:b}))))};function Bl(e){var o,i;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,g]=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===(o=r.dropdownData)||void 0===o?void 0:o.length)?null==r?void 0:r.dropdownData[0]:{}),[_,h]=l.useState(null),[A,N]=l.useState(()=>(null==p?void 0:p.fileStoreId)||null),[S,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==_?void 0:_.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{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],S.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)}},[S,f]),l.useEffect(()=>{},[_]),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===(i=r.uploadedDocuments)||void 0===i?void 0:i.length)&&n.createElement(Rl,{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=>g(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 o;0!==Object.keys(l).length&&b(n),(o=n[n.length-1])&&h(o.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Fl(e){let{fiReport:l,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginTop:"10px"}},n.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),l.map((e,o)=>{var i,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")+" - "+(o+1)),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(i=e.date)||void 0===i?void 0:i.split("-")[2])+"/"+(null===(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(Rl,{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 Ml(e){let{t:o,document:i,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==i?void 0:i.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!=i&&null!==(e=i.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==i||null===(t=i.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==i||null===(t=i.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(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=wt(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,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?f(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):r(o("CS_FILE_UPLOAD_ERROR"))})},function(){r(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),n.createElement("div",{style:{}},n.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},n.createElement(t.CardLabel,{style:{width:"100%"}},null!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("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:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const kl=e=>{var o;let{t:i,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===(o=c.data)||void 0===o?void 0:o.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[_,h]=l.useState([]),[A,N]=l.useState([]),[S,b]=l.useState(!1),[y,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,O]=l.useState(null),T=window.location.href.includes("/employee/");return l.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),l.useEffect(()=>{var e,t,l;let n,o=[];var i,r,s,c;n=u?null==E||null===(i=E.NOC)||void 0===i||null===(r=i.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},o.push(n[0].docTypes[0]));let m=[];o&&o.length>0&&(o.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.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)}),N(m))},[E,_]),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:T?""+i("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):i("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:T?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:T?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),n.createElement(Rl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),S&&(null==A?void 0:A.map((e,t)=>n.createElement(Ml,{key:t,document:e,t:i,error:D,setError:O,setNocDocuments:C,nocDocuments:y,checkEnablingDocs:S}))))},Ul=e=>{let{permissions:o,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.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"}},i("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 o;return t===n?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:l}))})(e,l),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("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:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Hl(e){let{taxHeadEstimatesCalculation:l}=e;const{taxHeadEstimates:o}=l,{t:a}=i.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==o?void 0:o.map((e,l)=>n.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:l===(null==o?void 0:o.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 Wl(e){let{floors:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map(e=>{var l;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(l=e.values)||void 0===l?void 0:l.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==l?"16px":"revert"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(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"})}))))}))}))}function jl(e){let{owners:l}=e,o={};o=window.location.href.includes("/employee/pt/")?l.slice().reverse():l;const{t:a}=i.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"},o.map((e,l)=>{var o;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===(o=e.values)||void 0===o?void 0:o.map((e,l)=>{var o;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===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const zl=e=>{var o,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(),g=Digit.ULBService.getStateId(),[_,h]=l.useState(),[A,N]=l.useState(),[S,b]=l.useState([]),[y,C]=l.useState(),[D,O]=l.useState(""),[T,L]=l.useState(null),[I,w]=l.useState({}),[P,R]=l.useState(!1),[x,B]=l.useState(!1);l.useEffect(()=>{!function(){try{L(null);const e=function(){if(y&&null!=y&&y.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==y||null===(t=y.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(y.size>=2e6)L(F("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",y,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?b([...S,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId,time:new Date}]):L(F("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else L(F("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),l.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(S))},[S]),l.useEffect(()=>{var e,t,l,n,o,i,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,o;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===(o=d.lessAdjustmentFeeFiles)||void 0===o?void 0:o.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,g).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===(o=d.selfCertificationCharges)||void 0===o?void 0:o.BPA_OTHER_CHARGES),f(null==d||null===(i=d.selfCertificationCharges)||void 0===i?void 0:i.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:F}=i.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?n.createElement("span",{style:{color:"#00703C"}},F(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?F(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void F("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===(o=r.values)||void 0===o?void 0:o.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:""+F(""+e.title),text:null!=e&&e.value?M(e)+" "+F(null==e?void 0:e.isUnit):F("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:""+F(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},F(null==e?void 0:e.title)):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},F(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))))))},Vl=e=>{var o,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:m}=i.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 g(e){var t;let l=[],n=0,o=0,i=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,N=Number(null===(r=e.occupancies)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.floorArea)||0,S=Number(null===(d=e.occupancies)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.deduction)||0;n+=A,o+=N,i+=S,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===(g=f[0])||void 0===g?void 0:g.deduction).toFixed(2),FloorArea:Number(null===(_=e.occupancies)||void 0===_||null===(h=_[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(i).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL"),FloorArea:Number(o).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL")}),l}function _(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 o,i;let t=null===(o=l[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.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===(o=s.values)||void 0===o?void 0:o.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 o,i,a,r,u;return n.createElement("div",{key:l,style:(null==s||null===(o=s.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.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:_(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:g(e),columns:f,getCellProps:e=>({style:{}})})))})))},Gl=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))},Yl=e=>{var o,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,m]=l.useState(!1),{t:v}=i.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(Gl,{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===(o=u.wfComment)||void 0===o?void 0:o.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 ql(e){let{units:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(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",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Kl(e){let{units:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const $l=e=>{var o,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=i.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:g,roadCuttingAddlDetails:_,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===(o=s.additionalDetails)||void 0===o?void 0:o.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==g?void 0:g.map(e=>{var l;return n.createElement("div",{style:(null==g?void 0:g.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==_?void 0:_.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:""})))))))},Xl=[{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"}],Zl=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],Jl=e=>{var o,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=i.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===(o=d.additionalDetails)||void 0===o||!o.isPaid),[A,N]=l.useState(!1),[S,b]=l.useState(m||{}),[y,C]=l.useState(null),[D,O]=l.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[T,L]=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 o=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 i,a,r,u,s,p,E;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(i=m.billDetails)||void 0===i||null===(a=i[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)}];L(e),O(null==m||null===(E=m.billDetails)||void 0===E?void 0:E[0])}else v(o),b(o)},[]);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)),B=function(e,t,l){void 0===t&&(t=!1);let n=c({},S);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 o,i;const t=0==(null==l||null===(o=l.target)||void 0===o?void 0:o.value)?1:Math.sign(null==l||null===(i=l.target)||void 0===i?void 0:i.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"}},T&&n.createElement(t.StatusTable,null,n.createElement("div",null,null==T?void 0:T.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=>{N(!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),N(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(m),N(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,l=null!=S&&S.adhocRebate?Number(null==S?void 0:S.adhocRebate):0;var n,o;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,a,r,u,m,p,E,g,h,A;const e=null==d||null===(i=d.additionalDetails)||void 0===i||null===(a=i.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,S);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 o="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,o).then((e,t)=>{var l,n,o,i,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===(o=n.taxHeadEstimates)||void 0===o?void 0:o.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===(i=e.Calculation)||void 0===i||null===(a=i[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(St(e.Calculation[0])),O(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),L(A),S.billDetails=null==e?void 0:e.Calculation,v(S),N(!1)}).catch(e=>{var t,l,n,o,i,a;C({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===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},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:Xl,optionKey:"title",select:e=>B("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==S||null===(r=S.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==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>B("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==S?void 0:S.adhocPenalty)||"",onChange:e=>B("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:Zl,optionKey:"title",select:e=>B("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==S||null===(u=S.adhocRebateReason_data)||void 0===u?void 0:u.title)&&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==S?void 0:S.adhocRebateComment)||"",onChange:e=>B("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==S?void 0:S.adhocRebate)||"",onChange:e=>B("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),y&&n.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==y?void 0:y.isWarning,error:null==y||!y.isWarning,label:s(null==y?void 0:y.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},Ql=e=>{var o,a,r,u,d,s,c;let{wsAdditionalDetails:m}=e;const{t:v}=i.useTranslation(),[p,E]=l.useState(!1),[f,g]=l.useState({}),_=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!==(o=m.additionalDetails)&&void 0!==o&&o.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),g(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(_,{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"}})))))},en=e=>{let{assessmentData:t}=e;const[o,i]=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:()=>{i(!o)}},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"}},o?"<":">"))),o&&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)))))},tn=e=>{var t;let{applicationData:i}=e;const[a,r]=l.useState(!1);return o.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"}},i.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"}},i.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=i.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"}},i.status)),n.createElement("div",null,n.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},ln=e=>{let{payments:t}=e;const[o,i]=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:()=>{i(!o)}},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"}},o?"<":">"))),o&&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,o;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===(o=l[0])||void 0===o?void 0:o.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))))},nn=n.memo(e=>{let{width:t=85,height:l=100,style:o}=e;return n.createElement("svg",{style:o,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"}))}),on=n.memo(e=>{let{value:o,Code:i,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:o},{value:o},i,a),d=l.useMemo(()=>{var e;const t=null!=o&&o.documents?null==o||null===(e=o.documents)||void 0===e?void 0:e.documents:o;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===i))||[]},[o,i]);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])||"",o=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==o?void 0:o.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==o?void 0:o[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(nn,{className:"timeline-doc-icon"})):null}))}),an=[{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"}],rn=(n.memo(e=>{var t,l;let{checkpoint:o,t:i}=e;return n.createElement("div",{className:"timeline-card"},n.createElement("div",{className:"timeline-header"},null==an?void 0:an.map(e=>{let{label:t,key:l}=e;return n.createElement("div",{key:l,className:"timeline-header-item"},n.createElement("span",{className:"timeline-label"},i(t),":"),n.createElement("span",{className:"timeline-value"},i(null==o?void 0:o[l])||"N/A"))})),n.createElement("div",{className:"timeline-note"},n.createElement("span",{className:"timeline-label"},i("CM_TIMELINE_NOTE"),":"),n.createElement("div",{className:"note-box"},(null==o?void 0:o.comment)||i("CM_TIMELINE_NO_COMMENTS"))),(null==o||null===(t=o.documents)||void 0===t?void 0:t.length)>0&&n.createElement("div",{className:"timeline-docs"},n.createElement("span",{className:"timeline-label"},i("CM_TIMELINE_DOCUMENT_ATTACHED"),":"),null==o||null===(l=o.documents)||void 0===l?void 0:l.map((e,t)=>n.createElement(on,{key:(null==e?void 0:e.documentType)+"-"+t,value:null==o?void 0:o.documents,Code:null==e?void 0:e.documentType,index:t}))))}),n.memo(e=>{let{width:t=20,height:l=20,style:o}=e;return n.createElement("svg",{style:o,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"}))})),un=n.memo(e=>{let{value:o,Code:i,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:o},{value:o},i,a),d=l.useMemo(()=>{var e;const t=null!=o&&o.documents?null==o||null===(e=o.documents)||void 0===e?void 0:e.documents:o;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===i))||[]},[o,i]);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])||"",o=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==o?void 0:o.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==o?void 0:o[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(rn,null),n.createElement("span",null,(null==e?void 0:e.fileName)||"Document")):null}))});function dn(e){var o,i,a,r,u,d;let{workflowDetails:s,t:m,tenantId:v=Digit.ULBService.getCurrentTenantId()}=e;const{isLoading:p,data:E}=Digit.Hooks.ads.useADSDocumentSearch({value:(null==s||null===(o=s.data)||void 0===o||null===(i=o.timeline)||void 0===i?void 0:i.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},{value:(null==s||null===(a=s.data)||void 0===a||null===(r=a.timeline)||void 0===r?void 0:r.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},null,0),f=n.useCallback(()=>{if(!p){const e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")||{},t=function(e,t,l,n){var o,i,a,r,u,d,s,c,m;void 0===l&&(l={}),console.log("pdfFiles",l);const v=(null==e||null===(o=e.data)||void 0===o?void 0:o.timeline)||(null==e?void 0:e.timeline)||[],p=(null==e||null===(i=e.data)||void 0===i?void 0:i.processInstances)||(null==e?void 0:e.processInstances)||[],E=(null==p||null===(a=p[0])||void 0===a?void 0:a.businessId)||"N/A",f=(null==p||null===(r=p[0])||void 0===r?void 0:r.businessService)||"N/A",g=(null==p||null===(u=p[0])||void 0===u?void 0:u.moduleName)||"N/A",_=(e,t)=>{var l;const n=(null==e?void 0:e[t])||"",o=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==o?void 0:o.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==o?void 0:o[0])||""},h=v.map((e,t)=>{var o,i,a,r,u,d;const s=(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.created)||"N/A",c=(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.timing)||"N/A",m=(null==e||null===(a=e.assigner)||void 0===a?void 0:a.name)||"N/A",v=(null==e||null===(r=e.assigner)||void 0===r?void 0:r.type)||"N/A",p=(null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber)||"N/A",E=(null==e?void 0:e.performedAction)||"N/A",f=(null==e?void 0:e.status)||(null==e?void 0:e.state)||"N/A",g=(null==e||null===(d=e.wfComment)||void 0===d?void 0:d[0])||"-",h=(null==e?void 0:e.wfDocuments)||[],A=(null==e?void 0:e.sla)||"N/A",N=Array.isArray(null==e?void 0:e.assignes)?e.assignes.map(e=>null==e?void 0:e.name).filter(Boolean).join(", "):"";return{sNo:t+1,action:n?n(E):E,status:n?n(f):f,assignerName:m,assignerType:v,mobileNumber:p,designation:v,date:s,time:c,dateTime:(s+" "+("N/A"!==c?c:"")).trim(),comment:g,documents:h.map(e=>({name:(null==e?void 0:e.fileName)||(null==e?void 0:e.documentType)||"Document",type:(null==e?void 0:e.documentType)||"Document",fileStoreId:null==e?void 0:e.fileStoreId,link:_(l,null==e?void 0:e.fileStoreId)})),hasDocuments:h.length>0,sla:A,assignedTo:N}});return{t:n,tenantId:(null==t?void 0:t.code)||"",tenantName:(null==t?void 0:t.name)||(null==t?void 0:t.i18nKey)||"Government Department",name:n?n("TIMELINE_PDF_TITLE"):"Application Timeline",heading:n?n("TIMELINE_PDF_HEADING"):"File Movement Report",businessId:E,businessService:n?n("CS_COMMON_"+(null==f?void 0:f.toUpperCase())):f,moduleName:g,currentStatus:n?n((null==v||null===(d=v[0])||void 0===d?void 0:d.status)||(null==v||null===(s=v[0])||void 0===s?void 0:s.state)||"N/A"):(null==v||null===(c=v[0])||void 0===c?void 0:c.status)||(null==v||null===(m=v[0])||void 0===m?void 0:m.state)||"N/A",generatedDate:(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),generatedDateTime:(new Date).toLocaleString("en-IN",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}),timelineRows:h,totalSteps:h.length}}(s,e,(null==E?void 0:E.pdfFiles)||{},m);Digit.Utils.pdf.generateTimelinePDF(t)}},[s,E,m,p]),g=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)},_=(e,t)=>{if(!e||!t)return null;const l=Math.floor((e-t)/6e4),n=Math.floor(l/60),o=Math.floor(n/24);return o>0?o+" day(s)":n>0?n+" hour(s)":l+" minute(s)"},h=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 o=g(e.auditDetails),i=t>0?g(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:o,sla:_(o,i)})}).reverse()})(s),[s]),A=(null==h?void 0:h.filter(e=>!("SAVE_AS_DRAFT"===(null==e?void 0:e.performedAction))))||[],N=A.map(e=>{var t;return null==e||null===(t=e.assigner)||void 0===t?void 0:t.userName}).filter(Boolean),S=[...new Set(N)].join(","),b=Digit.Hooks.useEmployeeSearch(v,{codes:S,isActive:!0},{enabled:!!S}),y={};return null==b||null===(u=b.data)||void 0===u||null===(d=u.Employees)||void 0===d||d.forEach(e=>{var t;const l=null==e||null===(t=e.assignments)||void 0===t?void 0:t[0];y[null==e?void 0:e.code]="COMMON_MASTERS_DESIGNATION_"+(null==l?void 0:l.designation)}),p?n.createElement(t.Loader,null):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"},m("TRACKING STATUS")),n.createElement("div",{className:"custom-tracking-line"})),n.createElement("div",{className:"custom-title-bar-row"},n.createElement("h2",{className:"custom-timeline-title"},m("Application History")),n.createElement("span",{onClick:f,className:"download-button"},m("CS_COMMON_DOWNLOAD")),n.createElement("div",{className:"custom-blue-bar"}))),n.createElement("div",{className:"custom-timeline-entries"},null==A?void 0:A.map((e,t)=>{var l,o,i,a,r,u,d,s,c,v,p,E,f,g,_,h;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"},m("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===(i=e.assigner)||void 0===i?void 0:i.name)||m("CS_COMMON_NA")),(null==e||null===(a=e.assigner)||void 0===a?void 0:a.emailId)&&n.createElement("div",{className:"custom-officer-email"},n.createElement("span",{className:"custom-email-label"},m("Email"))," ",null==e||null===(r=e.assigner)||void 0===r?void 0:r.emailId),y[null==e||null===(u=e.assigner)||void 0===u?void 0:u.userName]&&n.createElement("div",{className:"custom-officer-name"},m(y[null==e||null===(d=e.assigner)||void 0===d?void 0:d.userName])))),(null==e?void 0:e.sla)&&n.createElement("div",{className:"custom-card-left"},n.createElement("h3",{className:"custom-action-title"},m("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"},m("Action")),n.createElement("div",{className:"custom-status-text"},m((null==e?void 0:e.performedAction)||"CS_COMMON_NA")))),(null==e?void 0:e.wfComment)&&(null==e||null===(s=e.wfComment)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.wfComment)||void 0===c?void 0:c.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"},m("Officer Comments")),null==e||null===(v=e.wfComment)||void 0===v?void 0:v.map((e,t)=>n.createElement("p",{key:t},e))),(null==e||null===(p=e.assignes)||void 0===p?void 0:p.length)>0&&n.createElement("div",null,n.createElement("h3",{className:"custom-comments-title"},m("Assigned To")),n.createElement("div",{className:"custom-officer-info"},n.createElement("div",{className:"custom-officer-name"},null===(E=e.assignes[0])||void 0===E?void 0:E.name),y[null===(f=e.assignes[0])||void 0===f?void 0:f.userName]&&n.createElement("div",{className:"custom-officer-email"},m(y[null===(g=e.assignes[0])||void 0===g?void 0:g.userName]))))),(null==e?void 0:e.wfDocuments)&&(null==e||null===(_=e.wfDocuments)||void 0===_?void 0:_.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===(h=e.wfDocuments)||void 0===h?void 0:h.map((t,l)=>n.createElement(un,{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 sn(e){var a,r,u,d,s,m,v,p,E,f,g,h,A,N,S,b;let{applicationDetails:y,demandData:C,workflowDetails:D,isDataLoading:O,applicationData:T,timelineStatusPrefix:L,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:P,oldValue:R,isInfoLabel:x=!1,propertyId:B,moduleCode:F}=e;const{t:M}=i.useTranslation(),k=o.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",y,F),l.useEffect(()=>{!function(){try{const e=function(){if(window.location.href.includes("employee/ws")&&null!=T&&T.connectionNo){const e=wt(function(){return Promise.resolve(Digit.WSService.paymentsearch({tenantId:(null==T?void 0:T.tenantId)||U,filters:{consumerCodes:null==T?void 0:T.connectionNo,consumerCode:null==T?void 0:T.connectionNo},BusinessService:"SEWERAGE"===(null==T?void 0:T.serviceType)||"SEWARAGE"===(null==T?void 0:T.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==T?void 0:T.connectionNo,null==T?void 0:T.serviceType,U]);const[q,K]=l.useState({}),[$,X]=l.useState(),[Z,J]=l.useState([]),[Q,ee]=l.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==T?void 0:T.status)||Q.loading||Q.loaded||Q.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==Q||!Q.canLoad||Q.loading||Q.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(o){function i(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==o||null===(l=o.Assessments)||void 0===l?void 0:l.length)>0){const l=o.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 i=Array.from(n.values());return J(i),X(null==o?void 0:o.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(i):i()})}catch(e){return Promise.reject(e)}}((null==T?void 0:T.tenantId)||U,null==T?void 0:T.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 o;const e={date:te(null==T||null===(o=T.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==T?void 0:T.channel)||""};return n.createElement(Yl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,a,r,u,d,s,c,m,v,p,E,f,g,h,A,N,S,b,C,D;const o={uuid:(null==e||null===(i=e.assigner)||void 0===i?void 0:i.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==y?void 0:y.tenantId,businessIds:null==y?void 0:y.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,L={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==T||null===(m=T.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!=T&&null!==(f=T.processInstance)&&void 0!==f&&null!==(g=f.assignes)&&void 0!==g&&null!==(h=g[0])&&void 0!==h&&h.mobileNumber?null==T||null===(A=T.processInstance)||void 0===A||null===(N=A.assignes)||void 0===N||null===(S=N[0])||void 0===S?void 0:S.mobileNumber:(null==e||null===(b=e.assigner)||void 0===b?void 0:b.mobileNumber)||(null==e||null===(C=e.assignes)||void 0===C||null===(D=C[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(Yl,{data:L,OpenImage:Y,privacy:o})}{var O,L,I,w,P;const t={date:te(null==T||null===(O=T.auditDetails)||void 0===O?void 0:O.lastModifiedTime),name:(null==e||null===(L=e.assignes)||void 0===L||null===(I=L[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(Yl,{data:t})}},ne=(e,t)=>e?t?e:M(e):M("NA"),oe=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ie=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")||oe?{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==C||C.reduce((e,t)=>e+t.demandInterest,0),null==C||C.reduce((e,t)=>e+t.demandPenality,0),null==C||C.reduce((e,t)=>e+t.collectionTax,0),null==C||C.reduce((e,t)=>e+t.collectionInterest,0),null==C||C.reduce((e,t)=>e+t.collectionPenality,0),null==C||C.reduce((e,t)=>e+t.balanceTax,0),null==C||C.reduce((e,t)=>e+t.balanceInterest,0),null==C||C.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==y?void 0:y.applicationData,ve=(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==y||null===(r=y.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return l.useEffect(()=>{if("WS"!==F&&"SW"!==F&&!window.location.href.includes("employee/ws")&&!window.location.href.includes("/ws/")&&B)try{let e={consumerCodes:B};const t=!0;"BPAREG"===F?Digit.OBPSService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):"PT"===F&&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)}},[F,B,U]),n.createElement(t.Card,{style:{position:"relative"}},null==y||null===(u=y.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var a,r,u,d,s,c,m,v,p,E,f,g,_,h,A,N,S,b,C,O,T,L,I,w,x,B,F,k,U,H,W,j,z,Y,q,K,$,X,Z;return n.createElement(n.Fragment,{key:i},n.createElement("div",{style:(window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws"),{})},0!==i||e.asSectionHeader?n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:0==i&&oe?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ie?""+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,o)=>o===(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")||oe?{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,i)=>{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(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},M(null==l?void 0:l.title)))):ie||ae?""+M(l.title):M(l.title),text:n.createElement("div",null,n.createElement(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==l?void 0:l.value))),last:i===(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:i===(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(zl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P,additionalDetails:null==y||null===(u=y.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==y||null===(d=y.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(Fl,{fiReport:null==y||null===(v=y.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(Wl,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&n.createElement(jl,{owners:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&n.createElement(Kl,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.accessories)&&n.createElement(ql,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories}),!V&&(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.permissions)&&(null==D||null===(C=D.data)||void 0===C||null===(O=C.nextActions)||void 0===O?void 0:O.length)>0&&n.createElement(Ul,{applicationData:null==y?void 0:y.applicationData,t:M,permissions:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.permissions}),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.obpsDocuments)&&n.createElement("div",{style:{display:"flex"}},n.createElement(xl,{t:M,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&n.createElement(kl,{t:M,isNoc:!0,NOCdata:e.values,applicationData:null==y?void 0:y.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(zl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&n.createElement(zl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&n.createElement(Vl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.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(Hl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&n.createElement($l,{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(o.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===($=K.redirectUrl)||void 0===$?void 0:$.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&n.createElement(Jl,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.estimationDetails)&&n.createElement(Ql,{wsAdditionalDetails:e,workflowDetails:D}))}),(null==$?void 0:$.length)>0&&n.createElement(en,{assessmentData:Z}),n.createElement(ln,{payments:j}),"WS"!==F&&"SW"!==F&&"OBPS"!==F&&"BPAStakeholder"!==F&&"BPAREG"!==F&&"TL"!==F&&n.createElement(tn,{applicationData:null==y?void 0:y.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"!==F&&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(""+L+(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===(N=D.data)||void 0===N?void 0:N.timeline.slice(0,de?null==D?void 0:D.data.timeline.length:2).map((e,l,o)=>{var i;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(""+L+("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===(i=D.data)||void 0===i?void 0:i.timeline)}))}))),(null==D||null===(S=D.data)||void 0===S||null===(b=S.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"===F&&n.createElement(dn,{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==y||null===(e=y.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var l,n,o;if("INACTIVE"===(null==y||null===(l=y.applicationData)||void 0===l?void 0:l.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(n=y.applicationData)||void 0===n?void 0:n.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(o=y.applicationData)||void 0===o?void 0:o.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var i,a,r;if("INACTIVE"===(null==y||null===(i=y.applicationData)||void 0===i?void 0:i.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(r=y.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 cn(e){var l,o,i,a,r,u,d,s,c,m,v,p,E,f,g,_,h,A;let{t:N,showToast:S,closeToast:b,businessService:y}=e;if(null!=y&&y.includes("NewTL")||null!=y&&y.includes("TL")||null!=y&&y.includes("EDITRENEWAL")){var C;let e="";switch(null==S||null===(C=S.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==S?void 0:S.key)?null==S||null===(l=S.error)||void 0===l?void 0:l.message:N("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==S?void 0:S.key)?null==S||null===(o=S.error)||void 0===o?void 0:o.message:N("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==S?void 0:S.key)?null==S||null===(i=S.error)||void 0===i?void 0:i.message:N("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==S?void 0:S.key)?null==S||null===(a=S.error)||void 0===a?void 0:a.message:N("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==S?void 0:S.key)?null==S||null===(r=S.error)||void 0===r?void 0:r.message:N("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==S?void 0:S.key)?null==S||null===(u=S.error)||void 0===u?void 0:u.message:N("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==S?void 0:S.key)?null==S||null===(d=S.error)||void 0===d?void 0:d.message:N("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==S?void 0:S.key)?null==S||null===(s=S.error)||void 0===s?void 0:s.message:N("ES_"+y+"_"+(null==S||null===(c=S.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:e,onClose:b}))}if(null!=y&&y.includes("BPA")||null!=y&&y.includes("BPA_LOW")||null!=y&&y.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!=y&&y.includes("BPA_OC")?N(e[1]):N(e[0]),l};let l="";switch(null==S||null===(D=S.action)||void 0===D?void 0:D.action){case"REVOCATE":l="error"===(null==S?void 0:S.key)?null==S||null===(m=S.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==S?void 0:S.key)?null==S||null===(v=S.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":l="error"===(null==S?void 0:S.key)?null==S||null===(p=S.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":l="error"===(null==S?void 0:S.key)?null==S||null===(E=S.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":l="error"===(null==S?void 0:S.key)?null==S||null===(f=S.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==S?void 0:S.key)?null==S||null===(g=S.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":l="error"===(null==S?void 0:S.key)?null==S||null===(_=S.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:l="error"===(null==S?void 0:S.key)?null==S||null===(h=S.error)||void 0===h?void 0:h.message:N("ES_"+y+"_"+(null==S||null===(A=S.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:l,onClose:b}))}{var O,T;const e="error"===(null==S?void 0:S.key)?null==S||null===(O=S.error)||void 0===O?void 0:O.message:"ES_"+y+"_"+(null==S||null===(T=S.action)||void 0===T?void 0:T.action)+"_UPDATE_SUCCESS";return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:N(e),onClose:b}))}}function mn(e){var o,a,r,u,d,s,m,v,p,E,f,g,_,h,A,N;let{workflowDetails:S,displayMenu:b,onActionSelect:y,setDisplayMenu:C,businessService:D,forcedActionPrefix:O,ActionBarStyle:T={},MenuStyle:L={}}=e;const{t:I}=i.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===(o=w)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,B=!1,F=(null==S||null===(u=S.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==S||null===(m=S.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",S),Digit.Hooks.useClickOutside(P,()=>{C(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==F?void 0:F.length)||null!=F&&null!==(p=F[0])&&void 0!==p&&null!==(E=p.redirectionUrl)&&void 0!==E&&E.pathname.includes("/pt/property-details/")&&1==(null==F?void 0:F.length)?(B=!1,x=!0):(null==F?void 0:F.length)>0&&(B=!0,x=!1),n.createElement(n.Fragment,null,!(null!=S&&S.isLoading)&&B&&!x&&n.createElement(t.ActionBar,{style:c({},T)},b&&(null!=S&&null!==(f=S.data)&&void 0!==f&&null!==(g=f.actionState)&&void 0!==g&&g.nextActions||null!=S&&null!==(_=S.data)&&void 0!==_&&_.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:F,optionKey:"action",t:I,onSelect:y,style:L}):null,n.createElement(t.SubmitBar,{ref:P,label:I("WF_TAKE_ACTION"),onSubmit:()=>C(!b)})),!(null!=S&&S.isLoading)&&!B&&x&&n.createElement(t.ActionBar,{style:c({},T)},n.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==F||null===(h=F[0])||void 0===h?void 0:h.action,value:null==F||null===(A=F[0])||void 0===A?void 0:A.action,onClick:e=>{y((null==F?void 0:F[0])||{})}},I((O||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==F||null===(N=F[0])||void 0===N?void 0:N.action)))))}const vn=()=>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"})),pn=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(vn,null));function En(e){let{action:l,closeWarningPopup:o}=e;const{t:a}=i.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(pn,{onClick:()=>{o()}}),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:o,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 fn=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}=i.useTranslation(),E=o.useHistory();let{id:f}=o.useParams();const[g,_]=l.useState(!1),[h,A]=l.useState(null),[N,S]=l.useState(!1),[b,y]=l.useState(!1),[C,D]=l.useState(!1),{data:O}=Digit.Hooks.obps.useMDMS(m,"BPA",["RiskTypeComputation"]),{applicationDetails:T,demandData:L,totalDemandTax:I,totalBalanceTax:w,showToast:P,setShowToast:R,isLoading:x,isDataLoading:B,applicationData:F,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:$,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q,propertyId:ee}=e;l.useEffect(()=>{P&&U&&U.revalidate&&U.revalidate()},[P]);const te=r.useQueryClient(),le=()=>{A(null),S(!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(sn,{applicationDetails:T,demandData:L,id:H,workflowDetails:U,isDataLoading:B,applicationData:F,totalDemandTax:I,totalBalanceTax:w,businessService:W,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:$,showTimeLine:X,oldValue:Z,isInfoLabel:J,propertyId:ee,moduleCode:z}),N?n.createElement(Pl,{t:p,action:h,tenantId:s,state:m,id:f,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:le,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const o=function(o,i,a,r,u,d,s,m,v,f,g,_,A,N,S,b,C,D){if(0==(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(a=i.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===(g=f[0])||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(N=A.comment)||void 0===N?void 0:N.length)||0==(null==e||null===(S=e.SewerageConnection)||void 0===S||null===(b=S.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(C=e.BPA)||void 0===C||null===(D=C.comment)||void 0===D?void 0:D.length)){var O,T;"INITIATE"===(null==e||null===(O=e.Licenses)||void 0===O||null===(T=O[0])||void 0===T?void 0:T.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const o=function(o,i,a,r,u){if("BPA"!=(null==e||null===(o=e.BPA)||void 0===o?void 0:o.businessService)||null!=e&&null!==(i=e.BPA)&&void 0!==i&&null!==(a=i.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&&(y(!0),M(e,{onError:(e,t)=>{y(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var n,o,i,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),y(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=h,E.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=l)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=h,E.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=l)&&void 0!==i&&i.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!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(_=g.workflow)&&void 0!==_&&_.action.includes("REJECT")&&R({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,N,S;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!==(N=A.businessService)&&void 0!==N&&N.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===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber)));R({key:"success",action:h}),Q&&setTimeout(Q,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()}y(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const o=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)),o=wt(function(){return y(!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,o,i,a,r,u,d,s,c,m,v;y(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.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(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(d):d(o)}alert(p("Please select Blocking reason"))}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(o&&o.then?o.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,C?n.createElement(En,{action:h,workflowDetails:U,businessService:W,isWarningPop:C,closeWarningPopup:()=>{D(!1)}}):null,n.createElement(cn,{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==F?void 0:F.applicationNo})).then(function(e){var t,l,n,o,i,a;const r=Digit.Utils.obps.calculateRiskType(null==O||null===(t=O.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==T||null===(l=T.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(o=n.plot)||void 0===o?void 0:o.area,null==T||null===(i=T.edcrDetails)||void 0===i||null===(a=i.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,o,i,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===(o=n.additionalDetails)||void 0===o||null===(i=o.selfCertificationCharges)||void 0===i?void 0:i.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(mn,{workflowDetails:U,displayMenu:g,onActionSelect:function(e){var t,l,n;if(console.log("action====",e),console.log("applicationDetails===>",T),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]),"PAY"==e.action&&window.location.href.includes("tl"))E.push("/digit-ui/employee/payment/collect/"+T.applicationData.businessService+"/"+T.applicationData.applicationNumber);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var o,i,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.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===(i=e.redirectionUrll)||void 0===i?void 0:i.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))S(!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 S(!0);A(e),_(!1)},setDisplayMenu:_,businessService:W,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:K}))))};function gn(e){var o;let{t:i,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===(o=a.dropdownData)||void 0===o?void 0:o[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%"}},""+i("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 o;sessionStorage.setItem("NewNOCDocs",JSON.stringify(n)),(o=l[l.length-1])&&p(o.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const _n=e=>n.createElement("h1",{className:"heading-m"},e.label),hn=()=>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"})),An=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(hn,null)),Nn=e=>{var o;let{t:i,action:a,tenantId:r,getEmployees:u,closeModal:d,submitAction:s,applicationDetails:m,applicationData:v,businessService:p,showToast:E,setShowToast:f,closeToast:g,showErrorToast:_,errorOne:A,closeToastOne:N}=e;const[S,b]=l.useState({}),[y,C]=l.useState({}),[D,O]=l.useState([]),[T,L]=l.useState({}),[I,w]=l.useState(null),[P,R]=l.useState(null),[x,B]=l.useState(null),[F,M]=l.useState([]),[k,U]=l.useState(null),H=null==a||null===(o=a.state)||void 0===o?void 0:o.actions,W=(new Set(null==H?void 0:H.flatMap(e=>e.roles)),[...new Set(null==u?void 0:u.flatMap(e=>e.roles))]),{data:j}=Digit.Hooks.useEmployeeSearch(r,{roles:null==W?void 0:W.map(e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{data:z}=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;z&&z["egf-master"]&&M(null===(e=z["egf-master"])||void 0===e?void 0:e.FinancialYear)},[z]);const{data:V}=Digit.Hooks.useCustomMDMS(r,"common-masters",[{name:"Department"}]);function G(e){w(e.target.files[0])}return l.useEffect(()=>{if(j&&V){var e;const t=V["common-masters"].Department;O(null==j||null===(e=j.Employees)||void 0===e?void 0:e.map(e=>{var l,n,o;const i=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)===i);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[j,V]),l.useEffect(()=>{!function(){try{B(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)B(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",I,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?R(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):B(i("CS_FILE_UPLOAD_ERROR"))})},function(){B(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[I]),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&&b((e=>{let{t:l,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SENDBACK"!=(null==o?void 0:o.action)||(c=!1),o.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==o?void 0:o.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:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"},validation:{pattern:h("Comments"),required:!0,title:l("WF_COMMON_COMMENTS_ERROR")}},"APPROVE"===(null==o?void 0:o.action)?{label:l("WF_CONDITIONAL_COMMENTS_LABEL"),type:"textarea",populators:{name:"conditionalComments"},validation:{pattern:h("Comments"),required:!1,title:l("WF_COMMON_COMMENTS_ERROR")}}:null,{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")})}].filter(Boolean)}]}})({t:i,action:a,approvers:D,selectedApprover:T,setSelectedApprover:L,selectFile:G,uploadedFile:P,setUploadedFile:R,businessService:p}))},[a,D,F,k,P]),a&&S.form?n.createElement(t.Modal,{headerBarMain:n.createElement(_n,{label:i(S.label.heading)}),headerBarEnd:n.createElement(An,{onClick:d}),actionCancelLabel:i(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:S.form,className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l;let n=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==a?void 0:a.action);null!=a&&a.isTerminateState&&(n=!0);const o=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim(),r=null==e||null===(l=e.conditionalComments)||void 0===l?void 0:l.trim();let u=o;return"APPROVE"===(null==a?void 0:a.action)&&r&&(u=o+" , "+r),"APPROVE"===(null==a?void 0:a.action)||"REJECT"===(null==a?void 0:a.action)||null!=T&&T.uuid?n&&!o?(setTimeout(()=>{g()},2e3),void f({key:"true",error:!0,message:i("COMMON_COMMENTS_REQUIRED_LABEL")})):(v=c({},v,{action:null==a?void 0:a.action,comment:u,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:P?[{documentType:null==I?void 0:I.type,fileName:null==I?void 0:I.name,documentUid:P,filestoreId:P,documentAttachment:P}]:null}),void s({Licenses:[v]})):(setTimeout(()=>{g()},2e3),void f({key:"true",error:!0,message:i("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")}))},defaultValues:y,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:g,isDleteBtn:!0}),_&&n.createElement(t.Toast,{error:!0,label:A,isDleteBtn:!0,onClose:N})):n.createElement(t.Loader,null)},Sn=e=>{let{documents:o}=e;const{t:a}=i.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==o?void 0:o.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==o?void 0:o.length)>0}),s=null==o?void 0:o.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}))},bn=e=>{let{feeDataWithTotal:o,disable:i,feeData:a,handleAdjustedAmountChange:r,t:u,handleRemarkChange:d,onAdjustedAmountBlur:s,feeHistory:c,timeObj:m}=e;const[v,p]=l.useState(!1);return console.log("feeHistory",c),console.log("timeObj",m),console.log("feeHistory keys",Object.keys(c||{})),n.createElement("div",{className:"noc-table-container"},n.createElement("table",{className:"customTable table-border-style"},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",null,u("BPA_TAXHEAD_CODE")),n.createElement("th",null,u("BPA_AMOUNT")),n.createElement("th",null,u("BPA_REMARKS")))),n.createElement("tbody",null,o.map((e,l)=>{var o,c,m,v,p,E;return n.createElement("tr",{key:e.index||l},n.createElement("td",null,u(e.title)||u("CS_NA")),n.createElement("td",null,"NOC_TOTAL"===(null==e?void 0:e.taxHeadCode)?"":n.createElement(t.TextInput,{t:u,type:"number",isMandatory:!1,value:null!=(o=null!=(c=null===(m=a[e.index])||void 0===m?void 0:m.adjustedAmount)?c:e.amount)?o:"",onChange:t=>r(e.index,t.target.value),disable:i,step:1,onBlur:s})),n.createElement("td",null,"NOC_TOTAL"===(null==e?void 0:e.taxHeadCode)?n.createElement("div",null,n.createElement("strong",null,e.grandTotal),n.createElement("div",{style:{fontSize:"0.9em",color:"#555",marginTop:"4px"}},(e=>{if(null==e||""===e)return"Zero Rupees";const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],l=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],n=["","Thousand","Lakh","Crore"],o=e=>e<20?t[e]:e<100?l[Math.floor(e/10)]+(e%10?" "+t[e%10]:""):t[Math.floor(e/100)]+" Hundred"+(e%100?" "+o(e%100):""),i=e=>{if(!e)return"";let t=[e%1e3],l="";for(e=Math.floor(e/1e3);e;)t.push(e%100),e=Math.floor(e/100);for(let e=t.length-1;e>=0;e--)t[e]&&(l+=o(t[e])+" "+n[e]+" ");return l.trim()};let[a,r]=e.toString().split(".").map(e=>+e||0);return(a?i(a)+" Rupees":"")+(r?(a?" and ":"")+i(r)+" Paise":"")||"Zero Rupees"})(e.grandTotal))):n.createElement(t.TextInput,{t:u,type:"text",isMandatory:!0,value:null!=(v=null!=(p=null===(E=a[e.index])||void 0===E?void 0:E.remark)?p:e.remark)?v:"",onChange:t=>d(e.index,t.target.value,e.amount),disable:i,style:{width:"100%",padding:"4px",border:"1px solid #ccc",borderRadius:"4px"}})))}))),c&&Object.keys(c).length>0&&n.createElement("div",{style:{marginTop:"16px"}},n.createElement("div",{onClick:()=>p(!v),style:{cursor:"pointer"}},n.createElement(t.CardSubHeader,null,u("FEE_HISTORY")," ",v?"▲":"▼")),v&&n.createElement(l.Fragment,null,m&&n.createElement("div",{style:{marginBottom:"8px",fontStyle:"italic"}},u("TOTAL_TIME_TAKEN"),": ",null==m?void 0:m.days," ",u("DAYS")," ",null==m?void 0:m.hours," ",u("HOURS")," ",null==m?void 0:m.minutes," ",u("MINUTES")," ",null==m?void 0:m.seconds," ",u("SECONDS")),n.createElement("table",{className:"customTable table-border-style",style:{marginTop:"8px"}},n.createElement("thead",null,n.createElement("tr",null,Object.keys(c).map(e=>n.createElement("th",{key:e},u(e))))),n.createElement("tbody",null,Array.from({length:Math.max(...Object.values(c).map(e=>e.length))}).map((e,t)=>{const l=Math.max(...Object.values(c).map(e=>e.length))-1-t;return n.createElement("tr",{key:t},Object.entries(c).map(e=>{let[t,o]=e;const i=o[l];return n.createElement("td",{key:t},i?n.createElement("table",{className:"customTable table-border-style"},n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",null,n.createElement("strong",null,u("FEE"))),n.createElement("td",null,i.estimateAmount)),n.createElement("tr",null,n.createElement("td",null,n.createElement("strong",null,u("REMARK"))),n.createElement("td",null,i.remarks||u("CS_NA"))),n.createElement("tr",null,n.createElement("td",null,n.createElement("strong",null,u("LAST_UPDATED_BY"))),n.createElement("td",null,i.who||u("UNKNOWN"))))):u("CS_NA"))}))}))))))},yn=e=>{var o,a,r,u,d;let{formData:s,feeAdjustments:m=[],setFeeAdjustments:v=(()=>{}),disable:p=!1}=e;const{t:E}=i.useTranslation(),[f,g]=l.useState(null),_=Digit.ULBService.getStateId(),[h,A]=l.useState(null);console.log("savedCalc",s),l.useEffect(()=>{console.log("Component mounted. Initial feeAdjustments:",m)},[]);const N=e=>{var t,l,n,o,i,a,r,u;const d=null==C||null===(t=C.Calculation)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.taxHeadEstimates)||void 0===n?void 0:n.find(t=>t.taxHeadCode===e),c=null==s||null===(o=s.calculations)||void 0===o?void 0:o.find(t=>t.taxHeadCode===e);return{originalEstimate:null!=(i=null!=(a=null==d?void 0:d.estimateAmount)?a:null==c?void 0:c.estimateAmount)?i:0,originalRemark:null!=(r=null!=(u=null==d?void 0:d.remarks)?u:null==c?void 0:c.remarks)?r:""}},S=l.useMemo(()=>{var e,t,l,n,o,i,a,r,u,d,m,v,p,E,f,g,_,h,A,N,S,b,y,C,D,O,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$;return{CalculationCriteria:[{applicationNumber:null==s||null===(e=s.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,tenantId:null==s||null===(n=s.apiData)||void 0===n||null===(o=n.Noc)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.tenantId,NOC:c({},null==s||null===(a=s.apiData)||void 0===a||null===(r=a.Noc)||void 0===r?void 0:r[0],{nocDetails:c({},null===(u=s.apiData)||void 0===u||null===(d=u.Noc)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.nocDetails,{additionalDetails:c({},null==s||null===(v=s.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==s?void 0:s.applicationDetails,{applicantGender:(null==s||null===(g=s.applicationDetails)||void 0===g||null===(_=g.applicantGender)||void 0===_?void 0:_.code)||(null==s||null===(h=s.applicationDetails)||void 0===h?void 0:h.applicantGender)||""}),siteDetails:c({},null==s?void 0:s.siteDetails,{ulbName:(null==s||null===(A=s.siteDetails)||void 0===A||null===(N=A.ulbName)||void 0===N?void 0:N.name)||(null==s||null===(S=s.siteDetails)||void 0===S?void 0:S.ulbName)||"",roadType:(null==s||null===(b=s.siteDetails)||void 0===b||null===(y=b.roadType)||void 0===y?void 0:y.name)||(null==s||null===(C=s.siteDetails)||void 0===C?void 0:C.roadType)||"",buildingStatus:(null==s||null===(D=s.siteDetails)||void 0===D||null===(O=D.buildingStatus)||void 0===O?void 0:O.name)||(null==s||null===(T=s.siteDetails)||void 0===T?void 0:T.buildingStatus)||"",isBasementAreaAvailable:(null==s||null===(L=s.siteDetails)||void 0===L||null===(I=L.isBasementAreaAvailable)||void 0===I?void 0:I.code)||(null==s||null===(w=s.siteDetails)||void 0===w?void 0:w.isBasementAreaAvailable)||"",district:(null==s||null===(P=s.siteDetails)||void 0===P||null===(R=P.district)||void 0===R?void 0:R.name)||(null==s||null===(x=s.siteDetails)||void 0===x?void 0:x.district)||"",zone:(null==s||null===(B=s.siteDetails)||void 0===B||null===(F=B.zone)||void 0===F?void 0:F.name)||(null==s||null===(M=s.siteDetails)||void 0===M?void 0:M.zone)||"",specificationBuildingCategory:(null==s||null===(k=s.siteDetails)||void 0===k||null===(U=k.specificationBuildingCategory)||void 0===U?void 0:U.name)||(null==s||null===(H=s.siteDetails)||void 0===H?void 0:H.specificationBuildingCategory)||"",specificationNocType:(null==s||null===(W=s.siteDetails)||void 0===W||null===(j=W.specificationNocType)||void 0===j?void 0:j.name)||(null==s||null===(z=s.siteDetails)||void 0===z?void 0:z.specificationNocType)||"",specificationRestrictedArea:(null==s||null===(V=s.siteDetails)||void 0===V||null===(G=V.specificationRestrictedArea)||void 0===G?void 0:G.code)||(null==s||null===(Y=s.siteDetails)||void 0===Y?void 0:Y.specificationRestrictedArea)||"",specificationIsSiteUnderMasterPlan:(null==s||null===(q=s.siteDetails)||void 0===q||null===(K=q.specificationIsSiteUnderMasterPlan)||void 0===K?void 0:K.code)||(null==s||null===($=s.siteDetails)||void 0===$?void 0:$.specificationIsSiteUnderMasterPlan)||""})})})})}]}},[s]),b=l.useMemo(()=>function(e,t){void 0===e&&(e=[]);let{newestFirst:l=!0,limit:n=null}=void 0===t?{}:t;const o={};return Array.isArray(e)?(e.forEach(e=>{const t=(null==e?void 0:e.updatedBy)||null;((null==e?void 0:e.taxHeadEstimates)||[]).forEach(l=>{var n,i,a;null!=l&&l.taxHeadCode&&(o[l.taxHeadCode]=o[l.taxHeadCode]||[],o[l.taxHeadCode].push({who:t,estimateAmount:null!=(n=null==l?void 0:l.estimateAmount)?n:null,remarks:null!=(i=null==l?void 0:l.remarks)?i:null,isLatest:null!=(a=null==e?void 0:e.isLatest)&&a}))})}),Object.keys(o).forEach(e=>{l&&o[e].sort((e,t)=>(t.when||0)-(e.when||0)),n&&"number"==typeof n&&(o[e]=o[e].slice(0,n))}),o):o}(((null==s?void 0:s.calculations)||[]).filter(e=>((null==e?void 0:e.taxHeadEstimates)||[]).some(e=>(null==e?void 0:e.estimateAmount)>0)),{newestFirst:!0}),[null==s?void 0:s.calculations]);console.log("[payload] built with formData:",s),console.log("[payload] CalculationCriteria:",S.CalculationCriteria),console.log("payload for calc apiiiii",S);const{isLoading:y,data:C,revalidate:D}=Digit.Hooks.noc.useNOCFeeCalculator({payload:S},{enabled:!!S});console.log("[useNOCFeeCalculator] isLoading:",y,"data:",C),console.log("data from calc api",C),console.log("Raw API taxHeadEstimates:",null==C||null===(o=C.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates),null==C||null===(r=C.Calculation)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.taxHeadEstimates)||void 0===d||d.forEach((e,t)=>{console.log("API row "+t+": taxHead="+e.taxHeadCode+", estimate="+e.estimateAmount+", remarks="+e.remarks)});const[O,T]=l.useState(null);l.useEffect(()=>{bt.isEqual(O,null==s?void 0:s.siteDetails)||(console.log("[revalidate] siteDetails changed. Old:",O,"New:",null==s?void 0:s.siteDetails),D(),T(null==s?void 0:s.siteDetails))},[null==s?void 0:s.siteDetails]),l.useEffect(()=>{var e,t;null!=C&&null!==(e=C.Calculation)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.taxHeadEstimates&&v(function(e){void 0===e&&(e=[]);const t=(e||[]).reduce((e,t)=>(null!=t&&t.taxHeadCode&&(e[t.taxHeadCode]=t),e),{});return C.Calculation[0].taxHeadEstimates.map(e=>{var l,n,o,i,a,r,u,d,c;const m=null==s||null===(l=s.calculations)||void 0===l?void 0:l.find(t=>t.taxHeadCode===e.taxHeadCode),v=t[e.taxHeadCode]||{},p=!!v.edited;return{taxHeadCode:e.taxHeadCode,category:e.category,adjustedAmount:p?v.adjustedAmount:null!=(n=null!=(o=e.estimateAmount)?o:null==m?void 0:m.estimateAmount)?n:0,remark:p?null!=(i=v.remark)?i:"":null!=(a=null!=(r=e.remarks)?r:null==m?void 0:m.remarks)?a:"",filestoreId:void 0!==(null==v?void 0:v.filestoreId)?v.filestoreId:null!=(u=null!=(d=null==m?void 0:m.filestoreId)?d:e.filestoreId)?u:null,onDocumentLoading:!1,documentError:null,edited:null!=(c=v.edited)&&c}})})},[C]),l.useEffect(()=>{if(s){var e,t,l,n,o,i,a,r,u;console.log("formData",s);const d=null==s||null===(e=s.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.nocDetails)||void 0===n||null===(o=n.additionalDetails)||void 0===o?void 0:o.SubmittedOn,c=null==s||null===(i=s.apiData)||void 0===i||null===(a=i.Noc)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.auditDetails)||void 0===u?void 0:u.lastModifiedTime;console.log("submiited on , "+d+" , lastModified , "+c);const m=function(e){const t=Math.floor(e/1e3);return{days:Math.floor(t/86400),hours:Math.floor(t%86400/3600),minutes:Math.floor(t%3600/60),seconds:t%60}}(d&&c?c-d:null);A(m)}},[s]);const L=l.useMemo(()=>{var e,t;if(null==C||null===(e=C.Calculation)||void 0===e||null===(t=e[0])||void 0===t||!t.taxHeadEstimates)return[];const l=C.Calculation[0].taxHeadEstimates.map((e,t)=>{var l,n,o,i,a,r;const u=null!=(l=null===(n=m[t])||void 0===n?void 0:n.adjustedAmount)?l:e.estimateAmount,d=null!=(o=null!=(i=null===(a=m[t])||void 0===a?void 0:a.remark)?i:e.remarks)?o:"";return console.log("Row "+t+": taxHead="+e.taxHeadCode+", estimate="+e.estimateAmount+", adjusted="+u+", remark="+d),{index:t,id:"tax-"+t,title:E(e.taxHeadCode),taxHeadCode:e.taxHeadCode,amount:e.estimateAmount||0,category:e.category,adjustedAmount:u,remark:d,filestoreId:(null===(r=m[t])||void 0===r?void 0:r.filestoreId)||null}});console.log("[applicationFeeDataWithTotal] built rows:",l);const n=l.reduce((e,t)=>e+(t.adjustedAmount||0),0);return console.log("[applicationFeeDataWithTotal] grand total:",n),console.log("Final rows with total:",l),[...l,{id:"total",taxHeadCode:"NOC_TOTAL",title:E("NOC_TOTAL"),amount:l.reduce((e,t)=>e+(t.adjustedAmount||0),0),adjustedAmount:"",grandTotal:n}]},[C,E,m]);return y?n.createElement(t.Loader,null):n.createElement("div",null,y?n.createElement(t.Loader,null):n.createElement(l.Fragment,null,n.createElement(bn,{feeDataWithTotal:L,feeData:m,disable:p,isEmployee:!p,handleAdjustedAmountChange:(e,t)=>{var l;const n=""===t?null:Number(t),o=null==m||null===(l=m[e])||void 0===l?void 0:l.taxHeadCode,{originalEstimate:i,originalRemark:a}=N(o);null!==n&&n<0?g({error:!0,message:"Adjusted_Amount_More_Than_Ammount"}):v(t=>t.map((t,l)=>l!==e?t:c({},t,(null===n?0===i:n===i)?{adjustedAmount:n,edited:!1,remark:a}:{adjustedAmount:n,edited:!0,remark:""})))},handleRemarkChange:(e,t)=>{var l,n,o;const i=null==m||null===(l=m[e])||void 0===l?void 0:l.taxHeadCode,{originalEstimate:a,originalRemark:r}=N(i),u=(null!=(n=null==m||null===(o=m[e])||void 0===o?void 0:o.adjustedAmount)?n:0)!==a,d=(null!=t?t:"").trim()!==(null!=r?r:"").trim();v(l=>l.map((l,n)=>n===e?c({},l,{remark:t,edited:u||d}):l))},handleFileUpload:function(e,t){try{const l=t.target.files[0],n=wt(function(){return v(t=>t.map((t,l)=>l===e?c({},t,{onDocumentLoading:!0}):t)),Promise.resolve(Digit.UploadServices.Filestorage("noc-upload",l,_)).then(function(t){var l,n;(null==t||null===(l=t.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?v(l=>l.map((l,n)=>n===e?c({},l,{filestoreId:t.data.files[0].fileStoreId,onDocumentLoading:!1,documentError:null}):l)):g({error:!0,message:"PT_FILE_UPLOAD_ERROR"})})},function(e){g({error:!0,message:"PT_FILE_UPLOAD_ERROR"}),console.log("err in file upload",e)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},handleFileDelete:e=>{v(t=>t.map((t,l)=>l===e?c({},t,{filestoreId:null}):t))},routeTo:function(e,t){return Promise.resolve(function(e){try{return e?Promise.resolve(Digit.UploadServices.Filefetch([e],_)).then(function(t){var l;return(null==t||null===(l=t.data)||void 0===l?void 0:l[e])||null}):Promise.resolve()}catch(e){return Promise.reject(e)}}(e)).then(function(e){e&&window.open(e)})},t:E,onAdjustedAmountBlur:()=>{},feeHistory:b,timeObj:h}),f&&n.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,success:null==f?void 0:f.success,label:E(null==f?void 0:f.message),isDleteBtn:!0,onClose:()=>g(null)})))},Cn=e=>{let{ownerFileStoreId:o,ownerName:a}=e;const r=Digit.ULBService.getStateId(),[u,d]=(i.useTranslation(),l.useState(null)),[s,c]=l.useState(null);return l.useEffect(()=>{!function(){try{const e=function(){if(o)return Promise.resolve(Digit.UploadServices.Filefetch([o],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)}}()},[o]),n.createElement("div",{style:{padding:"20px 0px"}},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)}}))},Dn="__googleMapsScriptId";var On;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(On||(On={}));class Tn{constructor(e){let{apiKey:t,channel:l,client:n,id:o=Dn,libraries:i=[],language:a,region:r,version:u,mapIds:d,nonce:s,retries:c=3,url:m="https://maps.googleapis.com/maps/api/js"}=e;if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=u,this.apiKey=t,this.channel=l,this.client=n,this.id=o||Dn,this.libraries=i,this.language=a,this.region=r,this.mapIds=d,this.nonce=s,this.retries=c,this.url=m,Tn.instance){if(!function e(t,l){if(t===l)return!0;if(t&&l&&"object"==typeof t&&"object"==typeof l){if(t.constructor!==l.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=l.length)return!1;for(o=n;0!=o--;)if(!e(t[o],l[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===l.source&&t.flags===l.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===l.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===l.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(l).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(l,i[o]))return!1;for(o=n;0!=o--;){var a=i[o];if(!e(t[a],l[a]))return!1}return!0}return t!=t&&l!=l}(this.options,Tn.instance.options))throw new Error("Loader must not be called again with different options. "+JSON.stringify(this.options)+" !== "+JSON.stringify(Tn.instance.options));return Tn.instance}Tn.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}get status(){return this.errors.length?On.FAILURE:this.done?On.SUCCESS:this.loading?On.LOADING:On.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),this.libraries.length>0&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="®ion="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(l=>{l?t(l.error):e(window.google)})})}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const e=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=e,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in "+e+" ms."),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}const Ln=e=>(l.useEffect(()=>{!function(){try{const t=e=>{(e=>{var t,l;const n=window.Digit.Utils.browser.isMobile();if(0===(null==e?void 0:e.length))return;const o=new window.google.maps.Map(document.getElementById("map"),{center:{lat:null===(t=e[0])||void 0===t?void 0:t.latitude,lng:null===(l=e[0])||void 0===l?void 0:l.longitude},zoom:15,mapTypeId:"roadmap"});e.forEach((e,t)=>{const l=new window.google.maps.Marker({map:o,title:"SITE "+(t+1),position:{lat:null==e?void 0:e.latitude,lng:null==e?void 0:e.longitude}}),i=new window.google.maps.InfoWindow({content:'<div className="obps-autocomplete-font-size">SITE '+(t+1)+"</div>"});n?l.addListener("click",()=>{i.open(o,l)}):(l.addListener("mouseover",()=>i.open(o,l)),l.addListener("mouseout",()=>i.close()))})})(e)};(e=>{var t;const l=null===(t=globalConfigs)||void 0===t?void 0:t.getConfig("GMAPS_API_KEY");new Tn({apiKey:l,version:"weekly",libraries:["places"]}).load().then(()=>{e&&e()}).catch(e=>{})})(()=>{t(e.position)}),Promise.resolve()}catch(e){return Promise.reject(e)}}()},[null==e?void 0:e.position]),n.createElement("div",{className:"map-wrap"},n.createElement("div",{id:"map",className:"map"}))),In=e=>{let{page:t=!1}=e;const l={display:"flex",justifyContent:"center",alignItems:"center"},o=c({},l,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",zIndex:9999}),i=c({},l,{minHeight:"100px",width:"100%",position:"relative"});return n.createElement("div",{style:t?o:i},n.createElement("div",{style:{width:"64px",height:"64px",border:"8px solid #1976d2",borderTop:"8px solid transparent",borderRadius:"50%",animation:"spin 1.2s linear infinite"}}),n.createElement("style",null,"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "))},wn=e=>{var o,a,r,u,d,s,m,v,p,E,f,g,_,h,A,N,S;const{t:b}=i.useTranslation(),y=l.useRef(),[C,D]=l.useState(!1),[O,T]=l.useState(!1),[L,I]=l.useState(null),w=Digit.SessionStorage.get("userType");let P={};const R=Digit.ULBService.getStateId(),x=null===(o=window)||void 0===o||null===(a=o.Digit)||void 0===a||null===(r=a.Utils)||void 0===r||null===(u=r.browser)||void 0===u?void 0:u.isMobile();function B(t){null!=e&&e.customOpen?null==e||e.customOpen(t):F(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!=y&&null!==(d=y.current)&&void 0!==d&&d.value&&(y.current.value="",e.onDelete(),D(!1)),l.useEffect(()=>{var t,l;(null==y||null===(t=y.current)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)<=0&&null!==L&&(y.current.value="",e.onDelete())},[null==y||null===(s=y.current)||void 0===s?void 0:s.files]),l.useEffect(()=>{var e,t,l,n;null!=y&&null!==(e=y.current)&&void 0!==e&&null!==(t=e.files)&&void 0!==t&&t[0]?(D(!0),I(null==y||null===(l=y.current)||void 0===l||null===(n=l.files)||void 0===n?void 0:n[0])):D(!1)},[null==e?void 0:e.message]);const F=function(t){try{if(0===(null==t?void 0:t.length))return Promise.resolve();T(!0);const l=wt(function(){return Promise.resolve(Digit.UploadServices.Filefetch([t],R)).then(function(l){if(T(!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(){T(!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,o)=>{var i;const a=l[1];return n.createElement("div",{className:"tag-container",style:P?null===(i=P)||void 0===i?void 0:i.tagContainerStyles:null},n.createElement(t.RemoveableTag,{extraStyles:P,key:o,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===(g=P)||void 0===g?void 0:g.tagContainerStyles},n.createElement(t.SubmitBar,{onSubmit:()=>{B(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")}))),n.createElement("input",{className:e.disabled?"disabled":"input-mirror-selector-button",style:P?c({},null===(_=P)||void 0===_?void 0:_.inputStyles,null==e?void 0:e.inputStyles):c({},null==e?void 0:e.inputStyles),ref:y,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:()=>{B(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")})):n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width")+" "+(e.disabled?" disabled":""),style:null!==(N=P)&&void 0!==N&&N.uploadFile?null===(S=P)||void 0===S?void 0:S.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}))},Pn=e=>{var o,i,a;let{t:r,config:u,onSelect:d,formData:s,data:m,isLoading:v,error:p,setError:E,customOpen:f}=e;const[g,_]=l.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]);console.log("documents for field insepecttion in challan",g),console.log("data for challandocs",m);const[h,A]=l.useState(!0),[N,S]=l.useState(!1),b=(window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY"),()=>{let e;e=c({},s.documents,{documents:g}),d(u.key,e)});return l.useEffect(()=>{var e,t;let l=0;null==m||null===(e=m.FieldInspection)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==g||g.map(l=>{e.required&&null!=l&&l.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(l+=1)}),A("0"!=l&&0!=l||!((null==g?void 0:g.length)>0))},[g,N]),l.useEffect(()=>{console.log("documents check again",g)},[g]),n.createElement("div",null,v?n.createElement(In,null):n.createElement(t.FormStep,c({t:r,config:u,onSelect:b},null!=m&&m.FieldInspection?{}:{onSkip:()=>d()},{isDisabled:h,onAdd:function(){}}),null==m||null===(i=m.FieldInspection)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>n.createElement(Rn,{key:t,document:e,t:r,error:p,setError:E,setDocuments:_,documents:g,setCheckRequiredFields:S,handleSubmit:b,customOpen:f})),p&&n.createElement(t.Toast,{isDleteBtn:!0,label:p,onClose:()=>E(null),error:!0})))};function Rn(e){let{t:o,document:i,setDocuments:a,setError:r,documents:d,action:s,formData:m,handleSubmit:v,id:p,customOpen:E}=e;const f=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],[g,_]=(Digit.ULBService.getCurrentTenantId(),l.useState(()=>{var e;if(f){var t,l;const e=null==i||null===(t=i.dropdownData)||void 0===t?void 0:t.find(e=>e.code===f.documentType);return e?c({},e,{i18nKey:null===(l=e.code)||void 0===l?void 0:l.replaceAll(".","_")}):{}}if(1===(null==i||null===(e=i.dropdownData)||void 0===e?void 0:e.length)){var n;const e=i.dropdownData[0];return c({},e,{i18nKey:null===(n=e.code)||void 0===n?void 0:n.replaceAll(".","_")})}return{}})),[h,A]=l.useState(null),[N,S]=l.useState(()=>(null==f?void 0:f.filestoreId)||null);function b(e,t){void 0===t&&(t={}),a(function(l){void 0===l&&(l=[]);const n=l.map(l=>(null==l?void 0:l.documentType)===(null==e?void 0:e.code)?c({},l,t):l);return n.some(t=>(null==t?void 0:t.documentType)===(null==e?void 0:e.code))||n.push(c({documentType:null==e?void 0:e.code,filestoreId:null,documentUid:null},t)),n})}function y(e,t){const[l,n,o]=e;let i=l+n/60+o/3600;return"S"!==t&&"W"!==t||(i*=-1),i}const{dropdownData:C}=i;var D=C;const[O,T]=l.useState(!1),[L,I]=l.useState(!1);return l.useEffect(()=>{null!=g&&g.code&&a(e=>e.map(e=>(null==e?void 0:e.documentType)===(null==g?void 0:g.code)?c({},e,{filestoreId:N,documentUid:N}):e))},[N,g]),l.useEffect(()=>{(null==d?void 0:d.length)>0&&v()},[d]),l.useEffect(()=>{if("update"===s){var e,t;const l=null==m||null===(e=m.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==i?void 0:i.code))[0],n=D.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?(_(n),S(null==l?void 0:l.fileStoreId)):T(!0)}},[]),l.useEffect(()=>{var e;null!=i&&i.hasDropdown||_({code:null==i?void 0:i.code,i18nKey:null==i||null===(e=i.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),l.useEffect(()=>{!function(){try{r(null);const e=function(){if(h){I(!0);const e=wt(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",h,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;I(!1),(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?S(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):r(o("CS_FILE_UPLOAD_ERROR"))})},function(){I(!1),r(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[h]),l.useEffect(()=>{O&&S(null)},[O]),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement(t.LabelFieldPair,{style:{display:"inline"}},n.createElement(t.CardLabel,{style:{marginBottom:"8px",width:"auto"}},o(null==i?void 0:i.code)," ",n.createElement("span",{style:{color:"red"}}," ",(null==i?void 0:i.required)&&" *")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(wn,{onUpload:function(e){const t=e.target.files[0];if(!t)return;const l=t.type.toLowerCase();if(l.includes("image/jpeg")||l.includes("image/jpg")||l.includes("image/png")){const e=new FileReader;e.onload=function(){const l=new Image;l.onload=function(){u.getData(l,function(){const e=u.getTag(this,"GPSLatitude"),l=u.getTag(this,"GPSLongitude"),n=u.getTag(this,"GPSLatitudeRef")||"N",o=u.getTag(this,"GPSLongitudeRef")||"E";let i=null,a=null;e&&l?(i=y(e,n),a=y(l,o),console.log("📍 Latitude:",i,"Longitude:",a),A(t),b(g,{latitude:i,longitude:a})):alert("⚠️ No GPS data found in image.")})},l.src=e.result},e.readAsDataURL(t)}else console.log("📄 Non-image file uploaded, skipping EXIF read"),A(t),b(g,{})},onDelete:()=>{S(null)},id:p,message:N?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!N,uploadedFile:N,customOpen:E}))),L&&n.createElement(In,{page:!0}))}const xn=e=>{let{siteImages:a,setSiteImages:r,customOpen:u}=e;const{t:d}=i.useTranslation(),{pathname:s}=o.useLocation(),c=(s.includes("/modify-application/"),Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[m,v]=l.useState(null),{data:p,isLoading:E}=Digit.Hooks.useCustomMDMS(c,"FieldInspection",[{name:"Documents"}]);console.log("docData here in fieldinspe",p);const f=l.useMemo(()=>{var e;if(null!=a&&a.documents&&(null==a?void 0:a.documents.length)>0)return null==a||null===(e=a.documents)||void 0===e?void 0:e.map(e=>({latitude:(null==e?void 0:e.latitude)||"",longitude:(null==e?void 0:e.longitude)||""}))},[a]);return n.createElement("div",null,n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},d("SITE_INPECTION_IMAGES")),n.createElement("div",{style:{marginTop:"20px"}},n.createElement(Pn,{t:d,config:{key:"documents"},onSelect:(e,t)=>{r(t)},userType:"CITIZEN",formData:{documents:a},setError:v,error:m,clearErrors:()=>{},formState:{},data:p,isLoading:E,customOpen:u})),(null==f?void 0:f.length)>0&&n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},d("SITE_INSPECTION_IMAGES_LOCATIONS")),n.createElement(Ln,{position:f}))))},Bn=e=>{let{filestoreId:o,documentType:a,coordinates:r}=e;const u=Digit.ULBService.getStateId(),{t:d}=i.useTranslation(),[s,c]=l.useState(null),[m,v]=l.useState(null);return l.useEffect(()=>{!function(){try{const e=function(){if(o)return Promise.resolve(Digit.UploadServices.Filefetch([o],u)).then(function(e){var t,l;null!=e&&null!==(t=e.data)&&void 0!==t&&t.fileStoreIds&&c(null===(l=e.data.fileStoreIds[0])||void 0===l?void 0:l.url)})}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[o]),n.createElement("div",{style:{padding:"20px 0px"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"10px",padding:"0px 20px"}},n.createElement("div",{style:{textAlign:"start"}},n.createElement("div",null,n.createElement("span",null,d(null==a?void 0:a.replaceAll(".","_")))),n.createElement("img",{src:s,alt:d(null==a?void 0:a.replaceAll(".","_")),style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:s?"pointer":"default"},onClick:()=>s&&v(s)}),n.createElement("div",null,"Latitude - ","OWNER.SITEPHOTOGRAPHONE"===a?null==r?void 0:r.Latitude1:null==r?void 0:r.Latitude2),n.createElement("div",null,"Longitude - ","OWNER.SITEPHOTOGRAPHONE"===a?null==r?void 0:r.Longitude1:null==r?void 0:r.Longitude2))),m&&n.createElement(t.ImageViewer,{imageSrc:m,onClose:()=>{v(null)}}))},Fn=function(e,t,l,n){try{var o,i,a;const u=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),d=e=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const l=e%10,n=e%100;let o="th";return(n<11||n>13)&&(1===l?o="st":2===l?o="nd":3===l&&(o="rd")),""+e+o+" "+t("NOC_FLOOR_AREA_LABEL")},s=(null==e||null===(o=e.nocDetails)||void 0===o?void 0:o.additionalDetails)||{},m=(null==s?void 0:s.siteDetails)||{},v=null!=s&&s.SubmittedOn?null===(i=new Date(Number(null==s?void 0:s.SubmittedOn)))||void 0===i?void 0:i.toLocaleDateString("en-GB"):"";let p=[],E=(null==m?void 0:m.basementArea)||"NA",f=(null==m?void 0:m.totalFloorArea)||"NA";var r;p="Built Up"===(null==m?void 0:m.buildingStatus)?null===(r=(null==m?void 0:m.floorArea)||[])||void 0===r?void 0:r.map((e,t)=>c({},e,{floorNo:d(t)})):[{floorNo:"Floor No NA",value:"NA"}];const g=["NOC_SANCTION_THREE","NOC_SANCTION_FOUR","NOC_SANCTION_FIVE","NOC_SANCTION_SIX","NOC_SANCTION_SEVEN","NOC_SANCTION_EIGHT"],_="Provisional"===(null==m?void 0:m.specificationNocType)?g:g.slice(1),h=null==_?void 0:_.map((e,l)=>({number:3+l,text:t(e)}));return Promise.resolve({Noc:[c({},e,{nocDetails:c({},e.nocDetails,{additionalDetails:c({},null===(a=e.nocDetails)||void 0===a?void 0:a.additionalDetails,{SubmittedOn:v,siteDetails:c({},m,{floorArea:p,basementArea:E,totalFloorArea:f})})}),currentDate:u,sanctionTerms:h},l,{approverComment:n})]})}catch(e){return Promise.reject(e)}},Mn=e=>{let{filestoreId:o,documentType:a,documentName:r,latitude:d,longitude:s}=e;const c=Digit.ULBService.getStateId(),{t:m}=i.useTranslation(),[v,p]=l.useState(null),[E,f]=l.useState(null),[g,_]=l.useState(null);l.useEffect(()=>{if(o){const e=window.origin+"/filestore/v1/files/id?fileStoreId="+o+"&tenantId="+c;p(e),h(e)}},[o,c]);const h=e=>{const t=new Image;t.onload=function(){u.getData(t,function(){const e=u.getTag(this,"DateTimeOriginal");e&&_(e)})},t.src=e};return n.createElement("div",{style:{padding:"20px 0px"}},n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",marginTop:"10px",padding:"0px 20px"}},n.createElement("span",{style:{fontWeight:"500"}},m(null==a?void 0:a.replaceAll(".","_"))),n.createElement("img",{src:v,alt:r||m(null==a?void 0:a.replaceAll(".","_")),style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:v?"pointer":"default",marginTop:"8px"},onClick:()=>v&&f(v)}),(d||s)&&n.createElement("div",{style:{marginTop:"8px",fontSize:"12px",color:"#666"}},d&&n.createElement("span",null,"Lat: ",d),d&&s&&n.createElement("span",null,", "),s&&n.createElement("span",null,"Long: ",s)),g&&n.createElement("div",{style:{marginTop:"4px",fontSize:"12px",color:"#666"}},n.createElement("span",null,"Date Taken: ",g))),E&&n.createElement(t.ImageViewer,{imageSrc:E,onClose:()=>f(null)}))},kn=["tenantId","payments","pdfkey","EmpData"],Un=e=>{let{registerRef:o,searchFieldComponents:a}=e;const{t:r}=i.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:o({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:o({})}))):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:o({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:o({})})),n.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Hn=e=>{let{statuses:o,controlFilterForm:r,applicationTypesOfBPA:u}=e;const{t:d}=i.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===>",o),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==o?void 0:o.map((l,o)=>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:o})))})))};function Wn(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 jn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function zn(e){jn(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 Vn(e,t){jn(2,arguments);var l=zn(e).getTime(),n=Wn(t);return new Date(l+n)}function Gn(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 Yn(e){return jn(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function qn(e){if(jn(1,arguments),!Yn(e)&&"number"!=typeof e)return!1;var t=zn(e);return!isNaN(Number(t))}var Kn={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 $n(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:$n({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$n({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:$n({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Zn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Jn(e){return function(t,l){var n,o=l||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;n=e.formattingValues[a]||e.formattingValues[i]}else{var r=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function Qn(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,r=i[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?to(u,function(e){return e.test(r)}):eo(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 eo(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function to(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var lo,no={code:"en-US",formatDistance:function(e,t,l){var n,o=Kn[e];return n="string"==typeof o?o:1===t?o.one:o.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 Zn[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:Jn({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Jn({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:Jn({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:Jn({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:Jn({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:(lo={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(lo.matchPattern);if(!l)return null;var n=l[0],o=e.match(lo.parsePattern);if(!o)return null;var i=lo.valueCallback?lo.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(n.length);return{value:i,rest:a}}),era:Qn({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:Qn({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:Qn({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:Qn({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:Qn({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 oo(e,t){jn(2,arguments);var l=Wn(t);return Vn(e,-l)}function io(e){jn(1,arguments);var t=1,l=zn(e),n=l.getUTCDay(),o=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-o),l.setUTCHours(0,0,0,0),l}function ao(e){jn(1,arguments);var t=zn(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var o=io(n),i=new Date(0);i.setUTCFullYear(l,0,4),i.setUTCHours(0,0,0,0);var a=io(i);return t.getTime()>=o.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function ro(e){jn(1,arguments);var t=ao(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=io(l);return n}function uo(e,t){jn(1,arguments);var l=t||{},n=l.locale,o=n&&n.options&&n.options.weekStartsOn,i=null==o?0:Wn(o),a=null==l.weekStartsOn?i:Wn(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=zn(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 so(e,t){jn(1,arguments);var l=zn(e),n=l.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,r=null==a?1:Wn(a),u=null==o.firstWeekContainsDate?r:Wn(o.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=uo(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var m=uo(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=m.getTime()?n:n-1}function co(e,t){jn(1,arguments);var l=t||{},n=l.locale,o=n&&n.options&&n.options.firstWeekContainsDate,i=null==o?1:Wn(o),a=null==l.firstWeekContainsDate?i:Wn(l.firstWeekContainsDate),r=so(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=uo(u,t);return d}function mo(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var vo={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 mo("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var o=so(e,n),i=o>0?o:1-o;return"YY"===t?mo(i%100,2):"Yo"===t?l.ordinalNumber(i,{unit:"year"}):mo(i,t.length)},R:function(e,t){return mo(ao(e),t.length)},u:function(e,t){return mo(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 mo(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 mo(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):mo(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 mo(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 o=function(e,t){jn(1,arguments);var l=zn(e),n=uo(l,t).getTime()-co(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(o,{unit:"week"}):mo(o,t.length)},I:function(e,t,l){var n=function(e){jn(1,arguments);var t=zn(e),l=io(t).getTime()-ro(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):mo(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return mo(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){jn(1,arguments);var t=zn(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=l-n;return Math.floor(o/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):mo(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 o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return mo(i,2);case"eo":return l.ordinalNumber(i,{unit:"day"});case"eee":return l.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(o,{width:"short",context:"formatting"});case"eeee":default:return l.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return mo(i,t.length);case"co":return l.ordinalNumber(i,{unit:"day"});case"ccc":return l.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(o,{width:"narrow",context:"standalone"});case"cccccc":return l.day(o,{width:"short",context:"standalone"});case"cccc":default:return l.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return mo(o,t.length);case"io":return l.ordinalNumber(o,{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,o=e.getUTCHours();switch(n=12===o?"noon":0===o?"midnight":o/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,o=e.getUTCHours();switch(n=o>=17?"evening":o>=12?"afternoon":o>=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 mo(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 mo(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):mo(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):mo(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return mo(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return mo(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return mo(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Eo(o);case"XXXX":case"XX":return fo(o);case"XXXXX":case"XXX":default:return fo(o,":")}},x:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return Eo(o);case"xxxx":case"xx":return fo(o);case"xxxxx":case"xxx":default:return fo(o,":")}},O:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+po(o,":");case"OOOO":default:return"GMT"+fo(o,":")}},z:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+po(o,":");case"zzzz":default:return"GMT"+fo(o,":")}},t:function(e,t,l,n){return mo(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return mo((n._originalDate||e).getTime(),t.length)}};function po(e,t){var l=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),i=n%60;if(0===i)return l+String(o);var a=t||"";return l+String(o)+a+mo(i,2)}function Eo(e,t){return e%60==0?(e>0?"-":"+")+mo(Math.abs(e)/60,2):fo(e,t)}function fo(e,t){var l=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+mo(Math.floor(o/60),2)+l+mo(o%60,2)}function go(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 _o(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 ho={p:_o,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],o=n[1],i=n[2];if(!i)return go(e,t);switch(o){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}}",go(o,t)).replace("{{time}}",_o(i,t))}},Ao=["D","DD"],No=["YY","YYYY"];function So(e){return-1!==Ao.indexOf(e)}function bo(e){return-1!==No.indexOf(e)}function yo(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 Co=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Do=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Oo=/^'([^]*?)'?$/,To=/''/g,Lo=/[a-zA-Z]/;function Io(e,t,l){jn(2,arguments);var n=String(t),o=l||{},i=o.locale||no,a=i.options&&i.options.firstWeekContainsDate,r=null==a?1:Wn(a),u=null==o.firstWeekContainsDate?r:Wn(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=i.options&&i.options.weekStartsOn,s=null==d?0:Wn(d),c=null==o.weekStartsOn?s:Wn(o.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var m=zn(e);if(!qn(m))throw new RangeError("Invalid time value");var v=Gn(m),p=oo(m,v),E={firstWeekContainsDate:u,weekStartsOn:c,locale:i,_originalDate:m},f=n.match(Do).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,ho[t])(e,i.formatLong,E):e}).join("").match(Co).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return wo(l);var a=vo[n];if(a)return!o.useAdditionalWeekYearTokens&&bo(l)&&yo(l,t,e),!o.useAdditionalDayOfYearTokens&&So(l)&&yo(l,t,e),a(p,l,i.localize,E);if(n.match(Lo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return f}function wo(e){return e.match(Oo)[1].replace(To,"'")}const Po={step:1,isValid:!1,formData:{},coordinates:{},ownerPhotos:[],ownerIds:[]},Ro=function(e,t){switch(void 0===e&&(e=Po),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 Po;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}},xo=["path","url"],Bo=[],Fo=()=>{var e,l,a,r,u,d,s,c;const v=o.useRouteMatch(),{path:p}=v,E=(m(v,xo),i.useTranslation(),null===(e=Digit)||void 0===e||null===(l=e.ComponentRegistryService)||void 0===l?void 0:l.getComponent("NewNOCStepperForm")),f=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),g=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),_=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(o.Switch,null,n.createElement(t.AppContainer,null,(void 0===(N=Bo)&&(N=[]),N.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:g}),n.createElement(t.PrivateRoute,{path:p+"/edit-application/:id",component:h}),n.createElement(t.PrivateRoute,{path:p+"/search/application-overview/:id",component:_}),n.createElement(t.PrivateRoute,{path:p+"/search-application",component:A}))));var N},Mo=e=>{let{children:t,currentStep:l=1,stepsList:o=[]}=e;const{t:a}=i.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=o.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({},(i=t+1<=l,g=t===v-1,{display:"flex",alignItems:"center",justifyContent:"flex-start",flex:"0 0 auto",color:i?"#0D43A7":"#9CA3AF",padding:"14px 12px",width:"260px",marginBottom:g?"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(o[t].stepLabel))));var i,g})),n.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px",background:"transparent"}},t))},ko=e=>{let{stepsList:t=[],onSubmit:l,step:o,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function d(){o<r.length?c():o===r.length&&l()}function s(){o>1&&m()}const c=()=>a(o+1),m=()=>a(o-1);return n.createElement(Mo,{currentStep:o,nextStep:c,prevStep:m,stepsList:r},(()=>{var e,t;const l=r[o-1],{component:i,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(i);return n.createElement(n.Fragment,null,n.createElement(v,{config:{key:a,texts:c,component:i,currStepNumber:o,currStepConfig:m},onGoNext:d,onBackClick:s,t:u}))})())},Uo=[{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"}]}],Ho=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),Wo=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),jo=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),zo=(e,t)=>({type:"UPDATE_NOC_OwnerPhotos",payload:{key:e,value:t}}),Vo=(e,t)=>({type:"UPDATE_NOC_OwnerIds",payload:{key:e,value:t}}),Go=[{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:Uo.filter(t=>t.stepNumber===e.stepNumber)})),Yo=()=>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"})),qo=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Yo,null)),Ko=e=>{let{key:a="cpt",closeModal:r,onPropertySelect:u,tenantId:d}=e;const{t:m}=i.useTranslation(),v=l.useRef(null);s.useDispatch();let{state:p}=o.useLocation();p=p&&("string"==typeof p||p instanceof String)?JSON.parse(p):p;const E=d||(window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY")),[f,g]=l.useState(!1),[_,h]=l.useState(""),[A,N]=l.useState(""),[S,b]=l.useState(""),[y,C]=l.useState(null),[D,O]=l.useState([]),[T,L]=l.useState(!1),[I,w]=l.useState({}),P=window.Digit.Utils.browser.isMobile(),[R,x]=l.useState(!1),B=[{Header:m("Property ID"),accessor:"propertyId",Cell:e=>{let{value:t}=e;return t||m("CS_NA")}},{Header:m("Mobile Number"),accessor:"owners",id:"mobileNumber",Cell:e=>{var t;let l,{value:n}=e;return l=1===(null==n?void 0:n.length)?null==n?void 0:n[0]:(null==n?void 0:n.find(e=>null==e?void 0:e.isPrimaryOwner))||(null==n?void 0:n[0]),(null===(t=l)||void 0===t?void 0:t.mobileNumber)||""}},{Header:m("Owner"),accessor:"owners",id:"ownerName",Cell:e=>{var t;let l,{value:n}=e;return l=1===(null==n?void 0:n.length)?null==n?void 0:n[0]:(null==n?void 0:n.find(e=>null==e?void 0:e.isPrimaryOwner))||(null==n?void 0:n[0]),(null===(t=l)||void 0===t?void 0:t.name)||""}},{Header:m("Address"),accessor:"address",Cell:e=>{let{value:t}=e;const{doorNo:l,buildingName:n,city:o,state:i}=t||{};return[l,n,o,i].filter(Boolean).join(", ")||"-"}},{Header:m("Plot Area"),accessor:"landArea",Cell:e=>{let{value:t}=e;return t||m("CS_NA")}},{Header:m(""),accessor:"id",Cell:e=>{let{value:l}=e;return n.createElement(t.SubmitBar,{label:m("Select"),onSubmit:()=>{const e=null==D?void 0:D.find(e=>(null==e?void 0:e.id)===l);u(e),r()},style:{width:"100px"}})}}],{data:F,isLoading:M}=Digit.Hooks.useBoundaryLocalities(E,"revenue",{},m);return l.useEffect(()=>{if(y){const e=setTimeout(()=>{C(null)},3e3);return()=>clearTimeout(e)}},[y]),M?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement(t.Modal,{className:"property-search-modal",headerBarEnd:n.createElement(qo,{onClick:r}),formId:"modal-action",popupStyles:{width:"unset",minWidth:"1000px",padding:"20px"},hideSubmit:!0},n.createElement(t.LabelFieldPair,null,n.createElement("div",{className:"field ndc_property_search",style:c({display:"flex",gap:"16px",width:"100%"},P?{flexDirection:"column"}:{}),ref:v,id:"search-property-field"},n.createElement(t.TextInput,{key:"id",value:_,onChange:e=>{h(e.target.value)},disable:!1,placeholder:m("PT_PROPERTY_ID_PLACEHOLDER"),defaultValue:void 0}),n.createElement(t.TextInput,{key:"mobileNumber",value:A,onChange:e=>{N(e.target.value)},disable:!1,maxlength:10,placeholder:m("NOC_OWNER_MOBILE_NO_PLACEHOLDER"),defaultValue:void 0}),n.createElement(t.TextInput,{key:"name",value:S,onChange:e=>{b(e.target.value)},disable:!1,placeholder:m("BPA_ENTER_APPLICANT_NAME_PLACEHOLDER"),defaultValue:void 0}),n.createElement(t.Dropdown,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll",marginTop:"20px"},isMandatory:!1,option:F.sort((e,t)=>e.name.localeCompare(t.name)),selected:I,optionKey:"i18nkey",select:function(e){w(e)},t:m,placeholder:m("BPA_LOC_MOHALLA_LABEL")}),!R&&n.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",width:"100%",maxWidth:"100px"},onClick:function(){try{return A&&!Digit.Utils.getPattern("MobileNo").test(A)?(C({error:!0,label:"CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID"}),Promise.resolve()):!S||null!=I&&I.code?S||_||A||null==I||!I.code?(L(!0),Promise.resolve(wt(function(){var e;return Promise.resolve(Digit.PTService.search({tenantId:E,filters:c({},(null==_?void 0:_.length)>0?{propertyIds:_}:{},(null==A?void 0:A.length)>0?{mobileNumber:A}:{},(null==I||null===(e=I.code)||void 0===e?void 0:e.length)>0?{locality:null==I?void 0:I.code}:{},(null==S?void 0:S.length)>0?{name:S}:{})})).then(function(e){var t;(null==e||null===(t=e.Properties)||void 0===t?void 0:t.length)>0?(L(!1),O(null==e?void 0:e.Properties)):(L(!1),C({error:!0,label:"CS_PT_NO_PROPERTIES_FOUND"}))})},function(e){L(!1),C({error:!0,label:m(e.message)})}))):(C({error:!0,label:"CAN_NOT_SEARCH_ONLY_BASED_ON_LOCALITY"}),Promise.resolve()):(C({error:!0,label:"PLEASE_SELECT_LOCALITY_WITH_NAME"}),Promise.resolve())}catch(e){return Promise.reject(e)}}},""+m("PT_SEARCH")))),(null==D?void 0:D.length)>0&&n.createElement(t.StatusTable,null,T?n.createElement(t.Loader,null):n.createElement(t.Table,{className:"customTable table-border-style",t:m,data:D,columns:B,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1})),y&&n.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:y.error,warning:y.warning,label:m(y.label),onClose:()=>{C(null)}})))},$o=[{i18nKey:"NOC_OWNER_TYPE_INDIVIDUAL",code:"Individual",value:"Individual"},{i18nKey:"NOC_OWNER_TYPE_FIRM",code:"Firm",value:"Firm"}],Xo=e=>{const{t:o,currentStepData:i,Controller:a,control:r,setValue:u,errors:d,reset:m,useFieldArray:v,watch:p,ownerIdList:E,setOwnerIdList:f,ownerPhotoList:g,setOwnerPhotoList:_}=e,h=Digit.ULBService.getCurrentTenantId(),A=Digit.ULBService.getStateId(),[N,S]=(s.useDispatch(),l.useState(!1)),[b,y]=l.useState(!1),[C,D]=l.useState(null),O=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return k({key:"true",error:!0,message:o("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{k(null)},3e3),Promise.resolve();const n=Pt(function(){return wt(function(){return S(!0),Promise.resolve(Digit.UploadServices.Filestorage("CLU",l,A)).then(function(t){var n,i;if(S(!1),(null==t||null===(n=t.data)||void 0===n||null===(i=n.files)||void 0===i?void 0:i.length)>0){const n=t.data.files[0].fileStoreId;f(t=>{const o=[...t],i={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Id":"Owner"+(e+1)+" Id",documentUid:n};return e<=(null==o?void 0:o.length)?o[e]=i:o.push(i),o}),k({key:"true",success:!0,message:o("FILE_UPLOAD_SUCCESS")})}else k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(){S(!1),k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{k(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},T=e=>{const t=null==g?void 0:g.filter((t,l)=>l!==e);_(t)},L=e=>{const t=null==E?void 0:E.filter((t,l)=>l!==e);f(t)},I=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return k({key:"true",error:!0,message:o("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{k(null)},3e3),Promise.resolve();const n=Pt(function(){return wt(function(){return S(!0),Promise.resolve(Digit.UploadServices.Filestorage("NOC",l,A)).then(function(t){var n,i;if(S(!1),(null==t||null===(n=t.data)||void 0===n||null===(i=n.files)||void 0===i?void 0:i.length)>0){const n=t.data.files[0].fileStoreId;_(t=>{const o=[...t],i={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Photo":"Owner"+(e+1)+" Photo",documentUid:n};return e<=(null==o?void 0:o.length)?o[e]=i:o.push(i),o}),k({key:"true",success:!0,message:o("FILE_UPLOAD_SUCCESS")})}else k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(){S(!1),k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{k(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:w}=Digit.Hooks.obps.useMDMS(A,"common-masters",["GenderType"]);let P=[];w&&w["common-masters"].GenderType.filter(e=>e.active).map(e=>{P.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const R=e=>{if(!e)return null;const t="string"==typeof e?e:null==e?void 0:e.code;return P.find(e=>e.code===t)||null},{fields:x,append:B,remove:F}=v({control:r,name:"owners"});l.useEffect(()=>{console.log("currentStepData1",i);const e=null==i?void 0:i.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||"",PropertyOwnerName:e.PropertyOwnerName||"",PropertyOwnerMobileNumber:e.PropertyOwnerMobileNumber||"",PropertyOwnerAddress:e.PropertyOwnerAddress||"",PropertyOwnerPlotArea:e.PropertyOwnerPlotArea||null,gender:R(e.gender),dateOfBirth:e.dateOfBirth||e.dob||"",address:e.address||e.permanentAddress||"",ownerType:e.ownerType?$o.find(t=>{var l;return(null==t?void 0:t.code)===(null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)}):null})):[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",PropertyOwnerName:"",PropertyOwnerMobileNumber:"",PropertyOwnerAddress:"",PropertyOwnerPlotArea:null,gender:null,dateOfBirth:"",address:"",ownerType:null}];m(c({},e,{owners:t}))},[i,u,B,m]);const[M,k]=l.useState(null),U=window.location.pathname.includes("edit");return console.log("ownerIdList (local)==>",E),console.log("ownerPhotoList (local)==>",g),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},o("NOC_APPLICANT_DETAILS")),n.createElement("div",null,U&&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"),x.map((e,s)=>{var c,m,v,f,_,h,N,S,b,C,w,B,M,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te;return n.createElement("div",{key:e.id},n.createElement(t.CardSubHeader,null,0===s?o("NOC_PRIMARY_OWNER"):o("Owner")+" "+(s+1)),n.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,cursor:"pointer"},onClick:()=>(e=>{var t,l;L(e),T(e),null==i||null===(t=i.applicationDetails)||void 0===t||null===(l=t.owners)||void 0===l||l.filter((t,l)=>l!==e),F(e)})(s)},!U&&x.length>1&&"❌"),0===s&&n.createElement(t.LabelFieldPair,{style:{position:"relative",zIndex:"101",marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_OWNER_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].ownerType",rules:{required:o("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{t:o,option:$o,optionKey:"i18nKey",select:t=>{e.onChange(t)},selected:e.value,disabled:U})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==d||null===(c=d.owners)||void 0===c||null===(m=c[s])||void 0===m||null===(v=m.ownerType)||void 0===v?void 0:v.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("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["+s+"].mobileNumber",rules:{required:o("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:o("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:o,disabled:U})}),n.createElement("div",{style:{marginTop:"17px"},className:"search-icon",onClick:U?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(wt(function(){return Promise.resolve(Digit.UserService.userSearch(A,{userName:t},{})).then(function(t){var l,n,o,i,a;const r=null!=(l=null==t?void 0:t.user)?l:[];if(!r.length)return void k({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!=(o=d.emailId)?o:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].fatherOrHusbandName",null!=(i=d.fatherOrHusbandName)?i:"",{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=R(d.gender);u("owners["+e+"].gender",m,{shouldValidate:!0,shouldDirty:!0})})},function(){k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})):(k({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve())}catch(e){return Promise.reject(e)}}(s)}," ",n.createElement(t.SearchIcon,null)," ")),(null==d||null===(f=d.owners)||void 0===f||null===(_=f[s])||void 0===_?void 0:_.mobileNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].mobileNumber.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_FIRM_OWNER_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].ownerOrFirmName",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)},t:o,disabled:U})}),(null==d||null===(h=d.owners)||void 0===h||null===(N=h[s])||void 0===N?void 0:N.ownerOrFirmName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].ownerOrFirmName.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].emailId",rules:{required:o("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:o("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:o,disabled:U})}),(null==d||null===(S=d.owners)||void 0===S||null===(b=S[s])||void 0===b?void 0:b.emailId)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].emailId.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].fatherOrHusbandName",rules:{pattern:{value:/^[A-Za-z\s]+$/,message:o("ONLY_ENGLISH_LETTERS_ALLOWED")},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)},t:o})}),(null==d||null===(C=d.owners)||void 0===C||null===(w=C[s])||void 0===w?void 0:w.fatherOrHusbandName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].fatherOrHusbandName.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].address",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)},t:o})}),(null==d||null===(B=d.owners)||void 0===B||null===(M=B[s])||void 0===M?void 0:M.address)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].address.message))),0===s&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_PROPERTY_ID_LABEL")),n.createElement("div",{className:"field"},n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px"}},p("owners["+s+"].propertyId")&&n.createElement(t.StatusTable,{style:{marginBottom:"1rem"}},n.createElement(t.Row,{className:"border-none",label:o("PROPERTY_ID"),text:p("owners["+s+"].propertyId")}),n.createElement(t.Row,{label:o("PROPERTY_OWNER_NAME"),text:p("owners["+s+"].PropertyOwnerName")})," ",n.createElement(t.Row,{label:o("PROPERTY_OWNER_MOBILE_NUMBER"),text:p("owners["+s+"].PropertyOwnerMobileNumber")})," ",n.createElement(t.Row,{label:o("WS_PROPERTY_ADDRESS_LABEL"),text:p("owners["+s+"].PropertyOwnerAddress")})," ",n.createElement(t.Row,{label:o("PROPERTY_PLOT_AREA"),text:p("owners["+s+"].PropertyOwnerPlotArea")})),n.createElement(a,{control:r,name:"owners["+s+"].propertyId",rules:{maxLength:{value:100,message:o("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(l.Fragment,null,n.createElement(t.TextInput,{style:{display:"none"},value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t),t:o}),n.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t)}))}),n.createElement("button",{type:"button",className:"submit-bar",style:{marginBottom:"1rem",width:"100%"},onClick:()=>{D(s),y(!0)}},o("PT_SEARCH_PROPERTY")),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerName",rules:{maxLength:{value:100,message:o("MAX_100_CHARACTERS_ALLOWED")}}}),(null==d||null===(H=d.owners)||void 0===H||null===(W=H[s])||void 0===W?void 0:W.PropertyOwnerName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerName.message),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerMobileNumber",rules:{pattern:{value:/^[6-9]\d{9}$/,message:o("INVALID_MOBILE_NUMBER")}}}),(null==d||null===(j=d.owners)||void 0===j||null===(z=j[s])||void 0===z?void 0:z.PropertyOwnerMobileNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerMobileNumber.message),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerAddress",rules:{maxLength:{value:500,message:o("MAX_500_CHARACTERS_ALLOWED")}}}),(null==d||null===(V=d.owners)||void 0===V||null===(G=V[s])||void 0===G?void 0:G.PropertyOwnerAddress)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerAddress.message),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerPlotArea",rules:{pattern:{value:/^[0-9]*\.?[0-9]+$/,message:o("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:o("MAX_100_CHARACTERS_ALLOWED")}}}),(null==d||null===(Y=d.owners)||void 0===Y||null===(q=Y[s])||void 0===q?void 0:q.PropertyOwnerPlotArea)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerPlotArea.message)))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_DOB_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].dateOfBirth",rules:{required:o("REQUIRED_FIELD"),validate:e=>{const t=new Date,l=new Date(e),n=t.getFullYear()-l.getFullYear(),i=t.getMonth()-l.getMonth(),a=t.getDate()-l.getDate();return n>=18||18===n&&(i>0||0===i&&a>=0)||o("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:U})}),(null==d||null===(K=d.owners)||void 0===K||null===($=K[s])||void 0===$?void 0:$.dateOfBirth)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].dateOfBirth.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_GENDER_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].gender",rules:{required:o("REQUIRED_FIELD")},render:e=>n.createElement(t.RadioButtons,{t:o,options:P,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:U})}),(null==d||null===(X=d.owners)||void 0===X||null===(Z=X[s])||void 0===Z?void 0:Z.gender)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].gender.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},o("NOC_APPLICANT_PASSPORT_PHOTO"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(wn,{id:"passport-photo-"+s,onUpload:I(s),onDelete:()=>{T(s)},uploadedFile:null==g||null===(J=g[s])||void 0===J?void 0:J.filestoreId,message:null!=g&&null!==(Q=g[s])&&void 0!==Q&&Q.filestoreId?"1 "+o("FILEUPLOADED"):o("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:"image/*",disabled:U}))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},o("NOC_APPLICANT_ID_PROOF"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(wn,{id:"id-proof-"+s,onUpload:O(s),onDelete:()=>{L(s)},uploadedFile:null==E||null===(ee=E[s])||void 0===ee?void 0:ee.filestoreId,message:null!=E&&null!==(te=E[s])&&void 0!==te&&te.filestoreId?"1 "+o("FILEUPLOADED"):o("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:".pdf",disabled:U}))))})),n.createElement("div",null,n.createElement("button",{type:"button",onClick:()=>B({mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",PropertyOwnerName:"",PropertyOwnerMobileNumber:"",PropertyOwnerAddress:"",PropertyOwnerPlotArea:null,gender:null,dateOfBirth:"",address:"",ownerType:null}),style:{cursor:"pointer"}},!U&&"➕ Add Owner")),M&&n.createElement(t.Toast,{error:null==M?void 0:M.error,warning:null==M?void 0:M.warning,label:o(null==M?void 0:M.message),isDleteBtn:!0,onClose:()=>{k(null)}}),b&&n.createElement(Ko,{closeModal:()=>y(!1),onPropertySelect:e=>{if(console.log("property",e),null!==C&&null!=e&&e.propertyId){var t,l,n,o,i;const a=(null==e||null===(t=e.owners)||void 0===t?void 0:t.map(e=>null==e?void 0:e.name).filter(Boolean).join(", "))||"";u("owners["+C+"].propertyId",e.propertyId,{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerName",a||"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerMobileNumber",(null==e||null===(l=e.owners)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.mobileNumber)||"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerAddress",(null==e||null===(o=e.owners)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.permanentAddress)||"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerPlotArea",(null==e?void 0:e.landArea)||null,{shouldValidate:!0,shouldDirty:!0})}},formData:i,setApiLoading:S,tenantId:h}))},Zo=e=>{var o,i,a,r,u,d;const{t:s,currentStepData:c,Controller:m,control:v,setValue:p,errors:E}=e,f=window.localStorage.getItem("CITIZEN.CITY"),[g,_]=l.useState(null),[h,A]=l.useState(null),[N,S]=l.useState(null),[b,y]=l.useState(null),C=Digit.UserService.getUser(),D=null==C||null===(o=C.info)||void 0===o||null===(i=o.roles)||void 0===i?void 0:i.find(e=>"BPA_ARCHITECT"===(null==e?void 0:e.code)),{data:O}=Digit.Hooks.obps.useBPAREGSearch(D?"pb.punjab":f,{},{mobileNumber:null==C||null===(a=C.info)||void 0===a?void 0:a.mobileNumber},{cacheTime:0});return l.useEffect(()=>{console.log("currentStepData2",c);const e=null==c?void 0:c.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;p(t,l)})},[c,p]),l.useEffect(()=>{if(O)for(let o=0;o<(null==O||null===(e=O.Licenses)||void 0===e?void 0:e.length);o++){var e,t,l;if("APPROVED"===(null==O||null===(t=O.Licenses)||void 0===t||null===(l=t[o])||void 0===l?void 0:l.status)){var n;_(null==O||null===(n=O.Licenses)||void 0===n?void 0:n[o]);break}}},[O]),l.useEffect(()=>{var e,t,l,n,o,i,a,r;g&&(A(D?null==g||null===(a=g.tradeLicenseDetail)||void 0===a||null===(r=a.additionalDetail)||void 0===r?void 0:r.counsilForArchNo:null==g?void 0:g.licenseNumber),S((null==g||null===(e=g.tradeLicenseDetail)||void 0===e||null===(t=e.owners)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.permanentAddress)||(null==g||null===(n=g.tradeLicenseDetail)||void 0===n||null===(o=n.owners)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.correspondenceAddress)),y(Digit.DateUtils.ConvertEpochToDate(null==g?void 0:g.validTo)))},[g]),l.useEffect(()=>{h&&(p("professionalRegId",h,{shouldValidate:!0,shouldDirty:!1}),p("professionalAddress",N),p("professionalRegIdValidity",b,{shouldValidate:!0,shouldDirty:!1}))},[N,h,p,b]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_PROFESSIONAL_DETAILS")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,""+s("NOC_PROFESSIONAL_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalName",defaultValue:null==C||null===(r=C.info)||void 0===r?void 0:r.name,rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("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:s,disabled:"true"})}),(null==E?void 0:E.professionalName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalName.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalEmailId",defaultValue:null==C||null===(u=C.info)||void 0===u?void 0:u.emailId,rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:s("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:s,disabled:"true"})}),(null==E?void 0:E.professionalEmailId)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalEmailId.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalRegId",rules:{required:s("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:"true"})}),(null==E?void 0:E.professionalRegId)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalRegId.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalRegIdValidity",rules:{required:s("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:"true"})}),(null==E?void 0:E.professionalRegIdValidity)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalRegIdValidity.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalMobileNumber",defaultValue:null==C||null===(d=C.info)||void 0===d?void 0:d.mobileNumber,rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:s("INVALID_MOBILE_NUMBER")}},render:e=>n.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:s,disable:"true"})}),(null==E?void 0:E.professionalMobileNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalMobileNumber.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalAddress",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("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:s,disabled:"true",disable:"true"})}),(null==E?void 0:E.professionalAddress)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalAddress.message))))},Jo=e=>{var o,i,a,r,u,d,s;let m;m=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const v=Digit.ULBService.getStateId(),{t:p,currentStepData:E,Controller:f,control:g,setValue:_,errors:h,errorStyle:A,useFieldArray:S,watch:b}=e,[y,C]=l.useState("0.00"),D=b("netTotalArea"),O=b("areaLeftForRoadWidening");l.useEffect(()=>{const e=parseFloat(D),t=parseFloat(O),l=((isNaN(e)?0:e)-(isNaN(t)?0:t)).toFixed(2);C(l),_("netPlotAreaAfterWidening",l)},[D,O]);const[T,L]=l.useState(""),{fields:I,append:w,remove:P}=S({control:g,name:"floorArea"}),R=b("floorArea"),x=b("basementArea");l.useEffect(()=>{const e=null==R?void 0:R.reduce((e,t)=>{const l=parseFloat(null==t?void 0:t.value);return e+(isNaN(l)?0:l)},0),t=isNaN(x)?0:x,l=(e+parseFloat(t)).toFixed(2);L(l),_("totalFloorArea",l)},[R,x]);const[B,F]=l.useState((null==E||null===(o=E.siteDetails)||void 0===o?void 0:o.ulbName)||null),[M,k]=l.useState((null==E||null===(i=E.siteDetails)||void 0===i?void 0:i.ulbType)||""),[U,H]=l.useState((null==E||null===(a=E.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:W,isLoading:j}=Digit.Hooks.noc.useBuildingType(v);let{data:z,isLoading:V}=Digit.Hooks.noc.useRoadType(v);const{data:G,isLoading:Y}=Digit.Hooks.useTenants(),q=null==G?void 0:G.map(e=>c({},e,{displayName:p(e.i18nKey)}));z&!V&&(z=[...z].sort((e,t)=>e.name.localeCompare(t.name))),l.useEffect(()=>{if(B){var e;const t=null==B||null===(e=B.city)||void 0===e?void 0:e.ulbType;k(t),_("ulbType",t)}},[B,_]);const[K,$]=l.useState((null==E||null===(r=E.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),X=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Z=Digit.Hooks.noc.useTenants();console.log("allcities",Z);const[J,Q]=l.useState(Z),{data:ee,isLoading:te}=Digit.Hooks.useCustomMDMS(v,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+m+"')]"}]),[le,ne]=l.useState((null==E||null===(u=E.siteDetails)||void 0===u?void 0:u.district)||null);return console.log("selectedCity",le),l.useEffect(()=>{if(m&&(null==Z?void 0:Z.length)>0){var e,t;const l=null===(e=Z.find(e=>e.code===m))||void 0===e||null===(t=e.city)||void 0===t?void 0:t.districtName;console.log("defaultCity",l),l&&(ne(l),_("district",l))}},[m,Z]),l.useEffect(()=>{const e=null==E?void 0:E.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,l]=e;"floorArea"!==t&&_(t,l)}),Array.isArray(e.floorArea))){for(let e=I.length-1;e>=0;e--)P(e);e.floorArea.forEach(e=>{w({value:e.value||""})})}},[E,_,w,P]),n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardSectionHeader,{className:"card-section-header"},p("NOC_SITE_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_PLOT_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"plotNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.plotNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.plotNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},p("NOC_PROPOSED_SITE_ADDRESS"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"proposedSiteAddress",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:200,message:p("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!=h&&h.proposedSiteAddress?h.proposedSiteAddress.message:""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ULB_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!Y&&n.createElement(f,{control:g,name:"ulbName",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{F(t),e.onChange(t)},selected:e.value,option:q,optionKey:"displayName",t:p})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=h&&h.ulbName?h.ulbName.message:""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ULB_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"ulbType",render:e=>n.createElement(t.TextInput,{value:M||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_KHASRA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"khasraNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:500,message:p("MAX_500_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),(null==h?void 0:h.khasraNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.khasraNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_HADBAST_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"hadbastNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("MAX_100_CHARACTERS_ALLOWED")},pattern:{value:/^[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),(null==h?void 0:h.hadbastNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.hadbastNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ROAD_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!V&&n.createElement(f,{control:g,name:"roadType",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:z,optionKey:"name",t:p})}),(null==h?void 0:h.roadType)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.roadType.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_NET_TOTAL_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"netTotalArea",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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==h||null===(d=h.netTotalArea)||void 0===d?void 0:d.message)||""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"areaLeftForRoadWidening",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.areaLeftForRoadWidening)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.areaLeftForRoadWidening.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"netPlotAreaAfterWidening",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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)},disable:"true"})}),(null==h?void 0:h.netPlotAreaAfterWidening)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.netPlotAreaAfterWidening.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ROAD_WIDTH_AT_SITE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"roadWidthAtSite",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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!=h&&h.roadWidthAtSite?h.roadWidthAtSite.message:""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_BUILDING_STATUS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!j&&n.createElement(f,{control:g,name:"buildingStatus",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{H(t),e.onChange(t)},selected:e.value,option:W,optionKey:"name",t:p})}),(null==h?void 0:h.buildingStatus)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.buildingStatus.message))),"BUILTUP"===(null==U?void 0:U.code)&&n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"isBasementAreaAvailable",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{$(t),e.onChange(t)},selected:e.value,option:X,optionKey:"i18nKey",t:p})}),(null==h?void 0:h.ulbName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.ulbName.message))),"BUILTUP"===(null==U?void 0:U.code)&&"YES"===(null==K?void 0:K.code)&&n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_BASEMENT_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"basementArea",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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!=h&&h.basementArea?h.basementArea.message:""))),"BUILTUP"===(null==U?void 0:U.code)&&I.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(f,{control:g,name:"floorArea."+l+".value",defaultValue:e.value,rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var o,i;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==h||null===(o=h.floorArea)||void 0===o||null===(i=o[l])||void 0===i?void 0:i.value)&&n.createElement(t.CardLabelError,{className:A},h.floorArea[l].value.message))}}),n.createElement("button",{type:"button",onClick:()=>P(l)},"❌")))),"BUILTUP"===(null==U?void 0:U.code)&&n.createElement("button",{type:"button",onClick:()=>w({value:""})},"➕ Add Floor"),"BUILTUP"===(null==U?void 0:U.code)&&n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"totalFloorArea",defaultValue:T,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,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_WARD_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"wardNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.wardNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.wardNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_DISTRICT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"district",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{className:"form-field",value:le||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}),(null==h?void 0:h.district)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.district.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ZONE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!te&&n.createElement(f,{control:g,name:"zone",rules:{required:p("REQUIRED_FIELD")},render:e=>{var l,o,i;return n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:null==ee||null===(l=ee.tenant)||void 0===l||null===(o=l.zoneMaster)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.zones,optionKey:"code",t:p})}}),(null==h?void 0:h.zone)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.zone.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_VILLAGE_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"villageName",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.villageName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.villageName.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_COLONY_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"colonyName",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.colonyName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.colonyName.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_VASIKA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"vasikaNumber",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.vasikaNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.vasikaNumber.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_VASIKA_DATE"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"vasikaDate",rules:{required:p("REQUIRED_FIELD"),validate:e=>{}},render:e=>n.createElement(t.TextInput,{type:"date",value:N(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]})}),(null==h?void 0:h.vasikaDate)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},null==h||null===(s=h.vasikaDate)||void 0===s?void 0:s.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"khewatAndKhatuniNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("MAX_100_CHARACTERS_ALLOWED")},pattern:{value:/^[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),(null==h?void 0:h.khewatAndKhatuniNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.khewatAndKhatuniNo.message)))),n.createElement(t.BreakLine,null)))},Qo=e=>{var o;const{t:i,currentStepData:a,Controller:r,control:u,setValue:d,errors:s}=e,c=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[m,v]=l.useState((null==a||null===(o=a.siteDetails)||void 0===o?void 0:o.specificationBuildingCategory)||null),{data:p,isLoading:E}=Digit.Hooks.noc.useBuildingCategory(c),{data:f,isLoading:g}=Digit.Hooks.noc.useNocType(c),_=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return l.useEffect(()=>{console.log("currentStepData4",a);const e=null==a?void 0:a.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;d(t,l)})},[a,d]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,null,i("NOC_SPECIFICATION_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(r,{control:u,name:"specificationPlotArea",rules:{required:i("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:i("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:i("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:i})}),(null==s?void 0:s.specificationPlotArea)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationPlotArea.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_BUILDING_CATEGORY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!E&&p.length>0&&n.createElement(r,{control:u,name:"specificationBuildingCategory",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{v(t),e.onChange(t)},selected:e.value,option:p,optionKey:"name",t:i})}),(null==s?void 0:s.specificationBuildingCategory)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationBuildingCategory.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_NOC_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!g&&n.createElement(r,{control:u,name:"specificationNocType",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:f,optionKey:"name",t:i})}),(null==s?void 0:s.specificationNocType)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationNocType.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_RESTRICTED_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(r,{control:u,name:"specificationRestrictedArea",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:_,optionKey:"i18nKey",t:i})}),(null==s?void 0:s.specificationRestrictedArea)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationRestrictedArea.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(r,{control:u,name:"specificationIsSiteUnderMasterPlan",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:_,optionKey:"i18nKey",t:i})}),(null==s?void 0:s.specificationIsSiteUnderMasterPlan)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationIsSiteUnderMasterPlan.message)))))};function ei(e){var l,i,a,r,u,d,c,m,v,p,E,f,g,_,h,A,N,S,b,y,C,D,O,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne;let{currentStepData:Se,t:be}=e;o.useLocation(),o.useHistory(),s.useDispatch(),console.log("formData in Summary Page",Se);const ye=s.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)||{}}),Ce=s.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)||[]}),De=s.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 Oe=e=>{if(0===e)return be("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+" "+be("NOC_FLOOR_AREA_LABEL")},Te=(Digit.UserService.getUser(),e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t});let Le=null==Se||null===(l=Se.documents)||void 0===l||null===(i=l.documents)||void 0===i?void 0:i.documents;console.log("documents here in summary",Le);const Ie=null==Se||null===(a=Se.documents)||void 0===a||null===(r=a.documents)||void 0===r||null===(u=r.documents)||void 0===u?void 0:u.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),we=null==Se||null===(d=Se.documents)||void 0===d||null===(c=d.documents)||void 0===c||null===(m=c.documents)||void 0===m?void 0:m.filter(e=>!("OWNER.SITEPHOTOGRAPHONE"===(null==e?void 0:e.documentType)||"OWNER.SITEPHOTOGRAPHTWO"===(null==e?void 0:e.documentType))),Pe=null==Se||null===(v=Se.applicationDetails)||void 0===v||null===(p=v.owners)||void 0===p?void 0:p[0];return n.createElement("div",{className:"employee-main-application-details"},n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("OWNER_OWNERPHOTO")),n.createElement(t.StatusTable,null,n.createElement(Cn,{ownerFileStoreId:null==Ce||null===(E=Ce.ownerPhotoList)||void 0===E||null===(f=E[0])||void 0===f?void 0:f.filestoreId,ownerName:null==Se||null===(g=Se.applicationDetails)||void 0===g||null===(_=g.owners)||void 0===_||null===(h=_[0])||void 0===h?void 0:h.ownerOrFirmName}))),null===(A=null!=(N=null==Se||null===(S=Se.applicationDetails)||void 0===S?void 0:S.owners)?N:[])||void 0===A?void 0:A.map((e,l)=>{var o,i;return n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?be("NOC_PRIMARY_OWNER"):"Owner "+(l+1)),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_OWNER_TYPE_LABEL"),text:(null==e||null===(o=e.ownerType)||void 0===o?void 0:o.i18nKey)||"N/A"}),n.createElement(t.Row,{label:be("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:be("BPA_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_DOB_LABEL"),text:Te(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.gender)||void 0===i?void 0:i.code)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"})))}),Pe&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_PROPERTY_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==Pe?void 0:Pe.propertyId)||"N/A"}),n.createElement(t.Row,{label:be("PROPERTY_OWNER_NAME"),text:(null==Pe?void 0:Pe.PropertyOwnerName)||"N/A"}),n.createElement(t.Row,{label:be("PROPERTY_OWNER_MOBILE_NUMBER"),text:(null==Pe?void 0:Pe.PropertyOwnerMobileNumber)||"N/A"}),n.createElement(t.Row,{label:be("WS_PROPERTY_ADDRESS_LABEL"),text:(null==Pe?void 0:Pe.PropertyOwnerAddress)||"N/A"}),n.createElement(t.Row,{label:be("PROPERTY_PLOT_AREA"),text:(null==Pe?void 0:Pe.PropertyOwnerPlotArea)||"N/A"}))),(null==Se||null===(b=Se.applicationDetails)||void 0===b?void 0:b.professionalName)&&n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_PROFESSIONAL_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==Se||null===(y=Se.applicationDetails)||void 0===y?void 0:y.professionalName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==Se||null===(C=Se.applicationDetails)||void 0===C?void 0:C.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==Se||null===(D=Se.applicationDetails)||void 0===D?void 0:D.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),text:(null==Se||null===(O=Se.applicationDetails)||void 0===O?void 0:O.professionalRegIdValidity)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==Se||null===(T=Se.applicationDetails)||void 0===T?void 0:T.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==Se||null===(L=Se.applicationDetails)||void 0===L?void 0:L.professionalAddress)||"N/A"})))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_SITE_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_PLOT_NO_LABEL"),text:(null==Se||null===(I=Se.siteDetails)||void 0===I?void 0:I.plotNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROPOSED_SITE_ADDRESS"),text:(null==Se||null===(w=Se.siteDetails)||void 0===w?void 0:w.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ULB_NAME_LABEL"),text:(null==Se||null===(P=Se.siteDetails)||void 0===P||null===(R=P.ulbName)||void 0===R?void 0:R.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ULB_TYPE_LABEL"),text:(null==Se||null===(x=Se.siteDetails)||void 0===x?void 0:x.ulbType)||"N/A"}),n.createElement(t.Row,{label:be("NOC_KHASRA_NO_LABEL"),text:(null==Se||null===(B=Se.siteDetails)||void 0===B?void 0:B.khasraNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_HADBAST_NO_LABEL"),text:(null==Se||null===(F=Se.siteDetails)||void 0===F?void 0:F.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ROAD_TYPE_LABEL"),text:(null==Se||null===(M=Se.siteDetails)||void 0===M||null===(k=M.roadType)||void 0===k?void 0:k.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==Se||null===(U=Se.siteDetails)||void 0===U?void 0:U.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:be("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==Se||null===(H=Se.siteDetails)||void 0===H?void 0:H.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:be("NOC_NET_TOTAL_AREA_LABEL"),text:(null==Se||null===(W=Se.siteDetails)||void 0===W?void 0:W.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==Se||null===(j=Se.siteDetails)||void 0===j?void 0:j.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:be("NOC_BUILDING_STATUS_LABEL"),text:(null==Se||null===(z=Se.siteDetails)||void 0===z||null===(V=z.buildingStatus)||void 0===V?void 0:V.name)||"N/A"}),(null==Se||null===(G=Se.siteDetails)||void 0===G?void 0:G.isBasementAreaAvailable)&&n.createElement(t.Row,{label:be("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==Se||null===(Y=Se.siteDetails)||void 0===Y||null===(q=Y.isBasementAreaAvailable)||void 0===q?void 0:q.code)||"N/A"}),(null==Se||null===(K=Se.siteDetails)||void 0===K?void 0:K.basementArea)&&n.createElement(t.Row,{label:be("NOC_BASEMENT_AREA_LABEL"),text:(null==Se||null===($=Se.siteDetails)||void 0===$?void 0:$.basementArea)||"N/A"}),"BUILTUP"===(null==Se||null===(X=Se.siteDetails)||void 0===X||null===(Z=X.buildingStatus)||void 0===Z?void 0:Z.code)&&(null==Se||null===(J=Se.siteDetails)||void 0===J||null===(Q=J.floorArea)||void 0===Q?void 0:Q.map((e,l)=>n.createElement(t.Row,{label:Oe(l),text:(null==e?void 0:e.value)||"N/A"}))),"BUILTUP"===(null==Se||null===(ee=Se.siteDetails)||void 0===ee||null===(te=ee.buildingStatus)||void 0===te?void 0:te.code)&&n.createElement(t.Row,{label:be("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==Se||null===(le=Se.siteDetails)||void 0===le?void 0:le.totalFloorArea)||"N/A"}),n.createElement(t.Row,{label:be("NOC_DISTRICT_LABEL"),text:(null==Se||null===(ne=Se.siteDetails)||void 0===ne?void 0:ne.district)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ZONE_LABEL"),text:(null==Se||null===(oe=Se.siteDetails)||void 0===oe||null===(ie=oe.zone)||void 0===ie?void 0:ie.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_WARD_NO_LABEL"),text:(null==Se||null===(ae=Se.siteDetails)||void 0===ae?void 0:ae.wardNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==Se||null===(re=Se.siteDetails)||void 0===re?void 0:re.villageName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_COLONY_NAME_LABEL"),text:(null==Se||null===(ue=Se.siteDetails)||void 0===ue?void 0:ue.colonyName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_VASIKA_NO_LABEL"),text:(null==Se||null===(de=Se.siteDetails)||void 0===de?void 0:de.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:be("NOC_VASIKA_DATE"),text:(null==Se||null===(se=Se.siteDetails)||void 0===se?void 0:se.vasikaDate)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==Se||null===(ce=Se.siteDetails)||void 0===ce?void 0:ce.khewatAndKhatuniNo)||"N/A"}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_SPECIFICATION_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==Se||null===(me=Se.siteDetails)||void 0===me?void 0:me.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:be("NOC_BUILDING_CATEGORY_LABEL"),text:(null==Se||null===(ve=Se.siteDetails)||void 0===ve||null===(pe=ve.specificationBuildingCategory)||void 0===pe?void 0:pe.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_NOC_TYPE_LABEL"),text:(null==Se||null===(Ee=Se.siteDetails)||void 0===Ee||null===(fe=Ee.specificationNocType)||void 0===fe?void 0:fe.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_RESTRICTED_AREA_LABEL"),text:(null==Se||null===(ge=Se.siteDetails)||void 0===ge||null===(_e=ge.specificationRestrictedArea)||void 0===_e?void 0:_e.code)||"N/A"}),n.createElement(t.Row,{label:be("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==Se||null===(he=Se.siteDetails)||void 0===he||null===(Ae=he.specificationIsSiteUnderMasterPlan)||void 0===Ae?void 0:Ae.code)||"N/A"}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("BPA_UPLOADED _SITE_PHOTOGRAPHS_LABEL")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==Ie?void 0:Ie.length)>0&&(null==Ie?void 0:Ie.map(e=>n.createElement(Bn,{filestoreId:null==e?void 0:e.filestoreId,documentType:null==e?void 0:e.documentType,coordinates:ye}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==De||null===(Ne=De.ownerIdList)||void 0===Ne?void 0:Ne.length)>0&&n.createElement(Sn,{documents:null==De?void 0:De.ownerIdList}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==we?void 0:we.length)>0&&n.createElement(Sn,{documents:we}))))}function ti(e){var o;let{t:i,document:a,setDocuments:r,setError:d,documents:s,action:m,formData:v,handleSubmit:p,geocoordinates:E,setGeoCoordinates:f,dispatch:g}=e;const _=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[h,A]=(Digit.ULBService.getCurrentTenantId(),l.useState(_?c({},_,{active:!0===(null==a?void 0:a.active),code:null==_?void 0:_.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[N,S]=l.useState(null),[b,y]=l.useState(()=>(null==_?void 0:_.filestoreId)||null);function C(e){const t=e.target.files[0];S(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return console.log("file",e),new Promise(t=>{try{u.getData(e,function(){const e=u.getTag(this,"GPSLatitude"),l=u.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&l){const n=P(e).toFixed(6),o=P(l).toFixed(6);t({latitude:n,longitude:o})}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?(g(jo("Latitude1",e.latitude)),g(jo("Longitude1",e.longitude)),f(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(g(jo("Latitude1","")),g(jo("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(g(jo("Latitude2",e.latitude)),g(jo("Longitude2",e.longitude)),f(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(g(jo("Latitude2","")),g(jo("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:D}=a;var O=D;const[T,L]=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==s?void 0:s.length)>0&&(console.log("documents here",s),p())},[s]),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),y(null==l?void 0:l.fileStoreId)):L(!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{d(null);const e=function(){if(N){w(!0);const e=function(){if(N.size>=5242880)w(!1),d(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=wt(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId())).then(function(e){var t,l,n,o;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?y(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):d(i("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),d(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),l.useEffect(()=>{T&&y(null)},[T]),n.createElement("div",{className:"bpa-doc-required-wrapper"},I&&n.createElement(t.Loader,null),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"bpa-doc-required-label"},i(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(wn,"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:C,onDelete:()=>{y(null)},uploadedFile:b,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".jpg, .jpeg, .png"}:{id:"noc-doc",onUpload:C,onDelete:()=>{y(null)},uploadedFile:b,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".pdf, .jpeg, .jpg, .png"})),n.createElement("p",{style:{padding:"10px",fontSize:"14px"}},i("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 li=n.memo(function(e){var o,i,a;let{t:r,document:d,setDocuments:s,documents:m,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:E,handleSubmit:f}=e;console.log("documents here",m);const g=(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.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==d?void 0:d.code)})[0]);console.log("filteredDocument here",g);const _=Digit.ULBService.getStateId(),[h,A]=l.useState(g?c({},g,{active:!0,code:null==g?void 0:g.documentType,i18nKey:null==g?void 0:g.documentType}):(null==d||null===(o=d.dropdownData)||void 0===o?void 0:o.length)>0?null==d?void 0:d.dropdownData[0]:{}),[N,S]=l.useState(null),[b,y]=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==d?void 0:d.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[C,D]=l.useState([]),[O,T]=l.useState([]),[L,I]=l.useState([]||(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===h.code))),[w,P]=l.useState(null),[R,x]=l.useState(null);function B(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&&(s(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,o;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=L[t])||void 0===n?void 0:n.name)||"",id:m?null===(o=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===o?void 0:o.id:void 0})}),console.log("newfiles here",l),[...t,...l]}),T([])),null!=h&&h.code&&s(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,o,i;(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===(o=h.code)||void 0===o?void 0:o.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(i=e.file)&&void 0!==i&&i.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==N?void 0:N.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||T([...O,b])},[b]);const F=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:_}}])),console.log("selectedUplDocs here",l),l},[v]);return n.createElement("div",null,n.createElement(t.CardLabel,null,null!=d&&d.required?r(null==d?void 0:d.code)+" *":""+r(null==d?void 0:d.code)),n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:_,getFormState:function(e){let t,l,n=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{u.getData(e,function(){const e=u.getTag(this,"GPSLatitude"),l=u.getTag(this,"GPSLongitude");if(e&&l){const n=B(e),o=B(l);t({latitude:n,longitude:o})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==d?void 0:d.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(o=>{var i,a,r;console.log("Latitude:",o.latitude),console.log("Longitude:",o.longitude),P(o.latitude),x(o.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==d?void 0:d.code)&&(null!==o.latitude&&null!==o.longitude?(sessionStorage.setItem("Latitude",o.latitude),sessionStorage.setItem("Longitude",o.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),l=Object.values(t),l=null==v||null===(i=v.documents)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),D(l);let u=[];null==e||e.map((e,t)=>{var l,n,i,a;u.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:o.latitude,longitude:o.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===(i=e[1].fileStoreId)||void 0===i?void 0:i.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),...u];s(c),null===(r=l)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=n,function(e,t){e&&S(e.file),e&&I([...L,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)];s(e)}},setuploadedstate:F,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==d||null===(a=d.uploadedDocuments)||void 0===a?void 0:a.length)&&n.createElement(Rl,{isSendBackFlow:!0,documents:null==d?void 0:d.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==d?void 0:d.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)," ")))}),ni=[{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==Uo?void 0:Uo.filter(t=>(null==t?void 0:t.stepNumber)===(null==e?void 0:e.stepNumber))})),oi=["tenantId","payments","pdfkey","EmpData"],ii=e=>{var o,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=i.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,{className:"fields",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===(o=m.errors)||void 0===o||null===(r=o.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"))))},ai=["currentlyActiveMobileModal"],ri=["currentlyActiveMobileModal"],ui=e=>{var o,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:E}=i.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=()=>{_({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),N=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,o=m(e,ai);const{closeMobilePopupModal:i}=o;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,o,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:i}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,ri)))},[g]);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:()=>_({type:"set",payload:"SearchFormComponent"})})),g?n.createElement(t.PopUp,null,n.createElement(N,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:f,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=v&&null!==(o=v[0])&&void 0!==o&&o.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")}))},di=e=>{let{columns:o,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:g}=i.useTranslation(),_=()=>{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 N(e){v("limit",Number(e.target.value)),m(u)()}function S(){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 y=()=>{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}},g(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:g,data:d,columns:o,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:N,currentPage:E,onNextPage:S,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,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(y,null))},si=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}=i.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(o.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(),g=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(ui,{SearchFormFieldsComponent:ii,propsMobileInboxCards:g,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(di,{columns:E,SearchFormFieldsComponent:ii,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},ci=e=>{let{matchPath:l}=e;const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const d=[{link:l+"/noc/new-application",i18nKey:o("NOC_NEW_APPLICATION")},{link:l+"/noc/my-application",i18nKey:o("NOC_MY_APPLICATION")},{link:l+"/noc/search-application",i18nKey:o("NOC_SEARCH_APPLICATION")}];return n.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_NOC"),links:d,Icon:()=>n.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},mi=e=>{let{stateCode:l,userType:i,tenants:a}=e;const{path:r}=o.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"===i?n.createElement(Fo,null):n.createElement(Mt,{path:r,stateCode:l})},vi={NOCModule:mi,NOCCard:()=>{var e,a;const{t:r}=i.useTranslation(),u=o.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 g=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,g):null},NOCLinks:ci,NOCApplicationOverview:()=>{var e,a,r,u,d,s,m,p,f;const{id:g}=o.useParams(),{t:_}=i.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[N,S]=l.useState({}),[b,y]=l.useState(null),C={},[D]=l.useState(()=>(null==C?void 0:C.fileStoreId)||null),[O,T]=l.useState(null),[L,I]=l.useState([]),[w,P]=l.useState([]),[R,x]=l.useState([]),[B,F]=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:$}=Digit.Hooks.noc.useNOCDetails(_,h,{applicationNo:g}),{mutate:X}=Digit.Hooks.noc.useNOCApplicationActions(h),Z=Digit.Hooks.useWorkflowDetails({tenantId:h,id:g,moduleCode:"NOC"});var J,Q;null!=Z&&null!==(e=Z.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Z.isLoading&&(Z.data.actionState.nextActions=[...null==Z||null===(r=Z.data)||void 0===r?void 0:r.nextActions]),Z&&Z.data&&!Z.isLoading&&(Z.data.initialActionState=(null==Z||null===(J=Z.data)||void 0===J?void 0:J.initialActionState)||c({},null==Z||null===(Q=Z.data)||void 0===Q?void 0:Q.actionState)||{},Z.data.actionState=c({},Z.data)),l.useEffect(()=>{P([null==$?void 0:$.applicationData])},[null==$?void 0:$.applicationData]),l.useEffect(()=>{var e;x(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),l.useEffect(()=>{var e;F(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 o=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!=o&&null!==(l=o[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[0]&&(o[0].docTypes[0].nocType=o[0].nocType,o[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(o[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let l=e.documentType;e.dropdownData=[],B.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,B]),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:o,nocDataDetails:i,nocDocumentsList:a}=e;if(null!=i&&i.length&&null!=a&&a.length&&null!=(null==i?void 0:i[0])){var r,u,d,s,c,m,p,f,g,_,h,A,N,S,b,y,C,D,I,w;const e="WF_"+(null==i||null===(r=i[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==i||null===(u=i[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"}},""+o("NOC_MAIN_"+E(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:""+o("NOC_"+(null==i||null===(s=i[0])||void 0===s?void 0:s.nocType)+"_APPLICATION_LABEL"),text:o(null==i||null===(c=i[0])||void 0===c?void 0:c.applicationNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_STATUS_LABEL"),text:o(e)||"NA",textStyle:"APPROVED"==(null==i||null===(m=i[0])||void 0===m?void 0:m.applicationStatus)||"AUTO_APPROVED"==(null==i||null===(p=i[0])||void 0===p?void 0:p.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_SUBMITED_ON_LABEL"),text:null!=i&&null!==(f=i[0])&&void 0!==f&&null!==(g=f.additionalDetails)&&void 0!==g&&g.SubmittedOn?v(Number(null==i||null===(_=i[0])||void 0===_||null===(h=_.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVAL_NO_LABEL"),text:(null==i||null===(A=i[0])||void 0===A?void 0:A.nocNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?v(Number(null==i||null===(N=i[0])||void 0===N||null===(S=N.auditDetails)||void 0===S?void 0:S.lastModifiedTime)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("Documents"),text:""})),null!=i&&null!==(b=i[0])&&void 0!==b&&b.documents&&(null==i||null===(y=i[0])||void 0===y?void 0:y.documents.length)>0?n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==i||null===(C=i[0])||void 0===C||null===(D=C.documents)||void 0===D?void 0:D.map((e,l)=>{var i,r;return n.createElement("a",{target:"_",href:null===(i=U[e.fileStoreId])||void 0===i?void 0:i.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"}},o("NOC_MAIN_"+E(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):n.createElement("div",null,n.createElement("p",null,o("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),n.createElement("div",null,(null==Z||null===(I=Z.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==L?void 0:L.map((e,t)=>n.createElement(gn,{key:t,document:e,t:o,error:O,setError:T,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:""+_(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return l.useEffect(()=>{if($){var e;V(!0);const{applicationDetails:t}=$;S(c({},$,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>n.createElement(ee,{t:_,data:$,nocDataDetails:w,nocDocumentsList:L})}]})),V(!1)}},[$,L,w,D,W,U]),n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",null,n.createElement(t.Header,{styles:{fontSize:"32px"}},_("NOC_APP_OVER_VIEW_HEADER"))),n.createElement(fn,{applicationDetails:N,isLoading:K||z,isDataLoading:K,applicationData:null==$?void 0:$.applicationData,mutate:X,workflowDetails:Z,businessService:null!=Z&&null!==(d=Z.data)&&void 0!==d&&d.applicationBusinessService?null==Z||null===(s=Z.data)||void 0===s?void 0:s.applicationBusinessService:null==$||null===(m=$.applicationData)||void 0===m?void 0:m.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:b,setShowToast:y,closeToast:()=>{y(null)},timelineStatusPrefix:"WF_"+(null==$||null===(p=$.applicationData)||void 0===p||null===(f=p.additionalDetails)||void 0===f?void 0:f.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:r}=e;const{t:u}=i.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:N,data:S}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},g)});l.useEffect(()=>{S&&S.revalidate()},[]);const[b,y]=l.useState([]),[C,D]=l.useState([]),[O,T]=l.useState(0);l.useEffect(()=>{S&&(D((null==S?void 0:S.statuses)||[]),y((null==S?void 0:S.table)||[]),T((null==S?void 0:S.totalCount)||0))},[S]);const L={logoIcon:n.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search/application"}]},I=l.useCallback(e=>{let{registerRef:t,searchFormState:l,searchFieldComponents:o}=e;return n.createElement(Un,{registerRef:t,searchFormState:l,searchFieldComponents:o})},[]),w=l.useCallback(e=>{let{registerRef:t,controlFilterForm:l,setFilterFormValue:o,getFilterFormValue:i}=e;return n.createElement(Hn,{statuses:C,isInboxLoading:N,registerRef:t,controlFilterForm:l,setFilterFormValue:o,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[C,N,h,A]),P={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},v)}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==g?void 0:g.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:s})}},R={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},v)}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==g?void 0:g.filterForm,resetFilterFormDefaultValues:m,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),_({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:g}=i.useTranslation(),_=l.useMemo(()=>[{Header:g("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement(o.Link,{to:d+"/inbox/application-overview/"+t.original.applicationId},n.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,l;let{row:o}=e;return null!==(t=o.original)&&void 0!==t&&t.date?(e=>n.createElement("span",{className:"cell-text styled-cell"},e))(Io(new Date(null===(l=o.original)||void 0===l?void 0:l.date),"dd/MM/yyyy")):""}},{Header:g("NOC_PRIMARY_OWNER_NAME_LABEL"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:g("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>g(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:_}})(c({},{parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:c({},g.tableForm,{limit:e.target.value})})},formState:g,totalCount:O,table:b,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";g.tableForm.sortBy===t&&g.tableForm.sortOrder===n||_({action:"mutateTableForm",data:c({},g.tableForm,{sortBy:t,sortOrder:l?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:l,table:o}=e;const{t:r}=i.useTranslation();return{data:null==o?void 0:o.map(e=>{let{applicationId:t,date:l,status:n,owner:o}=e;return{[r("NOC_APPLICATION_NUMBER")]:t,[r("TL_COMMON_TABLE_COL_APP_DATE")]:Io(new Date(l),"dd/MM/yyyy"),[r("NOC_PRIMARY_OWNER_NAME_LABEL")]:r(o),[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:o,value:i}=l;return n.createElement(t.RadioButtons,{onSelect:e=>{o(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:b}),F={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:c({},g.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==g?void 0:g.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({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:N,PropsForInboxLinks:L},P,R,F,{propsForInboxTable:x,propsForInboxMobileCards:B,formState:g})))},NOCSearchApplication:Lt,NewNOCStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),a=s.useDispatch(),[r,u]=l.useState(null),d=s.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(ko,{stepsList:Go,onSubmit:e=>{console.log("dataGet===",e)},step:d,setStep:e=>{a(Wo(e))}}),r&&n.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var o,r,u;let{config:d,onGoNext:m,onBackClick:v}=e;const p=s.useDispatch(),{t:E}=i.useTranslation(),[f,g]=l.useState(null),[_,h]=l.useState(""),[A,N]=l.useState([]),[S,b]=l.useState([]),y=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),D=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos});l.useEffect(()=>{bt.isEqual(A,C)||N(null==C?void 0:C.ownerIdList),bt.isEqual(S,D)||b(null==D?void 0:D.ownerPhotoList)},[C,D]);const O=Digit.UserService.getUser(),{control:T,handleSubmit:L,setValue:I,formState:{errors:w},trigger:P,watch:R,reset:x}=a.useForm({defaultValues:{owners:[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:"",PropertyOwnerName:"",PropertyOwnerMobileNumber:"",PropertyOwnerAddress:"",PropertyOwnerPlotArea:null,ownerType:""}]}}),B={Controller:a.Controller,control:T,setValue:I,errors:w,trigger:P,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:x,useFieldArray:a.useFieldArray,watch:R,config:d,ownerIdList:A,setOwnerIdList:N,ownerPhotoList:S,setOwnerPhotoList:b};function F(e){p(Ho(d.key,e)),p(Vo("ownerIdList",A)),p(zo("ownerPhotoList",S)),m()}function M(e){v(d.key,e)}const[k,U]=l.useState((null==y||null===(o=y.applicationDetails)||void 0===o?void 0:o.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!=y&&null!==(e=y.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&I("isRegisteredStakeHolder","true")},[]),n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:L(e=>{P(),function(e){var t,l,n,o,i;const a=null!=(t=null==S?void 0:S.length)?t:0,r=null!=(l=null==A?void 0:A.length)?l:0,u=null!=(n=null==e||null===(o=e.owners)||void 0===o?void 0:o.length)?n:0,d=new Set((null==e||null===(i=e.owners)||void 0===i?void 0:i.map(e=>null==e?void 0:e.mobileNumber))||[]).size!==u;return u!==a?(setTimeout(()=>{g(null)},3e3),g({key:"true",error:!0,message:E("UPLOAD_ALL_OWNER_PHOTOS_LABEL")}),!1):u!==r?(setTimeout(()=>{g(null)},3e3),g({key:"true",error:!0,message:E("UPLOAD_ALL_OWNER_IDS_LABEL")}),!1):!d||(setTimeout(()=>{g(null)},3e3),g({key:"true",error:!0,message:E("DUPLICATE_OWNER_FOUND_LABEL")}),!1)}(e)&&F(e)})},n.createElement("div",{className:"employeeCard"},k?n.createElement(n.Fragment,null,n.createElement(Zo,c({onGoBack:M,goNext:F,currentStepData:y,t:E},B)),n.createElement(Xo,c({onGoBack:M,goNext:F,currentStepData:y,t:E},B))):n.createElement(n.Fragment,null,n.createElement(Xo,c({onGoBack:M,goNext:F,currentStepData:y,t:E},B)))),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:()=>{g(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:o,onBackClick:r,onGoNext:u}=e;const{t:d}=i.useTranslation(),m=s.useDispatch(),[v,p]=l.useState(null),[E,f]=l.useState(""),{control:g,handleSubmit:_,setValue:h,formState:{errors:N},trigger:S,watch:b}=(Digit.UserService.getUser(),a.useForm({defaultValues:{floorArea:[{value:""}],vasikaNumber:"",vasikaDate:""}})),y=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData});console.log("currentStepData at step 2",y);const C=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),D=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos}),O={Controller:a.Controller,control:g,setValue:h,errors:N,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:a.useFieldArray,watch:b};let T;T=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 I(e){m(Ho(o.key,e)),u()}function w(e){r(o.key,e)}return n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:_(function(e){try{return S(),function(e){var t,l,n,o,i,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!==(o=n[0])&&void 0!==o&&o.value?parseFloat(null==e||null===(i=e.floorArea)||void 0===i||null===(a=i[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)?Promise.resolve(wt(function(){return Promise.resolve(Digit.NOCService.NOCsearch({tenantId:T,filters:{vasikaNumber:null==e?void 0:e.vasikaNumber,vasikaDate:A(null==e?void 0:e.vasikaDate)}})).then(function(t){var l,n,i,a,r,d,s;const v=null!=(l=null==t?void 0:t.Noc)?l:[],E=null==y||null===(n=y.apiData)||void 0===n||null===(i=n.Noc)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.applicationNo;v.find(e=>(null==e?void 0:e.applicationNo)&&"REJECTED"!==(null==e?void 0:e.status)&&(null==e?void 0:e.applicationNo)!==E)?p({key:"true",error:!0,message:"Active application already exists..."}):(m(Ho(o.key,e)),null!=y&&null!==(r=y.apiData)&&void 0!==r&&null!==(d=r.Noc)&&void 0!==d&&null!==(s=d[0])&&void 0!==s&&s.applicationNo?u():function(e){try{var t,l,n,o,i,a,r,d,s,v,E,f,g,_,h,N,S,b,y,O,L,I,w,P,R,x;console.log("formData",e);const B={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===(o=n.roadType)||void 0===o?void 0:o.name)||"",buildingStatus:(null==e||null===(i=e.siteDetails)||void 0===i||null===(a=i.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?void 0:s.district)||"",zone:(null==e||null===(v=e.siteDetails)||void 0===v||null===(E=v.zone)||void 0===E?void 0:E.name)||"",vasikaDate:null!=e&&null!==(f=e.siteDetails)&&void 0!==f&&f.vasikaDate?A(null==e||null===(g=e.siteDetails)||void 0===g?void 0:g.vasikaDate):"",specificationBuildingCategory:(null==e||null===(_=e.siteDetails)||void 0===_||null===(h=_.specificationBuildingCategory)||void 0===h?void 0:h.name)||"",specificationNocType:(null==e||null===(N=e.siteDetails)||void 0===N||null===(S=N.specificationNocType)||void 0===S?void 0:S.name)||"",specificationRestrictedArea:(null==e||null===(b=e.siteDetails)||void 0===b||null===(y=b.specificationRestrictedArea)||void 0===y?void 0:y.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(O=e.siteDetails)||void 0===O||null===(L=O.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.code)||""}),ownerPhotos:Array.isArray(null==D?void 0:D.ownerPhotoList)?D.ownerPhotoList:[],ownerIds:Array.isArray(null==C?void 0:C.ownerIdList)?C.ownerIdList:[]},F=null===(I=null!=(w=null==B||null===(P=B.applicationDetails)||void 0===P?void 0:P.owners)?w:[])||void 0===I?void 0:I.map((e,t)=>{var l,n,o;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==D||null===(n=D.ownerPhotoList)||void 0===n?void 0:n[t]),ownerId:c({},null==C||null===(o=C.ownerIdList)||void 0===o?void 0:o[t])}}}),M={Noc:{vasikaDate:A(null==e||null===(R=e.siteDetails)||void 0===R?void 0:R.vasikaDate),vasikaNumber:null==e||null===(x=e.siteDetails)||void 0===x?void 0:x.vasikaNumber,applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:T,owners:F,workflow:{action:"INITIATE"},nocDetails:{additionalDetails:B,tenantId:T}}};console.log("final Payload here==>",M);const k=wt(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:T,details:M})).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(Ho("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(k&&k.then?k.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(c({},y,{siteDetails:c({},e)})))})},function(){p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})):Promise.resolve()}catch(e){return Promise.reject(e)}})},n.createElement("div",{className:"employeeCard"},n.createElement(Jo,c({onGoBack:w,goNext:I,currentStepData:y,t:d},O)),n.createElement(Qo,c({onGoBack:w,goNext:I,currentStepData:y,t:d},O))),n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:w}),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:d(null==v?void 0:v.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:o,onGoNext:i,onBackClick:a,t:r}=e;const u=s.useDispatch(),[d,m]=l.useState(!1),[v,p]=l.useState(""),E=Digit.ULBService.getStateId(),{isLoading:f,data:g}=Digit.Hooks.pt.usePropertyMDMS(E,"NOC",["Documents"]),_=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}}),h=s.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",h);const A=s.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:o.currStepConfig,onSubmit:function(e){var t,l,n,o;const a=function(e){if(!f){var t,l,n,o,i,a,r;let u="VACANT"===(null==A||null===(t=A.siteDetails)||void 0===t||null===(l=t.buildingStatus)||void 0===l?void 0:l.code)?null==g||null===(n=g.NOC)||void 0===n?void 0:n.Documents.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==g||null===(o=g.NOC)||void 0===o?void 0:o.Documents;const d=(null==e||null===(i=e.documents)||void 0===i?void 0:i.documents)||[];(null==A||null===(a=A.applicationDetails)||void 0===a||null===(r=a.owners)||void 0===r?void 0:r.some(e=>{var t,l;const n=null!=(t=null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)?t:null==e?void 0:e.ownerType;return"firm"===String(n).toLowerCase()}))&&(u=u.map(e=>"OWNER.AUTHORIZATIONLETTER"===e.code?c({},e,{required:!0}):e));const s=u.filter(e=>e.required).map(e=>e.code),m=d.map(e=>e.documentType);return s.filter(e=>!m.includes(e))}}(e);return a.length>0?(p(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),m(!0),void setTimeout(()=>{m(!1),p("")},3e3)):null!=h&&null!==(t=h.Latitude1)&&void 0!==t&&t.trim()&&null!=h&&null!==(l=h.Latitude2)&&void 0!==l&&l.trim()&&null!=h&&null!==(n=h.Longitude1)&&void 0!==n&&n.trim()&&null!=h&&null!==(o=h.Longitude2)&&void 0!==o&&o.trim()?void i():(p(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),m(!0),void setTimeout(()=>{m(!1),p("")},3e3))},onFormValueChange:function(e,t){bt.isEqual(t,_)||u(Ho(o.key,t))},label:r(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),d&&n.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{m(!1),p("")}}))},NewNOCStepFormFour:e=>{var i,a,r,u,d,m,v,p,E,f,g,_,h,N,S,b,y,C,D;let{config:O,onBackClick:T,t:L}=e;s.useDispatch();const[I,w]=l.useState(null),[P,R]=l.useState(""),[x,B]=l.useState(!1),F=window.location.pathname.includes("edit");console.log("selectedCheckBox",x);const M=s.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)||{}}),k=s.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)||{}}),U=s.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)||[]}),H=s.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)||[]}),W=l.useRef();let j=Digit.UserService.getUser();const z=null==j||null===(i=j.info)||void 0===i||null===(a=i.roles)||void 0===a?void 0:a.map(e=>e.code),[V,G]=l.useState(!1);Digit.Hooks.useClickOutside(W,()=>{G(!1)},V);const Y=o.useHistory();let q;q=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const K=e=>{console.log("formData in parent SummaryPage",M),Q(M,e)},$=l.useMemo(()=>{var e,t,l,n,o,i;return{CalculationCriteria:[{applicationNumber:null==M||null===(e=M.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,tenantId:null==M||null===(n=M.apiData)||void 0===n||null===(o=n.Noc)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.tenantId,NOC:ee(M,{action:""}).Noc}]}},[M]),{isLoading:X,data:Z,revalidate:J}=Digit.Hooks.noc.useNOCFeeCalculator({payload:$},{enabled:!!$});l.useEffect(()=>{J()},[null==M?void 0:M.siteDetails,null==M?void 0:M.applicationDetails]),console.log("calculatorData",Z);const Q=function(e,t){try{var l,n,o,i;if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return w({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),setTimeout(()=>{w(null)},3e3),Promise.resolve();const a=ee(e,t),r=(null==Z||null===(l=Z.Calculation)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.taxHeadEstimates)||[];a.Noc.nocDetails.additionalDetails.calculations=[{isLatest:!0,updatedBy:null===(o=Digit.UserService.getUser())||void 0===o||null===(i=o.info)||void 0===i?void 0:i.name,taxHeadEstimates:r}],console.log("finalPayload here==>",a);const u=Pt(function(){return wt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:q,details:a})).then(function(e){var l,n,o,i,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?(w({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{Y.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),Y.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(w({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{Y.push("/digit-ui/employee/noc/inbox")},3e3)):Y.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(i=e.Noc)||void 0===i||null===(a=i[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),w({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),w({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{w(null)},3e3),e)throw t;return t});return Promise.resolve(u&&u.then?u.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function ee(e,t){var l,n,o,i,a,r,u,d,s,m,v,p,E,f,g,_,h,N,S,b,y,C,D,O,T,L,I,w,P,R,x,B,W,j;console.log("nocFormData",e);const z=c({},null==e||null===(l=e.apiData)||void 0===l||null===(n=l.Noc)||void 0===n?void 0:n[0],{vasikaNumber:(null==e||null===(o=e.siteDetails)||void 0===o?void 0:o.vasikaNumber)||"",vasikaDate:null!=e&&null!==(i=e.siteDetails)&&void 0!==i&&i.vasikaDate?A(null==e||null===(a=e.siteDetails)||void 0===a?void 0:a.vasikaDate):"",workflow:{action:(null==t?void 0:t.action)||""},nocDetails: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:c({},null==e||null===(s=e.apiData)||void 0===s||null===(m=s.Noc)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(p=e.siteDetails)||void 0===p||null===(E=p.ulbName)||void 0===E?void 0:E.name)||"",roadType:(null==e||null===(f=e.siteDetails)||void 0===f||null===(g=f.roadType)||void 0===g?void 0:g.name)||"",buildingStatus:(null==e||null===(_=e.siteDetails)||void 0===_||null===(h=_.buildingStatus)||void 0===h?void 0:h.name)||"",isBasementAreaAvailable:(null==e||null===(N=e.siteDetails)||void 0===N||null===(S=N.isBasementAreaAvailable)||void 0===S?void 0:S.code)||"",district:(null==e||null===(b=e.siteDetails)||void 0===b?void 0:b.district)||"",zone:(null==e||null===(y=e.siteDetails)||void 0===y||null===(C=y.zone)||void 0===C?void 0:C.name)||"",vasikaDate:null!=e&&null!==(D=e.siteDetails)&&void 0!==D&&D.vasikaDate?A(null==e||null===(O=e.siteDetails)||void 0===O?void 0:O.vasikaDate):"",specificationBuildingCategory:(null==e||null===(T=e.siteDetails)||void 0===T||null===(L=T.specificationBuildingCategory)||void 0===L?void 0:L.name)||"",specificationNocType:(null==e||null===(I=e.siteDetails)||void 0===I||null===(w=I.specificationNocType)||void 0===w?void 0:w.name)||"",specificationRestrictedArea:(null==e||null===(P=e.siteDetails)||void 0===P||null===(R=P.specificationRestrictedArea)||void 0===R?void 0:R.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(x=e.siteDetails)||void 0===x||null===(B=x.specificationIsSiteUnderMasterPlan)||void 0===B?void 0:B.code)||""}),coordinates:c({},k),ownerPhotos:Array.isArray(null==H?void 0:H.ownerPhotoList)?H.ownerPhotoList:[],ownerIds:Array.isArray(null==U?void 0:U.ownerIdList)?U.ownerIdList:[]})}),documents:[]}),V=(null==e||null===(W=e.documents)||void 0===W||null===(j=W.documents)||void 0===j?void 0:j.documents)||[];if(F){var G,Y,q;const e=(null==M||null===(G=M.apiData)||void 0===G||null===(Y=G.Noc)||void 0===Y||null===(q=Y[0])||void 0===q?void 0:q.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==V||null===(t=V.find(t=>t.documentType===e.documentType))||void 0===t?void 0:t.uuid)||(null==V||null===(l=V.find(t=>t.documentType===e.documentType))||void 0===l?void 0:l.documentAttachment);return c({},e,{uuid:n,documentAttachment:n})}),n=(null==V?void 0:V.filter(e=>!t.has(e.documentType)))||[],o=[...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",o),o.forEach(e=>{var t;null==z||null===(t=z.documents)||void 0===t||t.push(c({},e))})}else V.forEach(e=>{z.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({},z)}}function te(e){T(O.key,e)}console.log("currentStepData in StepFour",M);const le=(null==M||null===(r=M.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.applicationNo)||"";console.log("applicationNo here==>",le);const ne=Digit.Hooks.useWorkflowDetails({tenantId:q,id:le,moduleCode:"obpas_noc"});console.log("workflow Details here==>",ne);let oe=(null==ne||null===(m=ne.data)||void 0===m||null===(v=m.actionState)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==z?void 0:z.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==ne||null===(E=ne.data)||void 0===E||null===(f=E.nextActions)||void 0===f?void 0:f.filter(e=>(null==z?void 0:z.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));if(console.log("actions here",oe),X)return n.createElement(t.Loader,null);const ie=null==M||null===(g=M.apiData)||void 0===g||null===(_=g.Noc)||void 0===_||null===(h=_[0])||void 0===h||null===(N=h.nocDetails.additionalDetails)||void 0===N||null===(S=N.applicationDetails)||void 0===S||null===(b=S.owners)||void 0===b?void 0:b.map(e=>e.ownerOrFirmName),ae=null==ie?void 0:ie.join(", ");return n.createElement(n.Fragment,null,X&&n.createElement(t.Loader,null),n.createElement(ei,{onGoBack:te,goNext:K,currentStepData:M,t:L}),n.createElement(t.CheckBox,{label:"I/We hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+ae+"). I/We 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){B(e.target.checked)}(e),value:x,checked:x}),oe&&n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:te}),V&&(null!=ne&&null!==(y=ne.data)&&void 0!==y&&null!==(C=y.actionState)&&void 0!==C&&C.nextActions||null!=ne&&null!==(D=ne.data)&&void 0!==D&&D.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:oe,optionKey:"action",t:L,onSelect:function(e){K(e)}}):null,x&&n.createElement(t.SubmitBar,{ref:W,label:L("WF_TAKE_ACTION"),onSubmit:()=>G(!V)})),I&&n.createElement(t.Toast,{isDleteBtn:!0,error:null==I?void 0:I.error,warning:null==I?void 0:I.warning,label:L(null==I?void 0:I.message),onClose:()=>{w(null)}}))},NOCApplicantDetails:Xo,NOCProfessionalDetails:Zo,NOCSiteDetails:Jo,NOCFeeTable:bn,NOCSpecificationDetails:Qo,NOCDocumentsRequired:e=>{var o,i,a,r,u,d,m,v,p,E,f;let{t:_,config:h,onSelect:A,formData:N}=e;Digit.ULBService.getStateId();const[S,b]=l.useState(null==N||null===(o=N.documents)||void 0===o?void 0:o.documents);console.log("documents in childStep three",S);const[y,C]=l.useState(null),[D,O]=l.useState(!0),[T,L]=l.useState(!1),[I,w]=l.useState(null),P=Digit.ULBService.getStateId(),R=s.useDispatch(),{isLoading:x,data:B}=Digit.Hooks.pt.usePropertyMDMS(P,"NOC",["Documents"]);console.log("data for documents here",B),console.log("formData here =====",N);const F=s.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(F).length>0&&w(F)},[F]),console.log("coordinates (from redux)",F),console.log("geocoordinates",I);const M=s.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})||{},k=null==M||null===(i=M.applicationDetails)||void 0===i||null===(a=i.owners)||void 0===a?void 0:a.some(e=>{var t,l;const n=null!=(t=null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)?t:null==e?void 0:e.ownerType;return"firm"===String(n).toLowerCase()});let U="VACANT"===(null==M||null===(r=M.siteDetails)||void 0===r||null===(u=r.buildingStatus)||void 0===u?void 0:u.code)?null==B||null===(d=B.NOC)||void 0===d||null===(m=d.Documents)||void 0===m?void 0:m.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==B||null===(v=B.NOC)||void 0===v?void 0:v.Documents;var H;k&&(U=null===(H=U)||void 0===H?void 0:H.map(e=>"OWNER.AUTHORIZATIONLETTER"===e.code?c({},e,{required:!0}):e)),console.log("filteredDocuments",U),l.useEffect(()=>{b(e=>{const t=Array.isArray(e)?e:[],l=t.some(e=>"OWNER.AUTHORIZATIONLETTER"===e.documentType);return k&&!l?[...t,{documentType:"OWNER.AUTHORIZATIONLETTER",filestoreId:"",documentUid:"",documentAttachment:""}]:!k&&l?t.filter(e=>"OWNER.AUTHORIZATIONLETTER"!==e.documentType):t})},[k]);const W=()=>{let e;e=c({},N.documents,{documents:S}),A(h.key,e)};l.useEffect(()=>{var e,t;let l=0;null==B||null===(e=B.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;console.log("documents in pet",S),null==S||S.map(l=>{e.required&&null!=l&&l.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(l+=1)}),O("0"!=l&&0!=l||!((null==S?void 0:S.length)>0))},[S,T]),l.useEffect(()=>{var e,t;"VACANT"===(null==M||null===(e=M.siteDetails)||void 0===e||null===(t=e.buildingStatus)||void 0===t?void 0:t.code)&&b(e=>null==e?void 0:e.filter(e=>"OWNER.BUILDINGDRAWING"!==e.documentType))},[null==M||null===(p=M.siteDetails)||void 0===p||null===(E=p.buildingStatus)||void 0===E?void 0:E.code]);const j={value:{workflowDocs:null==S?void 0:S.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:z}=Digit.Hooks.noc.useNOCDocumentSearch(j),V=null==S?void 0:S.map(e=>({code:e.documentType,link:g(null==z?void 0:z.pdfFiles,e.filestoreId)}));return n.createElement("div",null,x?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:_,config:h,onSelect:W,onSkip:()=>A(),isDisabled:D,onAdd:function(){}},null===(f=U)||void 0===f?void 0:f.map((e,t)=>{var l;return n.createElement("div",{className:"bpa-doc-required-card"},n.createElement(ti,{key:t,document:e,t:_,error:y,setError:C,setDocuments:b,documents:S,setCheckRequiredFields:L,handleSubmit:W,geocoordinates:I,setGeoCoordinates:w,dispatch:R,previewLink:null==V||null===(l=V.find(t=>t.code===e.code))||void 0===l?void 0:l.link}))}),y&&n.createElement(t.Toast,{label:y,isDleteBtn:!0,onClose:()=>C(null),error:!0})))},NOCSummary:ei,NOCDocumentWithLatLong:e=>{var o,i,a;let{t:r,config:u,onSelect:d,formData:s}=e;const m=Digit.ULBService.getStateId(),[v,p]=l.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]),[E,f]=l.useState(null),[g,_]=l.useState(!0),[h,A]=l.useState(!1),[N,S]=l.useState(!1),b=St((null==s?void 0:s.PrevStateDocuments)||[]),{isLoading:y,data:C}=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==C||null===(e=C.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,o,i,a;return e==(null==l||null===(n=l.documentType)||void 0===n||null===(o=n.split("."))||void 0===o?void 0:o[0])+"."+(null==l||null===(i=l.documentType)||void 0===i||null===(a=i.split("."))||void 0===a?void 0:a[1])||t},!1));_(!((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,y?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:r,config:u,onSelect:D,onSkip:()=>d(),onAdd:function(){}},null==C||null===(i=C.NOC)||void 0===i||null===(a=i.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(li,{key:t,document:e,t:r,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:A,formData:s,beforeUploadDocuments:b||[],isNextButtonDisabled:N,setIsNextButtonDisabled:S,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=o.useLocation(),{pathname:d,state:s}=u,{t:c}=i.useTranslation(),m=o.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:p}=Digit.Hooks.useStore.getInitData(),{tenants:f}=p||{},g=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:g,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(E(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=wt(function(){var e,t,l,n;const o=v,i=null==o||null===(e=o.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==i?void 0:i.ulbType,r=(null==i||null===(l=i.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==i?void 0:i.ulbName),u=f.find(e=>e.code===o.tenantId);return Promise.resolve(xt(o,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}=i.useTranslation(),s=(o.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 i;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(o.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(i=e.Applications)||void 0===i?void 0:i.applicationNo)},n.createElement(t.SubmitBar,{label:d(E[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,d,s,v,E,f,g,_,h,N,S,b,y,C,D,O,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne,Se,be,ye,Ce,De,Oe,Te,Le,Ie,we,Pe;const Re=function(e){let{tenantId:t,payments:l,pdfkey:n,EmpData:o}=e;m(e,oi);try{var i;const e=null==je||null===(i=je.Noc)||void 0===i?void 0:i[0];return Promise.resolve(Pt(function(){return wt(function(){if(Ke(!0),!e)throw new Error("Noc Application data is missing");return Promise.resolve(Fn(e,Be,o,ze)).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(Ke(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}},{id:xe}=o.useParams();console.log("id",xe.length);const{t:Be}=i.useTranslation(),Fe=o.useHistory(),Me=window.localStorage.getItem("CITIZEN.CITY"),[ke,Ue]=l.useState({}),{isLoading:He,data:We}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:xe},Me),je=null==We?void 0:We.resData;console.log("applicationD",je);const[ze,Ve]=l.useState(null),{data:Ge}=(null==je||null===(e=je.Noc)||void 0===e||null===(a=e[0])||void 0===a||null===(r=a.nocDetails)||void 0===r||null===(u=r.additionalDetails)||void 0===u||null===(d=u.calculations)||void 0===d||d.find(e=>e.isLatest),Digit.Hooks.useStore.getInitData()),{tenants:Ye}=Ge||{},[qe,Ke]=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 Xe=null===(s=$e)||void 0===s||null===(v=s.info)||void 0===v||null===(E=v.roles)||void 0===E?void 0:E.map(e=>e.code);l.useEffect(()=>{var e;const t=null==je||null===(e=je.Noc)||void 0===e?void 0:e[0];if(t){var l,n,o,i,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===(o=t.nocDetails)||void 0===o||null===(i=o.additionalDetails)||void 0===i?void 0:i.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)||[];Ue({applicantDetails:e?[e]:[],siteDetails:s?[s]:[],coordinates:c?[c]:[],Documents:m.length>0?m:[],ownerPhotoList:v})}},[null==je?void 0:je.Noc]);const Ze=null!=(f=null==je||null===(g=je.Noc)||void 0===g||null===(_=g[0])||void 0===_||null===(h=_.nocDetails)||void 0===h||null===(N=h.additionalDetails)||void 0===N?void 0:N.businessService)?f:null,{data:Je,isLoading:Qe}=Digit.Hooks.useRecieptSearch({tenantId:Me,businessService:"obpas_noc",consumerCodes:xe,isEmployee:!1},{enabled:!!xe}),et=[];let tt=p(Me,xe);"APPROVED"===(null==je||null===(S=je.Noc)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.applicationStatus)&&(et.push({label:Be("DOWNLOAD_CERTIFICATE"),onClick:function(){try{var e,t,l,n,o;const i=null==je||null===(e=je.Noc)||void 0===e?void 0:e[0],a=Ye.find(e=>e.code===i.tenantId),r=null==i||null===(t=i.nocDetails)||void 0===t||null===(l=t.additionalDetails)||void 0===l?void 0:l.siteDetails,u=null==r||null===(n=r.ulbName)||void 0===n||null===(o=n.city)||void 0===o?void 0:o.name;return Promise.resolve(xt(i,a,null==r?void 0:r.ulbType,u,Be)).then(function(e){Digit.Utils.pdf.generateFormatted(e)})}catch(e){return Promise.reject(e)}}}),Je&&(null==Je?void 0:Je.Payments.length)>0&&!Qe&&(et.push({label:Be("PDF_STATIC_LABEL_WS_CONSOLIDATED_SANCTION_LETTER"),onClick:()=>{var e;return Re({tenantId:null==Je||null===(e=Je.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Je?void 0:Je.Payments[0],pdfkey:"noc-sanctionletter",EmpData:tt})}}),et.push({label:Be("CHB_FEE_RECEIPT"),onClick:()=>{var e;return Re({tenantId:null==Je||null===(e=Je.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Je?void 0:Je.Payments[0],pdfkey:"noc-receipt",EmpData:tt})}})));const lt=e=>{if(0===e)return Be("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+" "+Be("NOC_FLOOR_AREA_LABEL")},[nt,ot]=l.useState(null),[it,at]=l.useState(!1),[rt,ut]=l.useState(null),[dt,st]=l.useState(!1),[ct,mt]=l.useState(!1),vt=l.useRef();Digit.Hooks.useClickOutside(vt,()=>{at(!1)},it);const pt=Digit.Hooks.useWorkflowDetails({tenantId:Me,id:xe,moduleCode:Ze});var Et,ft;null!=pt&&null!==(y=pt.data)&&void 0!==y&&null!==(C=y.actionState)&&void 0!==C&&C.nextActions&&!pt.isLoading&&(pt.data.actionState.nextActions=[...null==pt||null===(D=pt.data)||void 0===D?void 0:D.nextActions]),pt&&pt.data&&!pt.isLoading&&(pt.data.initialActionState=(null==pt||null===(Et=pt.data)||void 0===Et?void 0:Et.initialActionState)||c({},null==pt||null===(ft=pt.data)||void 0===ft?void 0:ft.actionState)||{},pt.data.actionState=c({},pt.data)),l.useEffect(()=>{pt&&pt.revalidate(),We&&We.revalidate()},[]);let gt=(null==pt||null===(O=pt.data)||void 0===O||null===(T=O.actionState)||void 0===T||null===(L=T.nextActions)||void 0===L?void 0:L.filter(e=>(null==Xe?void 0:Xe.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==pt||null===(I=pt.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.filter(e=>(null==Xe?void 0:Xe.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));console.log("actions here",gt),l.useEffect(()=>{if(pt&&pt.data&&!pt.isLoading){var e,t,l;const n=null==pt||null===(e=pt.data)||void 0===e||null===(t=e.timeline)||void 0===t||null===(l=t.filter(e=>"APPROVE"===(null==e?void 0:e.performedAction)))||void 0===l?void 0:l.flatMap(e=>(null==e?void 0:e.wfComment)||[]),o=null==n?void 0:n[0];Ve(n?"The above approval is subjected to the following conditions: "+o:"")}},[pt]);const _t=e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t},ht=null==je||null===(P=je.Noc)||void 0===P||null===(R=P[0])||void 0===R||null===(x=R.nocDetails)||void 0===x||null===(B=x.additionalDetails)||void 0===B?void 0:B.coordinates;if(He)return n.createElement(t.Loader,null);console.log("displayData=>",ke);const At=null==ke||null===(F=ke.Documents)||void 0===F?void 0:F.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),Nt=null==ke||null===(M=ke.Documents)||void 0===M?void 0:M.filter(e=>!("OWNER.SITEPHOTOGRAPHONE"===(null==e?void 0:e.documentType)||"OWNER.SITEPHOTOGRAPHTWO"===(null==e?void 0:e.documentType))),St=null==ke||null===(k=ke.applicantDetails)||void 0===k||null===(U=k[0])||void 0===U||null===(H=U.owners)||void 0===H?void 0:H[0],bt=null==je||null===(W=je.Noc)||void 0===W||null===(j=W[0])||void 0===j||null===(z=j.nocDetails.additionalDetails)||void 0===z||null===(V=z.applicationDetails)||void 0===V||null===(G=V.owners)||void 0===G?void 0:G.map(e=>e.ownerOrFirmName),yt=null==bt?void 0:bt.join(", ");return console.log("combinerOwnersName",yt),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"}},Be("NOC_APP_OVER_VIEW_HEADER")),n.createElement(t.LinkButton,{label:Be("VIEW_TIMELINE"),onClick:()=>{mt(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}),qe&&n.createElement(t.Loader,null),et&&et.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>st(!dt),displayOptions:dt,options:et})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Be("OWNER_OWNERPHOTO")),n.createElement(Cn,{ownerFileStoreId:null==ke||null===(Y=ke.ownerPhotoList)||void 0===Y||null===(q=Y[0])||void 0===q?void 0:q.filestoreId,ownerName:null==ke||null===(K=ke.applicantDetails)||void 0===K||null===($=K[0])||void 0===$||null===(X=$.owners)||void 0===X||null===(Z=X[0])||void 0===Z?void 0:Z.ownerOrFirmName})),xe.length>0&&n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Be("APPLICATIONNO"),text:xe||"N/A"}))))),null==ke||null===(J=ke.applicantDetails)||void 0===J||null===(Q=J[0])||void 0===Q||null===(ee=Q.owners)||void 0===ee?void 0:ee.map((e,l)=>{var o,i,a;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?Be("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:Be("NOC_OWNER_TYPE_LABEL"),text:null!=e&&null!==(o=e.ownerType)&&void 0!==o&&o.i18nKey?Be(null==e||null===(i=e.ownerType)||void 0===i?void 0:i.i18nKey):"N/A"}),n.createElement(t.Row,{label:Be("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_APPLICANT_DOB_LABEL"),text:_t(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(a=e.gender)||void 0===a?void 0:a.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"})))))}),(null==ke||null===(te=ke.applicantDetails)||void 0===te?void 0:te.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==ke||null===(le=ke.applicantDetails)||void 0===le?void 0:le.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Be("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:Be("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),text:(null==e?void 0:e.professionalRegIdValidity)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),St&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Be("NOC_PROPERTY_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Be("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==St?void 0:St.propertyId)||"N/A"}),n.createElement(t.Row,{label:Be("PROPERTY_OWNER_NAME"),text:(null==St?void 0:St.PropertyOwnerName)||"N/A"}),n.createElement(t.Row,{label:Be("PROPERTY_OWNER_MOBILE_NUMBER"),text:(null==St?void 0:St.PropertyOwnerMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Be("WS_PROPERTY_ADDRESS_LABEL"),text:(null==St?void 0:St.PropertyOwnerAddress)||"N/A"}),n.createElement(t.Row,{label:Be("PROPERTY_PLOT_AREA"),text:(null==St?void 0:St.PropertyOwnerPlotArea)||"N/A"}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Be("NOC_SITE_DETAILS")),null==ke||null===(ne=ke.siteDetails)||void 0===ne?void 0:ne.map((e,l)=>{var o,i,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:Be("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_ULB_NAME_LABEL"),text:(null==e||null===(o=e.ulbName)||void 0===o?void 0:o.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(i=e.roadType)||void 0===i?void 0:i.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:Be("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:Be("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:Be("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:lt(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:Be("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),n.createElement(t.Row,{label:Be("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:Be("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:Be("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_VASIKA_DATE"),text:(null==e?void 0:e.vasikaDate)||"N/A"}),n.createElement(t.Row,{label:Be("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,Be("NOC_SPECIFICATION_DETAILS")),null==ke||null===(oe=ke.siteDetails)||void 0===oe?void 0:oe.map((e,l)=>{var o,i,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:Be("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(o=e.specificationBuildingCategory)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:Be("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(i=e.specificationNocType)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:Be("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:Be("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,Be("BPA_UPLOADED _SITE_PHOTOGRAPHS_LABEL")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==At?void 0:At.length)>0&&(null==At?void 0:At.map(e=>n.createElement(Bn,{filestoreId:(null==e?void 0:e.filestoreId)||(null==e?void 0:e.uuid),documentType:null==e?void 0:e.documentType,coordinates:ht}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Be("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==je||null===(ie=je.Noc)||void 0===ie||null===(ae=ie[0])||void 0===ae||null===(re=ae.nocDetails)||void 0===re||null===(ue=re.additionalDetails)||void 0===ue||null===(de=ue.ownerIds)||void 0===de?void 0:de.length)>0&&n.createElement(Sn,{documents:[...(null==je||null===(se=je.Noc)||void 0===se||null===(ce=se[0])||void 0===ce||null===(me=ce.nocDetails)||void 0===me||null===(ve=me.additionalDetails)||void 0===ve?void 0:ve.ownerIds)||[]].reverse()}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Be("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==Nt?void 0:Nt.length)>0&&n.createElement(Sn,{documents:Nt}))),"APPROVED"===(null==je||null===(pe=je.Noc)||void 0===pe||null===(Ee=pe[0])||void 0===Ee?void 0:Ee.applicationStatus)&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Be("NOC_FEE_DETAILS_LABEL")),(null==je||null===(fe=je.Noc)||void 0===fe||null===(ge=fe[0])||void 0===ge?void 0:ge.nocDetails)&&n.createElement(yn,{formData:{apiData:c({},je),applicationDetails:c({},null==je||null===(_e=je.Noc)||void 0===_e||null===(he=_e[0])||void 0===he||null===(Ae=he.nocDetails)||void 0===Ae||null===(Ne=Ae.additionalDetails)||void 0===Ne?void 0:Ne.applicationDetails),siteDetails:c({},null==je||null===(Se=je.Noc)||void 0===Se||null===(be=Se[0])||void 0===be||null===(ye=be.nocDetails)||void 0===ye||null===(Ce=ye.additionalDetails)||void 0===Ce?void 0:Ce.siteDetails),calculations:(null==je||null===(De=je.Noc)||void 0===De||null===(Oe=De[0])||void 0===Oe||null===(Te=Oe.nocDetails)||void 0===Te||null===(Le=Te.additionalDetails)||void 0===Le?void 0:Le.calculations)||[]},disable:!0})),n.createElement(t.CheckBox,{label:"I/We hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+yt+"). I/We 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.",checked:"true"}),n.createElement("div",{id:"timeline"},n.createElement(dn,{workflowDetails:pt,t:Be})),gt&>.length>0&&n.createElement(t.ActionBar,null,it&&(null!=pt&&null!==(Ie=pt.data)&&void 0!==Ie&&null!==(we=Ie.actionState)&&void 0!==we&&we.nextActions||null!=pt&&null!==(Pe=pt.data)&&void 0!==Pe&&Pe.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:gt,optionKey:"action",t:Be,onSelect:function(e){var t,l;console.log("selected action",e);const n=null==je||null===(t=je.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,o={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?Fe.push("/digit-ui/citizen/noc/edit-application/"+n):"DRAFT"==(null==e?void 0:e.action)?(ot({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{ot(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,n,o,i,a,r,u;const d=(null==je||null===(t=je.Noc)||void 0===t?void 0:t[0])||{},s=c({},d,{vasikaNumber:(null==d||null===(l=d.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(o=n.siteDetails)||void 0===o?void 0:o.vasikaNumber)||"",vasikaDate:A(null==d||null===(i=d.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.vasikaDate)||"",workflow:{}});console.log("updatedApplicant",s);const m=null==e||null===(u=e.Licenses)||void 0===u?void 0:u[0];s.workflow={action:m.action,assignes:null==m?void 0:m.assignee,comment:null==m?void 0:m.comment,documents:null==m?void 0:m.wfDocuments};const v={Noc:c({},s)},p=Pt(function(){return wt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:Me,details:v})).then(function(e){var t,l,n;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==m?void 0:m.action)?(ot({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),pt.revalidate(),ut(null)):(console.log("We are calling citizen response page"),Fe.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}})):(ot({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),ut(null))})},function(){ot({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{ot(null)},3e3),e)throw t;return t});Promise.resolve(p&&p.then?p.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(o):"PAY"==(null==e?void 0:e.action)?Fe.push("/digit-ui/citizen/payment/collect/obpas_noc/"+n+"/"+Me+"?tenantId="+Me):ut(e)}}):null,n.createElement(t.SubmitBar,{ref:vt,label:Be("WF_TAKE_ACTION"),onSubmit:()=>at(!it)})),nt&&n.createElement(t.Toast,{error:null==nt?void 0:nt.error,warning:null==nt?void 0:nt.warning,label:Be(null==nt?void 0:nt.message),isDleteBtn:!0,onClose:()=>{ot(null)}}))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,d,s,v,E,f,g,_,h,N,S,b,y,C,D,O,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne,Se,be,ye,Ce,De,Oe,Te,Le,Ie,we,Pe,Re,xe,Be,Fe,Me,ke,Ue,He,We,je,ze,Ve,Ge,Ye,qe,Ke,$e;const{id:Xe}=o.useParams(),{t:Ze}=i.useTranslation(),Je=window.localStorage.getItem("Employee.tenant-id"),Qe=o.useHistory(),et=null==Je?void 0:Je.split(".")[0],[tt,lt]=l.useState(null),[nt,ot]=l.useState(null),[it,at]=l.useState(null),[rt,ut]=l.useState(null),[dt,st]=l.useState({}),[ct,mt]=l.useState(null),[vt,pt]=l.useState([]),[Et,ft]=l.useState(!1),[gt,_t]=l.useState([]),[ht,At]=l.useState([]),{isLoading:Nt,data:St,refetch:bt}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:Xe},Je),yt=Nt||Et,Ct=null==St?void 0:St.resData,[Dt,Ot]=l.useState(!1),[Tt,Lt]=l.useState(null),It=null===(e=window)||void 0===e||null===(a=e.Digit)||void 0===a||null===(r=a.Utils)||void 0===r||null===(u=r.browser)||void 0===u?void 0:u.isMobile(),[Rt,xt]=l.useState(null!=Ct&&null!==(d=Ct.Noc)&&void 0!==d&&null!==(s=d[0])&&void 0!==s&&null!==(v=s.nocDetails)&&void 0!==v&&null!==(E=v.additionalDetails)&&void 0!==E&&E.siteImages?{documents:null==Ct||null===(f=Ct.Noc)||void 0===f||null===(g=f[0])||void 0===g||null===(_=g.nocDetails)||void 0===_||null===(h=_.additionalDetails)||void 0===h?void 0:h.siteImages}:{}),{mutate:Bt,isLoading:Ft,error:Mt}=Digit.Hooks.tl.useESign(),[kt,Ut]=l.useState(!1);console.log("applicationDetails here==>",Ct);const Ht=null!=(N=null==Ct||null===(S=Ct.Noc)||void 0===S||null===(b=S[0])||void 0===b||null===(y=b.nocDetails)||void 0===y||null===(C=y.additionalDetails)||void 0===C?void 0:C.businessService)?N:null;console.log("businessService here==>",Ht);const{data:Wt,isLoading:jt}=Digit.Hooks.useRecieptSearch({tenantId:Je,businessService:"obpas_noc",consumerCodes:Xe,isEmployee:!1},{enabled:!!Xe}),zt=Digit.Hooks.useWorkflowDetails({tenantId:Je,id:Xe,moduleCode:Ht});console.log("workflowDetails here=>",zt),l.useEffect(()=>{Mt&<({key:"error",error:!0,label:Mt.message||"eSign process failed. Please try again."})},[Mt]);const Vt=l.useMemo(()=>{var e;if(null!=Rt&&Rt.documents&&(null==Rt?void 0:Rt.documents.length)>0)return null==Rt||null===(e=Rt.documents)||void 0===e?void 0:e.map(e=>({latitude:(null==e?void 0:e.latitude)||"",longitude:(null==e?void 0:e.longitude)||""}))},[Rt]),Gt=l.useMemo(()=>{var e;return null==Rt||null===(e=Rt.documents)||void 0===e?void 0:e.map((e,t)=>({title:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.filestoreId,latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude}))},[Rt]);var Yt,qt;Ze("BPA_SITES"),Ze(" "),null!=zt&&null!==(D=zt.data)&&void 0!==D&&null!==(O=D.actionState)&&void 0!==O&&O.nextActions&&!zt.isLoading&&(zt.data.actionState.nextActions=[...null==zt||null===(T=zt.data)||void 0===T?void 0:T.nextActions]),zt&&zt.data&&!zt.isLoading&&(zt.data.initialActionState=(null==zt||null===(Yt=zt.data)||void 0===Yt?void 0:Yt.initialActionState)||c({},null==zt||null===(qt=zt.data)||void 0===qt?void 0:qt.actionState)||{},zt.data.actionState=c({},zt.data));const 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"})),$t=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Kt,null));l.useEffect(()=>{!Nt&&Je&&Ht&&function(){try{const e=Pt(function(){return wt(function(){return ft(!0),Promise.resolve(Digit.WorkflowService.init(Je,Ht)).then(function(e){var t,l;console.log("wf=>",e),ft(!1),_t(null==e||null===(t=e.BusinessServices)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.states)})},function(e){console.error("Error Occurred",e)})},function(e,t){if(ft(!1),e)throw t;return t});e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Je,Ht,Nt]),l.useEffect(()=>{if(zt&&zt.data&&!zt.isLoading){var e,t,l;const n=null==zt||null===(e=zt.data)||void 0===e||null===(t=e.timeline)||void 0===t||null===(l=t.filter(e=>"APPROVE"===(null==e?void 0:e.performedAction)))||void 0===l?void 0:l.flatMap(e=>(null==e?void 0:e.wfComment)||[]),o=null==n?void 0:n[0];mt(n?"The above approval is subjected to the following conditions: "+o:"")}},[zt]);const Xt=[];let Zt=p(Je,Xe);"APPROVED"===(null==Ct||null===(L=Ct.Noc)||void 0===L||null===(I=L[0])||void 0===I?void 0:I.applicationStatus)&&Wt&&(null==Wt?void 0:Wt.Payments.length)>0&&!jt&&Xt.push({label:Ft?"🔄 Preparing eSign...":"📤 eSign Certificate",onClick:function(){try{const e=wt(function(){var e;return console.log("🎯 Starting certificate eSign process with custom hook..."),Promise.resolve(function(e){let{tenantId:t,payments:l,pdfkey:n,EmpData:o}=e;m(e,kn);try{var i;const e=null==Ct||null===(i=Ct.Noc)||void 0===i?void 0:i[0];return Promise.resolve(Pt(function(){return wt(function(){if(ft(!0),!e)throw new Error("Noc Application data is missing");return Promise.resolve(Fn(e,Ze,o,ct)).then(function(e){return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},l,{Noc:e.Noc})]},n)).then(function(e){var t;const l=null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0];if(!l)throw new Error("Failed to generate filestoreId");return l})})},function(e){console.error("Sanction Letter download error:",e)})},function(e,t){if(ft(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}({tenantId:null==Wt||null===(e=Wt.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Wt?void 0:Wt.Payments[0],pdfkey:"noc-sanctionletter",EmpData:Zt})).then(function(e){Bt({fileStoreId:e,tenantId:Je},{onSuccess:()=>{console.log("✅ eSign process initiated successfully")},onError:e=>{console.error("❌ Certificate eSign failed:",e),lt({key:"error",error:!0,label:e.message||"Failed to initiate digital signing process"})}})})},function(e){console.error("❌ Certificate preparation failed:",e),lt({key:"error",error:!0,label:e.message||"Failed to prepare certificate for eSign"})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:Ft}),l.useEffect(()=>{var e,t,l,n,o,i,a;const r=null==Ct||null===(e=Ct.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(o=n.calculations)||void 0===o?void 0:o.find(e=>e.isLatest),u=(null==St||null===(i=St.Calculation)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.taxHeadEstimates)||[];0!==u.length&&At(function(e){void 0===e&&(e=[]);const t=(e||[]).reduce((e,t)=>(null!=t&&t.taxHeadCode&&(e[t.taxHeadCode]=t),e),{});return u.map(e=>{var l,n,o,i,a,u,d,s,c;const m=null==r||null===(l=r.taxHeadEstimates)||void 0===l?void 0:l.find(t=>t.taxHeadCode===e.taxHeadCode),v=t[e.taxHeadCode]||{},p=!!v.edited;return{taxHeadCode:e.taxHeadCode,category:e.category,adjustedAmount:p?v.adjustedAmount:null!=(n=null!=(o=e.estimateAmount)?o:null==m?void 0:m.estimateAmount)?n:0,remark:p?null!=(i=v.remark)?i:"":null!=(a=null!=(u=e.remarks)?u:null==m?void 0:m.remarks)?a:"",filestoreId:void 0!==(null==v?void 0:v.filestoreId)?v.filestoreId:null!=(d=null!=(s=e.filestoreId)?s:null==m?void 0:m.filestoreId)?d:null,onDocumentLoading:!1,documentError:null,edited:null!=(c=v.edited)&&c}})})},[Ct,St]);const[Jt,Qt]=l.useState(!1),[el,tl]=l.useState(null),[ll,nl]=l.useState(!1),[ol,il]=l.useState(!1),al=()=>{lt(null)};let rl=Digit.UserService.getUser();const ul=l.useRef();if(Digit.Hooks.useClickOutside(ul,()=>{Qt(!1)},Jt),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};rl=null==t?void 0:t.value}const dl=null===(w=rl)||void 0===w||null===(P=w.info)||void 0===P||null===(R=P.roles)||void 0===R?void 0:R.map(e=>e.code);l.useEffect(()=>{zt&&zt.revalidate(),St&&St.revalidate()},[]);let sl=(null==zt||null===(x=zt.data)||void 0===x||null===(B=x.actionState)||void 0===B||null===(F=B.nextActions)||void 0===F?void 0:F.filter(e=>(null==dl?void 0:dl.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==zt||null===(M=zt.data)||void 0===M||null===(k=M.nextActions)||void 0===k?void 0:k.filter(e=>(null==dl?void 0:dl.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));console.log("actions here",sl),l.useEffect(()=>{var e;const t=null==Ct||null===(e=Ct.Noc)||void 0===e?void 0:e[0];if(t){var l,n,o,i,a,r,u,d,s,c;const e=null==t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.applicationDetails,m=null==t||null===(o=t.nocDetails)||void 0===o||null===(i=o.additionalDetails)||void 0===i?void 0:i.siteDetails,v=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,p=(null==t?void 0:t.documents)||[],E=(null==t||null===(u=t.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.ownerPhotos)||[];st({applicantDetails:e?[e]:[],siteDetails:m?[m]:[],coordinates:v?[v]:[],Documents:p.length>0?p:[],ownerPhotoList:E});const f=null==t||null===(s=t.nocDetails)||void 0===s||null===(c=s.additionalDetails)||void 0===c?void 0:c.siteImages;xt(f?{documents:f}:{})}},[null==Ct?void 0:Ct.Noc]);const cl="FIELDINSPECTION_INPROGRESS"===(null==Ct||null===(U=Ct.Noc)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.applicationStatus),ml=function(e){try{var t,l,n,o,i,a,r,u,d,s,m,v;const p=(null==Ct||null===(t=Ct.Noc)||void 0===t?void 0:t[0])||{};console.log("payloadData",p);const E=(null==p||null===(l=p.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(o=n.siteDetails)||void 0===o?void 0:o.vasikaNumber)||"",f=A(null==p||null===(i=p.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.vasikaDate)||"";if(!cl){const e=(ht||[]).some(e=>{var t;return(null!=(t=e.adjustedAmount)?t:0)>0}),t=(ht||[]).every(e=>!e.edited||e.remark&&""!==e.remark.trim());if(!e)return lt({key:"true",error:!0,message:"Please enter a fee amount before submission."}),Promise.resolve();if(!t)return lt({key:"true",error:!0,message:"Remarks are mandatory for all fee rows."}),Promise.resolve()}const g={isLatest:!0,updatedBy:null===(u=Digit.UserService.getUser())||void 0===u||null===(d=u.info)||void 0===d?void 0:d.name,taxHeadEstimates:ht.filter(e=>"NOC_TOTAL"!==e.taxHeadCode).map(e=>{var t;return{taxHeadCode:e.taxHeadCode,estimateAmount:null!=(t=e.adjustedAmount)?t:0,category:e.category,remarks:e.remark||null,filestoreId:e.filestoreId||null}})},_=((null==p||null===(s=p.nocDetails)||void 0===s||null===(m=s.additionalDetails)||void 0===m?void 0:m.calculations)||[]).map(e=>c({},e,{isLatest:!1})),h=c({},p,{vasikaNumber:E,vasikaDate:f,workflow:{},nocDetails:c({},p.nocDetails,{additionalDetails:c({},p.nocDetails.additionalDetails,{calculations:[..._,g],siteImages:(null==Rt?void 0:Rt.documents)||[]})})});console.log("updatedApplicant",h);const N=null==e||null===(v=e.Licenses)||void 0===v?void 0:v[0];h.workflow={action:N.action,assignes:null==N?void 0:N.assignee,comment:null==N?void 0:N.comment,documents:null==N?void 0:N.wfDocuments};const S={Noc:c({},h)};console.log("final Payload ",S);const b=Pt(function(){return wt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:Je,details:S})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==N?void 0:N.action))lt({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),zt.revalidate(),tl(null),setTimeout(()=>{Qe.push("/digit-ui/employee/noc/inbox")},3e3);else if("APPLY"===(null==N?void 0:N.action)||"RESUBMIT"===(null==N?void 0:N.action)||"DRAFT"===(null==N?void 0:N.action)){var l,n;console.log("We are calling employee response page"),Qe.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 lt({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),zt.revalidate(),bt(),At(e=>(e||[]).map(e=>c({},e,{edited:!1}))),tl(null),setTimeout(()=>{Qe.push("/digit-ui/employee/noc/inbox")},3e3);else lt({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),tl(null)})},function(){lt({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{lt(null)},3e3),e)throw t;return t});return Promise.resolve(b&&b.then?b.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},vl=e=>{if(0===e)return Ze("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+" "+Ze("NOC_FLOOR_AREA_LABEL")};if(yt)return n.createElement(t.Loader,null);const pl=e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t},El=null==Ct||null===(W=Ct.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.coordinates;console.log("displayData here",dt);const fl=null==dt||null===(G=dt.Documents)||void 0===G?void 0:G.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),gl=null==dt||null===(Y=dt.Documents)||void 0===Y?void 0:Y.filter(e=>!("OWNER.SITEPHOTOGRAPHONE"===(null==e?void 0:e.documentType)||"OWNER.SITEPHOTOGRAPHTWO"===(null==e?void 0:e.documentType))),_l=null==Ct||null===(q=Ct.Noc)||void 0===q||null===(K=q[0])||void 0===K||null===($=K.nocDetails.additionalDetails)||void 0===$||null===(X=$.applicationDetails)||void 0===X||null===(Z=X.owners)||void 0===Z?void 0:Z.map(e=>e.ownerOrFirmName),hl=null==_l?void 0:_l.join(", "),Al=null==dt||null===(J=dt.applicantDetails)||void 0===J||null===(Q=J[0])||void 0===Q||null===(ee=Q.owners)||void 0===ee?void 0:ee[0];return 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"}},Ze("NOC_APP_OVER_VIEW_HEADER")),n.createElement(t.LinkButton,{label:Ze("VIEW_TIMELINE"),onClick:()=>{il(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}),yt&&n.createElement(t.Loader,null),Xt&&Xt.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>Ut(!kt),displayOptions:kt,options:Xt})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("OWNER_OWNERPHOTO")),n.createElement(Cn,{ownerFileStoreId:null==dt||null===(te=dt.ownerPhotoList)||void 0===te||null===(le=te[0])||void 0===le?void 0:le.filestoreId,ownerName:null==dt||null===(ne=dt.applicantDetails)||void 0===ne||null===(oe=ne[0])||void 0===oe||null===(ie=oe.owners)||void 0===ie||null===(ae=ie[0])||void 0===ae?void 0:ae.ownerOrFirmName})),Xe.length>0&&n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Ze("APPLICATIONNO"),text:Xe||"N/A"}))))),null==dt||null===(re=dt.applicantDetails)||void 0===re||null===(ue=re[0])||void 0===ue||null===(de=ue.owners)||void 0===de?void 0:de.map((e,l)=>{var o,i,a;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?Ze("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:Ze("NOC_OWNER_TYPE_LABEL"),text:null!=e&&null!==(o=e.ownerType)&&void 0!==o&&o.i18nKey?Ze(null==e||null===(i=e.ownerType)||void 0===i?void 0:i.i18nKey):"N/A"}),n.createElement(t.Row,{label:Ze("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_APPLICANT_DOB_LABEL"),text:pl(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(a=e.gender)||void 0===a?void 0:a.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"})))))}),Al&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("NOC_PROPERTY_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Ze("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==Al?void 0:Al.propertyId)||"N/A"}),n.createElement(t.Row,{label:Ze("PROPERTY_OWNER_NAME"),text:(null==Al?void 0:Al.PropertyOwnerName)||"N/A"}),n.createElement(t.Row,{label:Ze("PROPERTY_OWNER_MOBILE_NUMBER"),text:(null==Al?void 0:Al.PropertyOwnerMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Ze("WS_PROPERTY_ADDRESS_LABEL"),text:(null==Al?void 0:Al.PropertyOwnerAddress)||"N/A"}),n.createElement(t.Row,{label:Ze("PROPERTY_PLOT_AREA"),text:(null==Al?void 0:Al.PropertyOwnerPlotArea)||"N/A"}))),(null==dt||null===(se=dt.applicantDetails)||void 0===se?void 0:se.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==dt||null===(ce=dt.applicantDetails)||void 0===ce?void 0:ce.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("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:Ze("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("NOC_SITE_DETAILS")),null==dt||null===(me=dt.siteDetails)||void 0===me?void 0:me.map((e,l)=>{var o,i,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:Ze("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_ULB_NAME_LABEL"),text:(null==e||null===(o=e.ulbName)||void 0===o?void 0:o.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(i=e.roadType)||void 0===i?void 0:i.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:Ze("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:Ze("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:Ze("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:vl(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:Ze("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==e?void 0:e.totalFloorArea)||"N/A"}),n.createElement(t.Row,{label:Ze("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:Ze("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:Ze("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_VASIKA_DATE"),text:(null==e?void 0:e.vasikaDate)||"N/A"}),n.createElement(t.Row,{label:Ze("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,Ze("NOC_SPECIFICATION_DETAILS")),null==dt||null===(ve=dt.siteDetails)||void 0===ve?void 0:ve.map((e,l)=>{var o,i,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:Ze("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(o=e.specificationBuildingCategory)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:Ze("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(i=e.specificationNocType)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:Ze("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:Ze("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,Ze("BPA_UPLOADED _SITE_PHOTOGRAPHS_LABEL")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==fl?void 0:fl.length)>0&&(null==fl?void 0:fl.map(e=>n.createElement(Bn,{filestoreId:(null==e?void 0:e.filestoreId)||(null==e?void 0:e.uuid),documentType:null==e?void 0:e.documentType,coordinates:El}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==Ct||null===(pe=Ct.Noc)||void 0===pe||null===(Ee=pe[0])||void 0===Ee||null===(fe=Ee.nocDetails)||void 0===fe||null===(ge=fe.additionalDetails)||void 0===ge||null===(_e=ge.ownerIds)||void 0===_e?void 0:_e.length)>0&&n.createElement(Sn,{documents:[...(null==Ct||null===(he=Ct.Noc)||void 0===he||null===(Ae=he[0])||void 0===Ae||null===(Ne=Ae.nocDetails)||void 0===Ne||null===(Se=Ne.additionalDetails)||void 0===Se?void 0:Se.ownerIds)||[]].reverse()}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==gl?void 0:gl.length)>0&&n.createElement(Sn,{documents:gl}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("NOC_FEE_DETAILS_LABEL")),(null==Ct||null===(be=Ct.Noc)||void 0===be||null===(ye=be[0])||void 0===ye?void 0:ye.nocDetails)&&n.createElement(yn,{formData:{apiData:c({},Ct),applicationDetails:c({},null==Ct||null===(Ce=Ct.Noc)||void 0===Ce||null===(De=Ce[0])||void 0===De||null===(Oe=De.nocDetails)||void 0===Oe||null===(Te=Oe.additionalDetails)||void 0===Te?void 0:Te.applicationDetails),siteDetails:c({},null==Ct||null===(Le=Ct.Noc)||void 0===Le||null===(Ie=Le[0])||void 0===Ie||null===(we=Ie.nocDetails)||void 0===we||null===(Pe=we.additionalDetails)||void 0===Pe?void 0:Pe.siteDetails),calculations:(null==Ct||null===(Re=Ct.Noc)||void 0===Re||null===(xe=Re[0])||void 0===xe||null===(Be=xe.nocDetails)||void 0===Be||null===(Fe=Be.additionalDetails)||void 0===Fe?void 0:Fe.calculations)||[]},feeAdjustments:ht,setFeeAdjustments:At,disable:"FIELDINSPECTION_INPROGRESS"===(null==Ct||null===(Me=Ct.Noc)||void 0===Me||null===(ke=Me[0])||void 0===ke?void 0:ke.applicationStatus)})),n.createElement(t.CheckBox,{label:"I/We hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+hl+"). I/We 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.",checked:"true"}),"FIELDINSPECTION_INPROGRESS"===(null==Ct||null===(Ue=Ct.Noc)||void 0===Ue||null===(He=Ue[0])||void 0===He?void 0:He.applicationStatus)&&(null===(We=rl)||void 0===We||null===(je=We.info)||void 0===je?void 0:je.roles.filter(e=>"OBPAS_NOC_JE"===e.code||"OBPAS_NOC_BI"===e.code)).length>0&&n.createElement(t.Card,null,n.createElement("div",{id:"fieldInspection"}),n.createElement(xn,{siteImages:Rt,setSiteImages:xt,geoLocations:Vt,customOpen:function(e){!function(e){try{if(0===(null==e?void 0:e.length))return Promise.resolve();const t=wt(function(){return Promise.resolve(Digit.UploadServices.Filefetch([e],et)).then(function(t){if(null!=t&&t.data){const l=t.data[e];l?It?(Ot(!0),Lt(l)):window.open(l,"_blank"):console.error(Ze("CS_FILE_FETCH_ERROR"))}else console.error(Ze("CS_FILE_FETCH_ERROR"))})},function(){console.error(Ze("CS_FILE_FETCH_ERROR"))});Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(e)}})),"FIELDINSPECTION_INPROGRESS"!==(null==Ct||null===(ze=Ct.Noc)||void 0===ze||null===(Ve=ze[0])||void 0===Ve?void 0:Ve.applicationStatus)&&(null==Rt||null===(Ge=Rt.documents)||void 0===Ge?void 0:Ge.length)>0&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Ze("BPA_FIELD_INSPECTION_UPLOADED_DOCUMENTS")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==Gt?void 0:Gt.length)>0&&Gt.map(e=>n.createElement(Mn,{key:(null==e?void 0:e.fileStoreId)||(null==e?void 0:e.uuid),filestoreId:(null==e?void 0:e.fileStoreId)||(null==e?void 0:e.uuid),documentType:null==e?void 0:e.title,documentName:null==e?void 0:e.title,latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude}))),(null==Vt?void 0:Vt.length)>0&&n.createElement(l.Fragment,null,n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},Ze("SITE_INSPECTION_IMAGES_LOCATIONS")),n.createElement(Ln,{position:Vt}))),n.createElement("div",{id:"timeline"},n.createElement(dn,{workflowDetails:zt,t:Ze})),(null==sl?void 0:sl.length)>0&&n.createElement(t.ActionBar,null,Jt&&(null!=zt&&null!==(Ye=zt.data)&&void 0!==Ye&&null!==(qe=Ye.actionState)&&void 0!==qe&&qe.nextActions||null!=zt&&null!==(Ke=zt.data)&&void 0!==Ke&&Ke.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:sl,optionKey:"action",t:Ze,onSelect:function(e){var t,l,n,o,i,a;console.log("selected action",e);const r=null==Ct||null===(t=Ct.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,u=(null==Rt||null===(n=Rt.documents)||void 0===n||n.every(e=>null!=(null==e?void 0:e.filestoreId)&&""!==(null==e?void 0:e.filestoreId)),null==e||null===(o=e.state)||void 0===o||null===(i=o.actions)||void 0===i?void 0:i.filter(t=>t.action==(null==e?void 0:e.action))),d=null==gt?void 0:gt.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=u[0])||void 0===t?void 0:t.nextState)});pt(null==d||null===(a=d[0])||void 0===a?void 0:a.actions);const s={Licenses:[e]};if("EDIT"==(null==e?void 0:e.action))lt({key:"true",warning:!0,message:"COMMON_NOT_EDITABLE_HERE_LABEL"}),setTimeout(()=>{lt(null)},3e3);else if("DRAFT"==(null==e?void 0:e.action))lt({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{lt(null)},3e3);else if("APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action))ml(s);else if("PAY"==(null==e?void 0:e.action))Qe.push("/digit-ui/employee/payment/collect/obpas_noc/"+r+"/"+Je+"?tenantId="+Je);else{var c,m,v;if("FIELDINSPECTION_INPROGRESS"===(null==Ct||null===(c=Ct.Noc)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.applicationStatus)&&"SEND_FOR_INSPECTION_REPORT"==(null==e?void 0:e.action)&&(null==Rt||!Rt.documents||(null==Rt||null===(v=Rt.documents)||void 0===v?void 0:v.length)<4))return void lt({key:"true",error:!0,message:"Please_Add_Site_Images_With_Geo_Location"});nl(!0),tl(e)}}}):null,n.createElement(t.SubmitBar,{ref:ul,label:Ze("WF_TAKE_ACTION"),onSubmit:()=>Qt(!Jt)})),Dt&&n.createElement(t.Modal,{headerBarEnd:n.createElement($t,{onClick:()=>{Ot(!1),Lt(null)}})},null!=Tt&&Tt.toLowerCase().endsWith(".pdf")?n.createElement("a",{style:{color:"blue"},href:Tt,target:"_blank",rel:"noopener noreferrer"},Ze("CS_VIEW_DOCUMENT")):n.createElement("img",{src:Tt,alt:"Preview",style:{width:"100%",height:"100%",objectFit:"contain"}})),ll?n.createElement(Nn,{t:Ze,action:el,tenantId:Je,state:et,getEmployees:vt,id:Xe,applicationDetails:Ct,applicationData:null==Ct?void 0:Ct.Noc,closeModal:()=>{tl(null),nl(!1)},submitAction:ml,actionData:null==zt||null===($e=zt.data)||void 0===$e?void 0:$e.timeline,workflowDetails:zt,showToast:tt,setShowToast:lt,closeToast:al,errors:nt,showErrorToast:it,errorOne:rt,closeToastOne:()=>{at(null)}}):null,tt&&n.createElement(t.Toast,{error:null==tt?void 0:tt.error,warning:null==tt?void 0:tt.warning,label:Ze(null==tt?void 0:tt.message),isDleteBtn:!0,onClose:al}),yt&&n.createElement(t.Loader,null))},NewNOCEditApplication:()=>{var e,a,r,u,d,m,v,p,E,f,g,_,h,A,N,S,b,y;const{id:C}=o.useParams(),{t:D}=(o.useHistory(),i.useTranslation()),O=s.useDispatch(),[T,L]=l.useState(null),I=s.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:B}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:C},R),F=null==B?void 0:B.resData;console.log("applicationDetails here==>",F);const M=(null==F||null===(e=F.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===(d=u.additionalDetails)||void 0===d?void 0:d.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===(g=M.nocDetails)||void 0===g||null===(_=g.additionalDetails)||void 0===_?void 0:_.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:$,isLoading:X}=Digit.Hooks.noc.useNocType(V),{data:Z,isLoading:J}=Digit.Hooks.useTenants(),[Q,ee]=l.useState(Digit.Hooks.noc.useTenants()),te=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],le=null==Z?void 0:Z.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===(N=A.filter(e=>e.active))||void 0===N||N.map(e=>{}));const[oe,ie]=l.useState(null),{data:ae,isLoading:re}=Digit.Hooks.useCustomMDMS(V,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+R+"')]"}]),ue=(null==ae||null===(S=ae.tenant)||void 0===S||null===(b=S.zoneMaster)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.zones)||[];return console.log("zoneOptions==>",ue),l.useEffect(()=>{if(O({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!x&&!Y&&null!=M&&M.nocDetails&&!J&&!re&&!X){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(jo(t,l))}),O(Vo("ownerIdList",z)),O(zo("ownerPhotoList",j));const t=c({},k),l=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)}),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==$?void 0:$.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(Ho("applicationDetails",t)),O(Ho("siteDetails",l)),O(Ho("documents",e)),O(Ho("apiData",F))}},[x,F,Y,re,X]),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(ko,{stepsList:ni,onSubmit:e=>{},step:P,setStep:e=>{O(Wo(e))}}),T&&n.createElement(t.Toast,{error:T.key,label:D(T.label),onClose:()=>{L(null)},isDleteBtn:"true"}))},NOCCitizenSearchApplication:()=>{const{t:e}=i.useTranslation(),o=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==o?void 0:o.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:g}=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(si,{t:e,tenantId:a,onSubmit:function(e,t){console.log("_data==>",e);let l=St(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),d(l)},isLoading:f,Count:v,error:g,data:c}))}};exports.NOCLinks=ci,exports.NOCModule=mi,exports.NOCReducers=()=>d.combineReducers({NOCNewApplicationFormReducer:Ro}),exports.initNOCComponents=()=>{Object.entries(vi).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),o=require("react-router-dom"),i=require("react-i18next"),a=require("react-hook-form"),r=require("react-query"),u=e(require("exif-js")),d=require("redux"),s=require("react-redux");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(),o=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,n+"/"+l+"/"+o}return null},p=(e,t)=>{var l,n,o,i,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===(o=s.assigner)||void 0===o?void 0:o.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===(i=m.data)||void 0===i||null===(a=i.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}},E=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=[],o=Digit.UserService.getUser().info.roles;return l.map((t,i)=>{let{roles:a}=t;a.map(t=>{o.map(o=>{var a;o.code===t&&n.push(e?null==l||null===(a=l[i])||void 0===a?void 0:a.code:null==l?void 0:l[i])})})}),n},g=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",o=(null==n?void 0:n.split(","))||[],i="";return o.length>0&&o.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(i=e)}),i},h=e=>{switch(e){case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6789][0-9]{9}$/i;case"Amount":return/^[0-9]{0,8}$/i;case"NonZeroAmount":return/^[1-9][0-9]{0,7}$/i;case"DecimalNumber":return/^\d{0,8}(\.\d{1,2})?$/i;case"Email":return/^(?=^.{1,64}$)((([^<>()\[\]\\.,;:\s$*@'"]+(\.[^<>()\[\]\\.,;:\s@'"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))$/i;case"Address":return/^[^\$\"<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,500}$/i;case"PAN":return/^[A-Za-z]{5}\d{4}[A-Za-z]{1}$/i;case"TradeName":return/^[-@.\/#&+\w\s]*$/;case"Date":return/^[12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/i;case"UOMValue":return/^(0)*[1-9][0-9]{0,5}$/i;case"OperationalArea":case"NoOfEmp":return/^(0)*[1-9][0-9]{0,6}$/i;case"GSTNo":return/^\d{2}[A-Z]{5}\d{4}[A-Z]{1}\d[Z]{1}[A-Z\d]{1}$/i;case"DoorHouseNo":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*:;“”‘’]{1,50}$/i;case"BuildingStreet":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,64}$/i;case"Pincode":return/^[1-9][0-9]{5}$/i;case"Landline":return/^[0-9]{11}$/i;case"PropertyID":return/^[a-zA-z0-9\s\\/\-]$/i;case"ElectricityConnNo":return/^.{1,15}$/i;case"DocumentNo":return/^[0-9]{1,15}$/i;case"eventName":return/^[^\$\"<>?\\\\~`!@#$%^()+={}\[\]*,.:;“”]{1,65}$/i;case"eventDescription":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,500}$/i;case"cancelChallan":return/^[^\$\"'<>?\\\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,100}$/i;case"FireNOCNo":return/^[a-zA-Z0-9-]*$/i;case"consumerNo":return/^[a-zA-Z0-9/-]*$/i;case"AadharNo":return/^([0-9]){12}$/;case"ChequeNo":return/^(?!0{6})[0-9]{6}$/;case"Comments":return/^[^\$"'<>?\\~`!@$%^()+={}\[\]*.:;“”‘’]{1,}$/i;case"OldLicenceNo":return/^[a-zA-Z0-9-/]{0,64}$/}};function A(e){const t=Math.floor(e/1e3);return{days:Math.floor(t/86400),hours:Math.floor(t%86400/3600),minutes:Math.floor(t%3600/60),seconds:t%60}}const N=e=>{if(!e)return"";const t=e.split("-");if(3!==t.length)return e;const[l,n,o]=t;return 2===l.length&&4===o.length?e:4===l.length?o+"-"+n+"-"+l:4===o.length&&2===l.length&&2===n.length?n+"-"+l+"-"+o:e},S=e=>{if(!e)return"";if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e;const[t,l,n]=e.split("-");return n+"-"+l+"-"+t};var b=function(e,t){return e===t||e!=e&&t!=t},y=function(e,t){for(var l=e.length;l--;)if(b(e[l][0],t))return l;return-1},C=Array.prototype.splice;function O(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])}}O.prototype.clear=function(){this.__data__=[],this.size=0},O.prototype.delete=function(e){var t=this.__data__,l=y(t,e);return!(l<0||(l==t.length-1?t.pop():C.call(t,l,1),--this.size,0))},O.prototype.get=function(e){var t=this.__data__,l=y(t,e);return l<0?void 0:t[l][1]},O.prototype.has=function(e){return y(this.__data__,e)>-1},O.prototype.set=function(e,t){var l=this.__data__,n=y(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var D=O,T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function L(e,t){return e(t={exports:{}},t.exports),t.exports}var I,w="object"==typeof T&&T&&T.Object===Object&&T,P="object"==typeof self&&self&&self.Object===Object&&self,R=w||P||Function("return this")(),x=R.Symbol,B=Object.prototype,F=B.hasOwnProperty,M=B.toString,k=x?x.toStringTag:void 0,U=Object.prototype.toString,H=x?x.toStringTag:void 0,W=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":H&&H in Object(e)?function(e){var t=F.call(e,k),l=e[k];try{e[k]=void 0;var n=!0}catch(e){}var o=M.call(e);return n&&(t?e[k]=l:delete e[k]),o}(e):function(e){return U.call(e)}(e)},j=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},z=function(e){if(!j(e))return!1;var t=W(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},V=R["__core-js_shared__"],G=(I=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",Y=Function.prototype.toString,q=function(e){if(null!=e){try{return Y.call(e)}catch(e){}try{return e+""}catch(e){}}return""},K=/^\[object .+?Constructor\]$/,$=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),X=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!j(e)||(t=e,G&&G in t))&&(z(e)?$:K).test(q(e));var t}(l)?l:void 0},Z=X(R,"Map"),J=X(Object,"create"),Q=Object.prototype.hasOwnProperty,ee=Object.prototype.hasOwnProperty;function te(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])}}te.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},te.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},te.prototype.get=function(e){var t=this.__data__;if(J){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return Q.call(t,e)?t[e]:void 0},te.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:ee.call(t,e)},te.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=J&&void 0===t?"__lodash_hash_undefined__":t,this};var le=te,ne=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 oe(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])}}oe.prototype.clear=function(){this.size=0,this.__data__={hash:new le,map:new(Z||D),string:new le}},oe.prototype.delete=function(e){var t=ne(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return ne(this,e).get(e)},oe.prototype.has=function(e){return ne(this,e).has(e)},oe.prototype.set=function(e,t){var l=ne(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var ie=oe;function ae(e){var t=this.__data__=new D(e);this.size=t.size}ae.prototype.clear=function(){this.__data__=new D,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var l=this.__data__;if(l instanceof D){var n=l.__data__;if(!Z||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new ie(n)}return l.set(e,t),this.size=l.size,this};var re=ae,ue=function(){try{var e=X(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),de=function(e,t,l){"__proto__"==t&&ue?ue(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},se=Object.prototype.hasOwnProperty,ce=function(e,t,l){var n=e[t];se.call(e,t)&&b(n,l)&&(void 0!==l||t in e)||de(e,t,l)},me=function(e,t,l,n){var o=!l;l||(l={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),o?de(l,r,u):ce(l,r,u)}return l},ve=function(e){return null!=e&&"object"==typeof e},pe=function(e){return ve(e)&&"[object Arguments]"==W(e)},Ee=Object.prototype,fe=Ee.hasOwnProperty,ge=Ee.propertyIsEnumerable,_e=pe(function(){return arguments}())?pe:function(e){return ve(e)&&fe.call(e,"callee")&&!ge.call(e,"callee")},he=Array.isArray,Ae=function(){return!1},Ne=L(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,o=n&&n.exports===l?R.Buffer:void 0;e.exports=(o?o.isBuffer:void 0)||Ae}),Se=/^(?:0|[1-9]\d*)$/,be=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&Se.test(e))&&e>-1&&e%1==0&&e<t},ye=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ce={};Ce["[object Float32Array]"]=Ce["[object Float64Array]"]=Ce["[object Int8Array]"]=Ce["[object Int16Array]"]=Ce["[object Int32Array]"]=Ce["[object Uint8Array]"]=Ce["[object Uint8ClampedArray]"]=Ce["[object Uint16Array]"]=Ce["[object Uint32Array]"]=!0,Ce["[object Arguments]"]=Ce["[object Array]"]=Ce["[object ArrayBuffer]"]=Ce["[object Boolean]"]=Ce["[object DataView]"]=Ce["[object Date]"]=Ce["[object Error]"]=Ce["[object Function]"]=Ce["[object Map]"]=Ce["[object Number]"]=Ce["[object Object]"]=Ce["[object RegExp]"]=Ce["[object Set]"]=Ce["[object String]"]=Ce["[object WeakMap]"]=!1;var Oe=function(e){return function(t){return e(t)}},De=L(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,o=n&&n.exports===l&&w.process,i=function(){try{return n&&n.require&&n.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}),Te=De&&De.isTypedArray,Le=Te?Oe(Te):function(e){return ve(e)&&ye(e.length)&&!!Ce[W(e)]},Ie=Object.prototype.hasOwnProperty,we=function(e,t){var l=he(e),n=!l&&_e(e),o=!l&&!n&&Ne(e),i=!l&&!n&&!o&&Le(e),a=l||n||o||i,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&&!Ie.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||be(d,u))||r.push(d);return r},Pe=Object.prototype,Re=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)},xe=function(e,t){return function(l){return e(t(l))}},Be=xe(Object.keys,Object),Fe=Object.prototype.hasOwnProperty,Me=function(e){return null!=e&&ye(e.length)&&!z(e)},ke=function(e){return Me(e)?we(e):function(e){if(!Re(e))return Be(e);var t=[];for(var l in Object(e))Fe.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Ue=Object.prototype.hasOwnProperty,He=function(e){return Me(e)?we(e,!0):function(e){if(!j(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=Re(e),l=[];for(var n in e)("constructor"!=n||!t&&Ue.call(e,n))&&l.push(n);return l}(e)},We=L(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,o=n&&n.exports===l?R.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=i?i(l):new e.constructor(l);return e.copy(n),n}}),je=function(){return[]},ze=Object.prototype.propertyIsEnumerable,Ve=Object.getOwnPropertySymbols,Ge=Ve?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,o=null==t?0:t.length,i=0,a=[];++n<o;){var r=t[n];ze.call(e,r)&&(a[i++]=r)}return a}(Ve(e)))}:je,Ye=function(e,t){for(var l=-1,n=t.length,o=e.length;++l<n;)e[o+l]=t[l];return e},qe=xe(Object.getPrototypeOf,Object),Ke=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Ye(t,Ge(e)),e=qe(e);return t}:je,$e=function(e,t,l){var n=t(e);return he(e)?n:Ye(n,l(e))},Xe=function(e){return $e(e,ke,Ge)},Ze=function(e){return $e(e,He,Ke)},Je=X(R,"DataView"),Qe=X(R,"Promise"),et=X(R,"Set"),tt=X(R,"WeakMap"),lt=q(Je),nt=q(Z),ot=q(Qe),it=q(et),at=q(tt),rt=W;(Je&&"[object DataView]"!=rt(new Je(new ArrayBuffer(1)))||Z&&"[object Map]"!=rt(new Z)||Qe&&"[object Promise]"!=rt(Qe.resolve())||et&&"[object Set]"!=rt(new et)||tt&&"[object WeakMap]"!=rt(new tt))&&(rt=function(e){var t=W(e),l="[object Object]"==t?e.constructor:void 0,n=l?q(l):"";if(n)switch(n){case lt:return"[object DataView]";case nt:return"[object Map]";case ot:return"[object Promise]";case it:return"[object Set]";case at:return"[object WeakMap]"}return t});var ut=rt,dt=Object.prototype.hasOwnProperty,st=R.Uint8Array,ct=function(e){var t=new e.constructor(e.byteLength);return new st(t).set(new st(e)),t},mt=/\w*$/,vt=x?x.prototype:void 0,pt=vt?vt.valueOf:void 0,Et=Object.create,ft=function(){function e(){}return function(t){if(!j(t))return{};if(Et)return Et(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),gt=De&&De.isMap,_t=gt?Oe(gt):function(e){return ve(e)&&"[object Map]"==ut(e)},ht=De&&De.isSet,At=ht?Oe(ht):function(e){return ve(e)&&"[object Set]"==ut(e)},Nt={};Nt["[object Arguments]"]=Nt["[object Array]"]=Nt["[object ArrayBuffer]"]=Nt["[object DataView]"]=Nt["[object Boolean]"]=Nt["[object Date]"]=Nt["[object Float32Array]"]=Nt["[object Float64Array]"]=Nt["[object Int8Array]"]=Nt["[object Int16Array]"]=Nt["[object Int32Array]"]=Nt["[object Map]"]=Nt["[object Number]"]=Nt["[object Object]"]=Nt["[object RegExp]"]=Nt["[object Set]"]=Nt["[object String]"]=Nt["[object Symbol]"]=Nt["[object Uint8Array]"]=Nt["[object Uint8ClampedArray]"]=Nt["[object Uint16Array]"]=Nt["[object Uint32Array]"]=!0,Nt["[object Error]"]=Nt["[object Function]"]=Nt["[object WeakMap]"]=!1;var St=function e(t,l,n,o,i,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=i?n(t,o,i,a):n(t)),void 0!==r)return r;if(!j(t))return t;var c=he(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&dt.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=ut(t),v="[object Function]"==m||"[object GeneratorFunction]"==m;if(Ne(t))return We(t,u);if("[object Object]"==m||"[object Arguments]"==m||v&&!i){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||Re(e)?{}:ft(qe(e))}(t),!u)return d?function(e,t){return me(e,Ke(e),t)}(t,function(e,t){return e&&me(t,He(t),e)}(r,t)):function(e,t){return me(e,Ge(e),t)}(t,function(e,t){return e&&me(t,ke(t),e)}(r,t))}else{if(!Nt[m])return i?t:{};r=function(e,t,l){var n,o,i=e.constructor;switch(t){case"[object ArrayBuffer]":return ct(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var l=t?ct(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?ct(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(o=new(n=e).constructor(n.source,mt.exec(n))).lastIndex=n.lastIndex,o;case"[object Set]":return new i;case"[object Symbol]":return pt?Object(pt.call(e)):{}}}(t,m,u)}}a||(a=new re);var p=a.get(t);if(p)return p;a.set(t,r),At(t)?t.forEach(function(o){r.add(e(o,l,n,o,t,a))}):_t(t)&&t.forEach(function(o,i){r.set(i,e(o,l,n,i,t,a))});var E=c?void 0:(s?d?Ze:Xe:d?He:ke)(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(o,i){E&&(o=t[i=o]),ce(r,i,e(o,l,n,i,t,a))}),r},bt=function(e){return St(e,5)},yt=L(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[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]",g="[object String]",_="[object Symbol]",h="[object WeakMap]",A="[object ArrayBuffer]",N="[object DataView]",S="[object Float32Array]",b="[object Float64Array]",y="[object Int8Array]",C="[object Int16Array]",O="[object Int32Array]",D="[object Uint8Array]",L="[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,B=/[&<>"']/g,F=RegExp(x.source),M=RegExp(B.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?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^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]",ge="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Se="(?:"+Ee+"|"+fe+")",be="(?:"+Ne+"|"+fe+")",ye="(?:"+ve+"|"+ge+")?",Ce="[\\ufe0e\\ufe0f]?"+ye+"(?:\\u200d(?:"+[_e,he,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+ye+")*",Oe="(?:"+["[\\u2700-\\u27bf]",he,Ae].join("|")+")"+Ce,De="(?:"+[_e+ve+"?",ve,he,Ae,"[\\ud800-\\udfff]"].join("|")+")",Te=RegExp("['’]","g"),Le=RegExp(ve,"g"),Ie=RegExp(ge+"(?="+ge+")|"+De+Ce,"g"),we=RegExp([Ne+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[me,Ne,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[me,Ne+Se,"$"].join("|")+")",Ne+"?"+Se+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ne+"+(?:['’](?: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,Oe].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"],Be=-1,Fe={};Fe[S]=Fe[b]=Fe[y]=Fe[C]=Fe[O]=Fe[D]=Fe["[object Uint8ClampedArray]"]=Fe[L]=Fe[I]=!0,Fe[i]=Fe[a]=Fe[A]=Fe[r]=Fe[N]=Fe[u]=Fe[d]=Fe[s]=Fe[m]=Fe[v]=Fe[p]=Fe[E]=Fe[f]=Fe[g]=Fe[h]=!1;var Me={};Me[i]=Me[a]=Me[A]=Me[N]=Me[r]=Me[u]=Me[S]=Me[b]=Me[y]=Me[C]=Me[O]=Me[m]=Me[v]=Me[p]=Me[E]=Me[f]=Me[g]=Me[_]=Me[D]=Me["[object Uint8ClampedArray]"]=Me[L]=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 T&&T&&T.Object===Object&&T,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){}}(),$e=Ke&&Ke.isArrayBuffer,Xe=Ke&&Ke.isDate,Ze=Ke&&Ke.isMap,Je=Ke&&Ke.isRegExp,Qe=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 o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];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 ot(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function it(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,o=0,i=[];++l<n;){var a=e[l];t(a,l,e)&&(i[o++]=a)}return i}function rt(e,t){return!(null==e||!e.length)&>(e,t,0)>-1}function ut(e,t,l){for(var n=-1,o=null==e?0:e.length;++n<o;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,o=Array(n);++l<n;)o[l]=t(e[l],l,e);return o}function st(e,t){for(var l=-1,n=t.length,o=e.length;++l<n;)e[o+l]=t[l];return e}function ct(e,t,l,n){var o=-1,i=null==e?0:e.length;for(n&&i&&(l=e[++o]);++o<i;)l=t(l,e[o],o,e);return l}function mt(e,t,l,n){var o=null==e?0:e.length;for(n&&o&&(l=e[--o]);o--;)l=t(l,e[o],o,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=Nt("length");function Et(e,t,l){var n;return l(e,function(e,l,o){if(t(e,l,o))return n=l,!1}),n}function ft(e,t,l,n){for(var o=e.length,i=l+(n?1:-1);n?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function gt(e,t,l){return t==t?function(e,t,l){for(var n=l-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,ht,l)}function _t(e,t,l,n){for(var o=l-1,i=e.length;++o<i;)if(n(e[o],t))return o;return-1}function ht(e){return e!=e}function At(e,t){var l=null==e?0:e.length;return l?yt(e,t)/l:NaN}function Nt(e){return function(t){return null==t?void 0:t[e]}}function St(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,l,n,o){return o(e,function(e,o,i){l=n?(n=!1,e):t(l,e,o,i)}),l}function yt(e,t){for(var l,n=-1,o=e.length;++n<o;){var i=t(e[n]);void 0!==i&&(l=void 0===l?i:l+i)}return l}function Ct(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Ot(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Dt(e){return function(t){return e(t)}}function Tt(e,t){return dt(t,function(t){return e[t]})}function Lt(e,t){return e.has(t)}function It(e,t){for(var l=-1,n=e.length;++l<n&>(t,e[l],0)>-1;);return l}function wt(e,t){for(var l=e.length;l--&>(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=St({"À":"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=St({"&":"&","<":"<",">":">",'"':""","'":"'"});function Bt(e){return"\\"+ke[e]}function Ft(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,o=e.length,i=0,a=[];++l<o;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[i++]=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 Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):pt(e)}function zt(e){return Ft(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=St({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var T=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,xe))).Array,q=t.Date,se=t.Error,ce=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,Ee=t.String,fe=t.TypeError,ge=T.prototype,_e=ve.prototype,he=t["__core-js_shared__"],Ae=ce.prototype.toString,Ne=_e.hasOwnProperty,Se=0,be=function(){var e=/[^.]+$/.exec(he&&he.keys&&he.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ye=_e.toString,Ce=Ae.call(ve),Oe=ze._,De=pe("^"+Ae.call(Ne).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ye?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=_e.propertyIsEnumerable,qe=ge.splice,Ke=Pe?Pe.isConcatSpreadable:void 0,pt=Pe?Pe.iterator:void 0,St=Pe?Pe.toStringTag:void 0,qt=function(){try{var e=Jo(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,$t=q&&q.now!==ze.Date.now&&q.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Zt=me.ceil,Jt=me.floor,Qt=ve.getOwnPropertySymbols,el=Ie?Ie.isBuffer:void 0,tl=t.isFinite,ll=ge.join,nl=kt(ve.keys,ve),ol=me.max,il=me.min,al=q.now,rl=t.parseInt,ul=me.random,dl=ge.reverse,sl=Jo(t,"DataView"),cl=Jo(t,"Map"),ml=Jo(t,"Promise"),vl=Jo(t,"Set"),pl=Jo(t,"WeakMap"),El=Jo(ve,"create"),fl=pl&&new pl,gl={},_l=Di(sl),hl=Di(cl),Al=Di(ml),Nl=Di(vl),Sl=Di(pl),bl=Pe?Pe.prototype:void 0,yl=bl?bl.valueOf:void 0,Cl=bl?bl.toString:void 0;function Ol(e){if(Va(e)&&!Ra(e)&&!(e instanceof Il)){if(e instanceof Ll)return e;if(Ne.call(e,"__wrapped__"))return Ti(e)}return new Ll(e)}var Dl=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 Tl(){}function Ll(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 Bl(e){var t=this.__data__=new Pl(e);this.size=t.size}function Fl(e,t){var l=Ra(e),n=!l&&Pa(e),o=!l&&!n&&Ma(e),i=!l&&!n&&!o&&Ja(e),a=l||n||o||i,r=a?Ct(e.length,Ee):[],u=r.length;for(var d in e)!t&&!Ne.call(e,d)||a&&("length"==d||o&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ii(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 Si(fo(e),ql(t,0,e.length))}function Ul(e){return Si(fo(e))}function Hl(e,t,l){(void 0!==l&&!La(e[t],l)||void 0===l&&!(t in e))&&Gl(e,t,l)}function Wl(e,t,l){var n=e[t];Ne.call(e,t)&&La(n,l)&&(void 0!==l||t in e)||Gl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(La(e[l][0],t))return l;return-1}function zl(e,t,l,n){return Jl(e,function(e,o,i){t(n,e,l(e),i)}),n}function Vl(e,t){return e&&go(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,o=T(n),i=null==e;++l<n;)o[l]=i?void 0:Er(e,t[l]);return o}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,o,a){var d,h=1&t,T=2&t,w=4&t;if(l&&(d=o?l(e,n,o,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]&&Ne.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!h)return fo(e,d)}else{var R=ti(e),x=R==s||R==c;if(Ma(e))return so(e,h);if(R==p||R==i||x&&!o){if(d=T||x?{}:ni(e),!h)return T?function(e,t){return go(e,ei(e),t)}(e,function(e,t){return e&&go(t,Nr(t),e)}(d,e)):function(e,t){return go(e,Qo(e),t)}(e,Vl(d,e))}else{if(!Me[R])return o?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case A:return co(e);case r:case u:return new n(+e);case N:return function(e,t){var l=t?co(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case S:case b:case y:case C:case O:case D:case"[object Uint8ClampedArray]":case L:case I:return mo(e,l);case m:return new n;case v:case g: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 _:return yl?ve(yl.call(e)):{}}}(e,R,h)}}a||(a=new Bl);var B=a.get(e);if(B)return B;a.set(e,d),$a(e)?e.forEach(function(n){d.add(Kl(n,t,l,n,e,a))}):Ga(e)&&e.forEach(function(n,o){d.set(o,Kl(n,t,l,o,e,a))});var F=P?void 0:(w?T?Go:Vo:T?Nr:Ar)(e);return nt(F||e,function(n,o){F&&(n=e[o=n]),Wl(d,o,Kl(n,t,l,o,e,a))}),d}function $l(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var o=l[n],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new fe(l);return _i(function(){e.apply(void 0,n)},t)}function Zl(e,t,l,n){var o=-1,i=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Dt(l))),n?(i=ut,a=!1):t.length>=200&&(i=Lt,a=!1,t=new xl(t));e:for(;++o<r;){var s=e[o],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 i(t,c,n)||u.push(s)}return u}Ol.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Ol}},(Ol.prototype=Tl.prototype).constructor=Ol,(Ll.prototype=Dl(Tl.prototype)).constructor=Ll,(Il.prototype=Dl(Tl.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 Ne.call(t,e)?t[e]:void 0},wl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:Ne.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():qe.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=Xo(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return Xo(this,e).get(e)},Rl.prototype.has=function(e){return Xo(this,e).has(e)},Rl.prototype.set=function(e,t){var l=Xo(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)},Bl.prototype.clear=function(){this.__data__=new Pl,this.size=0},Bl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},Bl.prototype.get=function(e){return this.__data__.get(e)},Bl.prototype.has=function(e){return this.__data__.has(e)},Bl.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 Jl=Ao(rn),Ql=Ao(un,!0);function en(e,t){var l=!0;return Jl(e,function(e,n,o){return l=!!t(e,n,o)}),l}function tn(e,t,l){for(var n=-1,o=e.length;++n<o;){var i=e[n],a=t(i);if(null!=a&&(void 0===r?a==a&&!Za(a):l(a,r)))var r=a,u=i}return u}function ln(e,t){var l=[];return Jl(e,function(e,n,o){t(e,n,o)&&l.push(e)}),l}function nn(e,t,l,n,o){var i=-1,a=e.length;for(l||(l=oi),o||(o=[]);++i<a;){var r=e[i];t>0&&l(r)?t>1?nn(r,t-1,l,n,o):st(o,r):n||(o[o.length]=r)}return o}var on=No(),an=No(!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=io(t,e)).length;null!=e&&l<n;)e=e[Oi(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]":St&&St in ve(e)?function(e){var t=Ne.call(e,St),l=e[St];try{e[St]=void 0;var n=!0}catch(e){}var o=ye.call(e);return n&&(t?e[St]=l:delete e[St]),o}(e):function(e){return ye.call(e)}(e)}function vn(e,t){return e>t}function pn(e,t){return null!=e&&Ne.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,o=e[0].length,i=e.length,a=i,r=T(i),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Dt(t))),u=il(s.length,u),r[a]=!l&&(t||o>=120&&s.length>=120)?new xl(a&&s):void 0}s=e[0];var c=-1,m=r[0];e:for(;++c<o&&d.length<u;){var v=s[c],p=t?t(v):v;if(v=l||0!==v?v:0,!(m?Lt(m,p):n(d,p,l))){for(a=i;--a;){var E=r[a];if(!(E?Lt(E,p):n(e[a],p,l)))continue e}m&&m.push(p),d.push(v)}}return d}function gn(e,t,l){var n=null==(e=pi(e,t=io(t,e)))?e:e[Oi(Ui(t))];return null==n?void 0:tt(n,e,l)}function _n(e){return Va(e)&&mn(e)==i}function hn(e,t,l,n,o){return e===t||(null==e||null==t||!Va(e)&&!Va(t)?e!=e&&t!=t:function(e,t,l,n,o,s){var c=Ra(e),h=Ra(t),S=c?a:ti(e),b=h?a:ti(t),y=(S=S==i?p:S)==p,C=(b=b==i?p:b)==p,O=S==b;if(O&&Ma(e)){if(!Ma(t))return!1;c=!0,y=!1}if(O&&!y)return s||(s=new Bl),c||Ja(e)?jo(e,t,l,n,o,s):function(e,t,l,n,o,i,a){switch(l){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!i(new ke(e),new ke(t)));case r:case u:case v:return La(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case g: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=jo(s(e),s(t),n,o,i,a);return a.delete(e),p;case _:if(yl)return yl.call(e)==yl.call(t)}return!1}(e,t,S,l,n,o,s);if(!(1&l)){var D=y&&Ne.call(e,"__wrapped__"),T=C&&Ne.call(t,"__wrapped__");if(D||T){var L=D?e.value():e,I=T?t.value():t;return s||(s=new Bl),o(L,I,l,n,s)}}return!!O&&(s||(s=new Bl),function(e,t,l,n,o,i){var a=1&l,r=Vo(e),u=r.length;if(u!=Vo(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Ne.call(t,s)))return!1}var c=i.get(e),m=i.get(t);if(c&&m)return c==t&&m==e;var v=!0;i.set(e,t),i.set(t,e);for(var p=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var g=a?n(f,E,s,t,e,i):n(E,f,s,e,t,i);if(!(void 0===g?E===f||o(E,f,l,n,i):g)){v=!1;break}p||(p="constructor"==s)}if(v&&!p){var _=e.constructor,h=t.constructor;_==h||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof h&&h instanceof h||(v=!1)}return i.delete(e),i.delete(t),v}(e,t,l,n,o,s))}(e,t,l,n,hn,o))}function An(e,t,l,n){var o=l.length,i=o,a=!n;if(null==e)return!i;for(e=ve(e);o--;){var r=l[o];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++o<i;){var u=(r=l[o])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new Bl;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 Nn(e){return!(!za(e)||(t=e,be&&be in t))&&(Ha(e)?De:oe).test(Di(e));var t}function Sn(e){return"function"==typeof e?e:null==e?Yr:"object"==typeof e?Ra(e)?Dn(e[0],e[1]):On(e):tu(e)}function bn(e){if(!si(e))return nl(e);var t=[];for(var l in ve(e))Ne.call(e,l)&&"constructor"!=l&&t.push(l);return t}function yn(e,t){return e<t}function Cn(e,t){var l=-1,n=Ba(e)?T(e.length):[];return Jl(e,function(e,o,i){n[++l]=t(e,o,i)}),n}function On(e){var t=Zo(e);return 1==t.length&&t[0][2]?mi(t[0][0],t[0][1]):function(l){return l===e||An(l,e,t)}}function Dn(e,t){return ri(e)&&ci(t)?mi(Oi(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?fr(l,e):hn(t,n,3)}}function Tn(e,t,l,n,o){e!==t&&on(t,function(i,a){if(o||(o=new Bl),za(i))!function(e,t,l,n,o,i,a){var r=fi(e,l),u=fi(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=i?i(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&&Ja(u);s=u,m||v||p?Ra(r)?s=r:Fa(r)?s=fo(r):v?(c=!1,s=so(u,!0)):p?(c=!1,s=mo(u,!0)):s=[]:qa(u)||Pa(u)?(s=r,Pa(r)?s=ar(r):za(r)&&!Ha(r)||(s=ni(u))):c=!1}c&&(a.set(u,s),o(s,u,n,i,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,Tn,n,o);else{var r=n?n(fi(e,a),i,a+"",e,t,o):void 0;void 0===r&&(r=i),Hl(e,a,r)}},Nr)}function Ln(e,t){var l=e.length;if(l)return ii(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,Dt($o())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,o=e.criteria,i=t.criteria,a=o.length,r=l.length;++n<a;){var u=vo(o[n],i[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}(Cn(e,function(e,l,o){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function wn(e,t,l){for(var n=-1,o=t.length,i={};++n<o;){var a=t[n],r=sn(e,a);l(r,a)&&Un(i,io(a,e),r)}return i}function Pn(e,t,l,n){var o=n?_t:gt,i=-1,a=t.length,r=e;for(e===t&&(t=fo(t)),l&&(r=dt(e,Dt(l)));++i<a;)for(var u=0,d=t[i],s=l?l(d):d;(u=o(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 o=t[l];if(l==n||o!==i){var i=o;ii(o)?qe.call(e,o,1):Zn(e,o)}}return e}function xn(e,t){return e+Jt(ul()*(t-e+1))}function Bn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Jt(t/2))&&(e+=e)}while(t);return l}function Fn(e,t){return hi(vi(e,t,Yr),e+"")}function Mn(e){return Ml(Lr(e))}function kn(e,t){var l=Lr(e);return Si(l,ql(t,0,l.length))}function Un(e,t,l,n){if(!za(e))return e;for(var o=-1,i=(t=io(t,e)).length,a=i-1,r=e;null!=r&&++o<i;){var u=Oi(t[o]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=za(s)?s:ii(t[o+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=fl?function(e,t){return fl.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 Si(Lr(e))}function zn(e,t,l){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(l=l>o?o:l)<0&&(l+=o),o=t>l?0:l-t>>>0,t>>>=0;for(var i=T(o);++n<o;)i[n]=e[n+t];return i}function Vn(e,t){var l;return Jl(e,function(e,n,o){return!(l=t(e,n,o))}),!!l}function Gn(e,t,l){var n=0,o=null==e?n:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;n<o;){var i=n+o>>>1,a=e[i];null!==a&&!Za(a)&&(l?a<=t:a<t)?n=i+1:o=i}return o}return Yn(e,t,Yr,l)}function Yn(e,t,l,n){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Za(t),d=void 0===t;o<i;){var s=Jt((o+i)/2),c=l(e[s]),m=void 0!==c,v=null===c,p=c==c,E=Za(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?o=s+1:i=s}return il(i,4294967294)}function qn(e,t){for(var l=-1,n=e.length,o=0,i=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!La(r,u)){var u=r;i[o++]=0===a?0:a}}return i}function Kn(e){return"number"==typeof e?e:Za(e)?NaN:+e}function $n(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,$n)+"";if(Za(e))return Cl?Cl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,o=rt,i=e.length,a=!0,r=[],u=r;if(l)a=!1,o=ut;else if(i>=200){var d=t?null:Fo(e);if(d)return Ht(d);a=!1,o=Lt,u=new xl}else u=t?[]:r;e:for(;++n<i;){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 o(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Zn(e,t){return null==(e=pi(e,t=io(t,e)))||delete e[Oi(Ui(t))]}function Jn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Qn(e,t,l,n){for(var o=e.length,i=n?o:-1;(n?i--:++i<o)&&t(e[i],i,e););return l?zn(e,n?0:i,n?i+1:o):zn(e,n?i+1:0,n?o:i)}function eo(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 to(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var o=-1,i=T(n);++o<n;)for(var a=e[o],r=-1;++r<n;)r!=o&&(i[o]=Zl(i[o]||a,e[r],t,l));return Xn(nn(i,1),t,l)}function lo(e,t,l){for(var n=-1,o=e.length,i=t.length,a={};++n<o;)l(a,e[n],n<i?t[n]:void 0);return a}function no(e){return Fa(e)?e:[]}function oo(e){return"function"==typeof e?e:Yr}function io(e,t){return Ra(e)?e:ri(e,t)?[e]:Ci(rr(e))}var ao=Fn;function ro(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:zn(e,t,l)}var uo=Kt||function(e){return ze.clearTimeout(e)};function so(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 co(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function mo(e,t){var l=t?co(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function vo(e,t){if(e!==t){var l=void 0!==e,n=null===e,o=e==e,i=Za(e),a=void 0!==t,r=null===t,u=t==t,d=Za(t);if(!r&&!d&&!i&&e>t||i&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!o)return 1;if(!n&&!i&&!d&&e<t||d&&l&&o&&!n&&!i||r&&l&&o||!a&&o||!u)return-1}return 0}function po(e,t,l,n){for(var o=-1,i=e.length,a=l.length,r=-1,u=t.length,d=ol(i-a,0),s=T(u+d),c=!n;++r<u;)s[r]=t[r];for(;++o<a;)(c||o<i)&&(s[l[o]]=e[o]);for(;d--;)s[r++]=e[o++];return s}function Eo(e,t,l,n){for(var o=-1,i=e.length,a=-1,r=l.length,u=-1,d=t.length,s=ol(i-r,0),c=T(s+d),m=!n;++o<s;)c[o]=e[o];for(var v=o;++u<d;)c[v+u]=t[u];for(;++a<r;)(m||o<i)&&(c[v+l[a]]=e[o++]);return c}function fo(e,t){var l=-1,n=e.length;for(t||(t=T(n));++l<n;)t[l]=e[l];return t}function go(e,t,l,n){var o=!l;l||(l={});for(var i=-1,a=t.length;++i<a;){var r=t[i],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),o?Gl(l,r,u):Wl(l,r,u)}return l}function _o(e,t){return function(l,n){var o=Ra(l)?lt:zl,i=t?t():{};return o(l,e,$o(n,2),i)}}function ho(e){return Fn(function(t,l){var n=-1,o=l.length,i=o>1?l[o-1]:void 0,a=o>2?l[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,a&&ai(l[0],l[1],a)&&(i=o<3?void 0:i,o=1),t=ve(t);++n<o;){var r=l[n];r&&e(t,r,n,i)}return t})}function Ao(e,t){return function(l,n){if(null==l)return l;if(!Ba(l))return e(l,n);for(var o=l.length,i=t?o:-1,a=ve(l);(t?i--:++i<o)&&!1!==n(a[i],i,a););return l}}function No(e){return function(t,l,n){for(var o=-1,i=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++o];if(!1===l(i[u],u,i))break}return t}}function So(e){return function(t){var l=Ft(t=rr(t))?zt(t):void 0,n=l?l[0]:t.charAt(0),o=l?ro(l,1).join(""):t.slice(1);return n[e]()+o}}function bo(e){return function(t){return ct(Hr(Pr(t).replace(Te,"")),e,"")}}function yo(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=Dl(e.prototype),n=e.apply(l,t);return za(n)?n:l}}function Co(e){return function(t,l,n){var o=ve(t);if(!Ba(t)){var i=$o(l,3);t=Ar(t),l=function(e){return i(o[e],e,o)}}var a=e(t,l,n);return a>-1?o[i?t[a]:a]:void 0}}function Oo(e){return zo(function(t){var n=t.length,o=n,i=Ll.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new fe(l);if(i&&!r&&"wrapper"==qo(a))var r=new Ll([],!0)}for(o=r?o:n;++o<n;){var u=qo(a=t[o]),d="wrapper"==u?Yo(a):void 0;r=d&&ui(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[qo(d[0])].apply(r,d[3]):1==a.length&&ui(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 o=0,i=n?t[o].apply(this,e):l;++o<n;)i=t[o].call(this,i);return i}})}function Do(e,t,l,n,o,i,a,r,u,d){var s=128&t,c=1&t,m=2&t,v=24&t,p=512&t,E=m?void 0:yo(e);return function f(){for(var g=arguments.length,_=T(g),h=g;h--;)_[h]=arguments[h];if(v)var A=Ko(f),N=Pt(_,A);if(n&&(_=po(_,n,o,v)),i&&(_=Eo(_,i,a,v)),g-=N,v&&g<d){var S=Ut(_,A);return xo(e,t,Do,f.placeholder,l,_,S,r,u,d-g)}var b=c?l:this,y=m?b[e]:e;return g=_.length,r?_=Ei(_,r):p&&g>1&&_.reverse(),s&&u<g&&(_.length=u),this&&this!==ze&&this instanceof f&&(y=E||yo(y)),y.apply(b,_)}}function To(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,o,i){t(n,l(e),o,i)}),n}(l,e,t(n),{})}}function Lo(e,t){return function(l,n){var o;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(o=l),void 0!==n){if(void 0===o)return n;"string"==typeof l||"string"==typeof n?(l=$n(l),n=$n(n)):(l=Kn(l),n=Kn(n)),o=e(l,n)}return o}}function Io(e){return zo(function(t){return t=dt(t,Dt($o())),Fn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function wo(e,t){var l=(t=void 0===t?" ":$n(t)).length;if(l<2)return l?Bn(t,e):t;var n=Bn(t,Zt(e/jt(t)));return Ft(t)?ro(zt(n),0,e).join(""):n.slice(0,e)}function Po(e){return function(t,l,n){return n&&"number"!=typeof n&&ai(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 o=-1,i=ol(Zt((t-e)/(l||1)),0),a=T(i);i--;)a[n?i:++o]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function Ro(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=ir(t),l=ir(l)),e(t,l)}}function xo(e,t,l,n,o,i,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,o,s?i:void 0,s?a:void 0,s?void 0:i,s?void 0:a,r,u,d],m=l.apply(void 0,c);return ui(e)&&gi(m,c),m.placeholder=n,Ai(m,e,t)}function Bo(e){var t=me[e];return function(e,l){if(e=ir(e),(l=null==l?0:il(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 Fo=vl&&1/Ht(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:Zr;function Mo(e){return function(t){var l=ti(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 ko(e,t,o,i,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=i?i.length:0;if(c||(t&=-97,i=a=void 0),u=void 0===u?u:ol(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var m=i,v=a;i=a=void 0}var p=s?void 0:Yo(e),E=[e,t,o,i,a,m,v,r,u,d];if(p&&function(e,t){var l=e[1],o=t[1],i=l|o;if(!(i<131||128==o&&8==l||128==o&&256==l&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==l))return e;1&o&&(e[2]=t[2],i|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?po(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?Eo(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&o&&(e[8]=null==e[8]?t[8]:il(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(E,p),e=E[0],t=E[1],o=E[2],i=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:ol(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)f=8==t||16==t?function(e,t,l){var n=yo(e);return function o(){for(var i=arguments.length,a=T(i),r=i,u=Ko(o);r--;)a[r]=arguments[r];var d=i<3&&a[0]!==u&&a[i-1]!==u?[]:Ut(a,u);if((i-=d.length)<l)return xo(e,t,Do,o.placeholder,void 0,a,d,void 0,void 0,l-i);var s=this&&this!==ze&&this instanceof o?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Do.apply(void 0,E):function(e,t,l,n){var o=1&t,i=yo(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=T(d+r),c=this&&this!==ze&&this instanceof t?i:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,o?l:this,s)}}(e,t,o,i);else var f=function(e,t,l){var n=1&t,o=yo(e);return function t(){var i=this&&this!==ze&&this instanceof t?o:e;return i.apply(n?l:this,arguments)}}(e,t,o);return Ai((p?Hn:gi)(f,E),e,t)}function Uo(e,t,l,n){return void 0===e||La(e,_e[l])&&!Ne.call(n,l)?t:e}function Ho(e,t,l,n,o,i){return za(e)&&za(t)&&(i.set(t,e),Tn(e,t,void 0,Ho,i),i.delete(t)),e}function Wo(e){return qa(e)?void 0:e}function jo(e,t,l,n,o,i){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=i.get(e),s=i.get(t);if(d&&s)return d==t&&s==e;var c=-1,m=!0,v=2&l?new xl:void 0;for(i.set(e,t),i.set(t,e);++c<r;){var p=e[c],E=t[c];if(n)var f=a?n(E,p,c,t,e,i):n(p,E,c,e,t,i);if(void 0!==f){if(f)continue;m=!1;break}if(v){if(!vt(t,function(e,t){if(!Lt(v,t)&&(p===e||o(p,e,l,n,i)))return v.push(t)})){m=!1;break}}else if(p!==E&&!o(p,E,l,n,i)){m=!1;break}}return i.delete(e),i.delete(t),m}function zo(e){return hi(vi(e,void 0,xi),e+"")}function Vo(e){return cn(e,Ar,Qo)}function Go(e){return cn(e,Nr,ei)}var Yo=fl?function(e){return fl.get(e)}:Zr;function qo(e){for(var t=e.name+"",l=gl[t],n=Ne.call(gl,t)?l.length:0;n--;){var o=l[n],i=o.func;if(null==i||i==e)return o.name}return t}function Ko(e){return(Ne.call(Ol,"placeholder")?Ol:e).placeholder}function $o(){var e=Ol.iteratee||qr;return e=e===qr?Sn:e,arguments.length?e(arguments[0],arguments[1]):e}function Xo(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 Zo(e){for(var t=Ar(e),l=t.length;l--;){var n=t[l],o=e[n];t[l]=[n,o,ci(o)]}return t}function Jo(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return Nn(l)?l:void 0}var Qo=Qt?function(e){return null==e?[]:(e=ve(e),at(Qt(e),function(t){return Ge.call(e,t)}))}:ou,ei=Qt?function(e){for(var t=[];e;)st(t,Qo(e)),e=je(e);return t}:ou,ti=mn;function li(e,t,l){for(var n=-1,o=(t=io(t,e)).length,i=!1;++n<o;){var a=Oi(t[n]);if(!(i=null!=e&&l(e,a)))break;e=e[a]}return i||++n!=o?i:!!(o=null==e?0:e.length)&&ja(o)&&ii(a,o)&&(Ra(e)||Pa(e))}function ni(e){return"function"!=typeof e.constructor||si(e)?{}:Dl(je(e))}function oi(e){return Ra(e)||Pa(e)||!!(Ke&&e&&e[Ke])}function ii(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 ai(e,t,l){if(!za(l))return!1;var n=typeof t;return!!("number"==n?Ba(l)&&ii(t,l.length):"string"==n&&t in l)&&La(l[t],e)}function ri(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Za(e))||j.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ui(e){var t=qo(e),l=Ol[t];if("function"!=typeof l||!(t in Il.prototype))return!1;if(e===l)return!0;var n=Yo(l);return!!n&&e===n[0]}(sl&&ti(new sl(new ArrayBuffer(1)))!=N||cl&&ti(new cl)!=m||ml&&"[object Promise]"!=ti(ml.resolve())||vl&&ti(new vl)!=f||pl&&ti(new pl)!=h)&&(ti=function(e){var t=mn(e),l=t==p?e.constructor:void 0,n=l?Di(l):"";if(n)switch(n){case _l:return N;case hl:return m;case Al:return"[object Promise]";case Nl:return f;case Sl:return h}return t});var di=he?Ha:iu;function si(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||_e)}function ci(e){return e==e&&!za(e)}function mi(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vi(e,t,l){return t=ol(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,i=ol(n.length-t,0),a=T(i);++o<i;)a[o]=n[t+o];o=-1;for(var r=T(t+1);++o<t;)r[o]=n[o];return r[t]=l(a),tt(e,this,r)}}function pi(e,t){return t.length<2?e:sn(e,zn(t,0,-1))}function Ei(e,t){for(var l=e.length,n=il(t.length,l),o=fo(e);n--;){var i=t[n];e[n]=ii(i,l)?o[i]:void 0}return e}function fi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var gi=Ni(Hn),_i=Xt||function(e,t){return ze.setTimeout(e,t)},hi=Ni(Wn);function Ai(e,t,l){var n=t+"";return hi(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(o,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match($);return t?t[1].split(X):[]}(n),l)))}function Ni(e){var t=0,l=0;return function(){var n=al(),o=16-(n-l);if(l=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Si(e,t){var l=-1,n=e.length,o=n-1;for(t=void 0===t?n:t;++l<t;){var i=xn(l,o),a=e[i];e[i]=e[l],e[l]=a}return e.length=t,e}var bi,yi,Ci=(bi=ba(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,l,n,o){t.push(n?o.replace(Q,"$1"):l||e)}),t},function(e){return 500===yi.size&&yi.clear(),e}),yi=bi.cache,bi);function Oi(e){if("string"==typeof e||Za(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Di(e){if(null!=e){try{return Ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ti(e){if(e instanceof Il)return e.clone();var t=new Ll(e.__wrapped__,e.__chain__);return t.__actions__=fo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Li=Fn(function(e,t){return Fa(e)?Zl(e,nn(t,1,Fa,!0)):[]}),Ii=Fn(function(e,t){var l=Ui(t);return Fa(l)&&(l=void 0),Fa(e)?Zl(e,nn(t,1,Fa,!0),$o(l,2)):[]}),wi=Fn(function(e,t){var l=Ui(t);return Fa(l)&&(l=void 0),Fa(e)?Zl(e,nn(t,1,Fa,!0),void 0,l):[]});function Pi(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=null==l?0:nr(l);return o<0&&(o=ol(n+o,0)),ft(e,$o(t,3),o)}function Ri(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return void 0!==l&&(o=nr(l),o=l<0?ol(n+o,0):il(o,n-1)),ft(e,$o(t,3),o,!0)}function xi(e){return null!=e&&e.length?nn(e,1):[]}function Bi(e){return e&&e.length?e[0]:void 0}var Fi=Fn(function(e){var t=dt(e,no);return t.length&&t[0]===e[0]?fn(t):[]}),Mi=Fn(function(e){var t=Ui(e),l=dt(e,no);return t===Ui(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,$o(t,2)):[]}),ki=Fn(function(e){var t=Ui(e),l=dt(e,no);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Ui(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Hi=Fn(Wi);function Wi(e,t){return e&&e.length&&t&&t.length?Pn(e,t):e}var ji=zo(function(e,t){var l=null==e?0:e.length,n=Yl(e,t);return Rn(e,dt(t,function(e){return ii(e,l)?+e:e}).sort(vo)),n});function zi(e){return null==e?e:dl.call(e)}var Vi=Fn(function(e){return Xn(nn(e,1,Fa,!0))}),Gi=Fn(function(e){var t=Ui(e);return Fa(t)&&(t=void 0),Xn(nn(e,1,Fa,!0),$o(t,2))}),Yi=Fn(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Fa,!0),void 0,t)});function qi(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Fa(e))return t=ol(e.length,t),!0}),Ct(t,function(t){return dt(e,Nt(t))})}function Ki(e,t){if(!e||!e.length)return[];var l=qi(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var $i=Fn(function(e,t){return Fa(e)?Zl(e,t):[]}),Xi=Fn(function(e){return to(at(e,Fa))}),Zi=Fn(function(e){var t=Ui(e);return Fa(t)&&(t=void 0),to(at(e,Fa),$o(t,2))}),Ji=Fn(function(e){var t=Ui(e);return t="function"==typeof t?t:void 0,to(at(e,Fa),void 0,t)}),Qi=Fn(qi),ea=Fn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Ki(e,l)});function ta(e){var t=Ol(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=zo(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,o=function(t){return Yl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Il&&ii(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[o],thisArg:void 0}),new Ll(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),oa=_o(function(e,t,l){Ne.call(e,l)?++e[l]:Gl(e,l,1)}),ia=Co(Pi),aa=Co(Ri);function ra(e,t){return(Ra(e)?nt:Jl)(e,$o(t,3))}function ua(e,t){return(Ra(e)?ot:Ql)(e,$o(t,3))}var da=_o(function(e,t,l){Ne.call(e,l)?e[l].push(t):Gl(e,l,[t])}),sa=Fn(function(e,t,l){var n=-1,o="function"==typeof t,i=Ba(e)?T(e.length):[];return Jl(e,function(e){i[++n]=o?tt(t,e,l):gn(e,t,l)}),i}),ca=_o(function(e,t,l){Gl(e,l,t)});function ma(e,t){return(Ra(e)?dt:Cn)(e,$o(t,3))}var va=_o(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),pa=Fn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&ai(e,t[0],t[1])?t=[]:l>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),In(e,nn(t,1),[])}),Ea=$t||function(){return ze.Date.now()};function fa(e,t,l){return t=l?void 0:t,ko(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ga(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 _a=Fn(function(e,t,l){var n=1;if(l.length){var o=Ut(l,Ko(_a));n|=32}return ko(e,n,t,l,o)}),ha=Fn(function(e,t,l){var n=3;if(l.length){var o=Ut(l,Ko(ha));n|=32}return ko(t,n,e,l,o)});function Aa(e,t,n){var o,i,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=o,n=i;return o=i=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=_i(g,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 g(){var e=Ea();if(f(e))return _(e);u=_i(g,function(e){var l=t-(e-d);return m?il(l,a-(e-s)):l}(e))}function _(e){return u=void 0,v&&o?p(e):(o=i=void 0,r)}function h(){var e=Ea(),l=f(e);if(o=arguments,i=this,d=e,l){if(void 0===u)return E(d);if(m)return uo(u),u=_i(g,t),p(d)}return void 0===u&&(u=_i(g,t)),r}return t=ir(t)||0,za(n)&&(c=!!n.leading,a=(m="maxWait"in n)?ol(ir(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),h.cancel=function(){void 0!==u&&uo(u),s=0,o=d=i=u=void 0},h.flush=function(){return void 0===u?r:_(Ea())},h}var Na=Fn(function(e,t){return Xl(e,1,t)}),Sa=Fn(function(e,t,l){return Xl(e,ir(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,o=t?t.apply(this,l):l[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,l);return n.cache=i.set(o,a)||i,a};return n.cache=new(ba.Cache||Rl),n}function ya(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 Ca=ao(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Dt($o())):dt(nn(t,1),Dt($o()))).length;return Fn(function(n){for(var o=-1,i=il(n.length,l);++o<i;)n[o]=t[o].call(this,n[o]);return tt(e,this,n)})}),Oa=Fn(function(e,t){return ko(e,32,void 0,t,Ut(t,Ko(Oa)))}),Da=Fn(function(e,t){return ko(e,64,void 0,t,Ut(t,Ko(Da)))}),Ta=zo(function(e,t){return ko(e,256,void 0,void 0,void 0,t)});function La(e,t){return e===t||e!=e&&t!=t}var Ia=Ro(vn),wa=Ro(function(e,t){return e>=t}),Pa=_n(function(){return arguments}())?_n:function(e){return Va(e)&&Ne.call(e,"callee")&&!Ge.call(e,"callee")},Ra=T.isArray,xa=$e?Dt($e):function(e){return Va(e)&&mn(e)==A};function Ba(e){return null!=e&&ja(e.length)&&!Ha(e)}function Fa(e){return Va(e)&&Ba(e)}var Ma=el||iu,ka=Xe?Dt(Xe):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=Ze?Dt(Ze):function(e){return Va(e)&&ti(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=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Ae.call(l)==Ce}var Ka=Je?Dt(Je):function(e){return Va(e)&&mn(e)==E},$a=Qe?Dt(Qe):function(e){return Va(e)&&ti(e)==f};function Xa(e){return"string"==typeof e||!Ra(e)&&Va(e)&&mn(e)==g}function Za(e){return"symbol"==typeof e||Va(e)&&mn(e)==_}var Ja=et?Dt(et):function(e){return Va(e)&&ja(e.length)&&!!Fe[mn(e)]},Qa=Ro(yn),er=Ro(function(e,t){return e<=t});function tr(e){if(!e)return[];if(Ba(e))return Xa(e)?zt(e):fo(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=ti(e);return(t==m?Mt:t==f?Ht:Lr)(e)}function lr(e){return e?(e=ir(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 or(e){return e?ql(nr(e),0,4294967295):0}function ir(e){if("number"==typeof e)return e;if(Za(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=Ot(e);var l=ne.test(e);return l||ie.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return go(e,Nr(e))}function rr(e){return null==e?"":$n(e)}var ur=ho(function(e,t){if(si(t)||Ba(t))go(t,Ar(t),e);else for(var l in t)Ne.call(t,l)&&Wl(e,l,t[l])}),dr=ho(function(e,t){go(t,Nr(t),e)}),sr=ho(function(e,t,l,n){go(t,Nr(t),e,n)}),cr=ho(function(e,t,l,n){go(t,Ar(t),e,n)}),mr=zo(Yl),vr=Fn(function(e,t){e=ve(e);var l=-1,n=t.length,o=n>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(n=1);++l<n;)for(var i=t[l],a=Nr(i),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||La(s,_e[d])&&!Ne.call(e,d))&&(e[d]=i[d])}return e}),pr=Fn(function(e){return e.push(void 0,Ho),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&&li(e,t,En)}var gr=To(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=ye.call(t)),e[t]=l},zr(Yr)),_r=To(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=ye.call(t)),Ne.call(e,t)?e[t].push(l):e[t]=[l]},$o),hr=Fn(gn);function Ar(e){return Ba(e)?Fl(e):bn(e)}function Nr(e){return Ba(e)?Fl(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=si(e),l=[];for(var n in e)("constructor"!=n||!t&&Ne.call(e,n))&&l.push(n);return l}(e)}var Sr=ho(function(e,t,l){Tn(e,t,l)}),br=ho(function(e,t,l,n){Tn(e,t,l,n)}),yr=zo(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=io(t,e),n||(n=t.length>1),t}),go(e,Go(e),l),n&&(l=Kl(l,7,Wo));for(var o=t.length;o--;)Zn(l,t[o]);return l}),Cr=zo(function(e,t){return null==e?{}:function(e,t){return wn(e,t,function(t,l){return fr(e,l)})}(e,t)});function Or(e,t){if(null==e)return{};var l=dt(Go(e),function(e){return[e]});return t=$o(t),wn(e,l,function(e,l){return t(e,l[0])})}var Dr=Mo(Ar),Tr=Mo(Nr);function Lr(e){return null==e?[]:Tt(e,Ar(e))}var Ir=bo(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(Le,"")}var Rr=bo(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),xr=bo(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),Br=So("toLowerCase"),Fr=bo(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),Mr=bo(function(e,t,l){return e+(l?" ":"")+Ur(t)}),kr=bo(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=So("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(Z)||[]}(e):e.match(t)||[]}var Wr=Fn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),jr=zo(function(e,t){return nt(t,function(t){t=Oi(t),Gl(e,t,_a(e[t],e))}),e});function zr(e){return function(){return e}}var Vr=Oo(),Gr=Oo(!0);function Yr(e){return e}function qr(e){return Sn("function"==typeof e?e:Kl(e,1))}var Kr=Fn(function(e,t){return function(l){return gn(l,e,t)}}),$r=Fn(function(e,t){return function(l){return gn(e,l,t)}});function Xr(e,t,l){var n=Ar(t),o=dn(t,n);null!=l||za(t)&&(o.length||!n.length)||(l=t,t=e,e=this,o=dn(t,Ar(t)));var i=!(za(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(o,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(i||t){var l=e(this.__wrapped__),o=l.__actions__=fo(this.__actions__);return o.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Zr(){}var Jr=Io(dt),Qr=Io(it),eu=Io(vt);function tu(e){return ri(e)?Nt(Oi(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=Po(),nu=Po(!0);function ou(){return[]}function iu(){return!1}var au,ru=Lo(function(e,t){return e+t},0),uu=Bo("ceil"),du=Lo(function(e,t){return e/t},1),su=Bo("floor"),cu=Lo(function(e,t){return e*t},1),mu=Bo("round"),vu=Lo(function(e,t){return e-t},0);return Ol.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)}},Ol.ary=fa,Ol.assign=ur,Ol.assignIn=dr,Ol.assignInWith=sr,Ol.assignWith=cr,Ol.at=mr,Ol.before=ga,Ol.bind=_a,Ol.bindAll=jr,Ol.bindKey=ha,Ol.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Ol.chain=ta,Ol.chunk=function(e,t,l){t=(l?ai(e,t,l):void 0===t)?1:ol(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var o=0,i=0,a=T(Zt(n/t));o<n;)a[i++]=zn(e,o,o+=t);return a},Ol.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,o=[];++t<l;){var i=e[t];i&&(o[n++]=i)}return o},Ol.concat=function(){var e=arguments.length;if(!e)return[];for(var t=T(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?fo(l):[l],nn(t,1))},Ol.cond=function(e){var t=null==e?0:e.length,n=$o();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Fn(function(l){for(var n=-1;++n<t;){var o=e[n];if(tt(o[0],this,l))return tt(o[1],this,l)}})},Ol.conforms=function(e){return function(e){var t=Ar(e);return function(l){return $l(l,e,t)}}(Kl(e,1))},Ol.constant=zr,Ol.countBy=oa,Ol.create=function(e,t){var l=Dl(e);return null==t?l:Vl(l,t)},Ol.curry=function e(t,l,n){var o=ko(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return o.placeholder=e.placeholder,o},Ol.curryRight=function e(t,l,n){var o=ko(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return o.placeholder=e.placeholder,o},Ol.debounce=Aa,Ol.defaults=vr,Ol.defaultsDeep=pr,Ol.defer=Na,Ol.delay=Sa,Ol.difference=Li,Ol.differenceBy=Ii,Ol.differenceWith=wi,Ol.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):[]},Ol.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):[]},Ol.dropRightWhile=function(e,t){return e&&e.length?Qn(e,$o(t,3),!0,!0):[]},Ol.dropWhile=function(e,t){return e&&e.length?Qn(e,$o(t,3),!0):[]},Ol.fill=function(e,t,l,n){var o=null==e?0:e.length;return o?(l&&"number"!=typeof l&&ai(e,t,l)&&(l=0,n=o),function(e,t,l,n){var o=e.length;for((l=nr(l))<0&&(l=-l>o?0:o+l),(n=void 0===n||n>o?o:nr(n))<0&&(n+=o),n=l>n?0:or(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Ol.filter=function(e,t){return(Ra(e)?at:ln)(e,$o(t,3))},Ol.flatMap=function(e,t){return nn(ma(e,t),1)},Ol.flatMapDeep=function(e,t){return nn(ma(e,t),1/0)},Ol.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(ma(e,t),l)},Ol.flatten=xi,Ol.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Ol.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Ol.flip=function(e){return ko(e,512)},Ol.flow=Vr,Ol.flowRight=Gr,Ol.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var o=e[t];n[o[0]]=o[1]}return n},Ol.functions=function(e){return null==e?[]:dn(e,Ar(e))},Ol.functionsIn=function(e){return null==e?[]:dn(e,Nr(e))},Ol.groupBy=da,Ol.initial=function(e){return null!=e&&e.length?zn(e,0,-1):[]},Ol.intersection=Fi,Ol.intersectionBy=Mi,Ol.intersectionWith=ki,Ol.invert=gr,Ol.invertBy=_r,Ol.invokeMap=sa,Ol.iteratee=qr,Ol.keyBy=ca,Ol.keys=Ar,Ol.keysIn=Nr,Ol.map=ma,Ol.mapKeys=function(e,t){var l={};return t=$o(t,3),rn(e,function(e,n,o){Gl(l,t(e,n,o),e)}),l},Ol.mapValues=function(e,t){var l={};return t=$o(t,3),rn(e,function(e,n,o){Gl(l,n,t(e,n,o))}),l},Ol.matches=function(e){return On(Kl(e,1))},Ol.matchesProperty=function(e,t){return Dn(e,Kl(t,1))},Ol.memoize=ba,Ol.merge=Sr,Ol.mergeWith=br,Ol.method=Kr,Ol.methodOf=$r,Ol.mixin=Xr,Ol.negate=ya,Ol.nthArg=function(e){return e=nr(e),Fn(function(t){return Ln(t,e)})},Ol.omit=yr,Ol.omitBy=function(e,t){return Or(e,ya($o(t)))},Ol.once=function(e){return ga(2,e)},Ol.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))},Ol.over=Jr,Ol.overArgs=Ca,Ol.overEvery=Qr,Ol.overSome=eu,Ol.partial=Oa,Ol.partialRight=Da,Ol.partition=va,Ol.pick=Cr,Ol.pickBy=Or,Ol.property=tu,Ol.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Ol.pull=Hi,Ol.pullAll=Wi,Ol.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?Pn(e,t,$o(l,2)):e},Ol.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?Pn(e,t,void 0,l):e},Ol.pullAt=ji,Ol.range=lu,Ol.rangeRight=nu,Ol.rearg=Ta,Ol.reject=function(e,t){return(Ra(e)?at:ln)(e,ya($o(t,3)))},Ol.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,o=[],i=e.length;for(t=$o(t,3);++n<i;){var a=e[n];t(a,n,e)&&(l.push(a),o.push(n))}return Rn(e,o),l},Ol.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Fn(e,t=void 0===t?t:nr(t))},Ol.reverse=zi,Ol.sampleSize=function(e,t,l){return t=(l?ai(e,t,l):void 0===t)?1:nr(t),(Ra(e)?kl:kn)(e,t)},Ol.set=function(e,t,l){return null==e?e:Un(e,t,l)},Ol.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Ol.shuffle=function(e){return(Ra(e)?Ul:jn)(e)},Ol.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&ai(e,t,l)?(t=0,l=n):(t=null==t?0:nr(t),l=void 0===l?n:nr(l)),zn(e,t,l)):[]},Ol.sortBy=pa,Ol.sortedUniq=function(e){return e&&e.length?qn(e):[]},Ol.sortedUniqBy=function(e,t){return e&&e.length?qn(e,$o(t,2)):[]},Ol.split=function(e,t,l){return l&&"number"!=typeof l&&ai(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=$n(t))&&Ft(e)?ro(zt(e),0,l):e.split(t,l):[]},Ol.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:ol(nr(t),0),Fn(function(l){var n=l[t],o=ro(l,0,t);return n&&st(o,n),tt(e,this,o)})},Ol.tail=function(e){var t=null==e?0:e.length;return t?zn(e,1,t):[]},Ol.take=function(e,t,l){return e&&e.length?zn(e,0,(t=l||void 0===t?1:nr(t))<0?0:t):[]},Ol.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):[]},Ol.takeRightWhile=function(e,t){return e&&e.length?Qn(e,$o(t,3),!1,!0):[]},Ol.takeWhile=function(e,t){return e&&e.length?Qn(e,$o(t,3)):[]},Ol.tap=function(e,t){return t(e),e},Ol.throttle=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new fe(l);return za(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),Aa(e,t,{leading:o,maxWait:t,trailing:i})},Ol.thru=la,Ol.toArray=tr,Ol.toPairs=Dr,Ol.toPairsIn=Tr,Ol.toPath=function(e){return Ra(e)?dt(e,Oi):Za(e)?[e]:fo(Ci(rr(e)))},Ol.toPlainObject=ar,Ol.transform=function(e,t,l){var n=Ra(e),o=n||Ma(e)||Ja(e);if(t=$o(t,4),null==l){var i=e&&e.constructor;l=o?n?new i:[]:za(e)&&Ha(i)?Dl(je(e)):{}}return(o?nt:rn)(e,function(e,n,o){return t(l,e,n,o)}),l},Ol.unary=function(e){return fa(e,1)},Ol.union=Vi,Ol.unionBy=Gi,Ol.unionWith=Yi,Ol.uniq=function(e){return e&&e.length?Xn(e):[]},Ol.uniqBy=function(e,t){return e&&e.length?Xn(e,$o(t,2)):[]},Ol.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Ol.unset=function(e,t){return null==e||Zn(e,t)},Ol.unzip=qi,Ol.unzipWith=Ki,Ol.update=function(e,t,l){return null==e?e:Jn(e,t,oo(l))},Ol.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Jn(e,t,oo(l),n)},Ol.values=Lr,Ol.valuesIn=function(e){return null==e?[]:Tt(e,Nr(e))},Ol.without=$i,Ol.words=Hr,Ol.wrap=function(e,t){return Oa(oo(t),e)},Ol.xor=Xi,Ol.xorBy=Zi,Ol.xorWith=Ji,Ol.zip=Qi,Ol.zipObject=function(e,t){return lo(e||[],t||[],Wl)},Ol.zipObjectDeep=function(e,t){return lo(e||[],t||[],Un)},Ol.zipWith=ea,Ol.entries=Dr,Ol.entriesIn=Tr,Ol.extend=dr,Ol.extendWith=sr,Xr(Ol,Ol),Ol.add=ru,Ol.attempt=Wr,Ol.camelCase=Ir,Ol.capitalize=wr,Ol.ceil=uu,Ol.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=ir(l))==l?l:0),void 0!==t&&(t=(t=ir(t))==t?t:0),ql(ir(e),t,l)},Ol.clone=function(e){return Kl(e,4)},Ol.cloneDeep=function(e){return Kl(e,5)},Ol.cloneDeepWith=function(e,t){return Kl(e,5,t="function"==typeof t?t:void 0)},Ol.cloneWith=function(e,t){return Kl(e,4,t="function"==typeof t?t:void 0)},Ol.conformsTo=function(e,t){return null==t||$l(e,t,Ar(t))},Ol.deburr=Pr,Ol.defaultTo=function(e,t){return null==e||e!=e?t:e},Ol.divide=du,Ol.endsWith=function(e,t,l){e=rr(e),t=$n(t);var n=e.length,o=l=void 0===l?n:ql(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,o)==t},Ol.eq=La,Ol.escape=function(e){return(e=rr(e))&&M.test(e)?e.replace(B,xt):e},Ol.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(V,"\\$&"):e},Ol.every=function(e,t,l){var n=Ra(e)?it:en;return l&&ai(e,t,l)&&(t=void 0),n(e,$o(t,3))},Ol.find=ia,Ol.findIndex=Pi,Ol.findKey=function(e,t){return Et(e,$o(t,3),rn)},Ol.findLast=aa,Ol.findLastIndex=Ri,Ol.findLastKey=function(e,t){return Et(e,$o(t,3),un)},Ol.floor=su,Ol.forEach=ra,Ol.forEachRight=ua,Ol.forIn=function(e,t){return null==e?e:on(e,$o(t,3),Nr)},Ol.forInRight=function(e,t){return null==e?e:an(e,$o(t,3),Nr)},Ol.forOwn=function(e,t){return e&&rn(e,$o(t,3))},Ol.forOwnRight=function(e,t){return e&&un(e,$o(t,3))},Ol.get=Er,Ol.gt=Ia,Ol.gte=wa,Ol.has=function(e,t){return null!=e&&li(e,t,pn)},Ol.hasIn=fr,Ol.head=Bi,Ol.identity=Yr,Ol.includes=function(e,t,l,n){e=Ba(e)?e:Lr(e),l=l&&!n?nr(l):0;var o=e.length;return l<0&&(l=ol(o+l,0)),Xa(e)?l<=o&&e.indexOf(t,l)>-1:!!o&>(e,t,l)>-1},Ol.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=null==l?0:nr(l);return o<0&&(o=ol(n+o,0)),gt(e,t,o)},Ol.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>=il(t,l)&&e<ol(t,l)}(e=ir(e),t,l)},Ol.invoke=hr,Ol.isArguments=Pa,Ol.isArray=Ra,Ol.isArrayBuffer=xa,Ol.isArrayLike=Ba,Ol.isArrayLikeObject=Fa,Ol.isBoolean=function(e){return!0===e||!1===e||Va(e)&&mn(e)==r},Ol.isBuffer=Ma,Ol.isDate=ka,Ol.isElement=function(e){return Va(e)&&1===e.nodeType&&!qa(e)},Ol.isEmpty=function(e){if(null==e)return!0;if(Ba(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Ma(e)||Ja(e)||Pa(e)))return!e.length;var t=ti(e);if(t==m||t==f)return!e.size;if(si(e))return!bn(e).length;for(var l in e)if(Ne.call(e,l))return!1;return!0},Ol.isEqual=function(e,t){return hn(e,t)},Ol.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},Ol.isError=Ua,Ol.isFinite=function(e){return"number"==typeof e&&tl(e)},Ol.isFunction=Ha,Ol.isInteger=Wa,Ol.isLength=ja,Ol.isMap=Ga,Ol.isMatch=function(e,t){return e===t||An(e,t,Zo(t))},Ol.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,An(e,t,Zo(t),l)},Ol.isNaN=function(e){return Ya(e)&&e!=+e},Ol.isNative=function(e){if(di(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Nn(e)},Ol.isNil=function(e){return null==e},Ol.isNull=function(e){return null===e},Ol.isNumber=Ya,Ol.isObject=za,Ol.isObjectLike=Va,Ol.isPlainObject=qa,Ol.isRegExp=Ka,Ol.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Ol.isSet=$a,Ol.isString=Xa,Ol.isSymbol=Za,Ol.isTypedArray=Ja,Ol.isUndefined=function(e){return void 0===e},Ol.isWeakMap=function(e){return Va(e)&&ti(e)==h},Ol.isWeakSet=function(e){return Va(e)&&"[object WeakSet]"==mn(e)},Ol.join=function(e,t){return null==e?"":ll.call(e,t)},Ol.kebabCase=Rr,Ol.last=Ui,Ol.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var o=n;return void 0!==l&&(o=(o=nr(l))<0?ol(n+o,0):il(o,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,o):ft(e,ht,o,!0)},Ol.lowerCase=xr,Ol.lowerFirst=Br,Ol.lt=Qa,Ol.lte=er,Ol.max=function(e){return e&&e.length?tn(e,Yr,vn):void 0},Ol.maxBy=function(e,t){return e&&e.length?tn(e,$o(t,2),vn):void 0},Ol.mean=function(e){return At(e,Yr)},Ol.meanBy=function(e,t){return At(e,$o(t,2))},Ol.min=function(e){return e&&e.length?tn(e,Yr,yn):void 0},Ol.minBy=function(e,t){return e&&e.length?tn(e,$o(t,2),yn):void 0},Ol.stubArray=ou,Ol.stubFalse=iu,Ol.stubObject=function(){return{}},Ol.stubString=function(){return""},Ol.stubTrue=function(){return!0},Ol.multiply=cu,Ol.nth=function(e,t){return e&&e.length?Ln(e,nr(t)):void 0},Ol.noConflict=function(){return ze._===this&&(ze._=Oe),this},Ol.noop=Zr,Ol.now=Ea,Ol.pad=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;if(!t||n>=t)return e;var o=(t-n)/2;return wo(Jt(o),l)+e+wo(Zt(o),l)},Ol.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?e+wo(t-n,l):e},Ol.padStart=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?wo(t-n,l)+e:e},Ol.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace(Y,""),t||0)},Ol.random=function(e,t,l){if(l&&"boolean"!=typeof l&&ai(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 o=ul();return il(e+o*(t-e+Ue("1e-"+((o+"").length-1))),t)}return xn(e,t)},Ol.reduce=function(e,t,l){var n=Ra(e)?ct:bt,o=arguments.length<3;return n(e,$o(t,4),l,o,Jl)},Ol.reduceRight=function(e,t,l){var n=Ra(e)?mt:bt,o=arguments.length<3;return n(e,$o(t,4),l,o,Ql)},Ol.repeat=function(e,t,l){return t=(l?ai(e,t,l):void 0===t)?1:nr(t),Bn(rr(e),t)},Ol.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Ol.result=function(e,t,l){var n=-1,o=(t=io(t,e)).length;for(o||(o=1,e=void 0);++n<o;){var i=null==e?void 0:e[Oi(t[n])];void 0===i&&(n=o,i=l),e=Ha(i)?i.call(e):i}return e},Ol.round=mu,Ol.runInContext=e,Ol.sample=function(e){return(Ra(e)?Ml:Mn)(e)},Ol.size=function(e){if(null==e)return 0;if(Ba(e))return Xa(e)?jt(e):e.length;var t=ti(e);return t==m||t==f?e.size:bn(e).length},Ol.snakeCase=Fr,Ol.some=function(e,t,l){var n=Ra(e)?vt:Vn;return l&&ai(e,t,l)&&(t=void 0),n(e,$o(t,3))},Ol.sortedIndex=function(e,t){return Gn(e,t)},Ol.sortedIndexBy=function(e,t,l){return Yn(e,t,$o(l,2))},Ol.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Gn(e,t);if(n<l&&La(e[n],t))return n}return-1},Ol.sortedLastIndex=function(e,t){return Gn(e,t,!0)},Ol.sortedLastIndexBy=function(e,t,l){return Yn(e,t,$o(l,2),!0)},Ol.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Gn(e,t,!0)-1;if(La(e[l],t))return l}return-1},Ol.startCase=Mr,Ol.startsWith=function(e,t,l){return e=rr(e),l=null==l?0:ql(nr(l),0,e.length),t=$n(t),e.slice(l,l+t.length)==t},Ol.subtract=vu,Ol.sum=function(e){return e&&e.length?yt(e,Yr):0},Ol.sumBy=function(e,t){return e&&e.length?yt(e,$o(t,2)):0},Ol.template=function(e,t,l){var n=Ol.templateSettings;l&&ai(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,Uo);var o,i,a=sr({},t.imports,n.imports,Uo),r=Ar(a),u=Tt(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="+(Ne.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(m,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,Bt),l&&(o=!0,c+="' +\n__e("+l+") +\n'"),r&&(i=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var p=Ne.call(t,"variable")&&t.variable;if(p){if(J.test(p))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(i?c.replace(w,""):c).replace(P,"$1").replace(R,"$1;"),c="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(r,v+"return "+c).apply(void 0,u)});if(E.source=c,Ua(E))throw E;return E},Ol.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=il(e,4294967295);e-=4294967295;for(var o=Ct(n,t=$o(t));++l<e;)t(l);return o},Ol.toFinite=lr,Ol.toInteger=nr,Ol.toLength=or,Ol.toLower=function(e){return rr(e).toLowerCase()},Ol.toNumber=ir,Ol.toSafeInteger=function(e){return e?ql(nr(e),-9007199254740991,9007199254740991):0===e?e:0},Ol.toString=rr,Ol.toUpper=function(e){return rr(e).toUpperCase()},Ol.trim=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return Ot(e);if(!e||!(t=$n(t)))return e;var n=zt(e),o=zt(t);return ro(n,It(n,o),wt(n,o)+1).join("")},Ol.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=$n(t)))return e;var n=zt(e);return ro(n,0,wt(n,zt(t))+1).join("")},Ol.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace(Y,"");if(!e||!(t=$n(t)))return e;var n=zt(e);return ro(n,It(n,zt(t))).join("")},Ol.truncate=function(e,t){var l=30,n="...";if(za(t)){var o="separator"in t?t.separator:o;l="length"in t?nr(t.length):l,n="omission"in t?$n(t.omission):n}var i=(e=rr(e)).length;if(Ft(e)){var a=zt(e);i=a.length}if(l>=i)return e;var r=l-jt(n);if(r<1)return n;var u=a?ro(a,0,r).join(""):e.slice(0,r);if(void 0===o)return u+n;if(a&&(r+=u.length-r),Ka(o)){if(e.slice(r).search(o)){var d,s=u;for(o.global||(o=pe(o.source,rr(te.exec(o))+"g")),o.lastIndex=0;d=o.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf($n(o),r)!=r){var m=u.lastIndexOf(o);m>-1&&(u=u.slice(0,m))}return u+n},Ol.unescape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,Gt):e},Ol.uniqueId=function(e){var t=++Se;return rr(e)+t},Ol.upperCase=kr,Ol.upperFirst=Ur,Ol.each=ra,Ol.eachRight=ua,Ol.first=Bi,Xr(Ol,(au={},rn(Ol,function(e,t){Ne.call(Ol.prototype,t)||(au[t]=e)}),au),{chain:!1}),Ol.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Ol[e].placeholder=Ol}),nt(["drop","take"],function(e,t){Il.prototype[e]=function(l){l=void 0===l?1:ol(nr(l),0);var n=this.__filtered__&&!t?new Il(this):this.clone();return n.__filtered__?n.__takeCount__=il(l,n.__takeCount__):n.__views__.push({size:il(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:$o(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=Fn(function(e,t){return"function"==typeof e?new Il(this):this.map(function(l){return gn(l,e,t)})}),Il.prototype.reject=function(e){return this.filter(ya($o(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),o=Ol[n?"take"+("last"==t?"Right":""):t],i=n||/^find/.test(t);o&&(Ol.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=o.apply(Ol,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=i&&!c,p=r&&!m;if(!i&&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 Ll(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=ge[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Ol.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var o=this.value();return t.apply(Ra(o)?o:[],e)}return this[l](function(l){return t.apply(Ra(l)?l:[],e)})}}),rn(Il.prototype,function(e,t){var l=Ol[t];if(l){var n=l.name+"";Ne.call(gl,n)||(gl[n]=[]),gl[n].push({name:t,func:l})}}),gl[Do(void 0,2).name]=[{name:"wrapper",func:void 0}],Il.prototype.clone=function(){var e=new Il(this.__wrapped__);return e.__actions__=fo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fo(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,o=l?e.length:0,i=function(e,t,l){for(var n=-1,o=l.length;++n<o;){var i=l[n],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=il(t,e+a);break;case"takeRight":e=ol(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,r=i.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,m=0,v=il(u,this.__takeCount__);if(!l||!n&&o==u&&v==u)return eo(e,this.__actions__);var p=[];e:for(;u--&&m<v;){for(var E=-1,f=e[d+=t];++E<c;){var g=s[E],_=g.type,h=(0,g.iteratee)(f);if(2==_)f=h;else if(!h){if(1==_)continue e;break e}}p[m++]=f}return p},Ol.prototype.at=na,Ol.prototype.chain=function(){return ta(this)},Ol.prototype.commit=function(){return new Ll(this.value(),this.__chain__)},Ol.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__++]}},Ol.prototype.plant=function(e){for(var t,l=this;l instanceof Tl;){var n=Ti(l);n.__index__=0,n.__values__=void 0,t?o.__wrapped__=n:t=n;var o=n;l=l.__wrapped__}return o.__wrapped__=e,t},Ol.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:[zi],thisArg:void 0}),new Ll(t,this.__chain__)}return this.thru(zi)},Ol.prototype.toJSON=Ol.prototype.valueOf=Ol.prototype.value=function(){return eo(this.__wrapped__,this.__actions__)},Ol.prototype.first=Ol.prototype.head,pt&&(Ol.prototype[pt]=function(){return this}),Ol}();Ge?((Ge.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(T)});const Ct=e=>{var o,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=i.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===(o=m.errors)||void 0===o||null===(r=o.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"))))},Ot=["currentlyActiveMobileModal"],Dt=["currentlyActiveMobileModal"],Tt=e=>{var o,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:E}=i.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=()=>{_({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),N=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,o=m(e,Ot);const{closeMobilePopupModal:i}=o;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,o,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:i}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,Dt)))},[g]);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:()=>_({type:"set",payload:"SearchFormComponent"})})),g?n.createElement(t.PopUp,null,n.createElement(N,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:f,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=v&&null!==(o=v[0])&&void 0!==o&&o.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")}))},Lt=e=>{let{columns:o,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:g}=i.useTranslation(),_=()=>{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 N(e){v("limit",Number(e.target.value)),m(u)()}function S(){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 y=()=>{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}},g(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:g,data:d,columns:o,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:N,currentPage:E,onNextPage:S,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,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(y,null))},It=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}=i.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(o.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(),g=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(Tt,{SearchFormFieldsComponent:Ct,propsMobileInboxCards:g,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(Lt,{columns:E,SearchFormFieldsComponent:Ct,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},wt=e=>{const{t:o}=i.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:g,error:_}=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"}},o("ACTION_TEST_SEARCH_NOC_APPLICATION")),n.createElement(It,{t:o,tenantId:r,onSubmit:function(e,t){console.log("_data==>",e);let l=bt(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),s(l)},isLoading:g,Count:p,error:_,data:m}))};function Pt(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function Rt(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 xt=(e,t)=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const l=e%10,n=e%100;let o="th";return(n<11||n>13)&&(1===l?o="st":2===l?o="nd":3===l&&(o="rd")),""+e+o+" "+t("NOC_FLOOR_AREA_LABEL")},Bt=function(e,t,l,n,o){try{var i,a,r,u;const d=Digit.ULBService.getStateId(),s=e||{};console.log("appData here in DownloadACK",s);let c=[],m="";const v=(null==s||null===(i=s.nocDetails)||void 0===i||null===(a=i.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 i,a,r,u,d;const v=null==e||null===(i=e.data)||void 0===i||null===(a=i.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,o,i,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===(o=n.applicationDetails)||void 0===o?void 0:o.professionalName)||"N/A"},{title:t("NOC_PROFESSIONAL_EMAIL_LABEL"),value:(null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.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===(g=e.nocDetails)||void 0===g||null===(_=g.additionalDetails)||void 0===_||null===(h=_.applicationDetails)||void 0===h?void 0:h.professionalAddress)||"N/A"}];return{title:t("NOC_PROFESSIONAL_DETAILS"),values:A}})(s,o));const p=(null==s?void 0:s.applicationNo)||"NA",E=o("LOCAL_GOVERNMENT_PUNJAB"),f=null==t?void 0:t.contactNumber,_=null==t?void 0:t.emailId,h=null==t?void 0:t.code,A=((e,t)=>{var l,n,o,i,a,r,u,d,s,c,m,v,p,E,f,g,_,h,A,N,S,b,y,C,O,D,T,L,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===(o=n.siteDetails)||void 0===o?void 0:o.specificationPlotArea)||"N/A"},{title:t("NOC_BUILDING_CATEGORY_LABEL"),value:(null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.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===(g=f.additionalDetails)||void 0===g||null===(_=g.siteDetails)||void 0===_?void 0:_.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===(N=A.siteDetails)||void 0===N||null===(S=N.specificationRestrictedArea)||void 0===S?void 0:S.code)||(null==e||null===(b=e.nocDetails)||void 0===b||null===(y=b.additionalDetails)||void 0===y||null===(C=y.siteDetails)||void 0===C?void 0:C.specificationRestrictedArea)||"N/A"},{title:t("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),value:(null==e||null===(O=e.nocDetails)||void 0===O||null===(D=O.additionalDetails)||void 0===D||null===(T=D.siteDetails)||void 0===T||null===(L=T.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.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,o),N=((e,t)=>{var l,n,o,i,a,r,u,d,s,c,m,v,p,E,f,g,_,h,A,N,S,b,y,C,O,D,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne,Se,be,ye,Ce,Oe,De,Te,Le,Ie,we,Pe,Re,xe,Be,Fe,Me,ke,Ue;let He=[{title:t("NOC_PLOT_NO_LABEL"),value:(null==e||null===(l=e.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(o=n.siteDetails)||void 0===o?void 0:o.plotNo)||"N/A"},{title:t("NOC_PROPOSED_SITE_ADDRESS"),value:(null==e||null===(i=e.nocDetails)||void 0===i||null===(a=i.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===(g=f.siteDetails)||void 0===g?void 0:g.ulbType)||"N/A"},{title:t("NOC_KHASRA_NO_LABEL"),value:(null==e||null===(_=e.nocDetails)||void 0===_||null===(h=_.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===(N=e.nocDetails)||void 0===N||null===(S=N.additionalDetails)||void 0===S||null===(b=S.siteDetails)||void 0===b?void 0:b.hadbastNo)||"N/A"},{title:t("NOC_ROAD_TYPE_LABEL"),value:(null==e||null===(y=e.nocDetails)||void 0===y||null===(C=y.additionalDetails)||void 0===C||null===(O=C.siteDetails)||void 0===O||null===(D=O.roadType)||void 0===D?void 0:D.name)||(null==e||null===(T=e.nocDetails)||void 0===T||null===(L=T.additionalDetails)||void 0===L||null===(I=L.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===(B=x.additionalDetails)||void 0===B||null===(F=B.siteDetails)||void 0===F?void 0:F.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===($=K.siteDetails)||void 0===$?void 0:$.district)||"N/A"},{title:t("NOC_ZONE_LABEL"),value:(null==e||null===(X=e.nocDetails)||void 0===X||null===(Z=X.additionalDetails)||void 0===Z||null===(J=Z.siteDetails)||void 0===J||null===(Q=J.zone)||void 0===Q?void 0:Q.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===(oe=ne.additionalDetails)||void 0===oe||null===(ie=oe.siteDetails)||void 0===ie?void 0:ie.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_VASIKA_DATE"),value:(null==e||null===(Ee=e.nocDetails)||void 0===Ee||null===(fe=Ee.additionalDetails)||void 0===fe||null===(ge=fe.siteDetails)||void 0===ge?void 0:ge.vasikaDate)||"N/A"},{title:t("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),value:(null==e||null===(_e=e.nocDetails)||void 0===_e||null===(he=_e.additionalDetails)||void 0===he||null===(Ae=he.siteDetails)||void 0===Ae?void 0:Ae.khewatAndKhatuniNo)||"N/A"},{title:t("NOC_BUILDING_STATUS_LABEL"),value:(null==e||null===(Ne=e.nocDetails)||void 0===Ne||null===(Se=Ne.additionalDetails)||void 0===Se||null===(be=Se.siteDetails)||void 0===be||null===(ye=be.buildingStatus)||void 0===ye?void 0:ye.name)||(null==e||null===(Ce=e.nocDetails)||void 0===Ce||null===(Oe=Ce.additionalDetails)||void 0===Oe||null===(De=Oe.siteDetails)||void 0===De?void 0:De.buildingStatus)||"N/A"}];var We,je,ze,Ve,Ge,Ye,qe,Ke,$e,Xe,Ze,Je,Qe,et,tt,lt,nt;return null!=e&&null!==(Te=e.nocDetails)&&void 0!==Te&&null!==(Le=Te.additionalDetails)&&void 0!==Le&&null!==(Ie=Le.siteDetails)&&void 0!==Ie&&Ie.isBasementAreaAvailable&&He.push({title:t("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),value:(null==e||null===(We=e.nocDetails)||void 0===We||null===(je=We.additionalDetails)||void 0===je||null===(ze=je.siteDetails)||void 0===ze||null===(Ve=ze.isBasementAreaAvailable)||void 0===Ve?void 0:Ve.code)||(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.isBasementAreaAvailable)||"N/A"}),null!=e&&null!==(we=e.nocDetails)&&void 0!==we&&null!==(Pe=we.additionalDetails)&&void 0!==Pe&&null!==(Re=Pe.siteDetails)&&void 0!==Re&&Re.basementArea&&He.push({title:t("NOC_BASEMENT_AREA_LABEL"),value:(null==e||null===(Ke=e.nocDetails)||void 0===Ke||null===($e=Ke.additionalDetails)||void 0===$e||null===(Xe=$e.siteDetails)||void 0===Xe?void 0:Xe.basementArea)||"N/A"}),"Built UP"==(null==e||null===(xe=e.nocDetails)||void 0===xe||null===(Be=xe.additionalDetails)||void 0===Be||null===(Fe=Be.siteDetails)||void 0===Fe?void 0:Fe.buildingStatus)&&(null==e||null===(Ze=e.nocDetails)||void 0===Ze||null===(Je=Ze.additionalDetails)||void 0===Je||null===(Qe=Je.siteDetails)||void 0===Qe||null===(et=Qe.floorArea)||void 0===et||et.map((e,l)=>He.push({title:xt(l,t),value:null==e?void 0:e.value}))),"Built Up"==(null==e||null===(Me=e.nocDetails)||void 0===Me||null===(ke=Me.additionalDetails)||void 0===ke||null===(Ue=ke.siteDetails)||void 0===Ue?void 0:Ue.buildingStatus)&&He.push({title:t("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),value:(null==e||null===(tt=e.nocDetails)||void 0===tt||null===(lt=tt.additionalDetails)||void 0===lt||null===(nt=lt.siteDetails)||void 0===nt?void 0:nt.totalFloorArea)||"N/A"}),{title:t("NOC_SITE_DETAILS"),values:He}})(s,o),S=((e,t)=>{var l,n,o,i;return(null!=(l=null==e||null===(n=e.nocDetails)||void 0===n||null===(o=n.additionalDetails)||void 0===o||null===(i=o.applicationDetails)||void 0===i?void 0:i.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"},{title:t("NOC_APPLICANT_PROPERTY_ID_LABEL"),value:(null==e?void 0:e.propertyId)||"NA"},{title:t("PROPERTY_OWNER_NAME"),value:(null==e?void 0:e.PropertyOwnerName)||"NA"},{title:t("PROPERTY_OWNER_MOBILE_NUMBER"),value:(null==e?void 0:e.PropertyOwnerMobileNumber)||"NA"},{title:t("PROPERTY_PLOT_AREA"),value:(null==e?void 0:e.PropertyOwnerPlotArea)||"NA"}]}})})(s,o),b=((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,o);return Promise.resolve(function(e,t){try{var l;function n(e){return console.log("res here==>",e),{title:t("BPA_TITILE_DOCUMENT_UPLOADED"),values:(null==o?void 0:o.length)>0?o.map((l,n)=>{const o=g(null==e?void 0:e.data,null==l?void 0:l.uuid);return{title:n+1+". "+(t(null==l?void 0:l.documentType.replace(/\./g,"_"))||t("CS_NA")),value:" ",link:o||""}}):[{title:t("PT_NO_DOCUMENTS"),value:"NA"}]}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.filter(e=>"OWNER.SITEPHOTOGRAPHONE"!==(null==e?void 0:e.documentType)&&"OWNER.SITEPHOTOGRAPHTWO"!==(null==e?void 0:e.documentType)),i=null==o?void 0:o.map(e=>null==e?void 0:e.uuid),a=(null==i?void 0:i.length)>0;return Promise.resolve(a?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(n):n(a))}catch(e){return Promise.reject(e)}}(s,o)).then(function(e){return Promise.resolve(function(e,t){try{var l;function n(l){var n,i;const a=(null==e||null===(n=e.nocDetails)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.coordinates)||{},r=(null==o?void 0:o.length)>0?o.map(e=>{const n=g(null==l?void 0:l.data,null==e?void 0:e.uuid);let o="N/A",i="N/A";return"OWNER.SITEPHOTOGRAPHONE"===e.documentType&&(o=(null==a?void 0:a.Latitude1)||"N/A",i=(null==a?void 0:a.Longitude1)||"N/A"),"OWNER.SITEPHOTOGRAPHTWO"===e.documentType&&(o=(null==a?void 0:a.Latitude2)||"N/A",i=(null==a?void 0:a.Longitude2)||"N/A"),{title:(t(e.documentType.replace(/\./g,"_"))||t("CS_NA"))+" (Lat: "+o+", Long: "+i+")",value:" ",link:n||""}}):[{title:t("CS_NO_DOCUMENTS_UPLOADED"),value:"NA"}];return{title:t("BPA_LOC_SITE_PHOTOGRAPH_PREVIEW"),isAttachments:!0,values:r}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),i=null==o?void 0:o.map(e=>null==e?void 0:e.uuid),a=(null==i?void 0:i.length)>0;return Promise.resolve(a?Promise.resolve(Digit.UploadServices.Filefetch(i,Digit.ULBService.getStateId())).then(n):n(a))}catch(e){return Promise.reject(e)}}(s,o)).then(function(t){return{t:o,tenantId:h,name:"NOC Application",email:_,phoneNumber:f,heading:E,applicationNumber:p,details:[b,...c,...S,N,A,e,t],imageURL:m,ulbType:l,ulbName:n}})})})}catch(e){return Promise.reject(e)}},Ft=e=>{var l,a,r;const u=o.useLocation(),{pathname:d,state:s}=u,{t:c}=i.useTranslation(),m=o.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:p}=Digit.Hooks.useStore.getInitData(),{tenants:f}=p||{},g=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:g,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(E(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=Pt(function(){var e,t,l,n;const o=v,i=null==o||null===(e=o.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==i?void 0:i.ulbType,r=(null==i||null===(l=i.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==i?void 0:i.ulbName),u=f.find(e=>e.code===o.tenantId);return Promise.resolve(Bt(o,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")}}))))},Mt=e=>{let{location:l}=e;const{t:o}=i.useTranslation(),a=[{path:"/digit-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/noc/inbox",content:o("ES_COMMON_INBOX"),show:!(!l.pathname.includes("noc/inbox")&&!l.pathname.includes("noc/new-application"))},{path:"/digit-ui/employee/noc/search/application",content:o("ES_COMMON_SEARCH_APPLICATION"),show:!!l.pathname.includes("noc/search/application")},{path:"/digit-ui/employee/noc/inbox/application-overview/:id",content:o("NOC_APPLICATION_OVERVIEW_HEADER"),show:!!l.pathname.includes("noc/inbox/application-overview")},{path:"/digit-ui/employee/noc/search",content:o("ES_COMMON_APPLICATION_SEARCH"),show:!!l.pathname.includes("/digit-ui/employee/noc/search")},{path:"/digit-ui/employee/noc/search/application-overview/:id",content:o("NOC_APP_OVER_VIEW_HEADER"),show:!!l.pathname.includes("/digit-ui/employee/noc/search/application-overview")}];return n.createElement(t.BreadCrumb,{crumbs:a})},kt=e=>{var a,r,u,d,s,m,v,p,E,f,g,_;let{path:h}=e;const A=o.useLocation(),N=(i.useTranslation(),null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NOCApplicationOverview")),S=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("NOCInbox"),b=(null===(s=Digit)||void 0===s||null===(m=s.ComponentRegistryService)||void 0===m||m.getComponent("NewNOCStepperForm"),null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("NOCEmployeeApplicationOverview")),y=(null===(E=Digit)||void 0===E||null===(f=E.ComponentRegistryService)||void 0===f||f.getComponent("NewNOCEditApplication"),null===(g=Digit)||void 0===g||null===(_=g.ComponentRegistryService)||void 0===_?void 0:_.getComponent("NOCCitizenApplicationOverview")),C=window.location.href.includes("/response"),O=window.Digit.Utils.browser.isMobile();return n.createElement(l.Fragment,null,C?null:n.createElement("div",{style:window.location.href.includes("application-overview")||O?{marginLeft:"10px"}:{}},n.createElement(Mt,{location:A})),n.createElement(o.Switch,null,n.createElement(t.PrivateRoute,{path:h+"/inbox/application-overview/:id",component:b}),n.createElement(t.PrivateRoute,{path:h+"/search/application-overview/:id",component:N}),n.createElement(t.PrivateRoute,{path:h+"/inbox",component:e=>n.createElement(S,c({},e,{parentRoute:h}))}),n.createElement(t.PrivateRoute,{path:h+"/search",component:e=>n.createElement(wt,c({},e,{parentRoute:h}))}),n.createElement(t.PrivateRoute,{path:h+"/response/:id",component:Ft}),n.createElement(t.PrivateRoute,{path:h+"/search/application",component:y})))},Ut=e=>{const[t,o]=l.useState(e.selectedVal?e.selectedVal:"");return l.useEffect(()=>{e.keepNull?o(""):e.selectedVal?o(e.selectedVal):(o(""),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||(o(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,o,i,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===(o=n.parentElement)||void 0===o||null===(i=o.children)||void 0===i||null===(a=i.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,N,S,b,y,C,O,D;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===(g=f.parentElement)||void 0===g||null===(_=g.children)||void 0===_||null===(h=_.namedItem("jk-dropdown-unique"))||void 0===h||null===(A=h.scrollTo)||void 0===A||A.call(h,1e5,1e5):(null==e||null===(N=e.addProps)||void 0===N?void 0:N.currentIndex)>2&&(null==t||null===(S=t.target)||void 0===S||null===(b=S.parentElement)||void 0===b||null===(y=b.parentElement)||void 0===y||null===(C=y.children)||void 0===C||null===(O=C.namedItem("jk-dropdown-unique"))||void 0===O||null===(D=O.scrollBy)||void 0===D||D.call(O,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"})})},Ht=e=>e,Wt=e=>{var o,i,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,N=e.t||Ht;function S(){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 y(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 C=e.option&&(null===(o=e.option)||void 0===o?void 0:o.filter(t=>{var l,n;return(null===(l=N(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 O,D;return"PropertyType"==(null==e||null===(i=e.option)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.label)&&(C=e.option),e.isBPAREG&&s&&((null===(O=e.option)||void 0===O||null===(D=O.filter(e=>(null==e?void 0:e.code)===(null==s?void 0:s.code)))||void 0===D?void 0:D.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:S},e.customSelector,e.showArrow&&n.createElement(t.ArrowDown,{onClick:S,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(Ut,{autoComplete:e.autoComplete,setFilter:function(e){p(e)},forceSet:E,setforceSet:f,setOptionIndex:_,keepNull:e.keepNull,selectedVal:s?e.t?e.isMultiSelectEmp?s+" "+N("BPA_SELECTED_TEXT"):e.t(e.optionKey?s[e.optionKey]:s):e.optionKey?s[e.optionKey]:s:null,filterVal:v,addProps:{length:C.length,currentIndex:g,selectOption:function(e){y(C[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:S,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},C&&C.map((t,l)=>(console.log("option",t),n.createElement("div",{className:"cp profile-dropdown--item display: flex ",style:l===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},key:l,onClick:()=>y(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),")")))),C&&0===C.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===g?{opacity:1,backgroundColor:"rgba(238, 238, 238, var(--bg-opacity))"}:{},onClick:()=>y(e)},e))):null)},jt=e=>n.createElement("h1",{className:"heading-m"},e.label),zt=()=>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"})),Vt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(zt,null)),Gt=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:_}=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({}),[N,S]=l.useState({}),[b,y]=l.useState([]),[C,O]=l.useState(null),[D,T]=l.useState(null),[L,I]=l.useState(null),[w,P]=l.useState(null),[R,x]=l.useState([]),[B,F]=l.useState(null),[M,k]=l.useState(!1);function U(e){T(e.target.files[0])}return l.useEffect(()=>{var e;_&&_["egf-master"]&&x(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),l.useEffect(()=>{var e;y(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(D){const e=function(){if(D.size>=5242880)P(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,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?I(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.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)}}()},[D]),l.useEffect(()=>{r&&A(null!=r&&r.showFinancialYearsModal?(e=>{let{t:l,action:o,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+o.action+"_APPLICATION",submit:"WF_PT.CREATE_"+o.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:l("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:n.createElement(t.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:B,setSelectedFinancialYear:F}):(e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:o(m||"WF_ROLE_"+(null===(l=i.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:o("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:C,setSelectedApprover:O,selectFile:U,uploadedFile:L,setUploadedFile:I,businessService:v}))},[r,b,R,B,L]),r&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(jt,{label:a(h.label.heading)}),headerBarEnd:n.createElement(Vt,{onClick:d}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!B:f||(null==r?void 0:r.docUploadRequired)&&!L,formId:"modal-action"},g?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:h.form,className:"BPAemployeeCard bpa-workflow-modal-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==B?void 0:B.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||!C?[]:[C],L&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:L}]),s({Property:c({},m,{workflow:t})})}},defaultValues:N,formId:"modal-action"})):n.createElement(t.Loader,null)},Yt=e=>n.createElement("h1",{className:"heading-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"})),Kt=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(qt,null)),$t=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,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({}),[N,S]=l.useState([]),[b,y]=l.useState({}),[C,O]=l.useState(null),[D,T]=l.useState(null),[L,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:B}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function F(e){O(e.target.files[0])}return l.useEffect(()=>{if(p&&B){var e;const t=B["common-masters"].Department;S(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var l,n,o;const i=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)===i);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[p]),l.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",C,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?T(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.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)}}()},[C]),l.useEffect(()=>{r&&_((e=>{let{t:l,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,m=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"CANCEL"===(null==o?void 0:o.action)?"WF_CANCEL_LICENSE":"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.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:i,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:N,selectedApprover:b,setSelectedApprover:y,selectFile:F,uploadedFile:D,setUploadedFile:T,businessService:v}))},[r,N,w,R,D]),r&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Yt,{label:a(g.label.heading)}),headerBarEnd:n.createElement(Kt,{onClick:d}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:g.form,className:"BPAemployeeCard bpa-workflow-modal-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:D?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null}),s({Licenses:[m]})},defaultValues:h,formId:"modal-action"})):n.createElement(t.Loader,null)},Xt=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Zt=()=>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(Zt,null)),Qt=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)});console.log(p,"DEKHO");const[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState({}),[y,C]=l.useState(null),[O,D]=l.useState(null),[T,L]=l.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(null==p||null===(e=p.Employees)||void 0===e?void 0:e.map(e=>{var t,l,n,o,i,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===(o=e.user)||void 0===o?void 0:o.name)+" ("+(a(null==e||null===(i=e.assignments)||void 0===i||null===(r=i[0])||void 0===r?void 0:r.designation)||"N/A")+")"}}))},[p]),l.useEffect(()=>{!function(){try{L(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",y,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).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?D(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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)}}()},[y]),l.useEffect(()=>{r&&g((e=>{let{t:l,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:m}=e,v=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)||(v=!1),o.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?l("WF_ASSIGNEE_NAME_LABEL")+"*":null,placeholder:v?l("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?n.createElement(Wt,{option:i,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:S,setSelectedApprover:b,selectFile:w,uploadedFile:O,setUploadedFile:D,businessService:v,error:T}))},[r,A,O,T]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Xt,{label:a(f.label.heading)}),headerBarEnd:n.createElement(Jt,{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!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:null}),console.log("action",r),console.log("applicationData",m),s({Licenses:[m]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},el=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),tl=()=>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"})),ll=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(tl,null)),nl=e=>{var o,i,a,u,d,s,m,v,p,E,f,g,_,h,A,N,S,b;let{t:y,action:C,tenantId:O,closeModal:D,submitAction:T,applicationDetails:L,applicationData:I,businessService:w,workflowDetails:P,blockReason:R}=e;console.log("applicationData_BPAACTIONMODAL",I);const x=[...new Set(null==P||null===(o=P.data)||void 0===o||null===(i=o.initialActionState)||void 0===i||null===(a=i.nextActions)||void 0===a||null===(u=a.find(e=>(null==e?void 0:e.action)===(null==C?void 0:C.action)))||void 0===u||null===(d=u.actions)||void 0===d?void 0:d.flatMap(e=>e.roles||[]))];console.log("workflowDetails_BPAACTIONMODAL",P,x,C),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:O,!1);const{data:B,isLoading:F}=Digit.Hooks.useEmployeeSearch(O,{roles:null==x?void 0:x.map(e=>({code:e})),zones:null===(g=I)||void 0===g||null===(_=g.additionalDetails)||void 0===_?void 0:_.zonenumber,categories:null===(h=I)||void 0===h||null===(A=h.additionalDetails)||void 0===A?void 0:A.categories,subcategories:null===(N=I)||void 0===N||null===(S=N.additionalDetails)||void 0===S?void 0:S.subcategories,assignedtenattids:null===(b=I)||void 0===b?void 0:b.tenantId,isActive:!0},{enabled:!(null!=C&&C.isTerminateState)});console.log("approverData",B),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]=l.useState(null),[Z,J]=l.useState(null),[Q,ee]=l.useState(null),[te,le]=l.useState(null),ne=!!Digit.Utils.browser.isMobile();function oe(e){X(e.target.files[0])}l.useEffect(()=>{var e;j(null==B||null===(e=B.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}}))},[B]),l.useEffect(()=>{!function(){try{ee(null);const e=function(){if($){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if($.size>=5242880)ee(y("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=$&&$.type&&!e.test(null==$?void 0:$.type))ee(y("NOT_SUPPORTED_FILE_TYPE"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",$,Digit.ULBService.getStateId()||(null==O?void 0:O.split(".")[0]))).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?J(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):ee(y("CS_FILE_UPLOAD_ERROR"))})},function(){ee(y("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[$]);const ie=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=[],o=[];var i,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(o=null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.fieldinspection_pending),o=o.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)=>{o.push({docs:ie(e.Documents),date:e.InspectionDate,questions:ae(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",o),o=o.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",o)):sessionStorage.removeItem("INSPECTION_DATA"),[...o]},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}))),C&&k((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectedBlockReason:d,setBlockReason:s,selectFile:c,uploadedFile:m,setUploadedFile:v,assigneeLabel:p,businessService:E,error:f,blockReasonFiltered:g}=e,_=!1;return"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"SKIP_PAYMENT"!=i.action&&"SEND_BACK_TO_CITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(_=!0),console.log("actionInModal",i),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+E+"_"+(null==i?void 0:i.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:i.isTerminateState||_||"BLOCK"==(null==i?void 0:i.action)||"VERIFY"==(null==i?void 0:i.action)||"SEND_FOR_INSPECTION_REPORT"==(null==i?void 0:i.action)||"ESIGN"==(null==i?void 0:i.action)?null:o(p||"WF_ROLE_"+(null===(l=i.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:i.isTerminateState||_||"BLOCK"==(null==i?void 0:i.action)||"VERIFY"==(null==i?void 0:i.action)||"SEND_FOR_INSPECTION_REPORT"==(null==i?void 0:i.action)||"ESIGN"==(null==i?void 0:i.action)?null:n.createElement(Wt,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r,t:o})},{label:"BLOCK"==(null==i?void 0:i.action)?o("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==i?void 0:i.action)?n.createElement(t.Dropdown,{option:g,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:d,isMandatory:!0}):null},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{v(null)},message:m?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:f})}]}]}})({t:y,action:C,approvers:W,selectedApprover:G,setSelectedApprover:Y,selectedBlockReason:q,setBlockReason:K,selectFile:oe,uploadedFile:Z,setUploadedFile:J,businessService:w,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Q,blockReasonFiltered:z}))},[C,W,te,Z,Q]),C&&M.form?n.createElement(t.Modal,{headerBarMain:n.createElement(el,{label:y(M.label.heading)}),headerBarEnd:n.createElement(ll,{onClick:D}),actionCancelLabel:y(M.label.cancel),actionCancelOnSubmit:D,actionSaveLabel:y(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"}:{}},F?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:M.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,o,i,a,r,u,d,s,m,v,p,E,f,g,_,h,A,N,S,b,O,w,R,x,B,F,M,k,U,H,W,j,z,V,Y,K,X,J,Q,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==C?void 0:C.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===(o=e.comments)||void 0===o?void 0:o.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==P||null===(i=P.data)||void 0===i||null===(a=i.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===(g=f.state)||void 0===g?void 0:g.applicationStatus)?[null==P||null===(_=P.data)||void 0===_||null===(h=_.processInstances)||void 0===h||null===(A=h[0])||void 0===A||null===(N=A.assigner)||void 0===N?void 0:N.uuid]:null!=G&&G.uuid?[null==G?void 0:G.uuid]:null,varificationDocuments:Z?[{documentType:(null==C?void 0:C.action)+" DOC",fileName:null==$?void 0:$.name,fileStoreId:Z}]:null},action:null==C?void 0:C.action,riskType:null===(S=I)||void 0===S||null===(b=S.additionalDetails)||void 0===b?void 0:b.riskType,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==P||null===(O=P.data)||void 0===O||null===(w=O.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===(B=P.data)||void 0===B||null===(F=B.processInstances)||void 0===F||null===(M=F[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:Z?[{documentType:(null==C?void 0:C.action)+" DOC",fileName:null==$?void 0:$.name,fileStoreId:Z}]: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===(X=K.selfCertificationCharges)||void 0===X?void 0:X.BPA_WATER_CHARGES)+parseInt(null===(J=I)||void 0===J||null===(Q=J.additionalDetails)||void 0===Q||null===(ee=Q.selfCertificationCharges)||void 0===ee?void 0:ee.BPA_GAUSHALA_CHARGES_CESS))D(),alert(y("Enterd Less Adjustment amount is invalid"));else{var te,le;const e=null==L||null===(te=L.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,o,i,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"REJECTED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(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 o=[];e&&e.map(e=>{var t,i,a,r,u,d,s,c,m,v,p,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(i=t.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(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)&&o.push(e)}),T({BPA:I},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})}return Promise.resolve()}catch(e){return Promise.reject(e)}},defaultValues:U,formId:"modal-action"})):n.createElement(t.Loader,null)},ol=e=>n.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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"})),al=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(il,null)),rl=e=>{var i,a,u,d,s,m,v;let{t:p,action:E,tenantId:f,closeModal:g,submitAction:_,applicationData:h,businessService:A}=e;const{data:N,isLoading:S}=Digit.Hooks.useEmployeeSearch(f,{roles:null===(i=workflowDetails)||void 0===i||null===(a=i.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,y]=(r.useQueryClient(),l.useState({})),[C,O]=l.useState({}),[D,T]=l.useState([]),[L,I]=l.useState({}),[w,P]=l.useState(null),[R,x]=l.useState(null),[B,F]=l.useState(null),M=!!Digit.Utils.browser.isMobile();function k(e){P(e.target.files[0])}return o.useHistory(),l.useEffect(()=>{var e;T(null==N||null===(e=N.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[N]),l.useEffect(()=>{!function(){try{F(null);const e=function(){if(w){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(w.size>=5242880)F(p("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=w&&w.type&&!e.test(null==w?void 0:w.type))F(p("NOT_SUPPORTED_FILE_TYPE"));else{const e=Pt(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,o;(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===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):F(p("CS_FILE_UPLOAD_ERROR"))})},function(){F(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&&y((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:m,businessService:v,error:p}=e,E=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(E=!0);let f=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(f=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||f?null:o(m||"WF_ROLE_"+(null===(l=i.assigneeRoles)||void 0===l?void 0:l[0])),type:"dropdown",populators:i.isTerminateState||f?null:n.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:o("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+o("WF_APPROVAL_UPLOAD_HEAD"),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:p,action:E,approvers:D,selectedApprover:L,setSelectedApprover:I,selectFile:k,uploadedFile:R,setUploadedFile:x,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:B}))},[E,D,R,B]),E&&b.form?n.createElement(t.Modal,{headerBarMain:n.createElement(ol,{label:p(b.label.heading)}),headerBarEnd:n.createElement(al,{onClick:g}),actionCancelLabel:p(b.label.cancel),actionCancelOnSubmit:g,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"}:{}},S?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:b.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let o=JSON.parse(sessionStorage.getItem("NewNOCDocs")),i=(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]:[];o.map((e,t)=>{i.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!=L&&L.uuid?[null==L?void 0:L.uuid]:null,documents:R?[{documentType:(null==E?void 0:E.action)+" DOC",fileName:null==w?void 0:w.name,fileStoreId:R}]:null},documents:i}),_({Noc:h},!1,{isNoc:!0})},defaultValues:C,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=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}},ml=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState({}),[y,C]=l.useState(null),[O,D]=l.useState(null),[T,L]=l.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function P(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=y&&y.type&&!e.test(null==y?void 0:y.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",y,Digit.ULBService.getCurrentTenantId())).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?D(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),L(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)}}()},[y]),l.useEffect(()=>{var e,l,o,i;"DisconnectWSConnection"==(null===(e=m)||void 0===e||null===(l=e.processInstance)||void 0===l?void 0:l.businessService)||"DisconnectSWConnection"==(null===(o=m)||void 0===o||null===(i=o.processInstance)||void 0===i?void 0:i.businessService)?r&&g((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:m,businessService:v,error:p}=e,E=!0,f=!1;return(null!=i&&null!==(l=i.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==i?void 0:i.action)||"RESUBMIT_APPLICATION"==(null==i?void 0:i.action))&&(E=!1),i.isTerminateState&&(E=!1),"EXECUTE_DISCONNECTION"!=(null==i?void 0:i.action)&&"DISCONNECTION_EXECUTED"!=(null==i?void 0:i.action)||(f=!0),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:E?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?o("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:o("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:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("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 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:S,setSelectedApprover:b,selectFile:P,uploadedFile:O,setUploadedFile:D,businessService:v,error:T})):r&&g((e=>{var l;let{t:o,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:m,error:v}=e,p=!0;return(null!=i&&null!==(l=i.action)&&void 0!==l&&l.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:p?o("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?o("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:o("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:o("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 "+o("ES_PT_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:A,selectedApprover:S,setSelectedApprover:b,selectFile:P,uploadedFile:O,setUploadedFile:D,businessService:v,error:T}))},[r,A,O,T]),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",style:I&&w?{width:"100%",height:"auto"}:{}},E?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:f.form,className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,o,i,a,d,v,p,E;if(null!==(t=m)&&void 0!==t&&t.isBillAmend){var f,g,_,h,A,N,b,C,D;const t=c({},null===(f=m)||void 0===f||null===(g=f.billAmendmentDetails)||void 0===g?void 0:g.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),l=c({},null===(_=m)||void 0===_?void 0:_.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!==(N=m)&&void 0!==N&&null!==(b=N.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=m)&&void 0!==C&&null!==(D=C.applicationType)&&void 0!==D&&D.includes("WATER")?"WS":"SW",assignes:null!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:[]}});s({AmendmentUpdate:l})}else{if(m=c({},m,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=S&&S.uuid?[null==S?void 0:S.uuid]:[],assignes:null!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],wfDocuments:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:null,processInstance:c({},null===(l=m)||void 0===l?void 0:l.processInstance,{action:null==r?void 0:r.action,assignes:null!=S&&S.uuid?[{uuid:null==S?void 0:S.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:O?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]:[]})}),null!=e&&e.date&&null!==(n=m)&&void 0!==n&&null!==(o=n.applicationType)&&void 0!==o&&o.includes("DISCONNECT")){const t=bt(null==e?void 0:e.date);m.disconnectionExecutionDate=cl(t)}else if(null!=e&&e.date){const t=bt(null==e?void 0:e.date);m.connectionExecutionDate=cl(t)}var T;if("DisconnectWSConnection"==(null===(i=m)||void 0===i||null===(a=i.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===(T=m)||void 0===T?void 0:T.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 L,I,w,P,R,x,B,F,M,k,U,H,W;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(L=t.value)&&void 0!==L&&L.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!==(B=t.value)&&void 0!==B&&B.adhocRebate&&(m.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.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:_,formId:"modal-action"})):n.createElement(t.Loader,null)},vl=e=>n.createElement("h1",{className:"heading-m"},e.label),pl=()=>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"})),El=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(pl,null)),fl=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState(null),[y,C]=l.useState(null),[O,D]=l.useState(null),[T,L]=l.useState(null),[I,w]=l.useState(!1);function P(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",y,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?D(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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: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:S,setSelectedApprover:b,selectFile:P,uploadedFile:O,setUploadedFile:D,businessService:v}))},[r,A,O]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(vl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(El,{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,className:"BPAemployeeCard bpa-workflow-modal-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||!S?[]:[S],O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]),s({PetRegistrationApplications:[c({},m,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},gl=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"})),hl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(_l,null)),Al=e=>{var o,i,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===(o=E.TradeLicense)||void 0===o?void 0:o.TradeType),console.log("applicationData",m);const[g,_]=l.useState({}),[h,A]=l.useState({}),[N,S]=l.useState([]),[b,y]=l.useState(""),[C,O]=l.useState([]),[D,T]=l.useState(null),L=null===(i=m)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",L);const I=l.useMemo(()=>{var e;if(f||!E||!L.length)return[];const t=new Set(L.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,L]);return console.log("years",I),l.useEffect(()=>{u&&_((e=>{let{t:l,action:o,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:l("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:n.createElement(t.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:y,businessService:v}))},[u,I,C,D]),u&&g.form?n.createElement(t.Modal,{headerBarMain:n.createElement(gl,{label:r(g.label.heading)}),headerBarEnd:n.createElement(hl,{onClick:d}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?n.createElement(t.Loader,null):n.createElement(t.FormComposer,{config:g.form,className:"BPAemployeeCard bpa-workflow-modal-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],o="20"+Number(n)+"-"+(Number(n)+1);m=c({},m,{financialYear:o,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)},Nl=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"})),bl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Sl,null)),yl=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState(null),[y,C]=l.useState(null),[O,D]=l.useState(null),[T,L]=l.useState(null),[I,w]=l.useState(!1);function P(e){w(!0),C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Rt(function(){return Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",y,u)).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?D(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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)}}()},[y]),console.log("actyhdesh,jhfsefsef",r,m),l.useEffect(()=>{g((e=>{let{t:l,action:o,selectFile:i,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==o?void 0:o.action)+"_APPLICATION",submit:"SV_"+(null==o?void 0:o.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==o?void 0:o.action)||"REJECT"===(null==o?void 0:o.action)||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?"":{label: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")+(o.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:i,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:S,setSelectedApprover:b,selectFile:P,uploadedFile:O,setUploadedFile:D,businessService:v,isUploading:I}))},[r,A,O]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Nl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(bl,{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!=S&&S.uuid?[null==S?void 0:S.uuid]:null};O&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,fileStoreId:O}]),s({streetVendingDetail:c({},m,{workflow:l})})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},Cl=e=>n.createElement("h1",{className:"heading-m"},e.label),Ol=()=>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(Ol,null)),Tl=e=>{var o,i;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===(o=r.assigneeRoles)||void 0===o||null===(i=o.map)||void 0===i?void 0:i.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,g]=l.useState({}),[_,h]=l.useState({}),[A,N]=l.useState([]),[S,b]=l.useState(null),[y,C]=l.useState(null),[O,D]=l.useState(null),[T,L]=l.useState(null),[I,w]=l.useState(!1);function P(e){C(e.target.files[0])}return l.useEffect(()=>{var e;N(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{L(null);const e=function(){if(y){const e=function(){if(y.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",y,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?D(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(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:o,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==o?void 0:o.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:l("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:l("ES_CHB_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:n.createElement(t.UploadFile,{id:"workflow-doc",onUpload:i,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:S,setSelectedApprover:b,selectFile:P,uploadedFile:O,setUploadedFile:D,businessService:v}))},[r,A,O]),r&&f.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Cl,{label:a(f.label.heading)}),headerBarEnd:n.createElement(Dl,{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,className:"BPAemployeeCard bpa-workflow-modal-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};O&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==y?void 0:y.name,filestoreId:O}]),s({hallsBookingApplication:[c({},m,{workflow:t})]})},defaultValues:_,formId:"modal-action"})):n.createElement(t.Loader,null)},Ll=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"})),wl=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(Il,null)),Pl=e=>{var i,a,r;let{t:u,action:d,tenantId:s,closeModal:m,submitAction:v,applicationData:p,businessService:E,moduleCode:f}=e;const{data:g}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(i=d.roles)||void 0===i||null===(a=i[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)}),_=o.useHistory(),[h,A]=l.useState({}),[N,S]=l.useState({}),[b,y]=l.useState([]),[C,O]=l.useState(null),[D,T]=l.useState(null);return l.useEffect(()=>{var e;y(null==g||null===(e=g.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[g]),l.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?_.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:C,setSelectedApprover:O,uploadedFile:D,setUploadedFile:T,businessService:E}))},[d,b,D]),d&&h.form?n.createElement(t.Modal,{headerBarMain:n.createElement(Ll,{label:u(h.label.heading)}),headerBarEnd:n.createElement(wl,{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,className:"BPAemployeeCard bpa-workflow-modal-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};D&&(t.documents=[]),v({Asset:c({},p,{workflow:t})})},defaultValues:N,formId:"modal-action"})):n.createElement(t.Loader,null)},Rl=e=>null!=e&&e.businessService.includes("PT")?n.createElement(Gt,e):null!=e&&e.businessService.includes("ptr")?n.createElement(fl,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?n.createElement($t,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?n.createElement(Al,e):null!=e&&e.moduleCode.includes("BPAREG")?n.createElement(Qt,e):null!=e&&e.moduleCode.includes("BPA")?n.createElement(nl,e):null!=e&&e.moduleCode.includes("NOC")?n.createElement(rl,e):null!=e&&e.moduleCode.includes("WS")?n.createElement(ml,e):null!=e&&e.businessService.includes("street-vending")?n.createElement(yl,e):null!=e&&e.businessService.includes("chb")?n.createElement(Tl,e):null!=e&&e.businessService.includes("asset-create")?n.createElement(Pl,e):void 0;function xl(e){let{documents:l,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=i.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,o)=>{var i,s,c;return n.createElement(n.Fragment,{key:o},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===(i=e.values)||void 0===i?void 0:i.map((l,o)=>{var i;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:o},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!==(i=l.documentType)&&void 0!==i&&i.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:o},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)!=o+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 i;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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>n.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.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 Bl=e=>{var t,o;let{t:i,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===(o=a.documents)||void 0===o?void 0:o.documents)||[]),[E,f]=l.useState(null),[g,_]=l.useState([]),[h,A]=l.useState(!0),[N,S]=l.useState(!1),[b,y]=l.useState(!1),{isLoading:C,data:O}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"]),{isLoading:D,data:T}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]);return l.useEffect(()=>{var e,t,l,n;let o=[];var i,a;null!=O&&null!==(e=O.BPA)&&void 0!==e&&e.DocTypeMapping&&(o=null==O||null===(i=O.BPA)||void 0===i||null===(a=i.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=o)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,o;let i=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==T||null===(t=T["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,i.length);i===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===(o=n.values)||void 0===o||o.map(t=>{var l,n;i===(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)),_(d)},[!C,!D]),l.useEffect(()=>{let e=0;g.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,N]),l.useEffect(()=>{y("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),n.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==g?void 0:g.map((e,t)=>n.createElement("div",{style:{padding:"20px"}},n.createElement(Fl,{key:t,index:t,document:e,t:i,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:S,applicationStatus:s,actions:c,bpaTaxDocuments:g,checkEnablingDocs:b}))))};function Fl(e){var o,i;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,g]=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===(o=r.dropdownData)||void 0===o?void 0:o.length)?null==r?void 0:r.dropdownData[0]:{}),[_,h]=l.useState(null),[A,N]=l.useState(()=>(null==p?void 0:p.fileStoreId)||null),[S,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==_?void 0:_.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{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],S.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)}},[S,f]),l.useEffect(()=>{},[_]),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===(i=r.uploadedDocuments)||void 0===i?void 0:i.length)&&n.createElement(xl,{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=>g(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 o;0!==Object.keys(l).length&&b(n),(o=n[n.length-1])&&h(o.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Ml(e){let{fiReport:l,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return n.createElement(n.Fragment,null,n.createElement("div",{style:{marginTop:"10px"}},n.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),l.map((e,o)=>{var i,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")+" - "+(o+1)),n.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(i=e.date)||void 0===i?void 0:i.split("-")[2])+"/"+(null===(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(xl,{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 kl(e){let{t:o,document:i,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==i?void 0:i.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!=i&&null!==(e=i.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==i||null===(t=i.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==i||null===(t=i.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(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=Pt(function(){return f(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,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?f(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):r(o("CS_FILE_UPLOAD_ERROR"))})},function(){r(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),n.createElement("div",{style:{}},n.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},n.createElement(t.CardLabel,{style:{width:"100%"}},null!=i&&i.required?o("TL_BUTTON_UPLOAD FILE")+"*":""+o("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:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Ul=e=>{var o;let{t:i,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===(o=c.data)||void 0===o?void 0:o.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(m,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(m,"BPA",["DocTypeMapping"],{enabled:!u}),{data:g}=Digit.Hooks.obps.useMDMS(m,"common-masters",["DocumentType"]),[_,h]=l.useState([]),[A,N]=l.useState([]),[S,b]=l.useState(!1),[y,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[O,D]=l.useState(null),T=window.location.href.includes("/employee/");return l.useEffect(()=>{var e;h(null==g||null===(e=g["common-masters"])||void 0===e?void 0:e.DocumentType)},[g]),l.useEffect(()=>{var e,t,l;let n,o=[];var i,r,s,c;n=u?null==E||null===(i=E.NOC)||void 0===i||null===(r=i.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},o.push(n[0].docTypes[0]));let m=[];o&&o.length>0&&(o.map(e=>{let t=e.documentType;e.dropdownData=[],null==_||_.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)}),N(m))},[E,_]),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:T?""+i("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):i("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:T?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:T?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),n.createElement(xl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),S&&(null==A?void 0:A.map((e,t)=>n.createElement(kl,{key:t,document:e,t:i,error:O,setError:D,setNocDocuments:C,nocDocuments:y,checkEnablingDocs:S}))))},Hl=e=>{let{permissions:o,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==o?void 0:o.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"}},i("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 o;return t===n?{label:null==e||null===(o=e.target)||void 0===o?void 0:o.value}:l}))})(e,l),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("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:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function Wl(e){let{taxHeadEstimatesCalculation:l}=e;const{taxHeadEstimates:o}=l,{t:a}=i.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==o?void 0:o.map((e,l)=>n.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:l===(null==o?void 0:o.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 jl(e){let{floors:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map(e=>{var l;return n.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},n.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(l=e.values)||void 0===l?void 0:l.map((e,l)=>{var i;return n.createElement(n.Fragment,{key:l},n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==l?"16px":"revert"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(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"})}))))}))}))}function zl(e){let{owners:l}=e,o={};o=window.location.href.includes("/employee/pt/")?l.slice().reverse():l;const{t:a}=i.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"},o.map((e,l)=>{var o;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===(o=e.values)||void 0===o?void 0:o.map((e,l)=>{var o;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===(o=e.values)||void 0===o?void 0:o.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Vl=e=>{var o,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(),g=Digit.ULBService.getStateId(),[_,h]=l.useState(),[A,N]=l.useState(),[S,b]=l.useState([]),[y,C]=l.useState(),[O,D]=l.useState(""),[T,L]=l.useState(null),[I,w]=l.useState({}),[P,R]=l.useState(!1),[x,B]=l.useState(!1);l.useEffect(()=>{!function(){try{L(null);const e=function(){if(y&&null!=y&&y.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==y||null===(t=y.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(y.size>=2e6)L(F("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",y,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?b([...S,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId,time:new Date}]):L(F("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else L(F("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[y]),l.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(S))},[S]),l.useEffect(()=>{var e,t,l,n,o,i,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,o;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===(o=d.lessAdjustmentFeeFiles)||void 0===o?void 0:o.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,g).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===(o=d.selfCertificationCharges)||void 0===o?void 0:o.BPA_OTHER_CHARGES),f(null==d||null===(i=d.selfCertificationCharges)||void 0===i?void 0:i.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:F}=i.useTranslation(),M=e=>null!=e&&e.value&&null!=e&&e.isTransLate?n.createElement("span",{style:{color:"#00703C"}},F(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?F(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void F("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===(o=r.values)||void 0===o?void 0:o.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:""+F(""+e.title),text:null!=e&&e.value?M(e)+" "+F(null==e?void 0:e.isUnit):F("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:""+F(""+e.title),text:M(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},F(null==e?void 0:e.title)):n.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},F(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))))))},Gl=e=>{var o,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:m}=i.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 g(e){var t;let l=[],n=0,o=0,i=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,N=Number(null===(r=e.occupancies)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.floorArea)||0,S=Number(null===(d=e.occupancies)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.deduction)||0;n+=A,o+=N,i+=S,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===(g=f[0])||void 0===g?void 0:g.deduction).toFixed(2),FloorArea:Number(null===(_=e.occupancies)||void 0===_||null===(h=_[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(i).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL"),FloorArea:Number(o).toFixed(2)+" "+m("BPA_SQ_MTRS_LABEL")}),l}function _(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 o,i;let t=null===(o=l[e])||void 0===o||null===(i=o.usageCategory)||void 0===i?void 0:i.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===(o=s.values)||void 0===o?void 0:o.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 o,i,a,r,u;return n.createElement("div",{key:l,style:(null==s||null===(o=s.subOccupancyTableDetails)||void 0===o||null===(i=o[0])||void 0===i||null===(a=i.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:_(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:g(e),columns:f,getCellProps:e=>({style:{}})})))})))},Yl=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))},ql=e=>{var o,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,m]=l.useState(!1),{t:v}=i.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(Yl,{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===(o=u.wfComment)||void 0===o?void 0:o.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 Kl(e){let{units:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(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",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function $l(e){let{units:l}=e;const{t:o}=i.useTranslation();return n.createElement(n.Fragment,null,l.map((e,l)=>{var i;return n.createElement("div",{key:o(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"}},o(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===(i=e.values)||void 0===i?void 0:i.map((e,l)=>{var i;return n.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:n.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:l===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Xl=e=>{var o,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=i.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:g,roadCuttingAddlDetails:_,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===(o=s.additionalDetails)||void 0===o?void 0:o.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==g?void 0:g.map(e=>{var l;return n.createElement("div",{style:(null==g?void 0:g.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==_?void 0:_.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:""})))))))},Zl=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Jl=[{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"}],Ql=e=>{var o,a,r,u;let{wsAdditionalDetails:d}=e;const{t:s}=i.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===(o=d.additionalDetails)||void 0===o||!o.isPaid),[A,N]=l.useState(!1),[S,b]=l.useState(m||{}),[y,C]=l.useState(null),[O,D]=l.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[T,L]=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 o=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 i,a,r,u,s,p,E;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:n.createElement("span",null,"₹",null==m||null===(i=m.billDetails)||void 0===i||null===(a=i[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)}];L(e),D(null==m||null===(E=m.billDetails)||void 0===E?void 0:E[0])}else v(o),b(o)},[]);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)),B=function(e,t,l){void 0===t&&(t=!1);let n=c({},S);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 o,i;const t=0==(null==l||null===(o=l.target)||void 0===o?void 0:o.value)?1:Math.sign(null==l||null===(i=l.target)||void 0===i?void 0:i.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"}},T&&n.createElement(t.StatusTable,null,n.createElement("div",null,null==T?void 0:T.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==O?void 0:O.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=>{N(!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),N(!1)}}),actionCancelLabel:s("PT_CANCEL"),actionCancelOnSubmit:()=>{b(m),N(!1)},actionSaveLabel:s("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=S&&S.adhocPenalty?Number(null==S?void 0:S.adhocPenalty):0,l=null!=S&&S.adhocRebate?Number(null==S?void 0:S.adhocRebate):0;var n,o;if(t||l)if(l>(null==d||null===(n=d.additionalDetails)||void 0===n||null===(o=n.data)||void 0===o?void 0:o.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:s("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var i,a,r,u,m,p,E,g,h,A;const e=null==d||null===(i=d.additionalDetails)||void 0===i||null===(a=i.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,S);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 o="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,o).then((e,t)=>{var l,n,o,i,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===(o=n.taxHeadEstimates)||void 0===o?void 0:o.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===(i=e.Calculation)||void 0===i||null===(a=i[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(bt(e.Calculation[0])),D(null==e||null===(p=e.Calculation)||void 0===p?void 0:p[0]),L(A),S.billDetails=null==e?void 0:e.Calculation,v(S),N(!1)}).catch(e=>{var t,l,n,o,i,a;C({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===(o=e.response)||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.Errors[0])||void 0===a?void 0:a.code)):s("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:s("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},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:Zl,optionKey:"title",select:e=>B("adhocPenaltyReason",!0,e),selected:(null==S?void 0:S.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:s})),"PT_OTHERS"===(null==S||null===(r=S.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==S?void 0:S.adhocPenaltyComment)||"",onChange:e=>B("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==S?void 0:S.adhocPenalty)||"",onChange:e=>B("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:Jl,optionKey:"title",select:e=>B("adhocRebateReason",!0,e),selected:(null==S?void 0:S.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:s})),"PT_OTHERS"===(null==S||null===(u=S.adhocRebateReason_data)||void 0===u?void 0:u.title)&&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==S?void 0:S.adhocRebateComment)||"",onChange:e=>B("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==S?void 0:S.adhocRebate)||"",onChange:e=>B("adhocRebate",!1,e)},w={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:s("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),y&&n.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==y?void 0:y.isWarning,error:null==y||!y.isWarning,label:s(null==y?void 0:y.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},en=e=>{var o,a,r,u,d,s,c;let{wsAdditionalDetails:m}=e;const{t:v}=i.useTranslation(),[p,E]=l.useState(!1),[f,g]=l.useState({}),_=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!==(o=m.additionalDetails)&&void 0!==o&&o.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),g(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(_,{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"}})))))},tn=e=>{let{assessmentData:t}=e;const[o,i]=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:()=>{i(!o)}},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"}},o?"<":">"))),o&&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)))))},ln=e=>{var t;let{applicationData:i}=e;const[a,r]=l.useState(!1);return o.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"}},i.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"}},i.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=i.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"}},i.status)),n.createElement("div",null,n.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},nn=e=>{let{payments:t}=e;const[o,i]=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:()=>{i(!o)}},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"}},o?"<":">"))),o&&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,o;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===(o=l[0])||void 0===o?void 0:o.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))))},on=n.memo(e=>{let{width:t=85,height:l=100,style:o}=e;return n.createElement("svg",{style:o,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"}))}),an=n.memo(e=>{let{value:o,Code:i,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:o},{value:o},i,a),d=l.useMemo(()=>{var e;const t=null!=o&&o.documents?null==o||null===(e=o.documents)||void 0===e?void 0:e.documents:o;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===i))||[]},[o,i]);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])||"",o=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==o?void 0:o.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==o?void 0:o[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(on,{className:"timeline-doc-icon"})):null}))}),rn=[{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"}],un=(n.memo(e=>{var t,l;let{checkpoint:o,t:i}=e;return n.createElement("div",{className:"timeline-card"},n.createElement("div",{className:"timeline-header"},null==rn?void 0:rn.map(e=>{let{label:t,key:l}=e;return n.createElement("div",{key:l,className:"timeline-header-item"},n.createElement("span",{className:"timeline-label"},i(t),":"),n.createElement("span",{className:"timeline-value"},i(null==o?void 0:o[l])||"N/A"))})),n.createElement("div",{className:"timeline-note"},n.createElement("span",{className:"timeline-label"},i("CM_TIMELINE_NOTE"),":"),n.createElement("div",{className:"note-box"},(null==o?void 0:o.comment)||i("CM_TIMELINE_NO_COMMENTS"))),(null==o||null===(t=o.documents)||void 0===t?void 0:t.length)>0&&n.createElement("div",{className:"timeline-docs"},n.createElement("span",{className:"timeline-label"},i("CM_TIMELINE_DOCUMENT_ATTACHED"),":"),null==o||null===(l=o.documents)||void 0===l?void 0:l.map((e,t)=>n.createElement(an,{key:(null==e?void 0:e.documentType)+"-"+t,value:null==o?void 0:o.documents,Code:null==e?void 0:e.documentType,index:t}))))}),n.memo(e=>{let{width:t=20,height:l=20,style:o}=e;return n.createElement("svg",{style:o,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"}))})),dn=n.memo(e=>{let{value:o,Code:i,index:a}=e;const{isLoading:r,data:u}=Digit.Hooks.ads.useADSDocumentSearch({value:o},{value:o},i,a),d=l.useMemo(()=>{var e;const t=null!=o&&o.documents?null==o||null===(e=o.documents)||void 0===e?void 0:e.documents:o;return(null==t?void 0:t.filter(e=>(null==e?void 0:e.documentType)===i))||[]},[o,i]);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])||"",o=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==o?void 0:o.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==o?void 0:o[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(un,null),n.createElement("span",null,(null==e?void 0:e.fileName)||"Document")):null}))});function sn(e){var o,i,a,r,u,d;let{workflowDetails:s,t:m,tenantId:v=Digit.ULBService.getCurrentTenantId(),timeObj:p}=e;console.log("timeObj in timeline",p);const{isLoading:E,data:f}=Digit.Hooks.ads.useADSDocumentSearch({value:(null==s||null===(o=s.data)||void 0===o||null===(i=o.timeline)||void 0===i?void 0:i.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},{value:(null==s||null===(a=s.data)||void 0===a||null===(r=a.timeline)||void 0===r?void 0:r.flatMap(e=>null==e?void 0:e.wfDocuments))||[]},null,0),g=n.useCallback(()=>{if(!E){const e=Digit.SessionStorage.get("CITIZEN.COMMON.HOME.CITY")||{},t=function(e,t,l,n){var o,i,a,r,u,d,s,c,m;void 0===l&&(l={}),console.log("pdfFiles",l);const v=(null==e||null===(o=e.data)||void 0===o?void 0:o.timeline)||(null==e?void 0:e.timeline)||[],p=(null==e||null===(i=e.data)||void 0===i?void 0:i.processInstances)||(null==e?void 0:e.processInstances)||[],E=(null==p||null===(a=p[0])||void 0===a?void 0:a.businessId)||"N/A",f=(null==p||null===(r=p[0])||void 0===r?void 0:r.businessService)||"N/A",g=(null==p||null===(u=p[0])||void 0===u?void 0:u.moduleName)||"N/A",_=(e,t)=>{var l;const n=(null==e?void 0:e[t])||"",o=(null==n||null===(l=n.split(","))||void 0===l?void 0:l.filter(Boolean))||[];return(null==o?void 0:o.find(e=>!(null!=e&&e.includes("large")||null!=e&&e.includes("medium")||null!=e&&e.includes("small"))))||(null==o?void 0:o[0])||""},h=v.map((e,t)=>{var o,i,a,r,u,d;const s=(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.created)||"N/A",c=(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.timing)||"N/A",m=(null==e||null===(a=e.assigner)||void 0===a?void 0:a.name)||"N/A",v=(null==e||null===(r=e.assigner)||void 0===r?void 0:r.type)||"N/A",p=(null==e||null===(u=e.assigner)||void 0===u?void 0:u.mobileNumber)||"N/A",E=(null==e?void 0:e.performedAction)||"N/A",f=(null==e?void 0:e.status)||(null==e?void 0:e.state)||"N/A",g=(null==e||null===(d=e.wfComment)||void 0===d?void 0:d[0])||"-",h=(null==e?void 0:e.wfDocuments)||[],A=(null==e?void 0:e.sla)||"N/A",N=Array.isArray(null==e?void 0:e.assignes)?e.assignes.map(e=>null==e?void 0:e.name).filter(Boolean).join(", "):"";return{sNo:t+1,action:n?n(E):E,status:n?n(f):f,assignerName:m,assignerType:v,mobileNumber:p,designation:v,date:s,time:c,dateTime:(s+" "+("N/A"!==c?c:"")).trim(),comment:g,documents:h.map(e=>({name:(null==e?void 0:e.fileName)||(null==e?void 0:e.documentType)||"Document",type:(null==e?void 0:e.documentType)||"Document",fileStoreId:null==e?void 0:e.fileStoreId,link:_(l,null==e?void 0:e.fileStoreId)})),hasDocuments:h.length>0,sla:A,assignedTo:N}});return{t:n,tenantId:(null==t?void 0:t.code)||"",tenantName:(null==t?void 0:t.name)||(null==t?void 0:t.i18nKey)||"Government Department",name:n?n("TIMELINE_PDF_TITLE"):"Application Timeline",heading:n?n("TIMELINE_PDF_HEADING"):"File Movement Report",businessId:E,businessService:n?n("CS_COMMON_"+(null==f?void 0:f.toUpperCase())):f,moduleName:g,currentStatus:n?n((null==v||null===(d=v[0])||void 0===d?void 0:d.status)||(null==v||null===(s=v[0])||void 0===s?void 0:s.state)||"N/A"):(null==v||null===(c=v[0])||void 0===c?void 0:c.status)||(null==v||null===(m=v[0])||void 0===m?void 0:m.state)||"N/A",generatedDate:(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),generatedDateTime:(new Date).toLocaleString("en-IN",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}),timelineRows:h,totalSteps:h.length}}(s,e,(null==f?void 0:f.pdfFiles)||{},m);Digit.Utils.pdf.generateTimelinePDF(t)}},[s,f,m,E]),_=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)},h=(e,t)=>{if(!e||!t)return null;const l=Math.floor((e-t)/6e4),n=Math.floor(l/60),o=Math.floor(n/24);return o>0?o+" day(s)":n>0?n+" hour(s)":l+" minute(s)"},A=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 o=_(e.auditDetails),i=t>0?_(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:o,sla:h(o,i)})}).reverse()})(s),[s]),N=(null==A?void 0:A.filter(e=>!("SAVE_AS_DRAFT"===(null==e?void 0:e.performedAction))))||[],S=N.map(e=>{var t;return null==e||null===(t=e.assigner)||void 0===t?void 0:t.userName}).filter(Boolean),b=[...new Set(S)].join(","),y=Digit.Hooks.useEmployeeSearch(v,{codes:b,isActive:!0},{enabled:!!b}),C={};return null==y||null===(u=y.data)||void 0===u||null===(d=u.Employees)||void 0===d||d.forEach(e=>{var t;const l=null==e||null===(t=e.assignments)||void 0===t?void 0:t[0];C[null==e?void 0:e.code]="COMMON_MASTERS_DESIGNATION_"+(null==l?void 0:l.designation)}),E?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement("div",{className:"custom-timeline-container"},p&&n.createElement("div",{style:{marginBottom:"8px",fontStyle:"italic"}},m("TOTAL_TIME_TAKEN"),": ",null==p?void 0:p.days," ",m("DAYS")," ",null==p?void 0:p.hours," ",m("HOURS")," ",null==p?void 0:p.minutes," ",m("MINUTES")," ",null==p?void 0:p.seconds," ",m("SECONDS")),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"},m("TRACKING STATUS")),n.createElement("div",{className:"custom-tracking-line"})),n.createElement("div",{className:"custom-title-bar-row"},n.createElement("h2",{className:"custom-timeline-title"},m("Application History")),n.createElement("span",{onClick:g,className:"download-button"},m("CS_COMMON_DOWNLOAD")),n.createElement("div",{className:"custom-blue-bar"}))),n.createElement("div",{className:"custom-timeline-entries"},null==N?void 0:N.map((e,t)=>{var l,o,i,a,r,u,d,s,c,v,p,E,f,g,_,h;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"},m("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===(i=e.assigner)||void 0===i?void 0:i.name)||m("CS_COMMON_NA")),(null==e||null===(a=e.assigner)||void 0===a?void 0:a.emailId)&&n.createElement("div",{className:"custom-officer-email"},n.createElement("span",{className:"custom-email-label"},m("Email"))," ",null==e||null===(r=e.assigner)||void 0===r?void 0:r.emailId),C[null==e||null===(u=e.assigner)||void 0===u?void 0:u.userName]&&n.createElement("div",{className:"custom-officer-name"},m(C[null==e||null===(d=e.assigner)||void 0===d?void 0:d.userName])))),(null==e?void 0:e.sla)&&n.createElement("div",{className:"custom-card-left"},n.createElement("h3",{className:"custom-action-title"},m("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"},m("Action")),n.createElement("div",{className:"custom-status-text"},m((null==e?void 0:e.performedAction)||"CS_COMMON_NA")))),(null==e?void 0:e.wfComment)&&(null==e||null===(s=e.wfComment)||void 0===s?void 0:s.length)>0&&(null==e||null===(c=e.wfComment)||void 0===c?void 0:c.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"},m("Officer Comments")),null==e||null===(v=e.wfComment)||void 0===v?void 0:v.map((e,t)=>n.createElement("p",{key:t},e))),(null==e||null===(p=e.assignes)||void 0===p?void 0:p.length)>0&&n.createElement("div",null,n.createElement("h3",{className:"custom-comments-title"},m("Assigned To")),n.createElement("div",{className:"custom-officer-info"},n.createElement("div",{className:"custom-officer-name"},null===(E=e.assignes[0])||void 0===E?void 0:E.name),C[null===(f=e.assignes[0])||void 0===f?void 0:f.userName]&&n.createElement("div",{className:"custom-officer-email"},m(C[null===(g=e.assignes[0])||void 0===g?void 0:g.userName]))))),(null==e?void 0:e.wfDocuments)&&(null==e||null===(_=e.wfDocuments)||void 0===_?void 0:_.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===(h=e.wfDocuments)||void 0===h?void 0:h.map((t,l)=>n.createElement(dn,{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 cn(e){var a,r,u,d,s,m,v,p,E,f,g,h,A,N,S,b;let{applicationDetails:y,demandData:C,workflowDetails:O,isDataLoading:D,applicationData:T,timelineStatusPrefix:L,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:P,oldValue:R,isInfoLabel:x=!1,propertyId:B,moduleCode:F}=e;const{t:M}=i.useTranslation(),k=o.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",y,F),l.useEffect(()=>{!function(){try{const e=function(){if(window.location.href.includes("employee/ws")&&null!=T&&T.connectionNo){const e=Pt(function(){return Promise.resolve(Digit.WSService.paymentsearch({tenantId:(null==T?void 0:T.tenantId)||U,filters:{consumerCodes:null==T?void 0:T.connectionNo,consumerCode:null==T?void 0:T.connectionNo},BusinessService:"SEWERAGE"===(null==T?void 0:T.serviceType)||"SEWARAGE"===(null==T?void 0:T.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==T?void 0:T.connectionNo,null==T?void 0:T.serviceType,U]);const[q,K]=l.useState({}),[$,X]=l.useState(),[Z,J]=l.useState([]),[Q,ee]=l.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==T?void 0:T.status)||Q.loading||Q.loaded||Q.canLoad||ee({loading:!1,loaded:!1,canLoad:!0}),null==Q||!Q.canLoad||Q.loading||Q.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(o){function i(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==o||null===(l=o.Assessments)||void 0===l?void 0:l.length)>0){const l=o.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 i=Array.from(n.values());return J(i),X(null==o?void 0:o.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}}();return r&&r.then?r.then(i):i()})}catch(e){return Promise.reject(e)}}((null==T?void 0:T.tenantId)||U,null==T?void 0:T.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 o;const e={date:te(null==T||null===(o=T.auditDetails)||void 0===o?void 0:o.createdTime),source:(null==T?void 0:T.channel)||""};return n.createElement(ql,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var i,a,r,u,d,s,c,m,v,p,E,f,g,h,A,N,S,b,C,O;const o={uuid:(null==e||null===(i=e.assigner)||void 0===i?void 0:i.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==y?void 0:y.tenantId,businessIds:null==y?void 0:y.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}}},D=l&&Array.isArray(l)&&t>0&&t-1<l.length?l[t-1]:null,L={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==T||null===(m=T.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!=T&&null!==(f=T.processInstance)&&void 0!==f&&null!==(g=f.assignes)&&void 0!==g&&null!==(h=g[0])&&void 0!==h&&h.mobileNumber?null==T||null===(A=T.processInstance)||void 0===A||null===(N=A.assignes)||void 0===N||null===(S=N[0])||void 0===S?void 0:S.mobileNumber:(null==e||null===(b=e.assigner)||void 0===b?void 0:b.mobileNumber)||(null==e||null===(C=e.assignes)||void 0===C||null===(O=C[0])||void 0===O?void 0:O.mobileNumber)||"N/A",comment:null!=e&&e.comment?M(e.comment):"",wfComment:D&&D.wfComment||[],thumbnailsToShow:(null==e?void 0:e.thumbnailsToShow)||[]};return n.createElement(ql,{data:L,OpenImage:Y,privacy:o})}{var D,L,I,w,P;const t={date:te(null==T||null===(D=T.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:(null==e||null===(L=e.assignes)||void 0===L||null===(I=L[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(ql,{data:t})}},ne=(e,t)=>e?t?e:M(e):M("NA"),oe=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ie=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")||oe?{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==C||C.reduce((e,t)=>e+t.demandInterest,0),null==C||C.reduce((e,t)=>e+t.demandPenality,0),null==C||C.reduce((e,t)=>e+t.collectionTax,0),null==C||C.reduce((e,t)=>e+t.collectionInterest,0),null==C||C.reduce((e,t)=>e+t.collectionPenality,0),null==C||C.reduce((e,t)=>e+t.balanceTax,0),null==C||C.reduce((e,t)=>e+t.balanceInterest,0),null==C||C.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==y?void 0:y.applicationData,ve=(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.propertyId)||"",pe=null==y||null===(r=y.additionalDetails)||void 0===r?void 0:r.propertytobestatus;return l.useEffect(()=>{if("WS"!==F&&"SW"!==F&&!window.location.href.includes("employee/ws")&&!window.location.href.includes("/ws/")&&B)try{let e={consumerCodes:B};const t=!0;"BPAREG"===F?Digit.OBPSService.paymentsearch({tenantId:U,filters:e,auth:t}).then(e=>{z(null==e?void 0:e.Payments)}):"PT"===F&&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)}},[F,B,U]),n.createElement(t.Card,{style:{position:"relative"}},null==y||null===(u=y.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var a,r,u,d,s,c,m,v,p,E,f,g,_,h,A,N,S,b,C,D,T,L,I,w,x,B,F,k,U,H,W,j,z,Y,q,K,$,X,Z;return n.createElement(n.Fragment,{key:i},n.createElement("div",{style:(window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws"),{})},0!==i||e.asSectionHeader?n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:0==i&&oe?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ie?""+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,o)=>o===(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")||oe?{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,i)=>{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(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},M(null==l?void 0:l.title)))):ie||ae?""+M(l.title):M(l.title),text:n.createElement("div",null,n.createElement(o.Link,{to:null==l?void 0:l.to},n.createElement("span",{className:"link",style:{color:"#a82227"}},null==l?void 0:l.value))),last:i===(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:i===(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(Vl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P,additionalDetails:null==y||null===(u=y.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==y||null===(d=y.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(Ml,{fiReport:null==y||null===(v=y.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(jl,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners)&&n.createElement(zl,{owners:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&n.createElement($l,{units:null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.accessories)&&n.createElement(Kl,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories}),!V&&(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.permissions)&&(null==O||null===(C=O.data)||void 0===C||null===(D=C.nextActions)||void 0===D?void 0:D.length)>0&&n.createElement(Hl,{applicationData:null==y?void 0:y.applicationData,t:M,permissions:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.permissions}),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.obpsDocuments)&&n.createElement("div",{style:{display:"flex"}},n.createElement(Bl,{t:M,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:O})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&n.createElement(Ul,{t:M,isNoc:!0,NOCdata:e.values,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:O}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.scruntinyDetails)&&n.createElement(Vl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&n.createElement(Vl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&n.createElement(Gl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.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(Wl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&n.createElement(Xl,{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(o.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===($=K.redirectUrl)||void 0===$?void 0:$.title))),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&n.createElement(Ql,{wsAdditionalDetails:e,workflowDetails:O}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.estimationDetails)&&n.createElement(en,{wsAdditionalDetails:e,workflowDetails:O}))}),(null==$?void 0:$.length)>0&&n.createElement(tn,{assessmentData:Z}),n.createElement(nn,{payments:j}),"WS"!==F&&"SW"!==F&&"OBPS"!==F&&"BPAStakeholder"!==F&&"BPAREG"!==F&&"TL"!==F&&n.createElement(ln,{applicationData:null==y?void 0:y.applicationData}),I&&(null==O||null===(d=O.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==O?void 0:O.isLoading)||D)&&n.createElement(t.Loader,null),!(null!=O&&O.isLoading)&&!D&&"BPAREG"!==F&&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!=O&&null!==(m=O.data)&&void 0!==m&&m.timeline&&1===(null==O||null===(v=O.data)||void 0===v||null===(p=v.timeline)||void 0===p?void 0:p.length)?n.createElement(t.CheckPoint,{isCompleted:!0,label:M(""+L+(null==O||null===(E=O.data)||void 0===E||null===(f=E.timeline[0])||void 0===f?void 0:f.state)),customChild:le(null==O||null===(g=O.data)||void 0===g?void 0:g.timeline[0],null==O||null===(h=O.data)||void 0===h?void 0:h.timeline)}):n.createElement(t.ConnectingCheckPoints,null,(null==O||null===(A=O.data)||void 0===A?void 0:A.timeline)&&(null==O||null===(N=O.data)||void 0===N?void 0:N.timeline.slice(0,de?null==O?void 0:O.data.timeline.length:2).map((e,l,o)=>{var i;let a="";var r,u,d,s,c,m;return window.location.href.includes("/obps/")&&(a=null!=O&&null!==(r=O.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!=O&&null!==(s=O.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(""+L+("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==O||null===(i=O.data)||void 0===i?void 0:i.timeline)}))}))),(null==O||null===(S=O.data)||void 0===S||null===(b=S.timeline)||void 0===b?void 0:b.length)>2&&n.createElement(t.LinkButton,{label:M(de?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{se(e=>!e)}}))),!(null!=O&&O.isLoading)&&!D&&"BPAREG"===F&&n.createElement(sn,{workflowDetails:O,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==y||null===(e=y.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var l,n,o;if("INACTIVE"===(null==y||null===(l=y.applicationData)||void 0===l?void 0:l.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(n=y.applicationData)||void 0===n?void 0:n.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(o=y.applicationData)||void 0===o?void 0:o.status)&&k.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var i,a,r;if("INACTIVE"===(null==y||null===(i=y.applicationData)||void 0===i?void 0:i.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==y||null===(a=y.applicationData)||void 0===a?void 0:a.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==y||null===(r=y.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 mn(e){var l,o,i,a,r,u,d,s,c,m,v,p,E,f,g,_,h,A;let{t:N,showToast:S,closeToast:b,businessService:y}=e;if(null!=y&&y.includes("NewTL")||null!=y&&y.includes("TL")||null!=y&&y.includes("EDITRENEWAL")){var C;let e="";switch(null==S||null===(C=S.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==S?void 0:S.key)?null==S||null===(l=S.error)||void 0===l?void 0:l.message:N("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==S?void 0:S.key)?null==S||null===(o=S.error)||void 0===o?void 0:o.message:N("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==S?void 0:S.key)?null==S||null===(i=S.error)||void 0===i?void 0:i.message:N("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==S?void 0:S.key)?null==S||null===(a=S.error)||void 0===a?void 0:a.message:N("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==S?void 0:S.key)?null==S||null===(r=S.error)||void 0===r?void 0:r.message:N("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==S?void 0:S.key)?null==S||null===(u=S.error)||void 0===u?void 0:u.message:N("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==S?void 0:S.key)?null==S||null===(d=S.error)||void 0===d?void 0:d.message:N("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==S?void 0:S.key)?null==S||null===(s=S.error)||void 0===s?void 0:s.message:N("ES_"+y+"_"+(null==S||null===(c=S.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:e,onClose:b}))}if(null!=y&&y.includes("BPA")||null!=y&&y.includes("BPA_LOW")||null!=y&&y.includes("BPA_OC")){var O;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!=y&&y.includes("BPA_OC")?N(e[1]):N(e[0]),l};let l="";switch(null==S||null===(O=S.action)||void 0===O?void 0:O.action){case"REVOCATE":l="error"===(null==S?void 0:S.key)?null==S||null===(m=S.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==S?void 0:S.key)?null==S||null===(v=S.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":l="error"===(null==S?void 0:S.key)?null==S||null===(p=S.error)||void 0===p?void 0:p.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":l="error"===(null==S?void 0:S.key)?null==S||null===(E=S.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":l="error"===(null==S?void 0:S.key)?null==S||null===(f=S.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==S?void 0:S.key)?null==S||null===(g=S.error)||void 0===g?void 0:g.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":l="error"===(null==S?void 0:S.key)?null==S||null===(_=S.error)||void 0===_?void 0:_.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:l="error"===(null==S?void 0:S.key)?null==S||null===(h=S.error)||void 0===h?void 0:h.message:N("ES_"+y+"_"+(null==S||null===(A=S.action)||void 0===A?void 0:A.action)+"_UPDATE_SUCCESS")}return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:l,onClose:b}))}{var D,T;const e="error"===(null==S?void 0:S.key)?null==S||null===(D=S.error)||void 0===D?void 0:D.message:"ES_"+y+"_"+(null==S||null===(T=S.action)||void 0===T?void 0:T.action)+"_UPDATE_SUCCESS";return n.createElement(n.Fragment,null,S&&n.createElement(t.Toast,{error:"error"===S.key,label:N(e),onClose:b}))}}function vn(e){var o,a,r,u,d,s,m,v,p,E,f,g,_,h,A,N;let{workflowDetails:S,displayMenu:b,onActionSelect:y,setDisplayMenu:C,businessService:O,forcedActionPrefix:D,ActionBarStyle:T={},MenuStyle:L={}}=e;const{t:I}=i.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===(o=w)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,B=!1,F=(null==S||null===(u=S.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==S||null===(m=S.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",S),Digit.Hooks.useClickOutside(P,()=>{C(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==F?void 0:F.length)||null!=F&&null!==(p=F[0])&&void 0!==p&&null!==(E=p.redirectionUrl)&&void 0!==E&&E.pathname.includes("/pt/property-details/")&&1==(null==F?void 0:F.length)?(B=!1,x=!0):(null==F?void 0:F.length)>0&&(B=!0,x=!1),n.createElement(n.Fragment,null,!(null!=S&&S.isLoading)&&B&&!x&&n.createElement(t.ActionBar,{style:c({},T)},b&&(null!=S&&null!==(f=S.data)&&void 0!==f&&null!==(g=f.actionState)&&void 0!==g&&g.nextActions||null!=S&&null!==(_=S.data)&&void 0!==_&&_.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:D||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()),options:F,optionKey:"action",t:I,onSelect:y,style:L}):null,n.createElement(t.SubmitBar,{ref:P,label:I("WF_TAKE_ACTION"),onSubmit:()=>C(!b)})),!(null!=S&&S.isLoading)&&!B&&x&&n.createElement(t.ActionBar,{style:c({},T)},n.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==F||null===(h=F[0])||void 0===h?void 0:h.action,value:null==F||null===(A=F[0])||void 0===A?void 0:A.action,onClick:e=>{y((null==F?void 0:F[0])||{})}},I((D||"WF_EMPLOYEE_"+(null==O?void 0:O.toUpperCase()))+"_"+(null==F||null===(N=F[0])||void 0===N?void 0:N.action)))))}const pn=()=>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(pn,null));function fn(e){let{action:l,closeWarningPopup:o}=e;const{t:a}=i.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(En,{onClick:()=>{o()}}),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:o,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 gn=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}=i.useTranslation(),E=o.useHistory();let{id:f}=o.useParams();const[g,_]=l.useState(!1),[h,A]=l.useState(null),[N,S]=l.useState(!1),[b,y]=l.useState(!1),[C,O]=l.useState(!1),{data:D}=Digit.Hooks.obps.useMDMS(m,"BPA",["RiskTypeComputation"]),{applicationDetails:T,demandData:L,totalDemandTax:I,totalBalanceTax:w,showToast:P,setShowToast:R,isLoading:x,isDataLoading:B,applicationData:F,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:$,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q,propertyId:ee}=e;l.useEffect(()=>{P&&U&&U.revalidate&&U.revalidate()},[P]);const te=r.useQueryClient(),le=()=>{A(null),S(!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(cn,{applicationDetails:T,demandData:L,id:H,workflowDetails:U,isDataLoading:B,applicationData:F,totalDemandTax:I,totalBalanceTax:w,businessService:W,timelineStatusPrefix:V,statusAttribute:Y,paymentsList:$,showTimeLine:X,oldValue:Z,isInfoLabel:J,propertyId:ee,moduleCode:z}),N?n.createElement(Rl,{t:p,action:h,tenantId:s,state:m,id:f,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:le,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const o=function(o,i,a,r,u,d,s,m,v,f,g,_,A,N,S,b,C,O){if(0==(null==e||null===(o=e.Property)||void 0===o||null===(i=o.workflow)||void 0===i||null===(a=i.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===(g=f[0])||void 0===g||null===(_=g.comment)||void 0===_?void 0:_.length))||0==(null==e||null===(A=e.WaterConnection)||void 0===A||null===(N=A.comment)||void 0===N?void 0:N.length)||0==(null==e||null===(S=e.SewerageConnection)||void 0===S||null===(b=S.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(C=e.BPA)||void 0===C||null===(O=C.comment)||void 0===O?void 0:O.length)){var D,T;"INITIATE"===(null==e||null===(D=e.Licenses)||void 0===D||null===(T=D[0])||void 0===T?void 0:T.action)?alert(p("Please fill in the validity before submitting")):alert(p("Please fill in the comments before submitting"))}else{const o=function(o,i,a,r,u){if("BPA"!=(null==e||null===(o=e.BPA)||void 0===o?void 0:o.businessService)||null!=e&&null!==(i=e.BPA)&&void 0!==i&&null!==(a=i.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&&(y(!0),M(e,{onError:(e,t)=>{y(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var n,o,i,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),y(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=h,E.replace("/digit-ui/employee/obps/response",{data:e})),null!==(o=l)&&void 0!==o&&o.isStakeholder&&(e.selectedAction=h,E.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(i=l)&&void 0!==i&&i.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!==(g=t.AmendmentUpdate)&&void 0!==g&&null!==(_=g.workflow)&&void 0!==_&&_.action.includes("REJECT")&&R({key:"success",label:p("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A,N,S;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!==(N=A.businessService)&&void 0!==N&&N.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===(S=e.Licenses[0])||void 0===S?void 0:S.applicationNumber)));R({key:"success",action:h}),Q&&setTimeout(Q,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()}y(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},e)));const o=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)),o=Pt(function(){return y(!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,o,i,a,r,u,d,s,c,m,v;y(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&null!==(i=o[0])&&void 0!==i&&i.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(o&&o.then)return o.then(function(){})}}();return o&&o.then?o.then(d):d(o)}alert(p("Please select Blocking reason"))}();if(o&&o.then)return o.then(function(){})}}();return Promise.resolve(o&&o.then?o.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,C?n.createElement(fn,{action:h,workflowDetails:U,businessService:W,isWarningPop:C,closeWarningPopup:()=>{O(!1)}}):null,n.createElement(mn,{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==F?void 0:F.applicationNo})).then(function(e){var t,l,n,o,i,a;const r=Digit.Utils.obps.calculateRiskType(null==D||null===(t=D.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==T||null===(l=T.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(o=n.plot)||void 0===o?void 0:o.area,null==T||null===(i=T.edcrDetails)||void 0===i||null===(a=i.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,o,i,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===(o=n.additionalDetails)||void 0===o||null===(i=o.selfCertificationCharges)||void 0===i?void 0:i.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(vn,{workflowDetails:U,displayMenu:g,onActionSelect:function(e){var t,l,n;if(console.log("action====",e),console.log("applicationDetails===>",T),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]),"PAY"==e.action&&window.location.href.includes("tl"))E.push("/digit-ui/employee/payment/collect/"+T.applicationData.businessService+"/"+T.applicationData.applicationNumber);else if(null!=e&&e.isWarningPopUp)O(!0);else if(null!=e&&e.redirectionUrll){var o,i,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.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===(i=e.redirectionUrll)||void 0===i?void 0:i.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))S(!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 S(!0);A(e),_(!1)},setDisplayMenu:_,businessService:W,forcedActionPrefix:G,ActionBarStyle:q,MenuStyle:K}))))};function _n(e){var o;let{t:i,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===(o=a.dropdownData)||void 0===o?void 0:o[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%"}},""+i("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 o;sessionStorage.setItem("NewNOCDocs",JSON.stringify(n)),(o=l[l.length-1])&&p(o.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const hn=e=>n.createElement("h1",{className:"heading-m"},e.label),An=()=>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"})),Nn=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(An,null)),Sn=e=>{var o;let{t:i,action:a,tenantId:r,getEmployees:u,closeModal:d,submitAction:s,applicationDetails:m,applicationData:v,businessService:p,showToast:E,setShowToast:f,closeToast:g,showErrorToast:_,errorOne:A,closeToastOne:N}=e;const[S,b]=l.useState({}),[y,C]=l.useState({}),[O,D]=l.useState([]),[T,L]=l.useState({}),[I,w]=l.useState(null),[P,R]=l.useState(null),[x,B]=l.useState(null),[F,M]=l.useState([]),[k,U]=l.useState(null),H=null==a||null===(o=a.state)||void 0===o?void 0:o.actions,W=(new Set(null==H?void 0:H.flatMap(e=>e.roles)),[...new Set(null==u?void 0:u.flatMap(e=>e.roles))]),{data:j}=Digit.Hooks.useEmployeeSearch(r,{roles:null==W?void 0:W.map(e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{data:z}=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;z&&z["egf-master"]&&M(null===(e=z["egf-master"])||void 0===e?void 0:e.FinancialYear)},[z]);const{data:V}=Digit.Hooks.useCustomMDMS(r,"common-masters",[{name:"Department"}]);function G(e){w(e.target.files[0])}return l.useEffect(()=>{if(j&&V){var e;const t=V["common-masters"].Department;D(null==j||null===(e=j.Employees)||void 0===e?void 0:e.map(e=>{var l,n,o;const i=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)===i);return{uuid:null==e?void 0:e.uuid,name:(null==e||null===(o=e.user)||void 0===o?void 0:o.name)+" - "+(null==a?void 0:a.name)}}))}},[j,V]),l.useEffect(()=>{!function(){try{B(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)B(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",I,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?R(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):B(i("CS_FILE_UPLOAD_ERROR"))})},function(){B(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[I]),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&&b((e=>{let{t:l,action:o,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s}=e,c=!0;return"SENDBACKTOCITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SENDBACK"!=(null==o?void 0:o.action)||(c=!1),o.isTerminateState&&(c=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_EMPLOYEE_NOC_"+(null==o?void 0:o.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:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:l("WF_COMMON_COMMENTS_LABEL")+"*",type:"textarea",populators:{name:"comments"},validation:{pattern:h("Comments"),required:!0,title:l("WF_COMMON_COMMENTS_ERROR")}},"APPROVE"===(null==o?void 0:o.action)?{label:l("WF_CONDITIONAL_COMMENTS_LABEL"),type:"textarea",populators:{name:"conditionalComments"},validation:{pattern:h("Comments"),required:!1,title:l("WF_COMMON_COMMENTS_ERROR")}}:null,{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")})}].filter(Boolean)}]}})({t:i,action:a,approvers:O,selectedApprover:T,setSelectedApprover:L,selectFile:G,uploadedFile:P,setUploadedFile:R,businessService:p}))},[a,O,F,k,P]),a&&S.form?n.createElement(t.Modal,{headerBarMain:n.createElement(hn,{label:i(S.label.heading)}),headerBarEnd:n.createElement(Nn,{onClick:d}),actionCancelLabel:i(S.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:i(S.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},n.createElement(t.FormComposer,{config:S.form,className:"BPAemployeeCard bpa-workflow-modal-form",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l;let n=["APPROVE","VERIFY","REJECT","SENDBACKTOCITIZEN","SENDBACKTOVERIFIER","FORWARD"].includes(null==a?void 0:a.action);null!=a&&a.isTerminateState&&(n=!0);const o=null==e||null===(t=e.comments)||void 0===t?void 0:t.toString().trim(),r=null==e||null===(l=e.conditionalComments)||void 0===l?void 0:l.trim();let u=o;return"APPROVE"===(null==a?void 0:a.action)&&r&&(u=o+" , "+r),"APPROVE"===(null==a?void 0:a.action)||"REJECT"===(null==a?void 0:a.action)||null!=T&&T.uuid?n&&!o?(setTimeout(()=>{g()},2e3),void f({key:"true",error:!0,message:i("COMMON_COMMENTS_REQUIRED_LABEL")})):(v=c({},v,{action:null==a?void 0:a.action,comment:u,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:P?[{documentType:null==I?void 0:I.type,fileName:null==I?void 0:I.name,documentUid:P,filestoreId:P,documentAttachment:P}]:null}),void s({Licenses:[v]})):(setTimeout(()=>{g()},2e3),void f({key:"true",error:!0,message:i("COMMON_ASSIGNEE_NAME_REQUIRED_LABEL")}))},defaultValues:y,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:g,isDleteBtn:!0}),_&&n.createElement(t.Toast,{error:!0,label:A,isDleteBtn:!0,onClose:N})):n.createElement(t.Loader,null)},bn=e=>{let{documents:o}=e;const{t:a}=i.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==o?void 0:o.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==o?void 0:o.length)>0}),s=null==o?void 0:o.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}))},yn=e=>{let{feeDataWithTotal:o,disable:i,feeData:a,handleAdjustedAmountChange:r,t:u,handleRemarkChange:d,onAdjustedAmountBlur:s,feeHistory:c,timeObj:m}=e;const[v,p]=l.useState(!1);return console.log("feeHistory",c),console.log("timeObj",m),console.log("feeHistory keys",Object.keys(c||{})),n.createElement("div",{className:"noc-table-container"},n.createElement("table",{className:"customTable table-border-style"},n.createElement("thead",null,n.createElement("tr",null,n.createElement("th",null,u("BPA_TAXHEAD_CODE")),n.createElement("th",null,u("BPA_AMOUNT")),n.createElement("th",null,u("BPA_REMARKS")))),n.createElement("tbody",null,o.map((e,l)=>{var o,c,m,v,p,E;return n.createElement("tr",{key:e.index||l},n.createElement("td",null,u(e.title)||u("CS_NA")),n.createElement("td",null,"NOC_TOTAL"===(null==e?void 0:e.taxHeadCode)?"":n.createElement(t.TextInput,{t:u,type:"number",isMandatory:!1,value:null!=(o=null!=(c=null===(m=a[e.index])||void 0===m?void 0:m.adjustedAmount)?c:e.amount)?o:"",onChange:t=>r(e.index,t.target.value),disable:i,step:1,onBlur:s})),n.createElement("td",null,"NOC_TOTAL"===(null==e?void 0:e.taxHeadCode)?n.createElement("div",null,n.createElement("strong",null,e.grandTotal),n.createElement("div",{style:{fontSize:"0.9em",color:"#555",marginTop:"4px"}},(e=>{if(null==e||""===e)return"Zero Rupees";const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],l=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],n=["","Thousand","Lakh","Crore"],o=e=>e<20?t[e]:e<100?l[Math.floor(e/10)]+(e%10?" "+t[e%10]:""):t[Math.floor(e/100)]+" Hundred"+(e%100?" "+o(e%100):""),i=e=>{if(!e)return"";let t=[e%1e3],l="";for(e=Math.floor(e/1e3);e;)t.push(e%100),e=Math.floor(e/100);for(let e=t.length-1;e>=0;e--)t[e]&&(l+=o(t[e])+" "+n[e]+" ");return l.trim()};let[a,r]=e.toString().split(".").map(e=>+e||0);return(a?i(a)+" Rupees":"")+(r?(a?" and ":"")+i(r)+" Paise":"")||"Zero Rupees"})(e.grandTotal))):n.createElement(t.TextInput,{t:u,type:"text",isMandatory:!0,value:null!=(v=null!=(p=null===(E=a[e.index])||void 0===E?void 0:E.remark)?p:e.remark)?v:"",onChange:t=>d(e.index,t.target.value,e.amount),disable:i,style:{width:"100%",padding:"4px",border:"1px solid #ccc",borderRadius:"4px"}})))}))),c&&Object.keys(c).length>0&&n.createElement("div",{style:{marginTop:"16px"}},n.createElement("div",{onClick:()=>p(!v),style:{cursor:"pointer"}},n.createElement(t.CardSubHeader,null,u("FEE_HISTORY")," ",v?"▲":"▼")),v&&n.createElement(l.Fragment,null,n.createElement("table",{className:"customTable table-border-style",style:{marginTop:"8px"}},n.createElement("thead",null,n.createElement("tr",null,Object.keys(c).map(e=>n.createElement("th",{key:e},u(e))))),n.createElement("tbody",null,Array.from({length:Math.max(...Object.values(c).map(e=>e.length))}).map((e,t)=>{const l=Math.max(...Object.values(c).map(e=>e.length))-1-t;return n.createElement("tr",{key:t},Object.entries(c).map(e=>{let[t,o]=e;const i=o[l];return n.createElement("td",{key:t},i?n.createElement("table",{className:"customTable table-border-style"},n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",null,n.createElement("strong",null,u("FEE"))),n.createElement("td",null,i.estimateAmount)),n.createElement("tr",null,n.createElement("td",null,n.createElement("strong",null,u("REMARK"))),n.createElement("td",null,i.remarks||u("CS_NA"))),n.createElement("tr",null,n.createElement("td",null,n.createElement("strong",null,u("LAST_UPDATED_BY"))),n.createElement("td",null,i.who||u("UNKNOWN"))))):u("CS_NA"))}))}))))))},Cn=e=>{var o,a,r,u,d;let{formData:s,feeAdjustments:m=[],setFeeAdjustments:v=(()=>{}),disable:p=!1}=e;const{t:E}=i.useTranslation(),[f,g]=l.useState(null),_=Digit.ULBService.getStateId(),[h,N]=l.useState(null);console.log("savedCalc",s),l.useEffect(()=>{console.log("Component mounted. Initial feeAdjustments:",m)},[]);const S=e=>{var t,l,n,o,i,a,r,u;const d=null==O||null===(t=O.Calculation)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.taxHeadEstimates)||void 0===n?void 0:n.find(t=>t.taxHeadCode===e),c=null==s||null===(o=s.calculations)||void 0===o?void 0:o.find(t=>t.taxHeadCode===e);return{originalEstimate:null!=(i=null!=(a=null==d?void 0:d.estimateAmount)?a:null==c?void 0:c.estimateAmount)?i:0,originalRemark:null!=(r=null!=(u=null==d?void 0:d.remarks)?u:null==c?void 0:c.remarks)?r:""}},b=l.useMemo(()=>{var e,t,l,n,o,i,a,r,u,d,m,v,p,E,f,g,_,h,A,N,S,b,y,C,O,D,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$;return{CalculationCriteria:[{applicationNumber:null==s||null===(e=s.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,tenantId:null==s||null===(n=s.apiData)||void 0===n||null===(o=n.Noc)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.tenantId,NOC:c({},null==s||null===(a=s.apiData)||void 0===a||null===(r=a.Noc)||void 0===r?void 0:r[0],{nocDetails:c({},null===(u=s.apiData)||void 0===u||null===(d=u.Noc)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.nocDetails,{additionalDetails:c({},null==s||null===(v=s.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==s?void 0:s.applicationDetails,{applicantGender:(null==s||null===(g=s.applicationDetails)||void 0===g||null===(_=g.applicantGender)||void 0===_?void 0:_.code)||(null==s||null===(h=s.applicationDetails)||void 0===h?void 0:h.applicantGender)||""}),siteDetails:c({},null==s?void 0:s.siteDetails,{ulbName:(null==s||null===(A=s.siteDetails)||void 0===A||null===(N=A.ulbName)||void 0===N?void 0:N.name)||(null==s||null===(S=s.siteDetails)||void 0===S?void 0:S.ulbName)||"",roadType:(null==s||null===(b=s.siteDetails)||void 0===b||null===(y=b.roadType)||void 0===y?void 0:y.name)||(null==s||null===(C=s.siteDetails)||void 0===C?void 0:C.roadType)||"",buildingStatus:(null==s||null===(O=s.siteDetails)||void 0===O||null===(D=O.buildingStatus)||void 0===D?void 0:D.name)||(null==s||null===(T=s.siteDetails)||void 0===T?void 0:T.buildingStatus)||"",isBasementAreaAvailable:(null==s||null===(L=s.siteDetails)||void 0===L||null===(I=L.isBasementAreaAvailable)||void 0===I?void 0:I.code)||(null==s||null===(w=s.siteDetails)||void 0===w?void 0:w.isBasementAreaAvailable)||"",district:(null==s||null===(P=s.siteDetails)||void 0===P||null===(R=P.district)||void 0===R?void 0:R.name)||(null==s||null===(x=s.siteDetails)||void 0===x?void 0:x.district)||"",zone:(null==s||null===(B=s.siteDetails)||void 0===B||null===(F=B.zone)||void 0===F?void 0:F.name)||(null==s||null===(M=s.siteDetails)||void 0===M?void 0:M.zone)||"",specificationBuildingCategory:(null==s||null===(k=s.siteDetails)||void 0===k||null===(U=k.specificationBuildingCategory)||void 0===U?void 0:U.name)||(null==s||null===(H=s.siteDetails)||void 0===H?void 0:H.specificationBuildingCategory)||"",specificationNocType:(null==s||null===(W=s.siteDetails)||void 0===W||null===(j=W.specificationNocType)||void 0===j?void 0:j.name)||(null==s||null===(z=s.siteDetails)||void 0===z?void 0:z.specificationNocType)||"",specificationRestrictedArea:(null==s||null===(V=s.siteDetails)||void 0===V||null===(G=V.specificationRestrictedArea)||void 0===G?void 0:G.code)||(null==s||null===(Y=s.siteDetails)||void 0===Y?void 0:Y.specificationRestrictedArea)||"",specificationIsSiteUnderMasterPlan:(null==s||null===(q=s.siteDetails)||void 0===q||null===(K=q.specificationIsSiteUnderMasterPlan)||void 0===K?void 0:K.code)||(null==s||null===($=s.siteDetails)||void 0===$?void 0:$.specificationIsSiteUnderMasterPlan)||""})})})})}]}},[s]),y=l.useMemo(()=>function(e,t){void 0===e&&(e=[]);let{newestFirst:l=!0,limit:n=null}=void 0===t?{}:t;const o={};return Array.isArray(e)?(e.forEach(e=>{const t=(null==e?void 0:e.updatedBy)||null;((null==e?void 0:e.taxHeadEstimates)||[]).forEach(l=>{if(null==l||!l.taxHeadCode)return;o[l.taxHeadCode]=o[l.taxHeadCode]||[];const n=o[l.taxHeadCode][o[l.taxHeadCode].length-1];var i,a,r;n&&n.estimateAmount===(null==l?void 0:l.estimateAmount)||o[l.taxHeadCode].push({who:t,estimateAmount:null!=(i=null==l?void 0:l.estimateAmount)?i:null,remarks:null!=(a=null==l?void 0:l.remarks)?a:null,isLatest:null!=(r=null==e?void 0:e.isLatest)&&r})})}),Object.keys(o).forEach(e=>{l&&o[e].sort((e,t)=>(t.when||0)-(e.when||0)),n&&"number"==typeof n&&(o[e]=o[e].slice(0,n))}),o):o}(((null==s?void 0:s.calculations)||[]).filter(e=>((null==e?void 0:e.taxHeadEstimates)||[]).some(e=>(null==e?void 0:e.estimateAmount)>0)),{newestFirst:!0}),[null==s?void 0:s.calculations]);console.log("[payload] built with formData:",s),console.log("[payload] CalculationCriteria:",b.CalculationCriteria),console.log("payload for calc apiiiii",b);const{isLoading:C,data:O,revalidate:D}=Digit.Hooks.noc.useNOCFeeCalculator({payload:b},{enabled:!!b});console.log("[useNOCFeeCalculator] isLoading:",C,"data:",O),console.log("data from calc api",O),console.log("Raw API taxHeadEstimates:",null==O||null===(o=O.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates),null==O||null===(r=O.Calculation)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.taxHeadEstimates)||void 0===d||d.forEach((e,t)=>{console.log("API row "+t+": taxHead="+e.taxHeadCode+", estimate="+e.estimateAmount+", remarks="+e.remarks)});const[T,L]=l.useState(null);l.useEffect(()=>{yt.isEqual(T,null==s?void 0:s.siteDetails)||(console.log("[revalidate] siteDetails changed. Old:",T,"New:",null==s?void 0:s.siteDetails),D(),L(null==s?void 0:s.siteDetails))},[null==s?void 0:s.siteDetails]),l.useEffect(()=>{var e,t;null!=O&&null!==(e=O.Calculation)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.taxHeadEstimates&&v(function(e){void 0===e&&(e=[]);const t=(e||[]).reduce((e,t)=>(null!=t&&t.taxHeadCode&&(e[t.taxHeadCode]=t),e),{});return O.Calculation[0].taxHeadEstimates.map(e=>{var l,n,o,i,a,r,u,d,c;const m=null==s||null===(l=s.calculations)||void 0===l?void 0:l.find(t=>t.taxHeadCode===e.taxHeadCode),v=t[e.taxHeadCode]||{},p=!!v.edited;return{taxHeadCode:e.taxHeadCode,category:e.category,adjustedAmount:p?v.adjustedAmount:null!=(n=null!=(o=e.estimateAmount)?o:null==m?void 0:m.estimateAmount)?n:0,remark:p?null!=(i=v.remark)?i:"":null!=(a=null!=(r=e.remarks)?r:null==m?void 0:m.remarks)?a:"",filestoreId:void 0!==(null==v?void 0:v.filestoreId)?v.filestoreId:null!=(u=null!=(d=null==m?void 0:m.filestoreId)?d:e.filestoreId)?u:null,onDocumentLoading:!1,documentError:null,edited:null!=(c=v.edited)&&c}})})},[O]),l.useEffect(()=>{if(s){var e,t,l,n,o,i,a,r,u;console.log("formData",s);const d=null==s||null===(e=s.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.nocDetails)||void 0===n||null===(o=n.additionalDetails)||void 0===o?void 0:o.SubmittedOn,c=null==s||null===(i=s.apiData)||void 0===i||null===(a=i.Noc)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.auditDetails)||void 0===u?void 0:u.lastModifiedTime;console.log("submiited on , "+d+" , lastModified , "+c);const m=A(d&&c?c-d:null);N(m)}},[s]);const I=l.useMemo(()=>{var e,t;if(null==O||null===(e=O.Calculation)||void 0===e||null===(t=e[0])||void 0===t||!t.taxHeadEstimates)return[];const l=O.Calculation[0].taxHeadEstimates.map((e,t)=>{var l,n,o,i,a,r;const u=null!=(l=null===(n=m[t])||void 0===n?void 0:n.adjustedAmount)?l:e.estimateAmount,d=null!=(o=null!=(i=null===(a=m[t])||void 0===a?void 0:a.remark)?i:e.remarks)?o:"";return console.log("Row "+t+": taxHead="+e.taxHeadCode+", estimate="+e.estimateAmount+", adjusted="+u+", remark="+d),{index:t,id:"tax-"+t,title:E(e.taxHeadCode),taxHeadCode:e.taxHeadCode,amount:e.estimateAmount||0,category:e.category,adjustedAmount:u,remark:d,filestoreId:(null===(r=m[t])||void 0===r?void 0:r.filestoreId)||null}});console.log("[applicationFeeDataWithTotal] built rows:",l);const n=l.reduce((e,t)=>e+(t.adjustedAmount||0),0);return console.log("[applicationFeeDataWithTotal] grand total:",n),console.log("Final rows with total:",l),[...l,{id:"total",taxHeadCode:"NOC_TOTAL",title:E("NOC_TOTAL"),amount:l.reduce((e,t)=>e+(t.adjustedAmount||0),0),adjustedAmount:"",grandTotal:n}]},[O,E,m]);return C?n.createElement(t.Loader,null):n.createElement("div",null,C?n.createElement(t.Loader,null):n.createElement(l.Fragment,null,n.createElement(yn,{feeDataWithTotal:I,feeData:m,disable:p,isEmployee:!p,handleAdjustedAmountChange:(e,t)=>{var l;const n=""===t?null:Number(t),o=null==m||null===(l=m[e])||void 0===l?void 0:l.taxHeadCode,{originalEstimate:i,originalRemark:a}=S(o);null!==n&&n<0?g({error:!0,message:"Adjusted_Amount_More_Than_Ammount"}):v(t=>t.map((t,l)=>l!==e?t:c({},t,(null===n?0===i:n===i)?{adjustedAmount:n,edited:!1,remark:a}:{adjustedAmount:n,edited:!0,remark:""})))},handleRemarkChange:(e,t)=>{var l,n,o;const i=null==m||null===(l=m[e])||void 0===l?void 0:l.taxHeadCode,{originalEstimate:a,originalRemark:r}=S(i),u=(null!=(n=null==m||null===(o=m[e])||void 0===o?void 0:o.adjustedAmount)?n:0)!==a,d=(null!=t?t:"").trim()!==(null!=r?r:"").trim();v(l=>l.map((l,n)=>n===e?c({},l,{remark:t,edited:u||d}):l))},handleFileUpload:function(e,t){try{const l=t.target.files[0],n=Pt(function(){return v(t=>t.map((t,l)=>l===e?c({},t,{onDocumentLoading:!0}):t)),Promise.resolve(Digit.UploadServices.Filestorage("noc-upload",l,_)).then(function(t){var l,n;(null==t||null===(l=t.data)||void 0===l||null===(n=l.files)||void 0===n?void 0:n.length)>0?v(l=>l.map((l,n)=>n===e?c({},l,{filestoreId:t.data.files[0].fileStoreId,onDocumentLoading:!1,documentError:null}):l)):g({error:!0,message:"PT_FILE_UPLOAD_ERROR"})})},function(e){g({error:!0,message:"PT_FILE_UPLOAD_ERROR"}),console.log("err in file upload",e)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},handleFileDelete:e=>{v(t=>t.map((t,l)=>l===e?c({},t,{filestoreId:null}):t))},routeTo:function(e,t){return Promise.resolve(function(e){try{return e?Promise.resolve(Digit.UploadServices.Filefetch([e],_)).then(function(t){var l;return(null==t||null===(l=t.data)||void 0===l?void 0:l[e])||null}):Promise.resolve()}catch(e){return Promise.reject(e)}}(e)).then(function(e){e&&window.open(e)})},t:E,onAdjustedAmountBlur:()=>{},feeHistory:y,timeObj:h}),f&&n.createElement(t.Toast,{error:null==f?void 0:f.error,warning:null==f?void 0:f.warning,success:null==f?void 0:f.success,label:E(null==f?void 0:f.message),isDleteBtn:!0,onClose:()=>g(null)})))},On=e=>{let{ownerFileStoreId:o,ownerName:a}=e;const r=Digit.ULBService.getStateId(),[u,d]=(i.useTranslation(),l.useState(null)),[s,c]=l.useState(null);return l.useEffect(()=>{!function(){try{const e=function(){if(o)return Promise.resolve(Digit.UploadServices.Filefetch([o],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)}}()},[o]),n.createElement("div",{style:{padding:"20px 0px"}},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)}}))},Dn="__googleMapsScriptId";var Tn;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"}(Tn||(Tn={}));class Ln{constructor(e){let{apiKey:t,channel:l,client:n,id:o=Dn,libraries:i=[],language:a,region:r,version:u,mapIds:d,nonce:s,retries:c=3,url:m="https://maps.googleapis.com/maps/api/js"}=e;if(this.CALLBACK="__googleMapsCallback",this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.version=u,this.apiKey=t,this.channel=l,this.client=n,this.id=o||Dn,this.libraries=i,this.language=a,this.region=r,this.mapIds=d,this.nonce=s,this.retries=c,this.url=m,Ln.instance){if(!function e(t,l){if(t===l)return!0;if(t&&l&&"object"==typeof t&&"object"==typeof l){if(t.constructor!==l.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=l.length)return!1;for(o=n;0!=o--;)if(!e(t[o],l[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===l.source&&t.flags===l.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===l.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===l.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(l).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(l,i[o]))return!1;for(o=n;0!=o--;){var a=i[o];if(!e(t[a],l[a]))return!1}return!0}return t!=t&&l!=l}(this.options,Ln.instance.options))throw new Error("Loader must not be called again with different options. "+JSON.stringify(this.options)+" !== "+JSON.stringify(Ln.instance.options));return Ln.instance}Ln.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url}}get status(){return this.errors.length?Tn.FAILURE:this.done?Tn.SUCCESS:this.loading?Tn.LOADING:Tn.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let e=this.url;return e+="?callback="+this.CALLBACK,this.apiKey&&(e+="&key="+this.apiKey),this.channel&&(e+="&channel="+this.channel),this.client&&(e+="&client="+this.client),this.libraries.length>0&&(e+="&libraries="+this.libraries.join(",")),this.language&&(e+="&language="+this.language),this.region&&(e+="®ion="+this.region),this.version&&(e+="&v="+this.version),this.mapIds&&(e+="&map_ids="+this.mapIds.join(",")),e}deleteScript(){const e=document.getElementById(this.id);e&&e.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((e,t)=>{this.loadCallback(l=>{l?t(l.error):e(window.google)})})}loadCallback(e){this.callbacks.push(e),this.execute()}setScript(){if(document.getElementById(this.id))return void this.callback();const e=this.createUrl(),t=document.createElement("script");t.id=this.id,t.type="text/javascript",t.src=e,t.onerror=this.loadErrorCallback.bind(this),t.defer=!0,t.async=!0,this.nonce&&(t.nonce=this.nonce),document.head.appendChild(t)}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(e){if(this.errors.push(e),this.errors.length<=this.retries){const e=this.errors.length*Math.pow(2,this.errors.length);console.log("Failed to load Google Maps script, retrying in "+e+" ms."),setTimeout(()=>{this.deleteScript(),this.setScript()},e)}else this.onerrorEvent=e,this.callback()}setCallback(){window.__googleMapsCallback=this.callback.bind(this)}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(e=>{e(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version)return console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),void this.callback();this.loading||(this.loading=!0,this.setCallback(),this.setScript())}}}const In=e=>(l.useEffect(()=>{!function(){try{const t=e=>{(e=>{var t,l;const n=window.Digit.Utils.browser.isMobile();if(0===(null==e?void 0:e.length))return;const o=new window.google.maps.Map(document.getElementById("map"),{center:{lat:null===(t=e[0])||void 0===t?void 0:t.latitude,lng:null===(l=e[0])||void 0===l?void 0:l.longitude},zoom:15,mapTypeId:"roadmap"});e.forEach((e,t)=>{const l=new window.google.maps.Marker({map:o,title:"SITE "+(t+1),position:{lat:null==e?void 0:e.latitude,lng:null==e?void 0:e.longitude}}),i=new window.google.maps.InfoWindow({content:'<div className="obps-autocomplete-font-size">SITE '+(t+1)+"</div>"});n?l.addListener("click",()=>{i.open(o,l)}):(l.addListener("mouseover",()=>i.open(o,l)),l.addListener("mouseout",()=>i.close()))})})(e)};(e=>{var t;const l=null===(t=globalConfigs)||void 0===t?void 0:t.getConfig("GMAPS_API_KEY");new Ln({apiKey:l,version:"weekly",libraries:["places"]}).load().then(()=>{e&&e()}).catch(e=>{})})(()=>{t(e.position)}),Promise.resolve()}catch(e){return Promise.reject(e)}}()},[null==e?void 0:e.position]),n.createElement("div",{className:"map-wrap"},n.createElement("div",{id:"map",className:"map"}))),wn=e=>{let{page:t=!1}=e;const l={display:"flex",justifyContent:"center",alignItems:"center"},o=c({},l,{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(255,255,255,0.6)",backdropFilter:"blur(4px)",zIndex:9999}),i=c({},l,{minHeight:"100px",width:"100%",position:"relative"});return n.createElement("div",{style:t?o:i},n.createElement("div",{style:{width:"64px",height:"64px",border:"8px solid #1976d2",borderTop:"8px solid transparent",borderRadius:"50%",animation:"spin 1.2s linear infinite"}}),n.createElement("style",null,"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "))},Pn=e=>{var o,a,r,u,d,s,m,v,p,E,f,g,_,h,A,N,S;const{t:b}=i.useTranslation(),y=l.useRef(),[C,O]=l.useState(!1),[D,T]=l.useState(!1),[L,I]=l.useState(null),w=Digit.SessionStorage.get("userType");let P={};const R=Digit.ULBService.getStateId(),x=null===(o=window)||void 0===o||null===(a=o.Digit)||void 0===a||null===(r=a.Utils)||void 0===r||null===(u=r.browser)||void 0===u?void 0:u.isMobile();function B(t){null!=e&&e.customOpen?null==e||e.customOpen(t):F(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!=y&&null!==(d=y.current)&&void 0!==d&&d.value&&(y.current.value="",e.onDelete(),O(!1)),l.useEffect(()=>{var t,l;(null==y||null===(t=y.current)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)<=0&&null!==L&&(y.current.value="",e.onDelete())},[null==y||null===(s=y.current)||void 0===s?void 0:s.files]),l.useEffect(()=>{var e,t,l,n;null!=y&&null!==(e=y.current)&&void 0!==e&&null!==(t=e.files)&&void 0!==t&&t[0]?(O(!0),I(null==y||null===(l=y.current)||void 0===l||null===(n=l.files)||void 0===n?void 0:n[0])):O(!1)},[null==e?void 0:e.message]);const F=function(t){try{if(0===(null==t?void 0:t.length))return Promise.resolve();T(!0);const l=Pt(function(){return Promise.resolve(Digit.UploadServices.Filefetch([t],R)).then(function(l){if(T(!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(){T(!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,o)=>{var i;const a=l[1];return n.createElement("div",{className:"tag-container",style:P?null===(i=P)||void 0===i?void 0:i.tagContainerStyles:null},n.createElement(t.RemoveableTag,{extraStyles:P,key:o,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===(g=P)||void 0===g?void 0:g.tagContainerStyles},n.createElement(t.SubmitBar,{onSubmit:()=>{B(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")}))),n.createElement("input",{className:e.disabled?"disabled":"input-mirror-selector-button",style:P?c({},null===(_=P)||void 0===_?void 0:_.inputStyles,null==e?void 0:e.inputStyles):c({},null==e?void 0:e.inputStyles),ref:y,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:()=>{B(e.uploadedFile)},label:b("CS_VIEW_DOCUMENT")})):n.createElement("div",{className:"upload-file "+("employee"===w?"":"upload-file-max-width")+" "+(e.disabled?" disabled":""),style:null!==(N=P)&&void 0!==N&&N.uploadFile?null===(S=P)||void 0===S?void 0:S.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)),D&&n.createElement(t.Loader,{page:!0}))},Rn=e=>{var o,i,a;let{t:r,config:u,onSelect:d,formData:s,data:m,isLoading:v,error:p,setError:E,customOpen:f}=e;const[g,_]=l.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]);console.log("documents for field insepecttion in challan",g),console.log("data for challandocs",m);const[h,A]=l.useState(!0),[N,S]=l.useState(!1),b=(window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY"),()=>{let e;e=c({},s.documents,{documents:g}),d(u.key,e)});return l.useEffect(()=>{var e,t;let l=0;null==m||null===(e=m.FieldInspection)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==g||g.map(l=>{e.required&&null!=l&&l.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(l+=1)}),A("0"!=l&&0!=l||!((null==g?void 0:g.length)>0))},[g,N]),l.useEffect(()=>{console.log("documents check again",g)},[g]),n.createElement("div",null,v?n.createElement(wn,null):n.createElement(t.FormStep,c({t:r,config:u,onSelect:b},null!=m&&m.FieldInspection?{}:{onSkip:()=>d()},{isDisabled:h,onAdd:function(){}}),null==m||null===(i=m.FieldInspection)||void 0===i||null===(a=i.Documents)||void 0===a?void 0:a.map((e,t)=>n.createElement(xn,{key:t,document:e,t:r,error:p,setError:E,setDocuments:_,documents:g,setCheckRequiredFields:S,handleSubmit:b,customOpen:f})),p&&n.createElement(t.Toast,{isDleteBtn:!0,label:p,onClose:()=>E(null),error:!0})))};function xn(e){let{t:o,document:i,setDocuments:a,setError:r,documents:d,action:s,formData:m,handleSubmit:v,id:p,customOpen:E}=e;const f=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==i?void 0:i.code)})[0],[g,_]=(Digit.ULBService.getCurrentTenantId(),l.useState(()=>{var e;if(f){var t,l;const e=null==i||null===(t=i.dropdownData)||void 0===t?void 0:t.find(e=>e.code===f.documentType);return e?c({},e,{i18nKey:null===(l=e.code)||void 0===l?void 0:l.replaceAll(".","_")}):{}}if(1===(null==i||null===(e=i.dropdownData)||void 0===e?void 0:e.length)){var n;const e=i.dropdownData[0];return c({},e,{i18nKey:null===(n=e.code)||void 0===n?void 0:n.replaceAll(".","_")})}return{}})),[h,A]=l.useState(null),[N,S]=l.useState(()=>(null==f?void 0:f.filestoreId)||null);function b(e,t){void 0===t&&(t={}),a(function(l){void 0===l&&(l=[]);const n=l.map(l=>(null==l?void 0:l.documentType)===(null==e?void 0:e.code)?c({},l,t):l);return n.some(t=>(null==t?void 0:t.documentType)===(null==e?void 0:e.code))||n.push(c({documentType:null==e?void 0:e.code,filestoreId:null,documentUid:null},t)),n})}function y(e,t){const[l,n,o]=e;let i=l+n/60+o/3600;return"S"!==t&&"W"!==t||(i*=-1),i}const{dropdownData:C}=i;var O=C;const[D,T]=l.useState(!1),[L,I]=l.useState(!1);return l.useEffect(()=>{null!=g&&g.code&&a(e=>e.map(e=>(null==e?void 0:e.documentType)===(null==g?void 0:g.code)?c({},e,{filestoreId:N,documentUid:N}):e))},[N,g]),l.useEffect(()=>{(null==d?void 0:d.length)>0&&v()},[d]),l.useEffect(()=>{if("update"===s){var e,t;const l=null==m||null===(e=m.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==i?void 0:i.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?(_(n),S(null==l?void 0:l.fileStoreId)):T(!0)}},[]),l.useEffect(()=>{var e;null!=i&&i.hasDropdown||_({code:null==i?void 0:i.code,i18nKey:null==i||null===(e=i.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),l.useEffect(()=>{!function(){try{r(null);const e=function(){if(h){I(!0);const e=Pt(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",h,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;I(!1),(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?S(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):r(o("CS_FILE_UPLOAD_ERROR"))})},function(){I(!1),r(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[h]),l.useEffect(()=>{D&&S(null)},[D]),n.createElement("div",{style:{marginBottom:"24px"}},n.createElement(t.LabelFieldPair,{style:{display:"inline"}},n.createElement(t.CardLabel,{style:{marginBottom:"8px",width:"auto"}},o(null==i?void 0:i.code)," ",n.createElement("span",{style:{color:"red"}}," ",(null==i?void 0:i.required)&&" *")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(Pn,{onUpload:function(e){const t=e.target.files[0];if(!t)return;const l=t.type.toLowerCase();if(l.includes("image/jpeg")||l.includes("image/jpg")||l.includes("image/png")){const e=new FileReader;e.onload=function(){const l=new Image;l.onload=function(){u.getData(l,function(){const e=u.getTag(this,"GPSLatitude"),l=u.getTag(this,"GPSLongitude"),n=u.getTag(this,"GPSLatitudeRef")||"N",o=u.getTag(this,"GPSLongitudeRef")||"E";let i=null,a=null;e&&l?(i=y(e,n),a=y(l,o),console.log("📍 Latitude:",i,"Longitude:",a),A(t),b(g,{latitude:i,longitude:a})):alert("⚠️ No GPS data found in image.")})},l.src=e.result},e.readAsDataURL(t)}else console.log("📄 Non-image file uploaded, skipping EXIF read"),A(t),b(g,{})},onDelete:()=>{S(null)},id:p,message:N?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!N,uploadedFile:N,customOpen:E}))),L&&n.createElement(wn,{page:!0}))}const Bn=e=>{let{siteImages:a,setSiteImages:r,customOpen:u}=e;const{t:d}=i.useTranslation(),{pathname:s}=o.useLocation(),c=(s.includes("/modify-application/"),Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[m,v]=l.useState(null),{data:p,isLoading:E}=Digit.Hooks.useCustomMDMS(c,"FieldInspection",[{name:"Documents"}]);console.log("docData here in fieldinspe",p);const f=l.useMemo(()=>{var e;if(null!=a&&a.documents&&(null==a?void 0:a.documents.length)>0)return null==a||null===(e=a.documents)||void 0===e?void 0:e.map(e=>({latitude:(null==e?void 0:e.latitude)||"",longitude:(null==e?void 0:e.longitude)||""}))},[a]);return n.createElement("div",null,n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},d("SITE_INPECTION_IMAGES")),n.createElement("div",{style:{marginTop:"20px"}},n.createElement(Rn,{t:d,config:{key:"documents"},onSelect:(e,t)=>{r(t)},userType:"CITIZEN",formData:{documents:a},setError:v,error:m,clearErrors:()=>{},formState:{},data:p,isLoading:E,customOpen:u})),(null==f?void 0:f.length)>0&&n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},d("SITE_INSPECTION_IMAGES_LOCATIONS")),n.createElement(In,{position:f}))))},Fn=e=>{let{filestoreId:o,documentType:a,coordinates:r}=e;const u=Digit.ULBService.getStateId(),{t:d}=i.useTranslation(),[s,c]=l.useState(null),[m,v]=l.useState(null);return l.useEffect(()=>{!function(){try{const e=function(){if(o)return Promise.resolve(Digit.UploadServices.Filefetch([o],u)).then(function(e){var t,l;null!=e&&null!==(t=e.data)&&void 0!==t&&t.fileStoreIds&&c(null===(l=e.data.fileStoreIds[0])||void 0===l?void 0:l.url)})}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[o]),n.createElement("div",{style:{padding:"20px 0px"}},n.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"10px",padding:"0px 20px"}},n.createElement("div",{style:{textAlign:"start"}},n.createElement("div",null,n.createElement("span",null,d(null==a?void 0:a.replaceAll(".","_")))),n.createElement("img",{src:s,alt:d(null==a?void 0:a.replaceAll(".","_")),style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:s?"pointer":"default"},onClick:()=>s&&v(s)}),n.createElement("div",null,"Latitude - ","OWNER.SITEPHOTOGRAPHONE"===a?null==r?void 0:r.Latitude1:null==r?void 0:r.Latitude2),n.createElement("div",null,"Longitude - ","OWNER.SITEPHOTOGRAPHONE"===a?null==r?void 0:r.Longitude1:null==r?void 0:r.Longitude2))),m&&n.createElement(t.ImageViewer,{imageSrc:m,onClose:()=>{v(null)}}))},Mn=function(e,t,l,n){try{var o,i,a;const u=(new Date).toLocaleDateString("en-IN",{day:"2-digit",month:"long",year:"numeric"}),d=e=>{if(0===e)return t("NOC_GROUND_FLOOR_AREA_LABEL");const l=e%10,n=e%100;let o="th";return(n<11||n>13)&&(1===l?o="st":2===l?o="nd":3===l&&(o="rd")),""+e+o+" "+t("NOC_FLOOR_AREA_LABEL")},s=(null==e||null===(o=e.nocDetails)||void 0===o?void 0:o.additionalDetails)||{},m=(null==s?void 0:s.siteDetails)||{},v=null!=s&&s.SubmittedOn?null===(i=new Date(Number(null==s?void 0:s.SubmittedOn)))||void 0===i?void 0:i.toLocaleDateString("en-GB"):"";let p=[],E=(null==m?void 0:m.basementArea)||"NA",f=(null==m?void 0:m.totalFloorArea)||"NA";var r;p="Built Up"===(null==m?void 0:m.buildingStatus)?null===(r=(null==m?void 0:m.floorArea)||[])||void 0===r?void 0:r.map((e,t)=>c({},e,{floorNo:d(t)})):[{floorNo:"Floor No NA",value:"NA"}];const g=["NOC_SANCTION_THREE","NOC_SANCTION_FOUR","NOC_SANCTION_FIVE","NOC_SANCTION_SIX","NOC_SANCTION_SEVEN","NOC_SANCTION_EIGHT"],_="Provisional"===(null==m?void 0:m.specificationNocType)?g:g.slice(1),h=null==_?void 0:_.map((e,l)=>({number:3+l,text:t(e)}));return Promise.resolve({Noc:[c({},e,{nocDetails:c({},e.nocDetails,{additionalDetails:c({},null===(a=e.nocDetails)||void 0===a?void 0:a.additionalDetails,{SubmittedOn:v,siteDetails:c({},m,{floorArea:p,basementArea:E,totalFloorArea:f})})}),currentDate:u,sanctionTerms:h},l,{approverComment:n})]})}catch(e){return Promise.reject(e)}},kn=e=>{let{filestoreId:o,documentType:a,documentName:r,latitude:d,longitude:s}=e;const c=Digit.ULBService.getStateId(),{t:m}=i.useTranslation(),[v,p]=l.useState(null),[E,f]=l.useState(null),[g,_]=l.useState(null);l.useEffect(()=>{if(o){const e=window.origin+"/filestore/v1/files/id?fileStoreId="+o+"&tenantId="+c;p(e),h(e)}},[o,c]);const h=e=>{const t=new Image;t.onload=function(){u.getData(t,function(){const e=u.getTag(this,"DateTimeOriginal");e&&_(e)})},t.src=e};return n.createElement("div",{style:{padding:"20px 0px"}},n.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",marginTop:"10px",padding:"0px 20px"}},n.createElement("span",{style:{fontWeight:"500"}},m(null==a?void 0:a.replaceAll(".","_"))),n.createElement("img",{src:v,alt:r||m(null==a?void 0:a.replaceAll(".","_")),style:{width:"100px",height:"100px",objectFit:"cover",borderRadius:"10%",cursor:v?"pointer":"default",marginTop:"8px"},onClick:()=>v&&f(v)}),(d||s)&&n.createElement("div",{style:{marginTop:"8px",fontSize:"12px",color:"#666"}},d&&n.createElement("span",null,"Lat: ",d),d&&s&&n.createElement("span",null,", "),s&&n.createElement("span",null,"Long: ",s)),g&&n.createElement("div",{style:{marginTop:"4px",fontSize:"12px",color:"#666"}},n.createElement("span",null,"Date Taken: ",g))),E&&n.createElement(t.ImageViewer,{imageSrc:E,onClose:()=>f(null)}))},Un=["tenantId","payments","pdfkey","EmpData"],Hn=e=>{let{registerRef:o,searchFieldComponents:a}=e;const{t:r}=i.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:o({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:o({})}))):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:o({})})),n.createElement(t.SearchField,null,n.createElement("label",null,r("NOC_APPLICANT_MOBILE_NO_LABEL")),n.createElement(t.TextInput,{name:"mobileNumber",inputRef:o({})})),n.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Wn=e=>{let{statuses:o,controlFilterForm:r,applicationTypesOfBPA:u}=e;const{t:d}=i.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===>",o),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==o?void 0:o.map((l,o)=>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:o})))})))};function jn(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 zn(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Vn(e){zn(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 Gn(e,t){zn(2,arguments);var l=Vn(e).getTime(),n=jn(t);return new Date(l+n)}function Yn(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 qn(e){return zn(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Kn(e){if(zn(1,arguments),!qn(e)&&"number"!=typeof e)return!1;var t=Vn(e);return!isNaN(Number(t))}var $n={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 Xn(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 Zn={date:Xn({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Xn({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:Xn({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Jn={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Qn(e){return function(t,l){var n,o=l||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=o.width?String(o.width):i;n=e.formattingValues[a]||e.formattingValues[i]}else{var r=e.defaultWidth,u=o.width?String(o.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function eo(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,r=i[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?lo(u,function(e){return e.test(r)}):to(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 to(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function lo(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var no,oo={code:"en-US",formatDistance:function(e,t,l){var n,o=$n[e];return n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=l&&l.addSuffix?l.comparison&&l.comparison>0?"in "+n:n+" ago":n},formatLong:Zn,formatRelative:function(e,t,l,n){return Jn[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:Qn({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Qn({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:Qn({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:Qn({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:Qn({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:(no={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(no.matchPattern);if(!l)return null;var n=l[0],o=e.match(no.parsePattern);if(!o)return null;var i=no.valueCallback?no.valueCallback(o[0]):o[0];i=t.valueCallback?t.valueCallback(i):i;var a=e.slice(n.length);return{value:i,rest:a}}),era:eo({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:eo({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:eo({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:eo({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:eo({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 io(e,t){zn(2,arguments);var l=jn(t);return Gn(e,-l)}function ao(e){zn(1,arguments);var t=1,l=Vn(e),n=l.getUTCDay(),o=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-o),l.setUTCHours(0,0,0,0),l}function ro(e){zn(1,arguments);var t=Vn(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var o=ao(n),i=new Date(0);i.setUTCFullYear(l,0,4),i.setUTCHours(0,0,0,0);var a=ao(i);return t.getTime()>=o.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function uo(e){zn(1,arguments);var t=ro(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=ao(l);return n}function so(e,t){zn(1,arguments);var l=t||{},n=l.locale,o=n&&n.options&&n.options.weekStartsOn,i=null==o?0:jn(o),a=null==l.weekStartsOn?i:jn(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Vn(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 co(e,t){zn(1,arguments);var l=Vn(e),n=l.getUTCFullYear(),o=t||{},i=o.locale,a=i&&i.options&&i.options.firstWeekContainsDate,r=null==a?1:jn(a),u=null==o.firstWeekContainsDate?r:jn(o.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=so(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var m=so(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=m.getTime()?n:n-1}function mo(e,t){zn(1,arguments);var l=t||{},n=l.locale,o=n&&n.options&&n.options.firstWeekContainsDate,i=null==o?1:jn(o),a=null==l.firstWeekContainsDate?i:jn(l.firstWeekContainsDate),r=co(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=so(u,t);return d}function vo(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var po={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 vo("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var o=co(e,n),i=o>0?o:1-o;return"YY"===t?vo(i%100,2):"Yo"===t?l.ordinalNumber(i,{unit:"year"}):vo(i,t.length)},R:function(e,t){return vo(ro(e),t.length)},u:function(e,t){return vo(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 vo(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 vo(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):vo(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 vo(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 o=function(e,t){zn(1,arguments);var l=Vn(e),n=so(l,t).getTime()-mo(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(o,{unit:"week"}):vo(o,t.length)},I:function(e,t,l){var n=function(e){zn(1,arguments);var t=Vn(e),l=ao(t).getTime()-uo(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):vo(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return vo(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){zn(1,arguments);var t=Vn(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),o=l-n;return Math.floor(o/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):vo(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 o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return vo(i,2);case"eo":return l.ordinalNumber(i,{unit:"day"});case"eee":return l.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(o,{width:"short",context:"formatting"});case"eeee":default:return l.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var o=e.getUTCDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return vo(i,t.length);case"co":return l.ordinalNumber(i,{unit:"day"});case"ccc":return l.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(o,{width:"narrow",context:"standalone"});case"cccccc":return l.day(o,{width:"short",context:"standalone"});case"cccc":default:return l.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return vo(o,t.length);case"io":return l.ordinalNumber(o,{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,o=e.getUTCHours();switch(n=12===o?"noon":0===o?"midnight":o/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,o=e.getUTCHours();switch(n=o>=17?"evening":o>=12?"afternoon":o>=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 vo(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 vo(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):vo(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):vo(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return vo(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return vo(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return vo(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return fo(o);case"XXXX":case"XX":return go(o);case"XXXXX":case"XXX":default:return go(o,":")}},x:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return fo(o);case"xxxx":case"xx":return go(o);case"xxxxx":case"xxx":default:return go(o,":")}},O:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Eo(o,":");case"OOOO":default:return"GMT"+go(o,":")}},z:function(e,t,l,n){var o=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Eo(o,":");case"zzzz":default:return"GMT"+go(o,":")}},t:function(e,t,l,n){return vo(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return vo((n._originalDate||e).getTime(),t.length)}};function Eo(e,t){var l=e>0?"-":"+",n=Math.abs(e),o=Math.floor(n/60),i=n%60;if(0===i)return l+String(o);var a=t||"";return l+String(o)+a+vo(i,2)}function fo(e,t){return e%60==0?(e>0?"-":"+")+vo(Math.abs(e)/60,2):go(e,t)}function go(e,t){var l=t||"",n=e>0?"-":"+",o=Math.abs(e);return n+vo(Math.floor(o/60),2)+l+vo(o%60,2)}function _o(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 ho(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 Ao={p:ho,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],o=n[1],i=n[2];if(!i)return _o(e,t);switch(o){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}}",_o(o,t)).replace("{{time}}",ho(i,t))}},No=["D","DD"],So=["YY","YYYY"];function bo(e){return-1!==No.indexOf(e)}function yo(e){return-1!==So.indexOf(e)}function Co(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 Oo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Do=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,To=/^'([^]*?)'?$/,Lo=/''/g,Io=/[a-zA-Z]/;function wo(e,t,l){zn(2,arguments);var n=String(t),o=l||{},i=o.locale||oo,a=i.options&&i.options.firstWeekContainsDate,r=null==a?1:jn(a),u=null==o.firstWeekContainsDate?r:jn(o.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=i.options&&i.options.weekStartsOn,s=null==d?0:jn(d),c=null==o.weekStartsOn?s:jn(o.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!i.localize)throw new RangeError("locale must contain localize property");if(!i.formatLong)throw new RangeError("locale must contain formatLong property");var m=Vn(e);if(!Kn(m))throw new RangeError("Invalid time value");var v=Yn(m),p=io(m,v),E={firstWeekContainsDate:u,weekStartsOn:c,locale:i,_originalDate:m},f=n.match(Do).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Ao[t])(e,i.formatLong,E):e}).join("").match(Oo).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return Po(l);var a=po[n];if(a)return!o.useAdditionalWeekYearTokens&&yo(l)&&Co(l,t,e),!o.useAdditionalDayOfYearTokens&&bo(l)&&Co(l,t,e),a(p,l,i.localize,E);if(n.match(Io))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return f}function Po(e){return e.match(To)[1].replace(Lo,"'")}const Ro={step:1,isValid:!1,formData:{},coordinates:{},ownerPhotos:[],ownerIds:[]},xo=function(e,t){switch(void 0===e&&(e=Ro),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 Ro;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}},Bo=["path","url"],Fo=[],Mo=()=>{var e,l,a,r,u,d,s,c;const v=o.useRouteMatch(),{path:p}=v,E=(m(v,Bo),i.useTranslation(),null===(e=Digit)||void 0===e||null===(l=e.ComponentRegistryService)||void 0===l?void 0:l.getComponent("NewNOCStepperForm")),f=Digit.ComponentRegistryService.getComponent("NOCResponseCitizen"),g=Digit.ComponentRegistryService.getComponent("NOCCitizenMyApplications"),_=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(o.Switch,null,n.createElement(t.AppContainer,null,(void 0===(N=Fo)&&(N=[]),N.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:g}),n.createElement(t.PrivateRoute,{path:p+"/edit-application/:id",component:h}),n.createElement(t.PrivateRoute,{path:p+"/search/application-overview/:id",component:_}),n.createElement(t.PrivateRoute,{path:p+"/search-application",component:A}))));var N},ko=e=>{let{children:t,currentStep:l=1,stepsList:o=[]}=e;const{t:a}=i.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=o.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({},(i=t+1<=l,g=t===v-1,{display:"flex",alignItems:"center",justifyContent:"flex-start",flex:"0 0 auto",color:i?"#0D43A7":"#9CA3AF",padding:"14px 12px",width:"260px",marginBottom:g?"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(o[t].stepLabel))));var i,g})),n.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px",background:"transparent"}},t))},Uo=e=>{let{stepsList:t=[],onSubmit:l,step:o,setStep:a}=e;const r=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function d(){o<r.length?c():o===r.length&&l()}function s(){o>1&&m()}const c=()=>a(o+1),m=()=>a(o-1);return n.createElement(ko,{currentStep:o,nextStep:c,prevStep:m,stepsList:r},(()=>{var e,t;const l=r[o-1],{component:i,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(i);return n.createElement(n.Fragment,null,n.createElement(v,{config:{key:a,texts:c,component:i,currStepNumber:o,currStepConfig:m},onGoNext:d,onBackClick:s,t:u}))})())},Ho=[{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"}]}],Wo=(e,t)=>({type:"UPDATE_NOCNewApplication_FORM",payload:{key:e,value:t}}),jo=e=>({type:"SET_NOCNewApplication_STEP",payload:e}),zo=(e,t)=>({type:"UPDATE_NOCNewApplication_CoOrdinates",payload:{key:e,value:t}}),Vo=(e,t)=>({type:"UPDATE_NOC_OwnerPhotos",payload:{key:e,value:t}}),Go=(e,t)=>({type:"UPDATE_NOC_OwnerIds",payload:{key:e,value:t}}),Yo=[{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:Ho.filter(t=>t.stepNumber===e.stepNumber)})),qo=()=>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"})),Ko=e=>n.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},n.createElement(qo,null)),$o=e=>{let{key:a="cpt",closeModal:r,onPropertySelect:u,tenantId:d}=e;const{t:m}=i.useTranslation(),v=l.useRef(null);s.useDispatch();let{state:p}=o.useLocation();p=p&&("string"==typeof p||p instanceof String)?JSON.parse(p):p;const E=d||(window.location.href.includes("employee")?Digit.ULBService.getCurrentPermanentCity():localStorage.getItem("CITIZEN.CITY")),[f,g]=l.useState(!1),[_,h]=l.useState(""),[A,N]=l.useState(""),[S,b]=l.useState(""),[y,C]=l.useState(null),[O,D]=l.useState([]),[T,L]=l.useState(!1),[I,w]=l.useState({}),P=window.Digit.Utils.browser.isMobile(),[R,x]=l.useState(!1),B=[{Header:m("Property ID"),accessor:"propertyId",Cell:e=>{let{value:t}=e;return t||m("CS_NA")}},{Header:m("Mobile Number"),accessor:"owners",id:"mobileNumber",Cell:e=>{var t;let l,{value:n}=e;return l=1===(null==n?void 0:n.length)?null==n?void 0:n[0]:(null==n?void 0:n.find(e=>null==e?void 0:e.isPrimaryOwner))||(null==n?void 0:n[0]),(null===(t=l)||void 0===t?void 0:t.mobileNumber)||""}},{Header:m("Owner"),accessor:"owners",id:"ownerName",Cell:e=>{var t;let l,{value:n}=e;return l=1===(null==n?void 0:n.length)?null==n?void 0:n[0]:(null==n?void 0:n.find(e=>null==e?void 0:e.isPrimaryOwner))||(null==n?void 0:n[0]),(null===(t=l)||void 0===t?void 0:t.name)||""}},{Header:m("Address"),accessor:"address",Cell:e=>{let{value:t}=e;const{doorNo:l,buildingName:n,city:o,state:i}=t||{};return[l,n,o,i].filter(Boolean).join(", ")||"-"}},{Header:m("Plot Area"),accessor:"landArea",Cell:e=>{let{value:t}=e;return t||m("CS_NA")}},{Header:m(""),accessor:"id",Cell:e=>{let{value:l}=e;return n.createElement(t.SubmitBar,{label:m("Select"),onSubmit:()=>{const e=null==O?void 0:O.find(e=>(null==e?void 0:e.id)===l);u(e),r()},style:{width:"100px"}})}}],{data:F,isLoading:M}=Digit.Hooks.useBoundaryLocalities(E,"revenue",{},m);return l.useEffect(()=>{if(y){const e=setTimeout(()=>{C(null)},3e3);return()=>clearTimeout(e)}},[y]),M?n.createElement(t.Loader,null):n.createElement(n.Fragment,null,n.createElement(t.Modal,{className:"property-search-modal",headerBarEnd:n.createElement(Ko,{onClick:r}),formId:"modal-action",popupStyles:{width:"unset",minWidth:"1000px",padding:"20px"},hideSubmit:!0},n.createElement(t.LabelFieldPair,null,n.createElement("div",{className:"field ndc_property_search",style:c({display:"flex",gap:"16px",width:"100%"},P?{flexDirection:"column"}:{}),ref:v,id:"search-property-field"},n.createElement(t.TextInput,{key:"id",value:_,onChange:e=>{h(e.target.value)},disable:!1,placeholder:m("PT_PROPERTY_ID_PLACEHOLDER"),defaultValue:void 0}),n.createElement(t.TextInput,{key:"mobileNumber",value:A,onChange:e=>{N(e.target.value)},disable:!1,maxlength:10,placeholder:m("NOC_OWNER_MOBILE_NO_PLACEHOLDER"),defaultValue:void 0}),n.createElement(t.TextInput,{key:"name",value:S,onChange:e=>{b(e.target.value)},disable:!1,placeholder:m("BPA_ENTER_APPLICANT_NAME_PLACEHOLDER"),defaultValue:void 0}),n.createElement(t.Dropdown,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll",marginTop:"20px"},isMandatory:!1,option:F.sort((e,t)=>e.name.localeCompare(t.name)),selected:I,optionKey:"i18nkey",select:function(e){w(e)},t:m,placeholder:m("BPA_LOC_MOHALLA_LABEL")}),!R&&n.createElement("button",{className:"submit-bar",type:"button",style:{color:"white",width:"100%",maxWidth:"100px"},onClick:function(){try{return A&&!Digit.Utils.getPattern("MobileNo").test(A)?(C({error:!0,label:"CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID"}),Promise.resolve()):!S||null!=I&&I.code?S||_||A||null==I||!I.code?(L(!0),Promise.resolve(Pt(function(){var e;return Promise.resolve(Digit.PTService.search({tenantId:E,filters:c({},(null==_?void 0:_.length)>0?{propertyIds:_}:{},(null==A?void 0:A.length)>0?{mobileNumber:A}:{},(null==I||null===(e=I.code)||void 0===e?void 0:e.length)>0?{locality:null==I?void 0:I.code}:{},(null==S?void 0:S.length)>0?{name:S}:{})})).then(function(e){var t;(null==e||null===(t=e.Properties)||void 0===t?void 0:t.length)>0?(L(!1),D(null==e?void 0:e.Properties)):(L(!1),C({error:!0,label:"CS_PT_NO_PROPERTIES_FOUND"}))})},function(e){L(!1),C({error:!0,label:m(e.message)})}))):(C({error:!0,label:"CAN_NOT_SEARCH_ONLY_BASED_ON_LOCALITY"}),Promise.resolve()):(C({error:!0,label:"PLEASE_SELECT_LOCALITY_WITH_NAME"}),Promise.resolve())}catch(e){return Promise.reject(e)}}},""+m("PT_SEARCH")))),(null==O?void 0:O.length)>0&&n.createElement(t.StatusTable,null,T?n.createElement(t.Loader,null):n.createElement(t.Table,{className:"customTable table-border-style",t:m,data:O,columns:B,getCellProps:()=>({style:{}}),disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1})),y&&n.createElement(t.Toast,{isDleteBtn:!0,labelstyle:{width:"100%"},error:y.error,warning:y.warning,label:m(y.label),onClose:()=>{C(null)}})))},Xo=[{i18nKey:"NOC_OWNER_TYPE_INDIVIDUAL",code:"Individual",value:"Individual"},{i18nKey:"NOC_OWNER_TYPE_FIRM",code:"Firm",value:"Firm"}],Zo=e=>{const{t:o,currentStepData:i,Controller:a,control:r,setValue:u,errors:d,reset:m,useFieldArray:v,watch:p,ownerIdList:E,setOwnerIdList:f,ownerPhotoList:g,setOwnerPhotoList:_}=e,h=Digit.ULBService.getCurrentTenantId(),A=Digit.ULBService.getStateId(),[N,S]=(s.useDispatch(),l.useState(!1)),[b,y]=l.useState(!1),[C,O]=l.useState(null),D=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return k({key:"true",error:!0,message:o("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{k(null)},3e3),Promise.resolve();const n=Rt(function(){return Pt(function(){return S(!0),Promise.resolve(Digit.UploadServices.Filestorage("CLU",l,A)).then(function(t){var n,i;if(S(!1),(null==t||null===(n=t.data)||void 0===n||null===(i=n.files)||void 0===i?void 0:i.length)>0){const n=t.data.files[0].fileStoreId;f(t=>{const o=[...t],i={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Id":"Owner"+(e+1)+" Id",documentUid:n};return e<=(null==o?void 0:o.length)?o[e]=i:o.push(i),o}),k({key:"true",success:!0,message:o("FILE_UPLOAD_SUCCESS")})}else k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(){S(!1),k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{k(null)},3e3),e)throw t;return t});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},T=e=>{const t=null==g?void 0:g.filter((t,l)=>l!==e);_(t)},L=e=>{const t=null==E?void 0:E.filter((t,l)=>l!==e);f(t)},I=e=>function(t){try{const l=t.target.files[0];if(l&&l.size>5242880)return k({key:"true",error:!0,message:o("FILE_SIZE_EXCEEDS_5MB")}),setTimeout(()=>{k(null)},3e3),Promise.resolve();const n=Rt(function(){return Pt(function(){return S(!0),Promise.resolve(Digit.UploadServices.Filestorage("NOC",l,A)).then(function(t){var n,i;if(S(!1),(null==t||null===(n=t.data)||void 0===n||null===(i=n.files)||void 0===i?void 0:i.length)>0){const n=t.data.files[0].fileStoreId;_(t=>{const o=[...t],i={filestoreId:n,fileName:l.name,documentType:0===e?"Primary Owner Photo":"Owner"+(e+1)+" Photo",documentUid:n};return e<=(null==o?void 0:o.length)?o[e]=i:o.push(i),o}),k({key:"true",success:!0,message:o("FILE_UPLOAD_SUCCESS")})}else k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(){S(!1),k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})},function(e,t){if(setTimeout(()=>{k(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:w}=Digit.Hooks.obps.useMDMS(A,"common-masters",["GenderType"]);let P=[];w&&w["common-masters"].GenderType.filter(e=>e.active).map(e=>{P.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})});const R=e=>{if(!e)return null;const t="string"==typeof e?e:null==e?void 0:e.code;return P.find(e=>e.code===t)||null},{fields:x,append:B,remove:F}=v({control:r,name:"owners"});l.useEffect(()=>{console.log("currentStepData1",i);const e=null==i?void 0:i.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||"",PropertyOwnerName:e.PropertyOwnerName||"",PropertyOwnerMobileNumber:e.PropertyOwnerMobileNumber||"",PropertyOwnerAddress:e.PropertyOwnerAddress||"",PropertyOwnerPlotArea:e.PropertyOwnerPlotArea||null,gender:R(e.gender),dateOfBirth:e.dateOfBirth||e.dob||"",address:e.address||e.permanentAddress||"",ownerType:e.ownerType?Xo.find(t=>{var l;return(null==t?void 0:t.code)===(null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)}):null})):[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",PropertyOwnerName:"",PropertyOwnerMobileNumber:"",PropertyOwnerAddress:"",PropertyOwnerPlotArea:null,gender:null,dateOfBirth:"",address:"",ownerType:null}];m(c({},e,{owners:t}))},[i,u,B,m]);const[M,k]=l.useState(null),U=window.location.pathname.includes("edit");return console.log("ownerIdList (local)==>",E),console.log("ownerPhotoList (local)==>",g),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},o("NOC_APPLICANT_DETAILS")),n.createElement("div",null,U&&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"),x.map((e,s)=>{var c,m,v,f,_,h,N,S,b,C,w,B,M,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te;return n.createElement("div",{key:e.id},n.createElement(t.CardSubHeader,null,0===s?o("NOC_PRIMARY_OWNER"):o("Owner")+" "+(s+1)),n.createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,cursor:"pointer"},onClick:()=>(e=>{var t,l;L(e),T(e),null==i||null===(t=i.applicationDetails)||void 0===t||null===(l=t.owners)||void 0===l||l.filter((t,l)=>l!==e),F(e)})(s)},!U&&x.length>1&&"❌"),0===s&&n.createElement(t.LabelFieldPair,{style:{position:"relative",zIndex:"101",marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_OWNER_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].ownerType",rules:{required:o("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{t:o,option:Xo,optionKey:"i18nKey",select:t=>{e.onChange(t)},selected:e.value,disabled:U})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},(null==d||null===(c=d.owners)||void 0===c||null===(m=c[s])||void 0===m||null===(v=m.ownerType)||void 0===v?void 0:v.message)||""))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("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["+s+"].mobileNumber",rules:{required:o("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:o("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:o,disabled:U})}),n.createElement("div",{style:{marginTop:"17px"},className:"search-icon",onClick:U?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(Pt(function(){return Promise.resolve(Digit.UserService.userSearch(A,{userName:t},{})).then(function(t){var l,n,o,i,a;const r=null!=(l=null==t?void 0:t.user)?l:[];if(!r.length)return void k({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!=(o=d.emailId)?o:"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+e+"].fatherOrHusbandName",null!=(i=d.fatherOrHusbandName)?i:"",{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=R(d.gender);u("owners["+e+"].gender",m,{shouldValidate:!0,shouldDirty:!0})})},function(){k({key:"true",error:!0,message:o("FILE_UPLOAD_FAILED")})})):(k({key:"true",error:!0,message:"INVALID_MOBILE_NUMBER"}),Promise.resolve())}catch(e){return Promise.reject(e)}}(s)}," ",n.createElement(t.SearchIcon,null)," ")),(null==d||null===(f=d.owners)||void 0===f||null===(_=f[s])||void 0===_?void 0:_.mobileNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].mobileNumber.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_FIRM_OWNER_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].ownerOrFirmName",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)},t:o,disabled:U})}),(null==d||null===(h=d.owners)||void 0===h||null===(N=h[s])||void 0===N?void 0:N.ownerOrFirmName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].ownerOrFirmName.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].emailId",rules:{required:o("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:o("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:o,disabled:U})}),(null==d||null===(S=d.owners)||void 0===S||null===(b=S[s])||void 0===b?void 0:b.emailId)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].emailId.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].fatherOrHusbandName",rules:{pattern:{value:/^[A-Za-z\s]+$/,message:o("ONLY_ENGLISH_LETTERS_ALLOWED")},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)},t:o})}),(null==d||null===(C=d.owners)||void 0===C||null===(w=C[s])||void 0===w?void 0:w.fatherOrHusbandName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].fatherOrHusbandName.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].address",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)},t:o})}),(null==d||null===(B=d.owners)||void 0===B||null===(M=B[s])||void 0===M?void 0:M.address)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].address.message))),0===s&&n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_PROPERTY_ID_LABEL")),n.createElement("div",{className:"field"},n.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px"}},p("owners["+s+"].propertyId")&&n.createElement(t.StatusTable,{style:{marginBottom:"1rem"}},n.createElement(t.Row,{className:"border-none",label:o("PROPERTY_ID"),text:p("owners["+s+"].propertyId")}),n.createElement(t.Row,{label:o("PROPERTY_OWNER_NAME"),text:p("owners["+s+"].PropertyOwnerName")})," ",n.createElement(t.Row,{label:o("PROPERTY_OWNER_MOBILE_NUMBER"),text:p("owners["+s+"].PropertyOwnerMobileNumber")})," ",n.createElement(t.Row,{label:o("WS_PROPERTY_ADDRESS_LABEL"),text:p("owners["+s+"].PropertyOwnerAddress")})," ",n.createElement(t.Row,{label:o("PROPERTY_PLOT_AREA"),text:p("owners["+s+"].PropertyOwnerPlotArea")})),n.createElement(a,{control:r,name:"owners["+s+"].propertyId",rules:{maxLength:{value:100,message:o("MAX_100_CHARACTERS_ALLOWED")}},render:e=>n.createElement(l.Fragment,null,n.createElement(t.TextInput,{style:{display:"none"},value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t),t:o}),n.createElement(t.TextInput,{value:e.value,onChange:t=>e.onChange(t.target.value),onBlur:t=>e.onBlur(t)}))}),n.createElement("button",{type:"button",className:"submit-bar",style:{marginBottom:"1rem",width:"100%"},onClick:()=>{O(s),y(!0)}},o("PT_SEARCH_PROPERTY")),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerName",rules:{maxLength:{value:100,message:o("MAX_100_CHARACTERS_ALLOWED")}}}),(null==d||null===(H=d.owners)||void 0===H||null===(W=H[s])||void 0===W?void 0:W.PropertyOwnerName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerName.message),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerMobileNumber",rules:{pattern:{value:/^[6-9]\d{9}$/,message:o("INVALID_MOBILE_NUMBER")}}}),(null==d||null===(j=d.owners)||void 0===j||null===(z=j[s])||void 0===z?void 0:z.PropertyOwnerMobileNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerMobileNumber.message),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerAddress",rules:{maxLength:{value:500,message:o("MAX_500_CHARACTERS_ALLOWED")}}}),(null==d||null===(V=d.owners)||void 0===V||null===(G=V[s])||void 0===G?void 0:G.PropertyOwnerAddress)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerAddress.message),n.createElement(a,{control:r,name:"owners["+s+"].PropertyOwnerPlotArea",rules:{pattern:{value:/^[0-9]*\.?[0-9]+$/,message:o("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:o("MAX_100_CHARACTERS_ALLOWED")}}}),(null==d||null===(Y=d.owners)||void 0===Y||null===(q=Y[s])||void 0===q?void 0:q.PropertyOwnerPlotArea)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].PropertyOwnerPlotArea.message)))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_DOB_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].dateOfBirth",rules:{required:o("REQUIRED_FIELD"),validate:e=>{const t=new Date,l=new Date(e),n=t.getFullYear()-l.getFullYear(),i=t.getMonth()-l.getMonth(),a=t.getDate()-l.getDate();return n>=18||18===n&&(i>0||0===i&&a>=0)||o("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:U})}),(null==d||null===(K=d.owners)||void 0===K||null===($=K[s])||void 0===$?void 0:$.dateOfBirth)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].dateOfBirth.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+o("NOC_APPLICANT_GENDER_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(a,{control:r,name:"owners["+s+"].gender",rules:{required:o("REQUIRED_FIELD")},render:e=>n.createElement(t.RadioButtons,{t:o,options:P,optionsKey:"code",value:e.value,selectedOption:e.value,onSelect:t=>{e.onChange(t)},isDependent:!0,disabled:U})}),(null==d||null===(X=d.owners)||void 0===X||null===(Z=X[s])||void 0===Z?void 0:Z.gender)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},d.owners[s].gender.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},o("NOC_APPLICANT_PASSPORT_PHOTO"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(Pn,{id:"passport-photo-"+s,onUpload:I(s),onDelete:()=>{T(s)},uploadedFile:null==g||null===(J=g[s])||void 0===J?void 0:J.filestoreId,message:null!=g&&null!==(Q=g[s])&&void 0!==Q&&Q.filestoreId?"1 "+o("FILEUPLOADED"):o("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:"image/*",disabled:U}))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"15px",marginTop:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},o("NOC_APPLICANT_ID_PROOF"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field",style:{width:"100%"}},n.createElement(Pn,{id:"id-proof-"+s,onUpload:D(s),onDelete:()=>{L(s)},uploadedFile:null==E||null===(ee=E[s])||void 0===ee?void 0:ee.filestoreId,message:null!=E&&null!==(te=E[s])&&void 0!==te&&te.filestoreId?"1 "+o("FILEUPLOADED"):o("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:"",accept:".pdf",disabled:U}))))})),n.createElement("div",null,n.createElement("button",{type:"button",onClick:()=>B({mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",PropertyOwnerName:"",PropertyOwnerMobileNumber:"",PropertyOwnerAddress:"",PropertyOwnerPlotArea:null,gender:null,dateOfBirth:"",address:"",ownerType:null}),style:{cursor:"pointer"}},!U&&"➕ Add Owner")),M&&n.createElement(t.Toast,{error:null==M?void 0:M.error,warning:null==M?void 0:M.warning,label:o(null==M?void 0:M.message),isDleteBtn:!0,onClose:()=>{k(null)}}),b&&n.createElement($o,{closeModal:()=>y(!1),onPropertySelect:e=>{if(console.log("property",e),null!==C&&null!=e&&e.propertyId){var t,l,n,o,i;const a=(null==e||null===(t=e.owners)||void 0===t?void 0:t.map(e=>null==e?void 0:e.name).filter(Boolean).join(", "))||"";u("owners["+C+"].propertyId",e.propertyId,{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerName",a||"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerMobileNumber",(null==e||null===(l=e.owners)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.mobileNumber)||"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerAddress",(null==e||null===(o=e.owners)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.permanentAddress)||"",{shouldValidate:!0,shouldDirty:!0}),u("owners["+C+"].PropertyOwnerPlotArea",(null==e?void 0:e.landArea)||null,{shouldValidate:!0,shouldDirty:!0})}},formData:i,setApiLoading:S,tenantId:h}))},Jo=e=>{var o,i,a,r,u,d;const{t:s,currentStepData:c,Controller:m,control:v,setValue:p,errors:E}=e,f=window.localStorage.getItem("CITIZEN.CITY"),[g,_]=l.useState(null),[h,A]=l.useState(null),[N,S]=l.useState(null),[b,y]=l.useState(null),C=Digit.UserService.getUser(),O=null==C||null===(o=C.info)||void 0===o||null===(i=o.roles)||void 0===i?void 0:i.find(e=>"BPA_ARCHITECT"===(null==e?void 0:e.code)),{data:D}=Digit.Hooks.obps.useBPAREGSearch(O?"pb.punjab":f,{},{mobileNumber:null==C||null===(a=C.info)||void 0===a?void 0:a.mobileNumber},{cacheTime:0});return l.useEffect(()=>{console.log("currentStepData2",c);const e=null==c?void 0:c.applicationDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;p(t,l)})},[c,p]),l.useEffect(()=>{if(D)for(let o=0;o<(null==D||null===(e=D.Licenses)||void 0===e?void 0:e.length);o++){var e,t,l;if("APPROVED"===(null==D||null===(t=D.Licenses)||void 0===t||null===(l=t[o])||void 0===l?void 0:l.status)){var n;_(null==D||null===(n=D.Licenses)||void 0===n?void 0:n[o]);break}}},[D]),l.useEffect(()=>{var e,t,l,n,o,i,a,r;g&&(A(O?null==g||null===(a=g.tradeLicenseDetail)||void 0===a||null===(r=a.additionalDetail)||void 0===r?void 0:r.counsilForArchNo:null==g?void 0:g.licenseNumber),S((null==g||null===(e=g.tradeLicenseDetail)||void 0===e||null===(t=e.owners)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.permanentAddress)||(null==g||null===(n=g.tradeLicenseDetail)||void 0===n||null===(o=n.owners)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.correspondenceAddress)),y(Digit.DateUtils.ConvertEpochToDate(null==g?void 0:g.validTo)))},[g]),l.useEffect(()=>{h&&(p("professionalRegId",h,{shouldValidate:!0,shouldDirty:!1}),p("professionalAddress",N),p("professionalRegIdValidity",b,{shouldValidate:!0,shouldDirty:!1}))},[N,h,p,b]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,{className:"card-section-header"},s("NOC_PROFESSIONAL_DETAILS")),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,null,""+s("NOC_PROFESSIONAL_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalName",defaultValue:null==C||null===(r=C.info)||void 0===r?void 0:r.name,rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("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:s,disabled:"true"})}),(null==E?void 0:E.professionalName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalName.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_EMAIL_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalEmailId",defaultValue:null==C||null===(u=C.info)||void 0===u?void 0:u.emailId,rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:s("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:s,disabled:"true"})}),(null==E?void 0:E.professionalEmailId)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalEmailId.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalRegId",rules:{required:s("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:"true"})}),(null==E?void 0:E.professionalRegId)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalRegId.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalRegIdValidity",rules:{required:s("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:s,disabled:"true"})}),(null==E?void 0:E.professionalRegIdValidity)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalRegIdValidity.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalMobileNumber",defaultValue:null==C||null===(d=C.info)||void 0===d?void 0:d.mobileNumber,rules:{required:s("REQUIRED_FIELD"),pattern:{value:/^[6-9]\d{9}$/,message:s("INVALID_MOBILE_NUMBER")}},render:e=>n.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:s,disable:"true"})}),(null==E?void 0:E.professionalMobileNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalMobileNumber.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+s("NOC_PROFESSIONAL_ADDRESS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(m,{control:v,name:"professionalAddress",rules:{required:s("REQUIRED_FIELD"),maxLength:{value:100,message:s("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:s,disabled:"true",disable:"true"})}),(null==E?void 0:E.professionalAddress)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},E.professionalAddress.message))))},Qo=e=>{var o,i,a,r,u,d,s;let m;m=window.location.pathname.includes("employee")?window.localStorage.getItem("Employee.tenant-id"):window.localStorage.getItem("CITIZEN.CITY");const v=Digit.ULBService.getStateId(),{t:p,currentStepData:E,Controller:f,control:g,setValue:_,errors:h,errorStyle:A,useFieldArray:N,watch:b}=e,[y,C]=l.useState("0.00"),O=b("netTotalArea"),D=b("areaLeftForRoadWidening");l.useEffect(()=>{const e=parseFloat(O),t=parseFloat(D),l=((isNaN(e)?0:e)-(isNaN(t)?0:t)).toFixed(2);C(l),_("netPlotAreaAfterWidening",l)},[O,D]);const[T,L]=l.useState(""),{fields:I,append:w,remove:P}=N({control:g,name:"floorArea"}),R=b("floorArea"),x=b("basementArea");l.useEffect(()=>{const e=null==R?void 0:R.reduce((e,t)=>{const l=parseFloat(null==t?void 0:t.value);return e+(isNaN(l)?0:l)},0),t=isNaN(x)?0:x,l=(e+parseFloat(t)).toFixed(2);L(l),_("totalFloorArea",l)},[R,x]);const[B,F]=l.useState((null==E||null===(o=E.siteDetails)||void 0===o?void 0:o.ulbName)||null),[M,k]=l.useState((null==E||null===(i=E.siteDetails)||void 0===i?void 0:i.ulbType)||""),[U,H]=l.useState((null==E||null===(a=E.siteDetails)||void 0===a?void 0:a.buildingStatus)||null),{data:W,isLoading:j}=Digit.Hooks.noc.useBuildingType(v);let{data:z,isLoading:V}=Digit.Hooks.noc.useRoadType(v);console.log("roadType",z);const{data:G,isLoading:Y}=Digit.Hooks.useTenants(),q=null==G?void 0:G.map(e=>c({},e,{displayName:p(e.i18nKey)})),K=l.useMemo(()=>null==z?void 0:z.slice().sort((e,t)=>e.name.localeCompare(t.name)),[z]);l.useEffect(()=>{if(B){var e;const t=null==B||null===(e=B.city)||void 0===e?void 0:e.ulbType;k(t),_("ulbType",t)}},[B,_]);const[$,X]=l.useState((null==E||null===(r=E.siteDetails)||void 0===r?void 0:r.isBasementAreaAvailable)||null),Z=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],J=Digit.Hooks.noc.useTenants();console.log("allcities",J);const[Q,ee]=l.useState(J),{data:te,isLoading:le}=Digit.Hooks.useCustomMDMS(v,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+m+"')]"}]),[ne,oe]=l.useState((null==E||null===(u=E.siteDetails)||void 0===u?void 0:u.district)||null);return console.log("selectedCity",ne),l.useEffect(()=>{if(m&&(null==J?void 0:J.length)>0){var e,t;const l=null===(e=J.find(e=>e.code===m))||void 0===e||null===(t=e.city)||void 0===t?void 0:t.districtName;console.log("defaultCity",l),l&&(oe(l),_("district",l))}},[m,J]),l.useEffect(()=>{const e=null==E?void 0:E.siteDetails;if(e&&(Object.entries(e).forEach(e=>{let[t,l]=e;"floorArea"!==t&&_(t,l)}),Array.isArray(e.floorArea))){for(let e=I.length-1;e>=0;e--)P(e);e.floorArea.forEach(e=>{w({value:e.value||""})})}},[E,_,w,P]),n.createElement(n.Fragment,null,n.createElement("div",{style:{marginBottom:"16px"}},n.createElement(t.CardSectionHeader,{className:"card-section-header"},p("NOC_SITE_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_PLOT_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"plotNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.plotNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.plotNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},p("NOC_PROPOSED_SITE_ADDRESS"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"proposedSiteAddress",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:200,message:p("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!=h&&h.proposedSiteAddress?h.proposedSiteAddress.message:""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ULB_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!Y&&n.createElement(f,{control:g,name:"ulbName",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{F(t),e.onChange(t)},selected:e.value,option:q,optionKey:"displayName",t:p})}),n.createElement(t.CardLabelError,{style:{fontSize:"12px",marginTop:"4px"}},null!=h&&h.ulbName?h.ulbName.message:""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ULB_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"ulbType",render:e=>n.createElement(t.TextInput,{value:M||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_KHASRA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"khasraNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:500,message:p("MAX_500_CHARACTERS_ALLOWED")}},render:e=>n.createElement(t.TextArea,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),(null==h?void 0:h.khasraNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.khasraNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_HADBAST_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"hadbastNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("MAX_100_CHARACTERS_ALLOWED")},pattern:{value:/^[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),(null==h?void 0:h.hadbastNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.hadbastNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ROAD_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!V&&n.createElement(f,{control:g,name:"roadType",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:K,optionKey:"name",t:p})}),(null==h?void 0:h.roadType)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.roadType.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_NET_TOTAL_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"netTotalArea",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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==h||null===(d=h.netTotalArea)||void 0===d?void 0:d.message)||""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"areaLeftForRoadWidening",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.areaLeftForRoadWidening)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.areaLeftForRoadWidening.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"netPlotAreaAfterWidening",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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)},disable:"true"})}),(null==h?void 0:h.netPlotAreaAfterWidening)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.netPlotAreaAfterWidening.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ROAD_WIDTH_AT_SITE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"roadWidthAtSite",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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!=h&&h.roadWidthAtSite?h.roadWidthAtSite.message:""))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_BUILDING_STATUS_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!j&&n.createElement(f,{control:g,name:"buildingStatus",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{H(t),e.onChange(t)},selected:e.value,option:W,optionKey:"name",t:p})}),(null==h?void 0:h.buildingStatus)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.buildingStatus.message))),"BUILTUP"===(null==U?void 0:U.code)&&n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"isBasementAreaAvailable",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{X(t),e.onChange(t)},selected:e.value,option:Z,optionKey:"i18nKey",t:p})}),(null==h?void 0:h.ulbName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.ulbName.message))),"BUILTUP"===(null==U?void 0:U.code)&&"YES"===(null==$?void 0:$.code)&&n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_BASEMENT_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"basementArea",rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("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!=h&&h.basementArea?h.basementArea.message:""))),"BUILTUP"===(null==U?void 0:U.code)&&I.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(f,{control:g,name:"floorArea."+l+".value",defaultValue:e.value,rules:{required:p("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:p("MAX_100_CHARACTERS_ALLOWED")}},render:e=>{var o,i;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==h||null===(o=h.floorArea)||void 0===o||null===(i=o[l])||void 0===i?void 0:i.value)&&n.createElement(t.CardLabelError,{className:A},h.floorArea[l].value.message))}}),n.createElement("button",{type:"button",onClick:()=>P(l)},"❌")))),"BUILTUP"===(null==U?void 0:U.code)&&n.createElement("button",{type:"button",onClick:()=>w({value:""})},"➕ Add Floor"),"BUILTUP"===(null==U?void 0:U.code)&&n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"totalFloorArea",defaultValue:T,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,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_WARD_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"wardNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.wardNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.wardNo.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_DISTRICT_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"district",rules:{required:p("REQUIRED_FIELD")},render:e=>n.createElement(t.TextInput,{className:"form-field",value:ne||e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},disable:"true"})}),(null==h?void 0:h.district)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.district.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_ZONE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!le&&n.createElement(f,{control:g,name:"zone",rules:{required:p("REQUIRED_FIELD")},render:e=>{var l,o,i;return n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:null==te||null===(l=te.tenant)||void 0===l||null===(o=l.zoneMaster)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.zones,optionKey:"code",t:p})}}),(null==h?void 0:h.zone)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.zone.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_VILLAGE_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"villageName",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.villageName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.villageName.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_COLONY_NAME_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"colonyName",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.colonyName)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.colonyName.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_VASIKA_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"vasikaNumber",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("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)}})}),(null==h?void 0:h.vasikaNumber)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.vasikaNumber.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_VASIKA_DATE"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"vasikaDate",rules:{required:p("REQUIRED_FIELD"),validate:e=>{}},render:e=>n.createElement(t.TextInput,{type:"date",value:S(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]})}),(null==h?void 0:h.vasikaDate)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},null==h||null===(s=h.vasikaDate)||void 0===s?void 0:s.message))),n.createElement(t.LabelFieldPair,{style:{marginBottom:"20px"}},n.createElement(t.CardLabel,{className:"card-label-smaller"},""+p("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(f,{control:g,name:"khewatAndKhatuniNo",rules:{required:p("REQUIRED_FIELD"),maxLength:{value:100,message:p("MAX_100_CHARACTERS_ALLOWED")},pattern:{value:/^[0-9]+$/,message:p("ONLY_NUMERIC_VALUES_ALLOWED")}},render:e=>n.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),(null==h?void 0:h.khewatAndKhatuniNo)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},h.khewatAndKhatuniNo.message)))),n.createElement(t.BreakLine,null)))},ei=e=>{var o;const{t:i,currentStepData:a,Controller:r,control:u,setValue:d,errors:s}=e,c=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[m,v]=l.useState((null==a||null===(o=a.siteDetails)||void 0===o?void 0:o.specificationBuildingCategory)||null),{data:p,isLoading:E}=Digit.Hooks.noc.useBuildingCategory(c),{data:f,isLoading:g}=Digit.Hooks.noc.useNocType(c),_=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}];return l.useEffect(()=>{console.log("currentStepData4",a);const e=null==a?void 0:a.siteDetails;e&&Object.entries(e).forEach(e=>{let[t,l]=e;d(t,l)})},[a,d]),n.createElement(n.Fragment,null,n.createElement(t.CardSectionHeader,null,i("NOC_SPECIFICATION_DETAILS")),n.createElement("div",null,n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(r,{control:u,name:"specificationPlotArea",rules:{required:i("REQUIRED_FIELD"),pattern:{value:/^[0-9]*\.?[0-9]+$/,message:i("ONLY_NUMERIC_VALUES_ALLOWED_MSG")},maxLength:{value:100,message:i("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:i})}),(null==s?void 0:s.specificationPlotArea)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationPlotArea.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_BUILDING_CATEGORY_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!E&&p.length>0&&n.createElement(r,{control:u,name:"specificationBuildingCategory",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:t=>{v(t),e.onChange(t)},selected:e.value,option:p,optionKey:"name",t:i})}),(null==s?void 0:s.specificationBuildingCategory)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationBuildingCategory.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_NOC_TYPE_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},!g&&n.createElement(r,{control:u,name:"specificationNocType",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:f,optionKey:"name",t:i})}),(null==s?void 0:s.specificationNocType)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationNocType.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_RESTRICTED_AREA_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(r,{control:u,name:"specificationRestrictedArea",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:_,optionKey:"i18nKey",t:i})}),(null==s?void 0:s.specificationRestrictedArea)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationRestrictedArea.message))),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"card-label-smaller"},""+i("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),n.createElement("span",{className:"requiredField"},"*")),n.createElement("div",{className:"field"},n.createElement(r,{control:u,name:"specificationIsSiteUnderMasterPlan",rules:{required:i("REQUIRED_FIELD")},render:e=>n.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:_,optionKey:"i18nKey",t:i})}),(null==s?void 0:s.specificationIsSiteUnderMasterPlan)&&n.createElement("p",{style:{color:"red",marginTop:"4px",marginBottom:"0"}},s.specificationIsSiteUnderMasterPlan.message)))))};function ti(e){var l,i,a,r,u,d,c,m,v,p,E,f,g,_,h,A,N,S,b,y,C,O,D,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne;let{currentStepData:Se,t:be}=e;o.useLocation(),o.useHistory(),s.useDispatch(),console.log("formData in Summary Page",Se);const ye=s.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)||{}}),Ce=s.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=s.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 De=e=>{if(0===e)return be("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+" "+be("NOC_FLOOR_AREA_LABEL")},Te=(Digit.UserService.getUser(),e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t});let Le=null==Se||null===(l=Se.documents)||void 0===l||null===(i=l.documents)||void 0===i?void 0:i.documents;console.log("documents here in summary",Le);const Ie=null==Se||null===(a=Se.documents)||void 0===a||null===(r=a.documents)||void 0===r||null===(u=r.documents)||void 0===u?void 0:u.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),we=null==Se||null===(d=Se.documents)||void 0===d||null===(c=d.documents)||void 0===c||null===(m=c.documents)||void 0===m?void 0:m.filter(e=>!("OWNER.SITEPHOTOGRAPHONE"===(null==e?void 0:e.documentType)||"OWNER.SITEPHOTOGRAPHTWO"===(null==e?void 0:e.documentType))),Pe=null==Se||null===(v=Se.applicationDetails)||void 0===v||null===(p=v.owners)||void 0===p?void 0:p[0];return n.createElement("div",{className:"employee-main-application-details"},n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("OWNER_OWNERPHOTO")),n.createElement(t.StatusTable,null,n.createElement(On,{ownerFileStoreId:null==Ce||null===(E=Ce.ownerPhotoList)||void 0===E||null===(f=E[0])||void 0===f?void 0:f.filestoreId,ownerName:null==Se||null===(g=Se.applicationDetails)||void 0===g||null===(_=g.owners)||void 0===_||null===(h=_[0])||void 0===h?void 0:h.ownerOrFirmName}))),null===(A=null!=(N=null==Se||null===(S=Se.applicationDetails)||void 0===S?void 0:S.owners)?N:[])||void 0===A?void 0:A.map((e,l)=>{var o,i;return n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?be("NOC_PRIMARY_OWNER"):"Owner "+(l+1)),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_OWNER_TYPE_LABEL"),text:(null==e||null===(o=e.ownerType)||void 0===o?void 0:o.i18nKey)||"N/A"}),n.createElement(t.Row,{label:be("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:be("BPA_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_DOB_LABEL"),text:Te(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(i=e.gender)||void 0===i?void 0:i.code)||"N/A"}),n.createElement(t.Row,{label:be("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"})))}),Pe&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_PROPERTY_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==Pe?void 0:Pe.propertyId)||"N/A"}),n.createElement(t.Row,{label:be("PROPERTY_OWNER_NAME"),text:(null==Pe?void 0:Pe.PropertyOwnerName)||"N/A"}),n.createElement(t.Row,{label:be("PROPERTY_OWNER_MOBILE_NUMBER"),text:(null==Pe?void 0:Pe.PropertyOwnerMobileNumber)||"N/A"}),n.createElement(t.Row,{label:be("WS_PROPERTY_ADDRESS_LABEL"),text:(null==Pe?void 0:Pe.PropertyOwnerAddress)||"N/A"}),n.createElement(t.Row,{label:be("PROPERTY_PLOT_AREA"),text:(null==Pe?void 0:Pe.PropertyOwnerPlotArea)||"N/A"}))),(null==Se||null===(b=Se.applicationDetails)||void 0===b?void 0:b.professionalName)&&n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_PROFESSIONAL_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==Se||null===(y=Se.applicationDetails)||void 0===y?void 0:y.professionalName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==Se||null===(C=Se.applicationDetails)||void 0===C?void 0:C.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==Se||null===(O=Se.applicationDetails)||void 0===O?void 0:O.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),text:(null==Se||null===(D=Se.applicationDetails)||void 0===D?void 0:D.professionalRegIdValidity)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==Se||null===(T=Se.applicationDetails)||void 0===T?void 0:T.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==Se||null===(L=Se.applicationDetails)||void 0===L?void 0:L.professionalAddress)||"N/A"})))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_SITE_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_PLOT_NO_LABEL"),text:(null==Se||null===(I=Se.siteDetails)||void 0===I?void 0:I.plotNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_PROPOSED_SITE_ADDRESS"),text:(null==Se||null===(w=Se.siteDetails)||void 0===w?void 0:w.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ULB_NAME_LABEL"),text:(null==Se||null===(P=Se.siteDetails)||void 0===P||null===(R=P.ulbName)||void 0===R?void 0:R.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ULB_TYPE_LABEL"),text:(null==Se||null===(x=Se.siteDetails)||void 0===x?void 0:x.ulbType)||"N/A"}),n.createElement(t.Row,{label:be("NOC_KHASRA_NO_LABEL"),text:(null==Se||null===(B=Se.siteDetails)||void 0===B?void 0:B.khasraNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_HADBAST_NO_LABEL"),text:(null==Se||null===(F=Se.siteDetails)||void 0===F?void 0:F.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ROAD_TYPE_LABEL"),text:(null==Se||null===(M=Se.siteDetails)||void 0===M||null===(k=M.roadType)||void 0===k?void 0:k.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==Se||null===(U=Se.siteDetails)||void 0===U?void 0:U.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:be("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==Se||null===(H=Se.siteDetails)||void 0===H?void 0:H.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:be("NOC_NET_TOTAL_AREA_LABEL"),text:(null==Se||null===(W=Se.siteDetails)||void 0===W?void 0:W.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==Se||null===(j=Se.siteDetails)||void 0===j?void 0:j.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:be("NOC_BUILDING_STATUS_LABEL"),text:(null==Se||null===(z=Se.siteDetails)||void 0===z||null===(V=z.buildingStatus)||void 0===V?void 0:V.name)||"N/A"}),(null==Se||null===(G=Se.siteDetails)||void 0===G?void 0:G.isBasementAreaAvailable)&&n.createElement(t.Row,{label:be("NOC_IS_BASEMENT_AREA_PRESENT_LABEL"),text:(null==Se||null===(Y=Se.siteDetails)||void 0===Y||null===(q=Y.isBasementAreaAvailable)||void 0===q?void 0:q.code)||"N/A"}),(null==Se||null===(K=Se.siteDetails)||void 0===K?void 0:K.basementArea)&&n.createElement(t.Row,{label:be("NOC_BASEMENT_AREA_LABEL"),text:(null==Se||null===($=Se.siteDetails)||void 0===$?void 0:$.basementArea)||"N/A"}),"BUILTUP"===(null==Se||null===(X=Se.siteDetails)||void 0===X||null===(Z=X.buildingStatus)||void 0===Z?void 0:Z.code)&&(null==Se||null===(J=Se.siteDetails)||void 0===J||null===(Q=J.floorArea)||void 0===Q?void 0:Q.map((e,l)=>n.createElement(t.Row,{label:De(l),text:(null==e?void 0:e.value)||"N/A"}))),"BUILTUP"===(null==Se||null===(ee=Se.siteDetails)||void 0===ee||null===(te=ee.buildingStatus)||void 0===te?void 0:te.code)&&n.createElement(t.Row,{label:be("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==Se||null===(le=Se.siteDetails)||void 0===le?void 0:le.totalFloorArea)||"N/A"}),n.createElement(t.Row,{label:be("NOC_DISTRICT_LABEL"),text:(null==Se||null===(ne=Se.siteDetails)||void 0===ne?void 0:ne.district)||"N/A"}),n.createElement(t.Row,{label:be("NOC_ZONE_LABEL"),text:(null==Se||null===(oe=Se.siteDetails)||void 0===oe||null===(ie=oe.zone)||void 0===ie?void 0:ie.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_WARD_NO_LABEL"),text:(null==Se||null===(ae=Se.siteDetails)||void 0===ae?void 0:ae.wardNo)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==Se||null===(re=Se.siteDetails)||void 0===re?void 0:re.villageName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_COLONY_NAME_LABEL"),text:(null==Se||null===(ue=Se.siteDetails)||void 0===ue?void 0:ue.colonyName)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_VASIKA_NO_LABEL"),text:(null==Se||null===(de=Se.siteDetails)||void 0===de?void 0:de.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:be("NOC_VASIKA_DATE"),text:(null==Se||null===(se=Se.siteDetails)||void 0===se?void 0:se.vasikaDate)||"N/A"}),n.createElement(t.Row,{label:be("NOC_SITE_KHEWAT_AND_KHATUNI_NO_LABEL"),text:(null==Se||null===(ce=Se.siteDetails)||void 0===ce?void 0:ce.khewatAndKhatuniNo)||"N/A"}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_SPECIFICATION_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:be("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==Se||null===(me=Se.siteDetails)||void 0===me?void 0:me.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:be("NOC_BUILDING_CATEGORY_LABEL"),text:(null==Se||null===(ve=Se.siteDetails)||void 0===ve||null===(pe=ve.specificationBuildingCategory)||void 0===pe?void 0:pe.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_NOC_TYPE_LABEL"),text:(null==Se||null===(Ee=Se.siteDetails)||void 0===Ee||null===(fe=Ee.specificationNocType)||void 0===fe?void 0:fe.name)||"N/A"}),n.createElement(t.Row,{label:be("NOC_RESTRICTED_AREA_LABEL"),text:(null==Se||null===(ge=Se.siteDetails)||void 0===ge||null===(_e=ge.specificationRestrictedArea)||void 0===_e?void 0:_e.code)||"N/A"}),n.createElement(t.Row,{label:be("NOC_IS_SITE_UNDER_MASTER_PLAN_LABEL"),text:(null==Se||null===(he=Se.siteDetails)||void 0===he||null===(Ae=he.specificationIsSiteUnderMasterPlan)||void 0===Ae?void 0:Ae.code)||"N/A"}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("BPA_UPLOADED _SITE_PHOTOGRAPHS_LABEL")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==Ie?void 0:Ie.length)>0&&(null==Ie?void 0:Ie.map(e=>n.createElement(Fn,{filestoreId:null==e?void 0:e.filestoreId,documentType:null==e?void 0:e.documentType,coordinates:ye}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==Oe||null===(Ne=Oe.ownerIdList)||void 0===Ne?void 0:Ne.length)>0&&n.createElement(bn,{documents:null==Oe?void 0:Oe.ownerIdList}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,be("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==we?void 0:we.length)>0&&n.createElement(bn,{documents:we}))))}function li(e){var o;let{t:i,document:a,setDocuments:r,setError:d,documents:s,action:m,formData:v,handleSubmit:p,geocoordinates:E,setGeoCoordinates:f,dispatch:g}=e;const _=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],[h,A]=(Digit.ULBService.getCurrentTenantId(),l.useState(_?c({},_,{active:!0===(null==a?void 0:a.active),code:null==_?void 0:_.documentType}):1===(null==a||null===(o=a.dropdownData)||void 0===o?void 0:o.length)?null==a?void 0:a.dropdownData[0]:{})),[N,S]=l.useState(null),[b,y]=l.useState(()=>(null==_?void 0:_.filestoreId)||null);function C(e){const t=e.target.files[0];S(t),console.log("selectedFile here",t),t&&"image/jpeg"===t.type&&function(e){return console.log("file",e),new Promise(t=>{try{u.getData(e,function(){const e=u.getTag(this,"GPSLatitude"),l=u.getTag(this,"GPSLongitude");if(console.log("lat====",e),e&&l){const n=P(e).toFixed(6),o=P(l).toFixed(6);t({latitude:n,longitude:o})}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?(g(zo("Latitude1",e.latitude)),g(zo("Longitude1",e.longitude)),f(t=>c({},t,{Latitude1:e.latitude,Longitude1:e.longitude}))):(window.location.pathname.includes("edit")&&(g(zo("Latitude1","")),g(zo("Longitude1",""))),alert("Please upload a photo with location details."))),"OWNER.SITEPHOTOGRAPHTWO"===(null==a?void 0:a.code)&&(null!==e.latitude&&null!==e.longitude?(g(zo("Latitude2",e.latitude)),g(zo("Longitude2",e.longitude)),f(t=>c({},t,{Latitude2:e.latitude,Longitude2:e.longitude}))):(window.location.pathname.includes("edit")&&(g(zo("Latitude2","")),g(zo("Longitude2",""))),alert("Please upload a photo with location details.")))})}const{dropdownData:O}=a;var D=O;const[T,L]=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==s?void 0:s.length)>0&&(console.log("documents here",s),p())},[s]),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=D.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),y(null==l?void 0:l.fileStoreId)):L(!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{d(null);const e=function(){if(N){w(!0);const e=function(){if(N.size>=5242880)w(!1),d(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Pt(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId())).then(function(e){var t,l,n,o;w(!1),(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?y(null==e||null===(n=e.data)||void 0===n||null===(o=n.files[0])||void 0===o?void 0:o.fileStoreId):d(i("CS_FILE_UPLOAD_ERROR"))})},function(){w(!1),d(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),l.useEffect(()=>{T&&y(null)},[T]),n.createElement("div",{className:"bpa-doc-required-wrapper"},I&&n.createElement(t.Loader,null),n.createElement(t.LabelFieldPair,null,n.createElement(t.CardLabel,{className:"bpa-doc-required-label"},i(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(Pn,"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:C,onDelete:()=>{y(null)},uploadedFile:b,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".jpg, .jpeg, .png"}:{id:"noc-doc",onUpload:C,onDelete:()=>{y(null)},uploadedFile:b,message:b?"1 "+i("CS_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},accept:".pdf, .jpeg, .jpg, .png"})),n.createElement("p",{style:{padding:"10px",fontSize:"14px"}},i("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 ni=n.memo(function(e){var o,i,a;let{t:r,document:d,setDocuments:s,documents:m,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:E,handleSubmit:f}=e;console.log("documents here",m);const g=(null==m?void 0:m.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.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==d?void 0:d.code)})[0]);console.log("filteredDocument here",g);const _=Digit.ULBService.getStateId(),[h,A]=l.useState(g?c({},g,{active:!0,code:null==g?void 0:g.documentType,i18nKey:null==g?void 0:g.documentType}):(null==d||null===(o=d.dropdownData)||void 0===o?void 0:o.length)>0?null==d?void 0:d.dropdownData[0]:{}),[N,S]=l.useState(null),[b,y]=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==d?void 0:d.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[C,O]=l.useState([]),[D,T]=l.useState([]),[L,I]=l.useState([]||(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===h.code))),[w,P]=l.useState(null),[R,x]=l.useState(null);function B(e){return e[0]+e[1]/60+e[2]/3600}l.useEffect(()=>{(null==m?void 0:m.length)>0&&f()},[m]),l.useEffect(()=>{D.length>0&&null!=h&&h.code&&(s(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 D&&D.map((e,t)=>{var n,o;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=L[t])||void 0===n?void 0:n.name)||"",id:m?null===(o=m.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===o?void 0:o.id:void 0})}),console.log("newfiles here",l),[...t,...l]}),T([])),null!=h&&h.code&&s(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,o,i;(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===(o=h.code)||void 0===o?void 0:o.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==h?void 0:h.code),null!=e&&null!==(i=e.file)&&void 0!==i&&i.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==N?void 0:N.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||T([...D,b])},[b]);const F=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:_}}])),console.log("selectedUplDocs here",l),l},[v]);return n.createElement("div",null,n.createElement(t.CardLabel,null,null!=d&&d.required?r(null==d?void 0:d.code)+" *":""+r(null==d?void 0:d.code)),n.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:_,getFormState:function(e){let t,l,n=h.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{try{u.getData(e,function(){const e=u.getTag(this,"GPSLatitude"),l=u.getTag(this,"GPSLongitude");if(e&&l){const n=B(e),o=B(l);t({latitude:n,longitude:o})}else t({latitude:null,longitude:null}),"OWNER.SITEPHOTOGRAPHONE"===(null==d?void 0:d.code)&&alert("Please Upload a Photo with Location Details")})}catch(e){t({latitude:null,longitude:null})}})})(e[0][1].file).then(o=>{var i,a,r;console.log("Latitude:",o.latitude),console.log("Longitude:",o.longitude),P(o.latitude),x(o.longitude),"OWNER.SITEPHOTOGRAPHONE"===(null==d?void 0:d.code)&&(null!==o.latitude&&null!==o.longitude?(sessionStorage.setItem("Latitude",o.latitude),sessionStorage.setItem("Longitude",o.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),l=Object.values(t),l=null==v||null===(i=v.documents)||void 0===i||null===(a=i.documents)||void 0===a?void 0:a.filter(e=>e.documentType===h.code),O(l);let u=[];null==e||e.map((e,t)=>{var l,n,i,a;u.push({documentType:null==h?void 0:h.code,additionalDetails:{category:null==h?void 0:h.code.split(".").slice(0,2).join("_"),latitude:o.latitude,longitude:o.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===(i=e[1].fileStoreId)||void 0===i?void 0:i.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),...u];s(c),null===(r=l)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=n,function(e,t){e&&S(e.file),e&&I([...L,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)];s(e)}},setuploadedstate:F,t:r,extraStyleName:"NOC",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==d||null===(a=d.uploadedDocuments)||void 0===a?void 0:a.length)&&n.createElement(xl,{isSendBackFlow:!0,documents:null==d?void 0:d.uploadedDocuments}),"OWNER.SITEPHOTOGRAPHONE"===(null==d?void 0:d.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)," ")))}),oi=[{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==Ho?void 0:Ho.filter(t=>(null==t?void 0:t.stepNumber)===(null==e?void 0:e.stepNumber))})),ii=["tenantId","payments","pdfkey","EmpData"],ai=e=>{var o,r;const{register:u,setValue:d,getValues:s,reset:c,formState:m}=a.useFormContext(),{t:v}=i.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,{className:"fields",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===(o=m.errors)||void 0===o||null===(r=o.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"))))},ri=["currentlyActiveMobileModal"],ui=["currentlyActiveMobileModal"],di=e=>{var o,r;let{SearchFormFieldsComponent:u,propsMobileInboxCards:d,isLoading:s,data:v,onSubmit:p}=e;const{t:E}=i.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=()=>{_({type:"remove"})},A=()=>n.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:h},n.createElement(t.CloseSvg,null)),N=l.useCallback(e=>{let{currentlyActiveMobileModal:l}=e;return(e=>{let{currentlyActiveMobileModal:l}=e,o=m(e,ri);const{closeMobilePopupModal:i}=o;switch(l){case"SearchFormComponent":return n.createElement(t.SearchForm,o,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:i}));default:return n.createElement("span",null)}})(c({currentlyActiveMobileModal:l},m(e,ui)))},[g]);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:()=>_({type:"set",payload:"SearchFormComponent"})})),g?n.createElement(t.PopUp,null,n.createElement(N,{onSubmit:e=>{_({type:"remove"}),p(e)},handleSubmit:f,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",currentlyActiveMobileModal:g,closeMobilePopupModal:h})):null,null!=v&&null!==(o=v[0])&&void 0!==o&&o.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")}))},si=e=>{let{columns:o,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:g}=i.useTranslation(),_=()=>{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 N(e){v("limit",Number(e.target.value)),m(u)()}function S(){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 y=()=>{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}},g(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:g,data:d,columns:o,getCellProps:e=>({style:{minWidth:e.column.Header===g("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:N,currentPage:E,onNextPage:S,onPrevPage:b,pageSizeLimit:Number(p("limit")),onSort:A,totalRecords:c,disableSort:!1,onLastPage:_,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(y,null))},ci=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}=i.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(o.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(),g=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(di,{SearchFormFieldsComponent:ai,propsMobileInboxCards:g,isLoading:s,data:u,getRedirectionLink:()=>"noc/inbox/application-overview",onSubmit:r}):n.createElement(si,{columns:E,SearchFormFieldsComponent:ai,onSubmit:r,data:u,error:d,isLoading:s,Count:c}))},mi=e=>{let{matchPath:l}=e;const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("NOC_MODULE",{});useEffect(()=>{u()},[]);const d=[{link:l+"/noc/new-application",i18nKey:o("NOC_NEW_APPLICATION")},{link:l+"/noc/my-application",i18nKey:o("NOC_MY_APPLICATION")},{link:l+"/noc/search-application",i18nKey:o("NOC_SEARCH_APPLICATION")}];return n.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_NOC"),links:d,Icon:()=>n.createElement(t.CaseIcon,{className:"fill-path-primary-main"})})},vi=e=>{let{stateCode:l,userType:i,tenants:a}=e;const{path:r}=o.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"===i?n.createElement(Mo,null):n.createElement(kt,{path:r,stateCode:l})},pi={NOCModule:vi,NOCCard:()=>{var e,a;const{t:r}=i.useTranslation(),u=o.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 g=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,g):null},NOCLinks:mi,NOCApplicationOverview:()=>{var e,a,r,u,d,s,m,p,f;const{id:g}=o.useParams(),{t:_}=i.useTranslation(),h=Digit.ULBService.getCurrentTenantId(),A=null==h?void 0:h.split(".")[0],[N,S]=l.useState({}),[b,y]=l.useState(null),C={},[O]=l.useState(()=>(null==C?void 0:C.fileStoreId)||null),[D,T]=l.useState(null),[L,I]=l.useState([]),[w,P]=l.useState([]),[R,x]=l.useState([]),[B,F]=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:$}=Digit.Hooks.noc.useNOCDetails(_,h,{applicationNo:g}),{mutate:X}=Digit.Hooks.noc.useNOCApplicationActions(h),Z=Digit.Hooks.useWorkflowDetails({tenantId:h,id:g,moduleCode:"NOC"});var J,Q;null!=Z&&null!==(e=Z.data)&&void 0!==e&&null!==(a=e.actionState)&&void 0!==a&&a.nextActions&&!Z.isLoading&&(Z.data.actionState.nextActions=[...null==Z||null===(r=Z.data)||void 0===r?void 0:r.nextActions]),Z&&Z.data&&!Z.isLoading&&(Z.data.initialActionState=(null==Z||null===(J=Z.data)||void 0===J?void 0:J.initialActionState)||c({},null==Z||null===(Q=Z.data)||void 0===Q?void 0:Q.actionState)||{},Z.data.actionState=c({},Z.data)),l.useEffect(()=>{P([null==$?void 0:$.applicationData])},[null==$?void 0:$.applicationData]),l.useEffect(()=>{var e;x(null==Y||null===(e=Y.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[Y]),l.useEffect(()=>{var e;F(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 o=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!=o&&null!==(l=o[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[0]&&(o[0].docTypes[0].nocType=o[0].nocType,o[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(o[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let l=e.documentType;e.dropdownData=[],B.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,B]),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:o,nocDataDetails:i,nocDocumentsList:a}=e;if(null!=i&&i.length&&null!=a&&a.length&&null!=(null==i?void 0:i[0])){var r,u,d,s,c,m,p,f,g,_,h,A,N,S,b,y,C,O,I,w;const e="WF_"+(null==i||null===(r=i[0])||void 0===r?void 0:r.additionalDetails.workflowCode)+"_"+(null==i||null===(u=i[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"}},""+o("NOC_MAIN_"+E(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:""+o("NOC_"+(null==i||null===(s=i[0])||void 0===s?void 0:s.nocType)+"_APPLICATION_LABEL"),text:o(null==i||null===(c=i[0])||void 0===c?void 0:c.applicationNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_STATUS_LABEL"),text:o(e)||"NA",textStyle:"APPROVED"==(null==i||null===(m=i[0])||void 0===m?void 0:m.applicationStatus)||"AUTO_APPROVED"==(null==i||null===(p=i[0])||void 0===p?void 0:p.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_SUBMITED_ON_LABEL"),text:null!=i&&null!==(f=i[0])&&void 0!==f&&null!==(g=f.additionalDetails)&&void 0!==g&&g.SubmittedOn?v(Number(null==i||null===(_=i[0])||void 0===_||null===(h=_.additionalDetails)||void 0===h?void 0:h.SubmittedOn)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVAL_NO_LABEL"),text:(null==i||null===(A=i[0])||void 0===A?void 0:A.nocNo)||"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("NOC_APPROVED_ON_LABEL"),text:"APPROVED"===e||"REJECTED"===e||"AUTO_APPROVED"===e||"AUTO_REJECTED"===e?v(Number(null==i||null===(N=i[0])||void 0===N||null===(S=N.auditDetails)||void 0===S?void 0:S.lastModifiedTime)):"NA"}),n.createElement(t.Row,{className:"border-none",label:""+o("Documents"),text:""})),null!=i&&null!==(b=i[0])&&void 0!==b&&b.documents&&(null==i||null===(y=i[0])||void 0===y?void 0:y.documents.length)>0?n.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null==i||null===(C=i[0])||void 0===C||null===(O=C.documents)||void 0===O?void 0:O.map((e,l)=>{var i,r;return n.createElement("a",{target:"_",href:null===(i=U[e.fileStoreId])||void 0===i?void 0:i.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"}},o("NOC_MAIN_"+E(null==a||null===(r=a[0])||void 0===r?void 0:r.code,".","_")+"_LABEL")))})):n.createElement("div",null,n.createElement("p",null,o("BPA_NO_DOCUMENTS_UPLOADED_LABEL"))),n.createElement("div",null,(null==Z||null===(I=Z.data)||void 0===I||null===(w=I.nextActions)||void 0===w?void 0:w.length)>0?null==L?void 0:L.map((e,t)=>n.createElement(_n,{key:t,document:e,t:o,error:D,setError:T,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:""+_(null==e?void 0:e.title),text:(null==e?void 0:e.value)||"NA"})))))}))};return l.useEffect(()=>{if($){var e;V(!0);const{applicationDetails:t}=$;S(c({},$,{applicationDetails:[null===(e=te(t))||void 0===e?void 0:e[0],{title:"NOC_DETAILS_SUMMARY_LABEL",belowComponent:()=>n.createElement(ee,{t:_,data:$,nocDataDetails:w,nocDocumentsList:L})}]})),V(!1)}},[$,L,w,O,W,U]),n.createElement("div",{className:"employee-main-application-details"},n.createElement("div",null,n.createElement(t.Header,{styles:{fontSize:"32px"}},_("NOC_APP_OVER_VIEW_HEADER"))),n.createElement(gn,{applicationDetails:N,isLoading:K||z,isDataLoading:K,applicationData:null==$?void 0:$.applicationData,mutate:X,workflowDetails:Z,businessService:null!=Z&&null!==(d=Z.data)&&void 0!==d&&d.applicationBusinessService?null==Z||null===(s=Z.data)||void 0===s?void 0:s.applicationBusinessService:null==$||null===(m=$.applicationData)||void 0===m?void 0:m.businessService,moduleCode:"NOC",ActionBarStyle:G?{}:{paddingRight:"50px"},MenuStyle:G?{}:{right:"50px"},showToast:b,setShowToast:y,closeToast:()=>{y(null)},timelineStatusPrefix:"WF_"+(null==$||null===(p=$.applicationData)||void 0===p||null===(f=p.additionalDetails)||void 0===f?void 0:f.workflowCode)+"_"}))},NOCInbox:e=>{let{parentRoute:r}=e;const{t:u}=i.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:N,data:S}=Digit.Hooks.noc.useInbox({tenantId:d,filters:c({},g)});l.useEffect(()=>{S&&S.revalidate()},[]);const[b,y]=l.useState([]),[C,O]=l.useState([]),[D,T]=l.useState(0);l.useEffect(()=>{S&&(O((null==S?void 0:S.statuses)||[]),y((null==S?void 0:S.table)||[]),T((null==S?void 0:S.totalCount)||0))},[S]);const L={logoIcon:n.createElement(t.ComplaintIcon,null),headerText:"ACTION_TEST_NOC",links:[{text:u("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/noc/search/application"}]},I=l.useCallback(e=>{let{registerRef:t,searchFormState:l,searchFieldComponents:o}=e;return n.createElement(Hn,{registerRef:t,searchFormState:l,searchFieldComponents:o})},[]),w=l.useCallback(e=>{let{registerRef:t,controlFilterForm:l,setFilterFormValue:o,getFilterFormValue:i}=e;return n.createElement(Wn,{statuses:C,isInboxLoading:N,registerRef:t,controlFilterForm:l,setFilterFormValue:o,filterFormState:null==g?void 0:g.filterForm,getFilterFormValue:i,localitiesForEmployeesCurrentTenant:h,loadingLocalitiesForEmployeesCurrentTenant:A})},[C,N,h,A]),P={SearchFormFields:I,onSearchFormSubmit:e=>{console.log("data in OnSearchFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},v)}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==g?void 0:g.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:s})}},R={FilterFormFields:w,onFilterFormSubmit:e=>{console.log("data in OnFilterFormSubmit",e),e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:c({},v)}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==g?void 0:g.filterForm,resetFilterFormDefaultValues:m,onFilterFormReset:e=>{e("moduleName","noc-service"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),_({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:g}=i.useTranslation(),_=l.useMemo(()=>[{Header:g("NOC_APPLICATION_NUMBER"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return n.createElement("div",null,n.createElement(o.Link,{to:d+"/inbox/application-overview/"+t.original.applicationId},n.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:g("TL_COMMON_TABLE_COL_APP_DATE"),accessor:"applicationDate",Cell:e=>{var t,l;let{row:o}=e;return null!==(t=o.original)&&void 0!==t&&t.date?(e=>n.createElement("span",{className:"cell-text styled-cell"},e))(wo(new Date(null===(l=o.original)||void 0===l?void 0:l.date),"dd/MM/yyyy")):""}},{Header:g("NOC_PRIMARY_OWNER_NAME_LABEL"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:g("PT_COMMON_TABLE_COL_STATUS_LABEL"),accessor:e=>g(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:_}})(c({},{parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:c({},g.tableForm,{limit:e.target.value})})},formState:g,totalCount:D,table:b,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";g.tableForm.sortBy===t&&g.tableForm.sortOrder===n||_({action:"mutateTableForm",data:c({},g.tableForm,{sortBy:t,sortOrder:l?"DESC":"ASC"})})}}})),B=(e=>{let{parentRoute:l,table:o}=e;const{t:r}=i.useTranslation();return{data:null==o?void 0:o.map(e=>{let{applicationId:t,date:l,status:n,owner:o}=e;return{[r("NOC_APPLICATION_NUMBER")]:t,[r("TL_COMMON_TABLE_COL_APP_DATE")]:wo(new Date(l),"dd/MM/yyyy"),[r("NOC_PRIMARY_OWNER_NAME_LABEL")]:r(o),[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:o,value:i}=l;return n.createElement(t.RadioButtons,{onSelect:e=>{o(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:b}),F={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:c({},g.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==g?void 0:g.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:v})}};return n.createElement(l.Fragment,null,n.createElement(t.Header,null,u("ES_COMMON_INBOX"),D?n.createElement("p",{className:"inbox-count"},D):null),n.createElement(t.InboxComposer,c({isInboxLoading:N,PropsForInboxLinks:L},P,R,F,{propsForInboxTable:x,propsForInboxMobileCards:B,formState:g})))},NOCSearchApplication:It,NewNOCStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),a=s.useDispatch(),[r,u]=l.useState(null),d=s.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(Uo,{stepsList:Yo,onSubmit:e=>{console.log("dataGet===",e)},step:d,setStep:e=>{a(jo(e))}}),r&&n.createElement(t.Toast,{error:r.key,label:e(r.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewNOCStepFormOne:e=>{var o,r,u;let{config:d,onGoNext:m,onBackClick:v}=e;const p=s.useDispatch(),{t:E}=i.useTranslation(),[f,g]=l.useState(null),[_,h]=l.useState(""),[A,N]=l.useState([]),[S,b]=l.useState([]),y=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData}),C=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),O=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos});l.useEffect(()=>{yt.isEqual(A,C)||N(null==C?void 0:C.ownerIdList),yt.isEqual(S,O)||b(null==O?void 0:O.ownerPhotoList)},[C,O]);const D=Digit.UserService.getUser(),{control:T,handleSubmit:L,setValue:I,formState:{errors:w},trigger:P,watch:R,reset:x}=a.useForm({defaultValues:{owners:[{mobileNumber:"",ownerOrFirmName:"",emailId:"",fatherOrHusbandName:"",propertyId:"",gender:null,dateOfBirth:"",address:"",PropertyOwnerName:"",PropertyOwnerMobileNumber:"",PropertyOwnerAddress:"",PropertyOwnerPlotArea:null,ownerType:""}]}}),B={Controller:a.Controller,control:T,setValue:I,errors:w,trigger:P,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},reset:x,useFieldArray:a.useFieldArray,watch:R,config:d,ownerIdList:A,setOwnerIdList:N,ownerPhotoList:S,setOwnerPhotoList:b};function F(e){p(Wo(d.key,e)),p(Go("ownerIdList",A)),p(Vo("ownerPhotoList",S)),m()}function M(e){v(d.key,e)}const[k,U]=l.useState((null==y||null===(o=y.applicationDetails)||void 0===o?void 0:o.isRegisteredStakeHolder)||!1),H=Digit.ULBService.getStateId(),[W,j]=l.useState(!1),z=null==D||null===(r=D.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!=y&&null!==(e=y.applicationDetails)&&void 0!==e&&e.isRegisteredStakeHolder&&I("isRegisteredStakeHolder","true")},[]),n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:L(e=>{P(),function(e){var t,l,n,o,i;const a=null!=(t=null==S?void 0:S.length)?t:0,r=null!=(l=null==A?void 0:A.length)?l:0,u=null!=(n=null==e||null===(o=e.owners)||void 0===o?void 0:o.length)?n:0,d=new Set((null==e||null===(i=e.owners)||void 0===i?void 0:i.map(e=>null==e?void 0:e.mobileNumber))||[]).size!==u;return u!==a?(setTimeout(()=>{g(null)},3e3),g({key:"true",error:!0,message:E("UPLOAD_ALL_OWNER_PHOTOS_LABEL")}),!1):u!==r?(setTimeout(()=>{g(null)},3e3),g({key:"true",error:!0,message:E("UPLOAD_ALL_OWNER_IDS_LABEL")}),!1):!d||(setTimeout(()=>{g(null)},3e3),g({key:"true",error:!0,message:E("DUPLICATE_OWNER_FOUND_LABEL")}),!1)}(e)&&F(e)})},n.createElement("div",{className:"employeeCard"},k?n.createElement(n.Fragment,null,n.createElement(Jo,c({onGoBack:M,goNext:F,currentStepData:y,t:E},B)),n.createElement(Zo,c({onGoBack:M,goNext:F,currentStepData:y,t:E},B))):n.createElement(n.Fragment,null,n.createElement(Zo,c({onGoBack:M,goNext:F,currentStepData:y,t:E},B)))),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:()=>{g(null),h("")}}))},NewNOCStepFormTwo:e=>{let{config:o,onBackClick:r,onGoNext:u}=e;const{t:d}=i.useTranslation(),m=s.useDispatch(),[v,p]=l.useState(null),[E,f]=l.useState(""),{control:g,handleSubmit:_,setValue:h,formState:{errors:A},trigger:S,watch:b}=(Digit.UserService.getUser(),a.useForm({defaultValues:{floorArea:[{value:""}],vasikaNumber:"",vasikaDate:""}})),y=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData});console.log("currentStepData at step 2",y);const C=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerIds}),O=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.ownerPhotos}),D={Controller:a.Controller,control:g,setValue:h,errors:A,errorStyle:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"},useFieldArray:a.useFieldArray,watch:b};let T;T=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 I(e){m(Wo(o.key,e)),u()}function w(e){r(o.key,e)}return n.createElement(n.Fragment,null,n.createElement("form",{onSubmit:_(function(e){try{return S(),function(e){var t,l,n,o,i,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!==(o=n[0])&&void 0!==o&&o.value?parseFloat(null==e||null===(i=e.floorArea)||void 0===i||null===(a=i[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)?Promise.resolve(Pt(function(){return Promise.resolve(Digit.NOCService.NOCsearch({tenantId:T,filters:{vasikaNumber:null==e?void 0:e.vasikaNumber,vasikaDate:N(null==e?void 0:e.vasikaDate)}})).then(function(t){var l,n,i,a,r,d,s;const v=null!=(l=null==t?void 0:t.Noc)?l:[],E=null==y||null===(n=y.apiData)||void 0===n||null===(i=n.Noc)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.applicationNo;v.find(e=>(null==e?void 0:e.applicationNo)&&"REJECTED"!==(null==e?void 0:e.status)&&(null==e?void 0:e.applicationNo)!==E)?p({key:"true",error:!0,message:"Active application already exists..."}):(m(Wo(o.key,e)),null!=y&&null!==(r=y.apiData)&&void 0!==r&&null!==(d=r.Noc)&&void 0!==d&&null!==(s=d[0])&&void 0!==s&&s.applicationNo?u():function(e){try{var t,l,n,o,i,a,r,d,s,v,E,f,g,_,h,A,S,b,y,D,L,I,w,P,R,x;console.log("formData",e);const B={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===(o=n.roadType)||void 0===o?void 0:o.name)||"",buildingStatus:(null==e||null===(i=e.siteDetails)||void 0===i||null===(a=i.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?void 0:s.district)||"",zone:(null==e||null===(v=e.siteDetails)||void 0===v||null===(E=v.zone)||void 0===E?void 0:E.name)||"",vasikaDate:null!=e&&null!==(f=e.siteDetails)&&void 0!==f&&f.vasikaDate?N(null==e||null===(g=e.siteDetails)||void 0===g?void 0:g.vasikaDate):"",specificationBuildingCategory:(null==e||null===(_=e.siteDetails)||void 0===_||null===(h=_.specificationBuildingCategory)||void 0===h?void 0:h.name)||"",specificationNocType:(null==e||null===(A=e.siteDetails)||void 0===A||null===(S=A.specificationNocType)||void 0===S?void 0:S.name)||"",specificationRestrictedArea:(null==e||null===(b=e.siteDetails)||void 0===b||null===(y=b.specificationRestrictedArea)||void 0===y?void 0:y.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(D=e.siteDetails)||void 0===D||null===(L=D.specificationIsSiteUnderMasterPlan)||void 0===L?void 0:L.code)||""}),ownerPhotos:Array.isArray(null==O?void 0:O.ownerPhotoList)?O.ownerPhotoList:[],ownerIds:Array.isArray(null==C?void 0:C.ownerIdList)?C.ownerIdList:[]},F=null===(I=null!=(w=null==B||null===(P=B.applicationDetails)||void 0===P?void 0:P.owners)?w:[])||void 0===I?void 0:I.map((e,t)=>{var l,n,o;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==O||null===(n=O.ownerPhotoList)||void 0===n?void 0:n[t]),ownerId:c({},null==C||null===(o=C.ownerIdList)||void 0===o?void 0:o[t])}}}),M={Noc:{vasikaDate:N(null==e||null===(R=e.siteDetails)||void 0===R?void 0:R.vasikaDate),vasikaNumber:null==e||null===(x=e.siteDetails)||void 0===x?void 0:x.vasikaNumber,applicationType:"NEW",documents:[],nocType:"NOC",status:"ACTIVE",tenantId:T,owners:F,workflow:{action:"INITIATE"},nocDetails:{additionalDetails:B,tenantId:T}}};console.log("final Payload here==>",M);const k=Pt(function(){return Promise.resolve(Digit.NOCService.NOCcreate({tenantId:T,details:M})).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(Wo("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(k&&k.then?k.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(c({},y,{siteDetails:c({},e)})))})},function(){p({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})):Promise.resolve()}catch(e){return Promise.reject(e)}})},n.createElement("div",{className:"employeeCard"},n.createElement(Qo,c({onGoBack:w,goNext:I,currentStepData:y,t:d},D)),n.createElement(ei,c({onGoBack:w,goNext:I,currentStepData:y,t:d},D))),n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:w}),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:d(null==v?void 0:v.message),onClose:()=>{p(null)}}))},NewNOCStepFormThree:e=>{let{config:o,onGoNext:i,onBackClick:a,t:r}=e;const u=s.useDispatch(),[d,m]=l.useState(!1),[v,p]=l.useState(""),E=Digit.ULBService.getStateId(),{isLoading:f,data:g}=Digit.Hooks.pt.usePropertyMDMS(E,"NOC",["Documents"]),_=s.useSelector(function(e){return e.noc.NOCNewApplicationFormReducer.formData&&e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]?e.noc.NOCNewApplicationFormReducer.formData[null==o?void 0:o.key]:{}}),h=s.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",h);const A=s.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:o.currStepConfig,onSubmit:function(e){var t,l,n,o;const a=function(e){if(!f){var t,l,n,o,i,a,r;let u="VACANT"===(null==A||null===(t=A.siteDetails)||void 0===t||null===(l=t.buildingStatus)||void 0===l?void 0:l.code)?null==g||null===(n=g.NOC)||void 0===n?void 0:n.Documents.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==g||null===(o=g.NOC)||void 0===o?void 0:o.Documents;const d=(null==e||null===(i=e.documents)||void 0===i?void 0:i.documents)||[];(null==A||null===(a=A.applicationDetails)||void 0===a||null===(r=a.owners)||void 0===r?void 0:r.some(e=>{var t,l;const n=null!=(t=null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)?t:null==e?void 0:e.ownerType;return"firm"===String(n).toLowerCase()}))&&(u=u.map(e=>"OWNER.AUTHORIZATIONLETTER"===e.code?c({},e,{required:!0}):e));const s=u.filter(e=>e.required).map(e=>e.code),m=d.map(e=>e.documentType);return s.filter(e=>!m.includes(e))}}(e);return a.length>0?(p(r("NOC_PLEASE_ATTACH_LABEL")+" "+r(a[0].replace(".","_").toUpperCase())),m(!0),void setTimeout(()=>{m(!1),p("")},3e3)):null!=h&&null!==(t=h.Latitude1)&&void 0!==t&&t.trim()&&null!=h&&null!==(l=h.Latitude2)&&void 0!==l&&l.trim()&&null!=h&&null!==(n=h.Longitude1)&&void 0!==n&&n.trim()&&null!=h&&null!==(o=h.Longitude2)&&void 0!==o&&o.trim()?void i():(p(""+r("NOC_PLEASE_ATTACH_GEO_TAGGED_PHOTOS_LABEL")),m(!0),void setTimeout(()=>{m(!1),p("")},3e3))},onFormValueChange:function(e,t){yt.isEqual(t,_)||u(Wo(o.key,t))},label:r(""+o.texts.submitBarLabel),currentStep:o.currStepNumber,onBackClick:function(e){a(o.key,e)}}),d&&n.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:v,onClose:()=>{m(!1),p("")}}))},NewNOCStepFormFour:e=>{var i,a,r,u,d,m,v,p,E,f,g,_,h,A,S,b,y,C,O;let{config:D,onBackClick:T,t:L}=e;s.useDispatch();const[I,w]=l.useState(null),[P,R]=l.useState(""),[x,B]=l.useState(!1),F=window.location.pathname.includes("edit");console.log("selectedCheckBox",x);const M=s.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)||{}}),k=s.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)||{}}),U=s.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)||[]}),H=s.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)||[]}),W=l.useRef();let j=Digit.UserService.getUser();const z=null==j||null===(i=j.info)||void 0===i||null===(a=i.roles)||void 0===a?void 0:a.map(e=>e.code),[V,G]=l.useState(!1);Digit.Hooks.useClickOutside(W,()=>{G(!1)},V);const Y=o.useHistory();let q;q=window.location.href.includes("citizen")?window.localStorage.getItem("CITIZEN.CITY"):window.localStorage.getItem("Employee.tenant-id");const K=e=>{console.log("formData in parent SummaryPage",M),Q(M,e)},$=l.useMemo(()=>{var e,t,l,n,o,i;return{CalculationCriteria:[{applicationNumber:null==M||null===(e=M.apiData)||void 0===e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,tenantId:null==M||null===(n=M.apiData)||void 0===n||null===(o=n.Noc)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.tenantId,NOC:ee(M,{action:""}).Noc}]}},[M]),{isLoading:X,data:Z,revalidate:J}=Digit.Hooks.noc.useNOCFeeCalculator({payload:$},{enabled:!!$});l.useEffect(()=>{J()},[null==M?void 0:M.siteDetails,null==M?void 0:M.applicationDetails]),console.log("calculatorData",Z);const Q=function(e,t){try{var l,n,o,i;if(console.log("formData inside onSubmit",e),window.location.pathname.includes("edit")&&"EDIT"===t.action)return w({key:"true",warning:!0,message:"COMMON_SAVE_OR_RESUBMIT_LABEL"}),setTimeout(()=>{w(null)},3e3),Promise.resolve();const a=ee(e,t),r=(null==Z||null===(l=Z.Calculation)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.taxHeadEstimates)||[];a.Noc.nocDetails.additionalDetails.calculations=[{isLatest:!0,updatedBy:null===(o=Digit.UserService.getUser())||void 0===o||null===(i=o.info)||void 0===i?void 0:i.name,taxHeadEstimates:r}],console.log("finalPayload here==>",a);const u=Rt(function(){return Pt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:q,details:a})).then(function(e){var l,n,o,i,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?(w({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{Y.push("/digit-ui/citizen/noc/my-application")},3e3)):(console.log("We are calling citizen response page"),Y.replace({pathname:"/digit-ui/citizen/noc/response/"+(null==e||null===(n=e.Noc)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.applicationNo),state:{data:e}})):(console.log("we are calling employee response page"),"CANCEL"===t.action?(w({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),setTimeout(()=>{Y.push("/digit-ui/employee/noc/inbox")},3e3)):Y.replace({pathname:"/digit-ui/employee/noc/response/"+(null==e||null===(i=e.Noc)||void 0===i||null===(a=i[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),w({key:"true",error:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}))})},function(e){console.log("errors here in goNext - catch block",e),w({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{w(null)},3e3),e)throw t;return t});return Promise.resolve(u&&u.then?u.then(function(){}):void 0)}catch(e){return Promise.reject(e)}};function ee(e,t){var l,n,o,i,a,r,u,d,s,m,v,p,E,f,g,_,h,A,S,b,y,C,O,D,T,L,I,w,P,R,x,B,W,j;console.log("nocFormData",e);const z=c({},null==e||null===(l=e.apiData)||void 0===l||null===(n=l.Noc)||void 0===n?void 0:n[0],{vasikaNumber:(null==e||null===(o=e.siteDetails)||void 0===o?void 0:o.vasikaNumber)||"",vasikaDate:null!=e&&null!==(i=e.siteDetails)&&void 0!==i&&i.vasikaDate?N(null==e||null===(a=e.siteDetails)||void 0===a?void 0:a.vasikaDate):"",workflow:{action:(null==t?void 0:t.action)||""},nocDetails: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:c({},null==e||null===(s=e.apiData)||void 0===s||null===(m=s.Noc)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.nocDetails.additionalDetails,{applicationDetails:c({},null==e?void 0:e.applicationDetails),siteDetails:c({},null==e?void 0:e.siteDetails,{ulbName:(null==e||null===(p=e.siteDetails)||void 0===p||null===(E=p.ulbName)||void 0===E?void 0:E.name)||"",roadType:(null==e||null===(f=e.siteDetails)||void 0===f||null===(g=f.roadType)||void 0===g?void 0:g.name)||"",buildingStatus:(null==e||null===(_=e.siteDetails)||void 0===_||null===(h=_.buildingStatus)||void 0===h?void 0:h.name)||"",isBasementAreaAvailable:(null==e||null===(A=e.siteDetails)||void 0===A||null===(S=A.isBasementAreaAvailable)||void 0===S?void 0:S.code)||"",district:(null==e||null===(b=e.siteDetails)||void 0===b?void 0:b.district)||"",zone:(null==e||null===(y=e.siteDetails)||void 0===y||null===(C=y.zone)||void 0===C?void 0:C.name)||"",vasikaDate:null!=e&&null!==(O=e.siteDetails)&&void 0!==O&&O.vasikaDate?N(null==e||null===(D=e.siteDetails)||void 0===D?void 0:D.vasikaDate):"",specificationBuildingCategory:(null==e||null===(T=e.siteDetails)||void 0===T||null===(L=T.specificationBuildingCategory)||void 0===L?void 0:L.name)||"",specificationNocType:(null==e||null===(I=e.siteDetails)||void 0===I||null===(w=I.specificationNocType)||void 0===w?void 0:w.name)||"",specificationRestrictedArea:(null==e||null===(P=e.siteDetails)||void 0===P||null===(R=P.specificationRestrictedArea)||void 0===R?void 0:R.code)||"",specificationIsSiteUnderMasterPlan:(null==e||null===(x=e.siteDetails)||void 0===x||null===(B=x.specificationIsSiteUnderMasterPlan)||void 0===B?void 0:B.code)||""}),coordinates:c({},k),ownerPhotos:Array.isArray(null==H?void 0:H.ownerPhotoList)?H.ownerPhotoList:[],ownerIds:Array.isArray(null==U?void 0:U.ownerIdList)?U.ownerIdList:[]})}),documents:[]}),V=(null==e||null===(W=e.documents)||void 0===W||null===(j=W.documents)||void 0===j?void 0:j.documents)||[];if(F){var G,Y,q;const e=(null==M||null===(G=M.apiData)||void 0===G||null===(Y=G.Noc)||void 0===Y||null===(q=Y[0])||void 0===q?void 0:q.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==V||null===(t=V.find(t=>t.documentType===e.documentType))||void 0===t?void 0:t.uuid)||(null==V||null===(l=V.find(t=>t.documentType===e.documentType))||void 0===l?void 0:l.documentAttachment);return c({},e,{uuid:n,documentAttachment:n})}),n=(null==V?void 0:V.filter(e=>!t.has(e.documentType)))||[],o=[...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",o),o.forEach(e=>{var t;null==z||null===(t=z.documents)||void 0===t||t.push(c({},e))})}else V.forEach(e=>{z.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({},z)}}function te(e){T(D.key,e)}console.log("currentStepData in StepFour",M);const le=(null==M||null===(r=M.apiData)||void 0===r||null===(u=r.Noc)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.applicationNo)||"";console.log("applicationNo here==>",le);const ne=Digit.Hooks.useWorkflowDetails({tenantId:q,id:le,moduleCode:"obpas_noc"});console.log("workflow Details here==>",ne);let oe=(null==ne||null===(m=ne.data)||void 0===m||null===(v=m.actionState)||void 0===v||null===(p=v.nextActions)||void 0===p?void 0:p.filter(e=>(null==z?void 0:z.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==ne||null===(E=ne.data)||void 0===E||null===(f=E.nextActions)||void 0===f?void 0:f.filter(e=>(null==z?void 0:z.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));if(console.log("actions here",oe),X)return n.createElement(t.Loader,null);const ie=null==M||null===(g=M.apiData)||void 0===g||null===(_=g.Noc)||void 0===_||null===(h=_[0])||void 0===h||null===(A=h.nocDetails.additionalDetails)||void 0===A||null===(S=A.applicationDetails)||void 0===S||null===(b=S.owners)||void 0===b?void 0:b.map(e=>e.ownerOrFirmName),ae=null==ie?void 0:ie.join(", ");return n.createElement(n.Fragment,null,X&&n.createElement(t.Loader,null),n.createElement(ti,{onGoBack:te,goNext:K,currentStepData:M,t:L}),n.createElement(t.CheckBox,{label:"I/We hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+ae+"). I/We 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){B(e.target.checked)}(e),value:x,checked:x}),oe&&n.createElement(t.ActionBar,null,n.createElement(t.SubmitBar,{className:"submit-bar-back",label:"Back",onSubmit:te}),V&&(null!=ne&&null!==(y=ne.data)&&void 0!==y&&null!==(C=y.actionState)&&void 0!==C&&C.nextActions||null!=ne&&null!==(O=ne.data)&&void 0!==O&&O.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:oe,optionKey:"action",t:L,onSelect:function(e){K(e)}}):null,x&&n.createElement(t.SubmitBar,{ref:W,label:L("WF_TAKE_ACTION"),onSubmit:()=>G(!V)})),I&&n.createElement(t.Toast,{isDleteBtn:!0,error:null==I?void 0:I.error,warning:null==I?void 0:I.warning,label:L(null==I?void 0:I.message),onClose:()=>{w(null)}}))},NOCApplicantDetails:Zo,NOCProfessionalDetails:Jo,NOCSiteDetails:Qo,NOCFeeTable:yn,NOCSpecificationDetails:ei,NOCDocumentsRequired:e=>{var o,i,a,r,u,d,m,v,p,E,f;let{t:_,config:h,onSelect:A,formData:N}=e;Digit.ULBService.getStateId();const[S,b]=l.useState(null==N||null===(o=N.documents)||void 0===o?void 0:o.documents);console.log("documents in childStep three",S);const[y,C]=l.useState(null),[O,D]=l.useState(!0),[T,L]=l.useState(!1),[I,w]=l.useState(null),P=Digit.ULBService.getStateId(),R=s.useDispatch(),{isLoading:x,data:B}=Digit.Hooks.pt.usePropertyMDMS(P,"NOC",["Documents"]);console.log("data for documents here",B),console.log("formData here =====",N);const F=s.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(F).length>0&&w(F)},[F]),console.log("coordinates (from redux)",F),console.log("geocoordinates",I);const M=s.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})||{},k=null==M||null===(i=M.applicationDetails)||void 0===i||null===(a=i.owners)||void 0===a?void 0:a.some(e=>{var t,l;const n=null!=(t=null==e||null===(l=e.ownerType)||void 0===l?void 0:l.code)?t:null==e?void 0:e.ownerType;return"firm"===String(n).toLowerCase()});let U="VACANT"===(null==M||null===(r=M.siteDetails)||void 0===r||null===(u=r.buildingStatus)||void 0===u?void 0:u.code)?null==B||null===(d=B.NOC)||void 0===d||null===(m=d.Documents)||void 0===m?void 0:m.filter(e=>"OWNER.BUILDINGDRAWING"!==e.code):null==B||null===(v=B.NOC)||void 0===v?void 0:v.Documents;var H;k&&(U=null===(H=U)||void 0===H?void 0:H.map(e=>"OWNER.AUTHORIZATIONLETTER"===e.code?c({},e,{required:!0}):e)),console.log("filteredDocuments",U),l.useEffect(()=>{b(e=>{const t=Array.isArray(e)?e:[],l=t.some(e=>"OWNER.AUTHORIZATIONLETTER"===e.documentType);return k&&!l?[...t,{documentType:"OWNER.AUTHORIZATIONLETTER",filestoreId:"",documentUid:"",documentAttachment:""}]:!k&&l?t.filter(e=>"OWNER.AUTHORIZATIONLETTER"!==e.documentType):t})},[k]);const W=()=>{let e;e=c({},N.documents,{documents:S}),A(h.key,e)};l.useEffect(()=>{var e,t;let l=0;null==B||null===(e=B.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;console.log("documents in pet",S),null==S||S.map(l=>{e.required&&null!=l&&l.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(l+=1)}),D("0"!=l&&0!=l||!((null==S?void 0:S.length)>0))},[S,T]),l.useEffect(()=>{var e,t;"VACANT"===(null==M||null===(e=M.siteDetails)||void 0===e||null===(t=e.buildingStatus)||void 0===t?void 0:t.code)&&b(e=>null==e?void 0:e.filter(e=>"OWNER.BUILDINGDRAWING"!==e.documentType))},[null==M||null===(p=M.siteDetails)||void 0===p||null===(E=p.buildingStatus)||void 0===E?void 0:E.code]);const j={value:{workflowDocs:null==S?void 0:S.map(e=>({documentType:e.documentType,filestoreId:e.filestoreId,documentUid:e.documentUid,documentAttachment:e.documentAttachment}))}},{data:z}=Digit.Hooks.noc.useNOCDocumentSearch(j),V=null==S?void 0:S.map(e=>({code:e.documentType,link:g(null==z?void 0:z.pdfFiles,e.filestoreId)}));return n.createElement("div",null,x?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:_,config:h,onSelect:W,onSkip:()=>A(),isDisabled:O,onAdd:function(){}},null===(f=U)||void 0===f?void 0:f.map((e,t)=>{var l;return n.createElement("div",{className:"bpa-doc-required-card"},n.createElement(li,{key:t,document:e,t:_,error:y,setError:C,setDocuments:b,documents:S,setCheckRequiredFields:L,handleSubmit:W,geocoordinates:I,setGeoCoordinates:w,dispatch:R,previewLink:null==V||null===(l=V.find(t=>t.code===e.code))||void 0===l?void 0:l.link}))}),y&&n.createElement(t.Toast,{label:y,isDleteBtn:!0,onClose:()=>C(null),error:!0})))},NOCSummary:ti,NOCDocumentWithLatLong:e=>{var o,i,a;let{t:r,config:u,onSelect:d,formData:s}=e;const m=Digit.ULBService.getStateId(),[v,p]=l.useState((null==s||null===(o=s.documents)||void 0===o?void 0:o.documents)||[]),[E,f]=l.useState(null),[g,_]=l.useState(!0),[h,A]=l.useState(!1),[N,S]=l.useState(!1),b=bt((null==s?void 0:s.PrevStateDocuments)||[]),{isLoading:y,data:C}=Digit.Hooks.pt.usePropertyMDMS(m,"NOC",["Documents"]),O=()=>{let e;e=c({},s.documents,{documents:v}),d(u.key,e)};return l.useEffect(()=>{var e,t;const l=null==C||null===(e=C.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,o,i,a;return e==(null==l||null===(n=l.documentType)||void 0===n||null===(o=n.split("."))||void 0===o?void 0:o[0])+"."+(null==l||null===(i=l.documentType)||void 0===i||null===(a=i.split("."))||void 0===a?void 0:a[1])||t},!1));_(!((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,y?n.createElement(t.Loader,null):n.createElement(t.FormStep,{t:r,config:u,onSelect:O,onSkip:()=>d(),onAdd:function(){}},null==C||null===(i=C.NOC)||void 0===i||null===(a=i.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(ni,{key:t,document:e,t:r,error:E,setError:f,setDocuments:p,documents:v,setCheckRequiredFields:A,formData:s,beforeUploadDocuments:b||[],isNextButtonDisabled:N,setIsNextButtonDisabled:S,handleSubmit:O}))),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=o.useLocation(),{pathname:d,state:s}=u,{t:c}=i.useTranslation(),m=o.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:p}=Digit.Hooks.useStore.getInitData(),{tenants:f}=p||{},g=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:g,info:"REJECTED"==(null==v?void 0:v.applicationStatus)?"":c(E(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=Pt(function(){var e,t,l,n;const o=v,i=null==o||null===(e=o.nocDetails)||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.siteDetails,a=null==i?void 0:i.ulbType,r=(null==i||null===(l=i.ulbName)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.name)||(null==i?void 0:i.ulbName),u=f.find(e=>e.code===o.tenantId);return Promise.resolve(Bt(o,u,a,r,c)).then(function(e){Digit.Utils.pdf.generateFormattedNOC(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}=i.useTranslation(),s=(o.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 i;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(o.Link,{to:"/digit-ui/citizen/noc/search/application-overview/"+(null==e||null===(i=e.Applications)||void 0===i?void 0:i.applicationNo)},n.createElement(t.SubmitBar,{label:d(E[2])}))))})))},NOCCitizenApplicationOverview:()=>{var e,a,r,u,d,s,v,E,f,g,_,h,S,b,y,C,O,D,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne,Se,be,ye,Ce,Oe,De,Te,Le,Ie,we,Pe,Re;const xe=function(e){let{tenantId:t,payments:l,pdfkey:n,EmpData:o}=e;m(e,ii);try{var i;const e=null==ze||null===(i=ze.Noc)||void 0===i?void 0:i[0];return Promise.resolve(Rt(function(){return Pt(function(){if(Ze(!0),!e)throw new Error("Noc Application data is missing");return Promise.resolve(Mn(e,Fe,o,Ye)).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(Ze(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}},{id:Be}=o.useParams();console.log("id",Be.length);const{t:Fe}=i.useTranslation(),Me=o.useHistory(),ke=window.localStorage.getItem("CITIZEN.CITY"),[Ue,He]=l.useState({}),{isLoading:We,data:je}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:Be},ke),ze=null==je?void 0:je.resData,[Ve,Ge]=l.useState(null);console.log("applicationD",ze);const[Ye,qe]=l.useState(null),{data:Ke}=(null==ze||null===(e=ze.Noc)||void 0===e||null===(a=e[0])||void 0===a||null===(r=a.nocDetails)||void 0===r||null===(u=r.additionalDetails)||void 0===u||null===(d=u.calculations)||void 0===d||d.find(e=>e.isLatest),Digit.Hooks.useStore.getInitData()),{tenants:$e}=Ke||{},[Xe,Ze]=l.useState(!1);let Je=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):{};Je=null==t?void 0:t.value}const Qe=null===(s=Je)||void 0===s||null===(v=s.info)||void 0===v||null===(E=v.roles)||void 0===E?void 0:E.map(e=>e.code);l.useEffect(()=>{var e;const t=null==ze||null===(e=ze.Noc)||void 0===e?void 0:e[0];if(t){var l,n,o,i,a,r,u,d,s,c,m;const e=null==t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.applicationDetails,v=null==t||null===(o=t.nocDetails)||void 0===o||null===(i=o.additionalDetails)||void 0===i?void 0:i.siteDetails,p=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,E=(null==t?void 0:t.documents)||[],f=(null==t||null===(u=t.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.ownerPhotos)||[];He({applicantDetails:e?[e]:[],siteDetails:v?[v]:[],coordinates:p?[p]:[],Documents:E.length>0?E:[],ownerPhotoList:f});const g=null==t||null===(s=t.nocDetails)||void 0===s||null===(c=s.additionalDetails)||void 0===c?void 0:c.SubmittedOn,_=null==t||null===(m=t.auditDetails)||void 0===m?void 0:m.lastModifiedTime;console.log("submiited on , "+g+" , lastModified , "+_);const h=A(g&&_?_-g:null);Ge(h)}},[null==ze?void 0:ze.Noc]);const et=null!=(f=null==ze||null===(g=ze.Noc)||void 0===g||null===(_=g[0])||void 0===_||null===(h=_.nocDetails)||void 0===h||null===(S=h.additionalDetails)||void 0===S?void 0:S.businessService)?f:null,{data:tt,isLoading:lt}=Digit.Hooks.useRecieptSearch({tenantId:ke,businessService:"obpas_noc",consumerCodes:Be,isEmployee:!1},{enabled:!!Be}),nt=[];let ot=p(ke,Be);"APPROVED"===(null==ze||null===(b=ze.Noc)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.applicationStatus)&&(nt.push({label:Fe("Download Application Form"),onClick:function(){try{var e,t,l,n,o;const i=null==ze||null===(e=ze.Noc)||void 0===e?void 0:e[0],a=$e.find(e=>e.code===i.tenantId),r=null==i||null===(t=i.nocDetails)||void 0===t||null===(l=t.additionalDetails)||void 0===l?void 0:l.siteDetails,u=null==r||null===(n=r.ulbName)||void 0===n||null===(o=n.city)||void 0===o?void 0:o.name;return Promise.resolve(Bt(i,a,null==r?void 0:r.ulbType,u,Fe)).then(function(e){Digit.Utils.pdf.generateFormattedNOC(e)})}catch(e){return Promise.reject(e)}}}),tt&&(null==tt?void 0:tt.Payments.length)>0&&!lt&&(nt.push({label:Fe("PDF_STATIC_LABEL_WS_CONSOLIDATED_SANCTION_LETTER"),onClick:()=>{var e;return xe({tenantId:null==tt||null===(e=tt.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==tt?void 0:tt.Payments[0],pdfkey:"noc-sanctionletter",EmpData:ot})}}),nt.push({label:Fe("CHB_FEE_RECEIPT"),onClick:()=>{var e;return xe({tenantId:null==tt||null===(e=tt.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==tt?void 0:tt.Payments[0],pdfkey:"noc-receipt",EmpData:ot})}})));const it=e=>{if(0===e)return Fe("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+" "+Fe("NOC_FLOOR_AREA_LABEL")},[at,rt]=l.useState(null),[ut,dt]=l.useState(!1),[st,ct]=l.useState(null),[mt,vt]=l.useState(!1),[pt,Et]=l.useState(!1),ft=l.useRef();Digit.Hooks.useClickOutside(ft,()=>{dt(!1)},ut);const gt=Digit.Hooks.useWorkflowDetails({tenantId:ke,id:Be,moduleCode:et});var _t,ht;null!=gt&&null!==(C=gt.data)&&void 0!==C&&null!==(O=C.actionState)&&void 0!==O&&O.nextActions&&!gt.isLoading&&(gt.data.actionState.nextActions=[...null==gt||null===(D=gt.data)||void 0===D?void 0:D.nextActions]),gt&>.data&&!gt.isLoading&&(gt.data.initialActionState=(null==gt||null===(_t=gt.data)||void 0===_t?void 0:_t.initialActionState)||c({},null==gt||null===(ht=gt.data)||void 0===ht?void 0:ht.actionState)||{},gt.data.actionState=c({},gt.data)),l.useEffect(()=>{gt&>.revalidate(),je&&je.revalidate()},[]);let At=(null==gt||null===(T=gt.data)||void 0===T||null===(L=T.actionState)||void 0===L||null===(I=L.nextActions)||void 0===I?void 0:I.filter(e=>(null==Qe?void 0:Qe.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==gt||null===(w=gt.data)||void 0===w||null===(P=w.nextActions)||void 0===P?void 0:P.filter(e=>(null==Qe?void 0:Qe.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));console.log("actions here",At),l.useEffect(()=>{if(gt&>.data&&!gt.isLoading){var e,t,l;const n=null==gt||null===(e=gt.data)||void 0===e||null===(t=e.timeline)||void 0===t||null===(l=t.filter(e=>"APPROVE"===(null==e?void 0:e.performedAction)))||void 0===l?void 0:l.flatMap(e=>(null==e?void 0:e.wfComment)||[]),o=null==n?void 0:n[0];qe(n?"The above approval is subjected to the following conditions: "+o:"")}},[gt]);const Nt=e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t},St=null==ze||null===(R=ze.Noc)||void 0===R||null===(x=R[0])||void 0===x||null===(B=x.nocDetails)||void 0===B||null===(F=B.additionalDetails)||void 0===F?void 0:F.coordinates;if(We)return n.createElement(t.Loader,null);console.log("displayData=>",Ue);const bt=null==Ue||null===(M=Ue.Documents)||void 0===M?void 0:M.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),yt=null==Ue||null===(k=Ue.Documents)||void 0===k?void 0:k.filter(e=>!("OWNER.SITEPHOTOGRAPHONE"===(null==e?void 0:e.documentType)||"OWNER.SITEPHOTOGRAPHTWO"===(null==e?void 0:e.documentType))),Ct=null==Ue||null===(U=Ue.applicantDetails)||void 0===U||null===(H=U[0])||void 0===H||null===(W=H.owners)||void 0===W?void 0:W[0],Ot=null==ze||null===(j=ze.Noc)||void 0===j||null===(z=j[0])||void 0===z||null===(V=z.nocDetails.additionalDetails)||void 0===V||null===(G=V.applicationDetails)||void 0===G||null===(Y=G.owners)||void 0===Y?void 0:Y.map(e=>e.ownerOrFirmName),Dt=null==Ot?void 0:Ot.join(", ");return console.log("combinerOwnersName",Dt),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"}},Fe("NOC_APP_OVER_VIEW_HEADER")),n.createElement(t.LinkButton,{label:Fe("VIEW_TIMELINE"),onClick:()=>{Et(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}),Xe&&n.createElement(t.Loader,null),nt&&nt.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>vt(!mt),displayOptions:mt,options:nt})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Fe("OWNER_OWNERPHOTO")),n.createElement(On,{ownerFileStoreId:null==Ue||null===(q=Ue.ownerPhotoList)||void 0===q||null===(K=q[0])||void 0===K?void 0:K.filestoreId,ownerName:null==Ue||null===($=Ue.applicantDetails)||void 0===$||null===(X=$[0])||void 0===X||null===(Z=X.owners)||void 0===Z||null===(J=Z[0])||void 0===J?void 0:J.ownerOrFirmName})),Be.length>0&&n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Fe("APPLICATIONNO"),text:Be||"N/A"}))))),null==Ue||null===(Q=Ue.applicantDetails)||void 0===Q||null===(ee=Q[0])||void 0===ee||null===(te=ee.owners)||void 0===te?void 0:te.map((e,l)=>{var o,i,a;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?Fe("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:Fe("NOC_OWNER_TYPE_LABEL"),text:null!=e&&null!==(o=e.ownerType)&&void 0!==o&&o.i18nKey?Fe(null==e||null===(i=e.ownerType)||void 0===i?void 0:i.i18nKey):"N/A"}),n.createElement(t.Row,{label:Fe("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_APPLICANT_DOB_LABEL"),text:Nt(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(a=e.gender)||void 0===a?void 0:a.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"})))))}),(null==Ue||null===(le=Ue.applicantDetails)||void 0===le?void 0:le.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===(ne=Ue.applicantDetails)||void 0===ne?void 0:ne.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Fe("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:Fe("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_PROFESSIONAL_REGISTRATION_ID_VALIDITY_LABEL"),text:(null==e?void 0:e.professionalRegIdValidity)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),Ct&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Fe("NOC_PROPERTY_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Fe("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==Ct?void 0:Ct.propertyId)||"N/A"}),n.createElement(t.Row,{label:Fe("PROPERTY_OWNER_NAME"),text:(null==Ct?void 0:Ct.PropertyOwnerName)||"N/A"}),n.createElement(t.Row,{label:Fe("PROPERTY_OWNER_MOBILE_NUMBER"),text:(null==Ct?void 0:Ct.PropertyOwnerMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Fe("WS_PROPERTY_ADDRESS_LABEL"),text:(null==Ct?void 0:Ct.PropertyOwnerAddress)||"N/A"}),n.createElement(t.Row,{label:Fe("PROPERTY_PLOT_AREA"),text:(null==Ct?void 0:Ct.PropertyOwnerPlotArea)||"N/A"}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Fe("NOC_SITE_DETAILS")),null==Ue||null===(oe=Ue.siteDetails)||void 0===oe?void 0:oe.map((e,l)=>{var o,i,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:Fe("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_ULB_NAME_LABEL"),text:(null==e||null===(o=e.ulbName)||void 0===o?void 0:o.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(i=e.roadType)||void 0===i?void 0:i.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:Fe("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:Fe("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:Fe("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:it(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:Fe("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:e.totalFloorArea||"N/A"}),n.createElement(t.Row,{label:Fe("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:Fe("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:Fe("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_VASIKA_DATE"),text:(null==e?void 0:e.vasikaDate)||"N/A"}),n.createElement(t.Row,{label:Fe("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,Fe("NOC_SPECIFICATION_DETAILS")),null==Ue||null===(ie=Ue.siteDetails)||void 0===ie?void 0:ie.map((e,l)=>{var o,i,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:Fe("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(o=e.specificationBuildingCategory)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:Fe("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(i=e.specificationNocType)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:Fe("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:Fe("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,Fe("BPA_UPLOADED _SITE_PHOTOGRAPHS_LABEL")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==bt?void 0:bt.length)>0&&(null==bt?void 0:bt.map(e=>n.createElement(Fn,{filestoreId:(null==e?void 0:e.filestoreId)||(null==e?void 0:e.uuid),documentType:null==e?void 0:e.documentType,coordinates:St}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Fe("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==ze||null===(ae=ze.Noc)||void 0===ae||null===(re=ae[0])||void 0===re||null===(ue=re.nocDetails)||void 0===ue||null===(de=ue.additionalDetails)||void 0===de||null===(se=de.ownerIds)||void 0===se?void 0:se.length)>0&&n.createElement(bn,{documents:[...(null==ze||null===(ce=ze.Noc)||void 0===ce||null===(me=ce[0])||void 0===me||null===(ve=me.nocDetails)||void 0===ve||null===(pe=ve.additionalDetails)||void 0===pe?void 0:pe.ownerIds)||[]].reverse()}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Fe("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==yt?void 0:yt.length)>0&&n.createElement(bn,{documents:yt}))),"APPROVED"===(null==ze||null===(Ee=ze.Noc)||void 0===Ee||null===(fe=Ee[0])||void 0===fe?void 0:fe.applicationStatus)&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Fe("NOC_FEE_DETAILS_LABEL")),(null==ze||null===(ge=ze.Noc)||void 0===ge||null===(_e=ge[0])||void 0===_e?void 0:_e.nocDetails)&&n.createElement(Cn,{formData:{apiData:c({},ze),applicationDetails:c({},null==ze||null===(he=ze.Noc)||void 0===he||null===(Ae=he[0])||void 0===Ae||null===(Ne=Ae.nocDetails)||void 0===Ne||null===(Se=Ne.additionalDetails)||void 0===Se?void 0:Se.applicationDetails),siteDetails:c({},null==ze||null===(be=ze.Noc)||void 0===be||null===(ye=be[0])||void 0===ye||null===(Ce=ye.nocDetails)||void 0===Ce||null===(Oe=Ce.additionalDetails)||void 0===Oe?void 0:Oe.siteDetails),calculations:(null==ze||null===(De=ze.Noc)||void 0===De||null===(Te=De[0])||void 0===Te||null===(Le=Te.nocDetails)||void 0===Le||null===(Ie=Le.additionalDetails)||void 0===Ie?void 0:Ie.calculations)||[]},disable:!0})),n.createElement(t.CheckBox,{label:"I/We hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+Dt+"). I/We 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.",checked:"true"}),n.createElement("div",{id:"timeline"},n.createElement(sn,{workflowDetails:gt,t:Fe,timeObj:Ve})),At&&At.length>0&&n.createElement(t.ActionBar,null,ut&&(null!=gt&&null!==(we=gt.data)&&void 0!==we&&null!==(Pe=we.actionState)&&void 0!==Pe&&Pe.nextActions||null!=gt&&null!==(Re=gt.data)&&void 0!==Re&&Re.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:At,optionKey:"action",t:Fe,onSelect:function(e){var t,l;console.log("selected action",e);const n=null==ze||null===(t=ze.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,o={Licenses:[e]};"EDIT"==(null==e?void 0:e.action)?Me.push("/digit-ui/citizen/noc/edit-application/"+n):"DRAFT"==(null==e?void 0:e.action)?(rt({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{rt(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,n,o,i,a,r,u;const d=(null==ze||null===(t=ze.Noc)||void 0===t?void 0:t[0])||{},s=c({},d,{vasikaNumber:(null==d||null===(l=d.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(o=n.siteDetails)||void 0===o?void 0:o.vasikaNumber)||"",vasikaDate:N(null==d||null===(i=d.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.vasikaDate)||"",workflow:{}});console.log("updatedApplicant",s);const m=null==e||null===(u=e.Licenses)||void 0===u?void 0:u[0];s.workflow={action:m.action,assignes:null==m?void 0:m.assignee,comment:null==m?void 0:m.comment,documents:null==m?void 0:m.wfDocuments};const v={Noc:c({},s)},p=Rt(function(){return Pt(function(){return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:ke,details:v})).then(function(e){var t,l,n;"successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status)?"CANCEL"===(null==m?void 0:m.action)?(rt({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),gt.revalidate(),ct(null)):(console.log("We are calling citizen response page"),Me.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}})):(rt({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),ct(null))})},function(){rt({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{rt(null)},3e3),e)throw t;return t});Promise.resolve(p&&p.then?p.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(o):"PAY"==(null==e?void 0:e.action)?Me.push("/digit-ui/citizen/payment/collect/obpas_noc/"+n+"/"+ke+"?tenantId="+ke):ct(e)}}):null,n.createElement(t.SubmitBar,{ref:ft,label:Fe("WF_TAKE_ACTION"),onSubmit:()=>dt(!ut)})),at&&n.createElement(t.Toast,{error:null==at?void 0:at.error,warning:null==at?void 0:at.warning,label:Fe(null==at?void 0:at.message),isDleteBtn:!0,onClose:()=>{rt(null)}}))},NOCEmployeeApplicationOverview:()=>{var e,a,r,u,d,s,v,E,f,g,_,h,S,b,y,C,O,D,T,L,I,w,P,R,x,B,F,M,k,U,H,W,j,z,V,G,Y,q,K,$,X,Z,J,Q,ee,te,le,ne,oe,ie,ae,re,ue,de,se,ce,me,ve,pe,Ee,fe,ge,_e,he,Ae,Ne,Se,be,ye,Ce,Oe,De,Te,Le,Ie,we,Pe,Re,xe,Be,Fe,Me,ke,Ue,He,We,je,ze,Ve,Ge,Ye,qe,Ke,$e,Xe;const{id:Ze}=o.useParams(),{t:Je}=i.useTranslation(),Qe=window.localStorage.getItem("Employee.tenant-id"),et=o.useHistory(),tt=null==Qe?void 0:Qe.split(".")[0],[lt,nt]=l.useState(null),[ot,it]=l.useState(null),[at,rt]=l.useState(null),[ut,dt]=l.useState(null),[st,ct]=l.useState({}),[mt,vt]=l.useState(null),[pt,Et]=l.useState([]),[ft,gt]=l.useState(!1),[_t,ht]=l.useState([]),[At,Nt]=l.useState([]),{isLoading:St,data:bt,refetch:yt}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:Ze},Qe),Ct=St||ft,Ot=null==bt?void 0:bt.resData,[Dt,Tt]=l.useState(!1),[Lt,It]=l.useState(null),wt=null===(e=window)||void 0===e||null===(a=e.Digit)||void 0===a||null===(r=a.Utils)||void 0===r||null===(u=r.browser)||void 0===u?void 0:u.isMobile(),[xt,Bt]=l.useState(null!=Ot&&null!==(d=Ot.Noc)&&void 0!==d&&null!==(s=d[0])&&void 0!==s&&null!==(v=s.nocDetails)&&void 0!==v&&null!==(E=v.additionalDetails)&&void 0!==E&&E.siteImages?{documents:null==Ot||null===(f=Ot.Noc)||void 0===f||null===(g=f[0])||void 0===g||null===(_=g.nocDetails)||void 0===_||null===(h=_.additionalDetails)||void 0===h?void 0:h.siteImages}:{}),[Ft,Mt]=l.useState(null),{mutate:kt,isLoading:Ut,error:Ht}=Digit.Hooks.tl.useESign(),[Wt,jt]=l.useState(!1);console.log("applicationDetails here==>",Ot);const zt=null!=(S=null==Ot||null===(b=Ot.Noc)||void 0===b||null===(y=b[0])||void 0===y||null===(C=y.nocDetails)||void 0===C||null===(O=C.additionalDetails)||void 0===O?void 0:O.businessService)?S:null;console.log("businessService here==>",zt);const{data:Vt,isLoading:Gt}=Digit.Hooks.useRecieptSearch({tenantId:Qe,businessService:"obpas_noc",consumerCodes:Ze,isEmployee:!1},{enabled:!!Ze}),Yt=Digit.Hooks.useWorkflowDetails({tenantId:Qe,id:Ze,moduleCode:zt});console.log("workflowDetails here=>",Yt),l.useEffect(()=>{Ht&&nt({key:"error",error:!0,label:Ht.message||"eSign process failed. Please try again."})},[Ht]);const qt=l.useMemo(()=>{var e;if(null!=xt&&xt.documents&&(null==xt?void 0:xt.documents.length)>0)return null==xt||null===(e=xt.documents)||void 0===e?void 0:e.map(e=>({latitude:(null==e?void 0:e.latitude)||"",longitude:(null==e?void 0:e.longitude)||""}))},[xt]),Kt=l.useMemo(()=>{var e;return null==xt||null===(e=xt.documents)||void 0===e?void 0:e.map((e,t)=>({title:null==e?void 0:e.documentType,fileStoreId:null==e?void 0:e.filestoreId,latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude}))},[xt]);var $t,Xt;Je("BPA_SITES"),Je(" "),null!=Yt&&null!==(D=Yt.data)&&void 0!==D&&null!==(T=D.actionState)&&void 0!==T&&T.nextActions&&!Yt.isLoading&&(Yt.data.actionState.nextActions=[...null==Yt||null===(L=Yt.data)||void 0===L?void 0:L.nextActions]),Yt&&Yt.data&&!Yt.isLoading&&(Yt.data.initialActionState=(null==Yt||null===($t=Yt.data)||void 0===$t?void 0:$t.initialActionState)||c({},null==Yt||null===(Xt=Yt.data)||void 0===Xt?void 0:Xt.actionState)||{},Yt.data.actionState=c({},Yt.data));const Zt=()=>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(Zt,null));l.useEffect(()=>{!St&&Qe&&zt&&function(){try{const e=Rt(function(){return Pt(function(){return gt(!0),Promise.resolve(Digit.WorkflowService.init(Qe,zt)).then(function(e){var t,l;console.log("wf=>",e),gt(!1),ht(null==e||null===(t=e.BusinessServices)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.states)})},function(e){console.error("Error Occurred",e)})},function(e,t){if(gt(!1),e)throw t;return t});e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Qe,zt,St]),l.useEffect(()=>{if(Yt&&Yt.data&&!Yt.isLoading){var e,t,l;const n=null==Yt||null===(e=Yt.data)||void 0===e||null===(t=e.timeline)||void 0===t||null===(l=t.filter(e=>"APPROVE"===(null==e?void 0:e.performedAction)))||void 0===l?void 0:l.flatMap(e=>(null==e?void 0:e.wfComment)||[]),o=null==n?void 0:n[0];vt(n?"The above approval is subjected to the following conditions: "+o:"")}},[Yt]);const Qt=[];let el=p(Qe,Ze);"APPROVED"===(null==Ot||null===(I=Ot.Noc)||void 0===I||null===(w=I[0])||void 0===w?void 0:w.applicationStatus)&&Vt&&(null==Vt?void 0:Vt.Payments.length)>0&&!Gt&&Qt.push({label:Ut?"🔄 Preparing eSign...":"📤 eSign Certificate",onClick:function(){try{const e=Pt(function(){var e;return console.log("🎯 Starting certificate eSign process with custom hook..."),Promise.resolve(function(e){let{tenantId:t,payments:l,pdfkey:n,EmpData:o}=e;m(e,Un);try{var i;const e=null==Ot||null===(i=Ot.Noc)||void 0===i?void 0:i[0];return Promise.resolve(Rt(function(){return Pt(function(){if(gt(!0),!e)throw new Error("Noc Application data is missing");return Promise.resolve(Mn(e,Je,o,mt)).then(function(e){return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},l,{Noc:e.Noc})]},n)).then(function(e){var t;const l=null==e||null===(t=e.filestoreIds)||void 0===t?void 0:t[0];if(!l)throw new Error("Failed to generate filestoreId");return l})})},function(e){console.error("Sanction Letter download error:",e)})},function(e,t){if(gt(!1),e)throw t;return t}))}catch(e){return Promise.reject(e)}}({tenantId:null==Vt||null===(e=Vt.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Vt?void 0:Vt.Payments[0],pdfkey:"noc-sanctionletter",EmpData:el})).then(function(e){kt({fileStoreId:e,tenantId:Qe},{onSuccess:()=>{console.log("✅ eSign process initiated successfully")},onError:e=>{console.error("❌ Certificate eSign failed:",e),nt({key:"error",error:!0,label:e.message||"Failed to initiate digital signing process"})}})})},function(e){console.error("❌ Certificate preparation failed:",e),nt({key:"error",error:!0,label:e.message||"Failed to prepare certificate for eSign"})});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:Ut}),l.useEffect(()=>{var e,t,l,n,o,i,a;const r=null==Ot||null===(e=Ot.Noc)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(o=n.calculations)||void 0===o?void 0:o.find(e=>e.isLatest),u=(null==bt||null===(i=bt.Calculation)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.taxHeadEstimates)||[];0!==u.length&&Nt(function(e){void 0===e&&(e=[]);const t=(e||[]).reduce((e,t)=>(null!=t&&t.taxHeadCode&&(e[t.taxHeadCode]=t),e),{});return u.map(e=>{var l,n,o,i,a,u,d,s,c;const m=null==r||null===(l=r.taxHeadEstimates)||void 0===l?void 0:l.find(t=>t.taxHeadCode===e.taxHeadCode),v=t[e.taxHeadCode]||{},p=!!v.edited;return{taxHeadCode:e.taxHeadCode,category:e.category,adjustedAmount:p?v.adjustedAmount:null!=(n=null!=(o=e.estimateAmount)?o:null==m?void 0:m.estimateAmount)?n:0,remark:p?null!=(i=v.remark)?i:"":null!=(a=null!=(u=e.remarks)?u:null==m?void 0:m.remarks)?a:"",filestoreId:void 0!==(null==v?void 0:v.filestoreId)?v.filestoreId:null!=(d=null!=(s=e.filestoreId)?s:null==m?void 0:m.filestoreId)?d:null,onDocumentLoading:!1,documentError:null,edited:null!=(c=v.edited)&&c}})})},[Ot,bt]);const[tl,ll]=l.useState(!1),[nl,ol]=l.useState(null),[il,al]=l.useState(!1),[rl,ul]=l.useState(!1),dl=()=>{nt(null)};let sl=Digit.UserService.getUser();const cl=l.useRef();if(Digit.Hooks.useClickOutside(cl,()=>{ll(!1)},tl),window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};sl=null==t?void 0:t.value}const ml=null===(P=sl)||void 0===P||null===(R=P.info)||void 0===R||null===(x=R.roles)||void 0===x?void 0:x.map(e=>e.code);l.useEffect(()=>{Yt&&Yt.revalidate(),bt&&bt.revalidate()},[]);let vl=(null==Yt||null===(B=Yt.data)||void 0===B||null===(F=B.actionState)||void 0===F||null===(M=F.nextActions)||void 0===M?void 0:M.filter(e=>(null==ml?void 0:ml.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==Yt||null===(k=Yt.data)||void 0===k||null===(U=k.nextActions)||void 0===U?void 0:U.filter(e=>(null==ml?void 0:ml.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));console.log("actions here",vl),l.useEffect(()=>{var e;const t=null==Ot||null===(e=Ot.Noc)||void 0===e?void 0:e[0];if(t){var l,n,o,i,a,r,u,d,s,c,m,v,p;const e=null==t||null===(l=t.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.applicationDetails,E=null==t||null===(o=t.nocDetails)||void 0===o||null===(i=o.additionalDetails)||void 0===i?void 0:i.siteDetails,f=null==t||null===(a=t.nocDetails)||void 0===a||null===(r=a.additionalDetails)||void 0===r?void 0:r.coordinates,g=(null==t?void 0:t.documents)||[],_=(null==t||null===(u=t.nocDetails)||void 0===u||null===(d=u.additionalDetails)||void 0===d?void 0:d.ownerPhotos)||[];ct({applicantDetails:e?[e]:[],siteDetails:E?[E]:[],coordinates:f?[f]:[],Documents:g.length>0?g:[],ownerPhotoList:_});const h=null==t||null===(s=t.nocDetails)||void 0===s||null===(c=s.additionalDetails)||void 0===c?void 0:c.SubmittedOn,N=null==t||null===(m=t.auditDetails)||void 0===m?void 0:m.lastModifiedTime;console.log("submiited on , "+h+" , lastModified , "+N);const S=A(h&&N?N-h:null);Mt(S);const b=null==t||null===(v=t.nocDetails)||void 0===v||null===(p=v.additionalDetails)||void 0===p?void 0:p.siteImages;Bt(b?{documents:b}:{})}},[null==Ot?void 0:Ot.Noc]);const pl="FIELDINSPECTION_INPROGRESS"===(null==Ot||null===(H=Ot.Noc)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.applicationStatus),El=function(e){try{var t,l,n,o,i,a,r,u,d,s,m,v;const p=(null==Ot||null===(t=Ot.Noc)||void 0===t?void 0:t[0])||{};console.log("payloadData",p);const E=(null==p||null===(l=p.nocDetails)||void 0===l||null===(n=l.additionalDetails)||void 0===n||null===(o=n.siteDetails)||void 0===o?void 0:o.vasikaNumber)||"",f=N(null==p||null===(i=p.nocDetails)||void 0===i||null===(a=i.additionalDetails)||void 0===a||null===(r=a.siteDetails)||void 0===r?void 0:r.vasikaDate)||"";if(!pl){const e=(At||[]).some(e=>{var t;return(null!=(t=e.adjustedAmount)?t:0)>0}),t=(At||[]).every(e=>!e.edited||e.remark&&""!==e.remark.trim());if(!e)return nt({key:"true",error:!0,message:"Please enter a fee amount before submission."}),Promise.resolve();if(!t)return nt({key:"true",error:!0,message:"Remarks are mandatory for all fee rows."}),Promise.resolve()}const g={isLatest:!0,updatedBy:null===(u=Digit.UserService.getUser())||void 0===u||null===(d=u.info)||void 0===d?void 0:d.name,taxHeadEstimates:At.filter(e=>"NOC_TOTAL"!==e.taxHeadCode).map(e=>{var t;return{taxHeadCode:e.taxHeadCode,estimateAmount:null!=(t=e.adjustedAmount)?t:0,category:e.category,remarks:e.remark||null,filestoreId:e.filestoreId||null}})},_=((null==p||null===(s=p.nocDetails)||void 0===s||null===(m=s.additionalDetails)||void 0===m?void 0:m.calculations)||[]).map(e=>c({},e,{isLatest:!1})),h=c({},p,{vasikaNumber:E,vasikaDate:f,workflow:{},nocDetails:c({},p.nocDetails,{additionalDetails:c({},p.nocDetails.additionalDetails,{calculations:[..._,g],siteImages:(null==xt?void 0:xt.documents)||[]})})});console.log("updatedApplicant",h);const A=null==e||null===(v=e.Licenses)||void 0===v?void 0:v[0];h.workflow={action:A.action,assignes:null==A?void 0:A.assignee,comment:null==A?void 0:A.comment,documents:null==A?void 0:A.wfDocuments};const S={Noc:c({},h)};return console.log("final Payload ",S),Promise.resolve(Rt(function(){return Pt(function(){if(!["SENDBACKTOCITIZEN","REJECT"].includes(null==A?void 0:A.action)||window.confirm("Are you sure you want to reject this application?"))return Promise.resolve(Digit.NOCService.NOCUpdate({tenantId:Qe,details:S})).then(function(e){var t;if("successful"===(null==e||null===(t=e.ResponseInfo)||void 0===t?void 0:t.status))if("CANCEL"===(null==A?void 0:A.action))nt({key:"true",success:!0,message:"COMMON_APPLICATION_CANCELLED_LABEL"}),Yt.revalidate(),ol(null),setTimeout(()=>{et.push("/digit-ui/employee/noc/inbox")},3e3);else if("APPLY"===(null==A?void 0:A.action)||"RESUBMIT"===(null==A?void 0:A.action)||"DRAFT"===(null==A?void 0:A.action)){var l,n;console.log("We are calling employee response page"),et.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 nt({key:"true",success:!0,message:"COMMON_SUCCESSFULLY_UPDATED_APPLICATION_STATUS_LABEL"}),Yt.revalidate(),yt(),Nt(e=>(e||[]).map(e=>c({},e,{edited:!1}))),ol(null),setTimeout(()=>{et.push("/digit-ui/employee/noc/inbox")},3e3);else nt({key:"true",warning:!0,message:"COMMON_SOMETHING_WENT_WRONG_LABEL"}),ol(null)});ol(null)},function(){nt({key:"true",error:!0,message:"COMMON_SOME_ERROR_OCCURRED_LABEL"})})},function(e,t){if(setTimeout(()=>{nt(null)},3e3),e)throw t;return t}))}catch(e){return Promise.reject(e)}},fl=e=>{if(0===e)return Je("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+" "+Je("NOC_FLOOR_AREA_LABEL")};if(Ct)return n.createElement(t.Loader,null);const gl=e=>{if(!e)return"";const[t,l,n]=e.split("-");return n+"/"+l+"/"+t},_l=null==Ot||null===(j=Ot.Noc)||void 0===j||null===(z=j[0])||void 0===z||null===(V=z.nocDetails)||void 0===V||null===(G=V.additionalDetails)||void 0===G?void 0:G.coordinates;console.log("displayData here",st);const hl=null==st||null===(Y=st.Documents)||void 0===Y?void 0:Y.filter(e=>"OWNER.SITEPHOTOGRAPHONE"===e.documentType||"OWNER.SITEPHOTOGRAPHTWO"===e.documentType),Al=null==st||null===(q=st.Documents)||void 0===q?void 0:q.filter(e=>!("OWNER.SITEPHOTOGRAPHONE"===(null==e?void 0:e.documentType)||"OWNER.SITEPHOTOGRAPHTWO"===(null==e?void 0:e.documentType))),Nl=null==Ot||null===(K=Ot.Noc)||void 0===K||null===($=K[0])||void 0===$||null===(X=$.nocDetails.additionalDetails)||void 0===X||null===(Z=X.applicationDetails)||void 0===Z||null===(J=Z.owners)||void 0===J?void 0:J.map(e=>e.ownerOrFirmName),Sl=null==Nl?void 0:Nl.join(", "),bl=null==st||null===(Q=st.applicantDetails)||void 0===Q||null===(ee=Q[0])||void 0===ee||null===(te=ee.owners)||void 0===te?void 0:te[0];return 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"}},Je("NOC_APP_OVER_VIEW_HEADER")),n.createElement(t.LinkButton,{label:Je("VIEW_TIMELINE"),onClick:()=>{ul(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}),Ct&&n.createElement(t.Loader,null),Qt&&Qt.length>0&&n.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>jt(!Wt),displayOptions:Wt,options:Qt})),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("OWNER_OWNERPHOTO")),n.createElement(On,{ownerFileStoreId:null==st||null===(le=st.ownerPhotoList)||void 0===le||null===(ne=le[0])||void 0===ne?void 0:ne.filestoreId,ownerName:null==st||null===(oe=st.applicantDetails)||void 0===oe||null===(ie=oe[0])||void 0===ie||null===(ae=ie.owners)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.ownerOrFirmName})),Ze.length>0&&n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement("div",{style:{marginBottom:"30px",background:"#FAFAFA",padding:"16px",borderRadius:"4px"}},n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Je("APPLICATIONNO"),text:Ze||"N/A"}))))),null==st||null===(ue=st.applicantDetails)||void 0===ue||null===(de=ue[0])||void 0===de||null===(se=de.owners)||void 0===se?void 0:se.map((e,l)=>{var o,i,a;return n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,0===l?Je("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:Je("NOC_OWNER_TYPE_LABEL"),text:null!=e&&null!==(o=e.ownerType)&&void 0!==o&&o.i18nKey?Je(null==e||null===(i=e.ownerType)||void 0===i?void 0:i.i18nKey):"N/A"}),n.createElement(t.Row,{label:Je("NOC_FIRM_OWNER_NAME_LABEL"),text:(null==e?void 0:e.ownerOrFirmName)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_APPLICANT_EMAIL_LABEL"),text:(null==e?void 0:e.emailId)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_APPLICANT_FATHER_HUSBAND_NAME_LABEL"),text:(null==e?void 0:e.fatherOrHusbandName)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_APPLICANT_MOBILE_NO_LABEL"),text:(null==e?void 0:e.mobileNumber)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_APPLICANT_DOB_LABEL"),text:gl(null==e?void 0:e.dateOfBirth)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_APPLICANT_GENDER_LABEL"),text:(null==e||null===(a=e.gender)||void 0===a?void 0:a.code)||(null==e?void 0:e.gender)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_APPLICANT_ADDRESS_LABEL"),text:(null==e?void 0:e.address)||"N/A"})))))}),bl&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("NOC_PROPERTY_DETAILS")),n.createElement(t.StatusTable,null,n.createElement(t.Row,{label:Je("NOC_APPLICANT_PROPERTY_ID_LABEL"),text:(null==bl?void 0:bl.propertyId)||"N/A"}),n.createElement(t.Row,{label:Je("PROPERTY_OWNER_NAME"),text:(null==bl?void 0:bl.PropertyOwnerName)||"N/A"}),n.createElement(t.Row,{label:Je("PROPERTY_OWNER_MOBILE_NUMBER"),text:(null==bl?void 0:bl.PropertyOwnerMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Je("WS_PROPERTY_ADDRESS_LABEL"),text:(null==bl?void 0:bl.PropertyOwnerAddress)||"N/A"}),n.createElement(t.Row,{label:Je("PROPERTY_PLOT_AREA"),text:(null==bl?void 0:bl.PropertyOwnerPlotArea)||"N/A"}))),(null==st||null===(ce=st.applicantDetails)||void 0===ce?void 0:ce.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==st||null===(me=st.applicantDetails)||void 0===me?void 0:me.map((e,l)=>n.createElement(n.Fragment,null,n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("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:Je("NOC_PROFESSIONAL_NAME_LABEL"),text:(null==e?void 0:e.professionalName)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_PROFESSIONAL_EMAIL_LABEL"),text:(null==e?void 0:e.professionalEmailId)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_PROFESSIONAL_REGISTRATION_ID_LABEL"),text:(null==e?void 0:e.professionalRegId)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_PROFESSIONAL_MOBILE_NO_LABEL"),text:(null==e?void 0:e.professionalMobileNumber)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_PROFESSIONAL_ADDRESS_LABEL"),text:(null==e?void 0:e.professionalAddress)||"N/A"}))))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("NOC_SITE_DETAILS")),null==st||null===(ve=st.siteDetails)||void 0===ve?void 0:ve.map((e,l)=>{var o,i,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:Je("NOC_PLOT_NO_LABEL"),text:(null==e?void 0:e.plotNo)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_PROPOSED_SITE_ADDRESS"),text:(null==e?void 0:e.proposedSiteAddress)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_ULB_NAME_LABEL"),text:(null==e||null===(o=e.ulbName)||void 0===o?void 0:o.name)||(null==e?void 0:e.ulbName)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_ULB_TYPE_LABEL"),text:(null==e?void 0:e.ulbType)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_KHASRA_NO_LABEL"),text:(null==e?void 0:e.khasraNo)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_HADBAST_NO_LABEL"),text:(null==e?void 0:e.hadbastNo)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_ROAD_TYPE_LABEL"),text:(null==e||null===(i=e.roadType)||void 0===i?void 0:i.name)||(null==e?void 0:e.roadType)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_AREA_LEFT_FOR_ROAD_WIDENING_LABEL"),text:(null==e?void 0:e.areaLeftForRoadWidening)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_NET_PLOT_AREA_AFTER_WIDENING_LABEL"),text:(null==e?void 0:e.netPlotAreaAfterWidening)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_NET_TOTAL_AREA_LABEL"),text:(null==e?void 0:e.netTotalArea)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_ROAD_WIDTH_AT_SITE_LABEL"),text:(null==e?void 0:e.roadWidthAtSite)||"N/A"}),n.createElement(t.Row,{label:Je("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:Je("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:Je("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:fl(l),text:e.value||"N/A"}))),"Built Up"==(null==e?void 0:e.buildingStatus)&&n.createElement(t.Row,{label:Je("NOC_TOTAL_FLOOR_BUILT_UP_AREA_LABEL"),text:(null==e?void 0:e.totalFloorArea)||"N/A"}),n.createElement(t.Row,{label:Je("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:Je("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:Je("NOC_SITE_WARD_NO_LABEL"),text:(null==e?void 0:e.wardNo)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_SITE_VILLAGE_NAME_LABEL"),text:(null==e?void 0:e.villageName)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_SITE_COLONY_NAME_LABEL"),text:(null==e?void 0:e.colonyName)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_SITE_VASIKA_NO_LABEL"),text:(null==e?void 0:e.vasikaNumber)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_VASIKA_DATE"),text:(null==e?void 0:e.vasikaDate)||"N/A"}),n.createElement(t.Row,{label:Je("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,Je("NOC_SPECIFICATION_DETAILS")),null==st||null===(pe=st.siteDetails)||void 0===pe?void 0:pe.map((e,l)=>{var o,i,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:Je("NOC_PLOT_AREA_JAMA_BANDI_LABEL"),text:(null==e?void 0:e.specificationPlotArea)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_BUILDING_CATEGORY_LABEL"),text:(null==e||null===(o=e.specificationBuildingCategory)||void 0===o?void 0:o.name)||(null==e?void 0:e.specificationBuildingCategory)||"N/A"}),n.createElement(t.Row,{label:Je("NOC_NOC_TYPE_LABEL"),text:(null==e||null===(i=e.specificationNocType)||void 0===i?void 0:i.name)||(null==e?void 0:e.specificationNocType)||"N/A"}),n.createElement(t.Row,{label:Je("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:Je("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,Je("BPA_UPLOADED _SITE_PHOTOGRAPHS_LABEL")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==hl?void 0:hl.length)>0&&(null==hl?void 0:hl.map(e=>n.createElement(Fn,{filestoreId:(null==e?void 0:e.filestoreId)||(null==e?void 0:e.uuid),documentType:null==e?void 0:e.documentType,coordinates:_l}))))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("NOC_UPLOADED_OWNER_ID")),n.createElement(t.StatusTable,null,(null==Ot||null===(Ee=Ot.Noc)||void 0===Ee||null===(fe=Ee[0])||void 0===fe||null===(ge=fe.nocDetails)||void 0===ge||null===(_e=ge.additionalDetails)||void 0===_e||null===(he=_e.ownerIds)||void 0===he?void 0:he.length)>0&&n.createElement(bn,{documents:[...(null==Ot||null===(Ae=Ot.Noc)||void 0===Ae||null===(Ne=Ae[0])||void 0===Ne||null===(Se=Ne.nocDetails)||void 0===Se||null===(be=Se.additionalDetails)||void 0===be?void 0:be.ownerIds)||[]].reverse()}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("NOC_TITILE_DOCUMENT_UPLOADED")),n.createElement(t.StatusTable,null,(null==Al?void 0:Al.length)>0&&n.createElement(bn,{documents:Al}))),n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("NOC_FEE_DETAILS_LABEL")),(null==Ot||null===(ye=Ot.Noc)||void 0===ye||null===(Ce=ye[0])||void 0===Ce?void 0:Ce.nocDetails)&&n.createElement(Cn,{formData:{apiData:c({},Ot),applicationDetails:c({},null==Ot||null===(Oe=Ot.Noc)||void 0===Oe||null===(De=Oe[0])||void 0===De||null===(Te=De.nocDetails)||void 0===Te||null===(Le=Te.additionalDetails)||void 0===Le?void 0:Le.applicationDetails),siteDetails:c({},null==Ot||null===(Ie=Ot.Noc)||void 0===Ie||null===(we=Ie[0])||void 0===we||null===(Pe=we.nocDetails)||void 0===Pe||null===(Re=Pe.additionalDetails)||void 0===Re?void 0:Re.siteDetails),calculations:(null==Ot||null===(xe=Ot.Noc)||void 0===xe||null===(Be=xe[0])||void 0===Be||null===(Fe=Be.nocDetails)||void 0===Fe||null===(Me=Fe.additionalDetails)||void 0===Me?void 0:Me.calculations)||[]},feeAdjustments:At,setFeeAdjustments:Nt,disable:"FIELDINSPECTION_INPROGRESS"===(null==Ot||null===(ke=Ot.Noc)||void 0===ke||null===(Ue=ke[0])||void 0===Ue?void 0:Ue.applicationStatus)})),n.createElement(t.CheckBox,{label:"I/We hereby solemnly affirm and declare that I am submitting this application on behalf of the applicant ("+Sl+"). I/We 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.",checked:"true"}),"FIELDINSPECTION_INPROGRESS"===(null==Ot||null===(He=Ot.Noc)||void 0===He||null===(We=He[0])||void 0===We?void 0:We.applicationStatus)&&(null===(je=sl)||void 0===je||null===(ze=je.info)||void 0===ze?void 0:ze.roles.filter(e=>"OBPAS_NOC_JE"===e.code||"OBPAS_NOC_BI"===e.code)).length>0&&n.createElement(t.Card,null,n.createElement("div",{id:"fieldInspection"}),n.createElement(Bn,{siteImages:xt,setSiteImages:Bt,geoLocations:qt,customOpen:function(e){!function(e){try{if(0===(null==e?void 0:e.length))return Promise.resolve();const t=Pt(function(){return Promise.resolve(Digit.UploadServices.Filefetch([e],tt)).then(function(t){if(null!=t&&t.data){const l=t.data[e];l?wt?(Tt(!0),It(l)):window.open(l,"_blank"):console.error(Je("CS_FILE_FETCH_ERROR"))}else console.error(Je("CS_FILE_FETCH_ERROR"))})},function(){console.error(Je("CS_FILE_FETCH_ERROR"))});Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(e)}})),"FIELDINSPECTION_INPROGRESS"!==(null==Ot||null===(Ve=Ot.Noc)||void 0===Ve||null===(Ge=Ve[0])||void 0===Ge?void 0:Ge.applicationStatus)&&(null==xt||null===(Ye=xt.documents)||void 0===Ye?void 0:Ye.length)>0&&n.createElement(t.Card,null,n.createElement(t.CardSubHeader,null,Je("BPA_FIELD_INSPECTION_UPLOADED_DOCUMENTS")),n.createElement(t.StatusTable,{style:{display:"flex",gap:"20px",flexWrap:"wrap",justifyContent:"space-between"}},(null==Kt?void 0:Kt.length)>0&&Kt.map(e=>n.createElement(kn,{key:(null==e?void 0:e.fileStoreId)||(null==e?void 0:e.uuid),filestoreId:(null==e?void 0:e.fileStoreId)||(null==e?void 0:e.uuid),documentType:null==e?void 0:e.title,documentName:null==e?void 0:e.title,latitude:null==e?void 0:e.latitude,longitude:null==e?void 0:e.longitude}))),(null==qt?void 0:qt.length)>0&&n.createElement(l.Fragment,null,n.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},Je("SITE_INSPECTION_IMAGES_LOCATIONS")),n.createElement(In,{position:qt}))),n.createElement("div",{id:"timeline"},n.createElement(sn,{workflowDetails:Yt,t:Je,timeObj:Ft})),(null==vl?void 0:vl.length)>0&&n.createElement(t.ActionBar,null,tl&&(null!=Yt&&null!==(qe=Yt.data)&&void 0!==qe&&null!==(Ke=qe.actionState)&&void 0!==Ke&&Ke.nextActions||null!=Yt&&null!==($e=Yt.data)&&void 0!==$e&&$e.nextActions)?n.createElement(t.Menu,{localeKeyPrefix:"WF_EMPLOYEE_NOC",options:vl,optionKey:"action",t:Je,onSelect:function(e){var t,l,n,o,i,a;console.log("selected action",e);const r=null==Ot||null===(t=Ot.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.applicationNo,u=(null==xt||null===(n=xt.documents)||void 0===n||n.every(e=>null!=(null==e?void 0:e.filestoreId)&&""!==(null==e?void 0:e.filestoreId)),null==e||null===(o=e.state)||void 0===o||null===(i=o.actions)||void 0===i?void 0:i.filter(t=>t.action==(null==e?void 0:e.action))),d=null==_t?void 0:_t.filter(e=>{var t;return(null==e?void 0:e.uuid)==(null===(t=u[0])||void 0===t?void 0:t.nextState)});Et(null==d||null===(a=d[0])||void 0===a?void 0:a.actions);const s={Licenses:[e]};if("EDIT"==(null==e?void 0:e.action))nt({key:"true",warning:!0,message:"COMMON_NOT_EDITABLE_HERE_LABEL"}),setTimeout(()=>{nt(null)},3e3);else if("DRAFT"==(null==e?void 0:e.action))nt({key:"true",warning:!0,message:"COMMON_EDIT_APPLICATION_BEFORE_SAVE_OR_SUBMIT_LABEL"}),setTimeout(()=>{nt(null)},3e3);else if("APPLY"==(null==e?void 0:e.action)||"RESUBMIT"==(null==e?void 0:e.action)||"CANCEL"==(null==e?void 0:e.action))El(s);else if("PAY"==(null==e?void 0:e.action))et.push("/digit-ui/employee/payment/collect/obpas_noc/"+r+"/"+Qe+"?tenantId="+Qe);else{var c,m,v;if("FIELDINSPECTION_INPROGRESS"===(null==Ot||null===(c=Ot.Noc)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.applicationStatus)&&"SEND_FOR_INSPECTION_REPORT"==(null==e?void 0:e.action)&&(null==xt||!xt.documents||(null==xt||null===(v=xt.documents)||void 0===v?void 0:v.length)<4))return void nt({key:"true",error:!0,message:"Please_Add_Site_Images_With_Geo_Location"});al(!0),ol(e)}}}):null,n.createElement(t.SubmitBar,{ref:cl,label:Je("WF_TAKE_ACTION"),onSubmit:()=>ll(!tl)})),Dt&&n.createElement(t.Modal,{headerBarEnd:n.createElement(Jt,{onClick:()=>{Tt(!1),It(null)}})},null!=Lt&&Lt.toLowerCase().endsWith(".pdf")?n.createElement("a",{style:{color:"blue"},href:Lt,target:"_blank",rel:"noopener noreferrer"},Je("CS_VIEW_DOCUMENT")):n.createElement("img",{src:Lt,alt:"Preview",style:{width:"100%",height:"100%",objectFit:"contain"}})),il?n.createElement(Sn,{t:Je,action:nl,tenantId:Qe,state:tt,getEmployees:pt,id:Ze,applicationDetails:Ot,applicationData:null==Ot?void 0:Ot.Noc,closeModal:()=>{ol(null),al(!1)},submitAction:El,actionData:null==Yt||null===(Xe=Yt.data)||void 0===Xe?void 0:Xe.timeline,workflowDetails:Yt,showToast:lt,setShowToast:nt,closeToast:dl,errors:ot,showErrorToast:at,errorOne:ut,closeToastOne:()=>{rt(null)}}):null,lt&&n.createElement(t.Toast,{error:null==lt?void 0:lt.error,warning:null==lt?void 0:lt.warning,label:Je(null==lt?void 0:lt.message),isDleteBtn:!0,onClose:dl}),Ct&&n.createElement(t.Loader,null))},NewNOCEditApplication:()=>{var e,a,r,u,d,m,v,p,E,f,g,_,h,A,N,S,b,y;const{id:C}=o.useParams(),{t:O}=(o.useHistory(),i.useTranslation()),D=s.useDispatch(),[T,L]=l.useState(null),I=s.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:B}=Digit.Hooks.noc.useNOCSearchApplication({applicationNo:C},R),F=null==B?void 0:B.resData;console.log("applicationDetails here==>",F);const M=(null==F||null===(e=F.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===(d=u.additionalDetails)||void 0===d?void 0:d.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===(g=M.nocDetails)||void 0===g||null===(_=g.additionalDetails)||void 0===_?void 0:_.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:$,isLoading:X}=Digit.Hooks.noc.useNocType(V),{data:Z,isLoading:J}=Digit.Hooks.useTenants(),[Q,ee]=l.useState(Digit.Hooks.noc.useTenants()),te=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],le=null==Z?void 0:Z.map(e=>c({},e,{displayName:O(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===(N=A.filter(e=>e.active))||void 0===N||N.map(e=>{}));const[oe,ie]=l.useState(null),{data:ae,isLoading:re}=Digit.Hooks.useCustomMDMS(V,"tenant",[{name:"zoneMaster",filter:"$.[?(@.tanentId == '"+R+"')]"}]),ue=(null==ae||null===(S=ae.tenant)||void 0===S||null===(b=S.zoneMaster)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.zones)||[];return console.log("zoneOptions==>",ue),l.useEffect(()=>{if(D({type:"RESET_NOC_NEW_APPLICATION_FORM"}),!x&&!Y&&null!=M&&M.nocDetails&&!J&&!re&&!X){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;D(zo(t,l))}),D(Go("ownerIdList",z)),D(Vo("ownerPhotoList",j));const t=c({},k),l=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)}),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==$?void 0:$.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)})});D(Wo("applicationDetails",t)),D(Wo("siteDetails",l)),D(Wo("documents",e)),D(Wo("apiData",F))}},[x,F,Y,re,X]),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},O("NOC_REGISTRATION_APPLICATION")),n.createElement(Uo,{stepsList:oi,onSubmit:e=>{},step:P,setStep:e=>{D(jo(e))}}),T&&n.createElement(t.Toast,{error:T.key,label:O(T.label),onClose:()=>{L(null)},isDleteBtn:"true"}))},NOCCitizenSearchApplication:()=>{const{t:e}=i.useTranslation(),o=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==o?void 0:o.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:g}=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(ci,{t:e,tenantId:a,onSubmit:function(e,t){console.log("_data==>",e);let l=bt(e);!!l.applicationNo&&!l.mobileNumber&&(console.log("we are deleteing mobileNumber here"),delete l.mobileNumber),d(l)},isLoading:f,Count:v,error:g,data:c}))}};exports.NOCLinks=mi,exports.NOCModule=vi,exports.NOCReducers=()=>d.combineReducers({NOCNewApplicationFormReducer:xo}),exports.initNOCComponents=()=>{Object.entries(pi).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
|