@mseva/digit-ui-module-obps 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e,t=require("react"),l=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-i18next"),i=require("react-router-dom"),o=require("@mseva/digit-ui-react-components"),a=require("react-hook-form");require("react-dom");var r=require("react-query");function u(){return(u=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 d(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var s=function(e,t){return e===t||e!=e&&t!=t},c=function(e,t){for(var l=e.length;l--;)if(s(e[l][0],t))return l;return-1},p=Array.prototype.splice;function v(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])}}v.prototype.clear=function(){this.__data__=[],this.size=0},v.prototype.delete=function(e){var t=this.__data__,l=c(t,e);return!(l<0||(l==t.length-1?t.pop():p.call(t,l,1),--this.size,0))},v.prototype.get=function(e){var t=this.__data__,l=c(t,e);return l<0?void 0:t[l][1]},v.prototype.has=function(e){return c(this.__data__,e)>-1},v.prototype.set=function(e,t){var l=this.__data__,n=c(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var m=v,E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(e,t){return e(t={exports:{}},t.exports),t.exports}var g,A="object"==typeof E&&E&&E.Object===Object&&E,S="object"==typeof self&&self&&self.Object===Object&&self,h=A||S||Function("return this")(),b=h.Symbol,y=Object.prototype,C=y.hasOwnProperty,T=y.toString,D=b?b.toStringTag:void 0,P=Object.prototype.toString,N=b?b.toStringTag:void 0,I=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":N&&N in Object(e)?function(e){var t=C.call(e,D),l=e[D];try{e[D]=void 0;var n=!0}catch(e){}var i=T.call(e);return n&&(t?e[D]=l:delete e[D]),i}(e):function(e){return P.call(e)}(e)},L=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},B=function(e){if(!L(e))return!1;var t=I(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},O=h["__core-js_shared__"],R=(g=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",x=Function.prototype.toString,w=function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""},M=/^\[object .+?Constructor\]$/,k=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!L(e)||(t=e,R&&R in t))&&(B(e)?k:M).test(w(e));var t}(l)?l:void 0},U=F(h,"Map"),H=F(Object,"create"),W=Object.prototype.hasOwnProperty,j=Object.prototype.hasOwnProperty;function $(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}$.prototype.clear=function(){this.__data__=H?H(null):{},this.size=0},$.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},$.prototype.get=function(e){var t=this.__data__;if(H){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return W.call(t,e)?t[e]:void 0},$.prototype.has=function(e){var t=this.__data__;return H?void 0!==t[e]:j.call(t,e)},$.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=H&&void 0===t?"__lodash_hash_undefined__":t,this};var z=$,Y=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 G(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])}}G.prototype.clear=function(){this.size=0,this.__data__={hash:new z,map:new(U||m),string:new z}},G.prototype.delete=function(e){var t=Y(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return Y(this,e).get(e)},G.prototype.has=function(e){return Y(this,e).has(e)},G.prototype.set=function(e,t){var l=Y(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var K=G;function V(e){var t=this.__data__=new m(e);this.size=t.size}V.prototype.clear=function(){this.__data__=new m,this.size=0},V.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},V.prototype.get=function(e){return this.__data__.get(e)},V.prototype.has=function(e){return this.__data__.has(e)},V.prototype.set=function(e,t){var l=this.__data__;if(l instanceof m){var n=l.__data__;if(!U||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new K(n)}return l.set(e,t),this.size=l.size,this};var q=V,X=function(){try{var e=F(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),J=function(e,t,l){"__proto__"==t&&X?X(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},Z=Object.prototype.hasOwnProperty,Q=function(e,t,l){var n=e[t];Z.call(e,t)&&s(n,l)&&(void 0!==l||t in e)||J(e,t,l)},ee=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?J(l,r,u):Q(l,r,u)}return l},te=function(e){return null!=e&&"object"==typeof e},le=function(e){return te(e)&&"[object Arguments]"==I(e)},ne=Object.prototype,ie=ne.hasOwnProperty,oe=ne.propertyIsEnumerable,ae=le(function(){return arguments}())?le:function(e){return te(e)&&ie.call(e,"callee")&&!oe.call(e,"callee")},re=Array.isArray,ue=function(){return!1},de=f(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?h.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ue}),se=/^(?:0|[1-9]\d*)$/,ce=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},pe=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;var me=function(e){return function(t){return e(t)}},Ee=f(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&A.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),fe=Ee&&Ee.isTypedArray,_e=fe?me(fe):function(e){return te(e)&&pe(e.length)&&!!ve[I(e)]},ge=Object.prototype.hasOwnProperty,Ae=function(e,t){var l=re(e),n=!l&&ae(e),i=!l&&!n&&de(e),o=!l&&!n&&!i&&_e(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!ge.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ce(d,u))||r.push(d);return r},Se=Object.prototype,he=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Se)},be=function(e,t){return function(l){return e(t(l))}},ye=be(Object.keys,Object),Ce=Object.prototype.hasOwnProperty,Te=function(e){return null!=e&&pe(e.length)&&!B(e)},De=function(e){return Te(e)?Ae(e):function(e){if(!he(e))return ye(e);var t=[];for(var l in Object(e))Ce.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Pe=Object.prototype.hasOwnProperty,Ne=function(e){return Te(e)?Ae(e,!0):function(e){if(!L(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=he(e),l=[];for(var n in e)("constructor"!=n||!t&&Pe.call(e,n))&&l.push(n);return l}(e)},Ie=f(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?h.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Le=function(){return[]},Be=Object.prototype.propertyIsEnumerable,Oe=Object.getOwnPropertySymbols,Re=Oe?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];Be.call(e,r)&&(a[o++]=r)}return a}(Oe(e)))}:Le,xe=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},we=be(Object.getPrototypeOf,Object),Me=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)xe(t,Re(e)),e=we(e);return t}:Le,ke=function(e,t,l){var n=t(e);return re(e)?n:xe(n,l(e))},Fe=function(e){return ke(e,De,Re)},Ue=function(e){return ke(e,Ne,Me)},He=F(h,"DataView"),We=F(h,"Promise"),je=F(h,"Set"),$e=F(h,"WeakMap"),ze=w(He),Ye=w(U),Ge=w(We),Ke=w(je),Ve=w($e),qe=I;(He&&"[object DataView]"!=qe(new He(new ArrayBuffer(1)))||U&&"[object Map]"!=qe(new U)||We&&"[object Promise]"!=qe(We.resolve())||je&&"[object Set]"!=qe(new je)||$e&&"[object WeakMap]"!=qe(new $e))&&(qe=function(e){var t=I(e),l="[object Object]"==t?e.constructor:void 0,n=l?w(l):"";if(n)switch(n){case ze:return"[object DataView]";case Ye:return"[object Map]";case Ge:return"[object Promise]";case Ke:return"[object Set]";case Ve:return"[object WeakMap]"}return t});var Xe=qe,Je=Object.prototype.hasOwnProperty,Ze=h.Uint8Array,Qe=function(e){var t=new e.constructor(e.byteLength);return new Ze(t).set(new Ze(e)),t},et=/\w*$/,tt=b?b.prototype:void 0,lt=tt?tt.valueOf:void 0,nt=Object.create,it=function(){function e(){}return function(t){if(!L(t))return{};if(nt)return nt(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),ot=Ee&&Ee.isMap,at=ot?me(ot):function(e){return te(e)&&"[object Map]"==Xe(e)},rt=Ee&&Ee.isSet,ut=rt?me(rt):function(e){return te(e)&&"[object Set]"==Xe(e)},dt={};dt["[object Arguments]"]=dt["[object Array]"]=dt["[object ArrayBuffer]"]=dt["[object DataView]"]=dt["[object Boolean]"]=dt["[object Date]"]=dt["[object Float32Array]"]=dt["[object Float64Array]"]=dt["[object Int8Array]"]=dt["[object Int16Array]"]=dt["[object Int32Array]"]=dt["[object Map]"]=dt["[object Number]"]=dt["[object Object]"]=dt["[object RegExp]"]=dt["[object Set]"]=dt["[object String]"]=dt["[object Symbol]"]=dt["[object Uint8Array]"]=dt["[object Uint8ClampedArray]"]=dt["[object Uint16Array]"]=dt["[object Uint32Array]"]=!0,dt["[object Error]"]=dt["[object Function]"]=dt["[object WeakMap]"]=!1;var st=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!L(t))return t;var c=re(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&Je.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 p=Xe(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(de(t))return Ie(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||he(e)?{}:it(we(e))}(t),!u)return d?function(e,t){return ee(e,Me(e),t)}(t,function(e,t){return e&&ee(t,Ne(t),e)}(r,t)):function(e,t){return ee(e,Re(e),t)}(t,function(e,t){return e&&ee(t,De(t),e)}(r,t))}else{if(!dt[p])return o?t:{};r=function(e,t,l){var n,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return Qe(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var l=t?Qe(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?Qe(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(n=e).constructor(n.source,et.exec(n))).lastIndex=n.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return lt?Object(lt.call(e)):{}}}(t,p,u)}}a||(a=new q);var m=a.get(t);if(m)return m;a.set(t,r),ut(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):at(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?Ue:Fe:d?Ne:De)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),Q(r,o,e(i,l,n,o,t,a))}),r},ct=function(e){return st(e,5)};const pt=e=>{switch(e){case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6-9]{1}[0-9]{9}$/i}},vt=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},mt=()=>require("uuid/v4")(),Et=(e,t)=>{var l,n;let i={Noc:e},o=(null==t||null===(l=t.nocDocuments)||void 0===l?void 0:l.nocDocuments.length)>0&&(null==t||null===(n=t.nocDocuments)||void 0===n?void 0:n.nocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}).map(e=>({fileName:(null==e?void 0:e.fileName)||"",name:(null==e?void 0:e.name)||"",fileStoreId:null==e?void 0:e.fileStoreId,fileUrl:"",isClickable:!0,link:"",title:null==e?void 0:e.documentType,documentType:null==e?void 0:e.documentType,id:null==e?void 0:e.id,additionalDetails:{}})))||[];return o=[...o,...null!=t&&t.PrevStateNocDocuments?null==t?void 0:t.PrevStateNocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}):[]],i.Noc.documents=o,i},ft=function(e,t,l,n){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(null==e?void 0:e.tenantId,{edcrNumber:null==e?void 0:e.edcrNumber})).then(function(i){var o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M;const k=null==i?void 0:i.edcrDetail[0];var F,U,H,W;e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.locality.i18nkey=""+n(`${vt(null==e||null===(r=e.landInfo)||void 0===r||null===(u=r.address)||void 0===u?void 0:u.tenantId,".","_").toUpperCase()}_REVENUE_${null==e||null===(d=e.landInfo)||void 0===d||null===(s=d.address)||void 0===s||null===(c=s.locality)||void 0===c?void 0:c.code}`),e.placeName=(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.GISPlaceName)||"",e.data={scrutinyNumber:{edcrNumber:null==k?void 0:k.edcrNumber},applicantName:null==k||null===(v=k.planDetail)||void 0===v||null===(m=v.planInformation)||void 0===m?void 0:m.applicantName,applicationDate:null==e||null===(E=e.auditDetails)||void 0===E?void 0:E.createdTime,applicationType:null==k?void 0:k.appliactionType,holdingNumber:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.holdingNo,boundaryWallLength:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.boundaryWallLength,occupancyType:null==k||null===(g=k.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.occupancy,registrationDetails:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==t||null===(h=t.BPA)||void 0===h?void 0:h.RiskTypeComputation,null==k||null===(b=k.planDetail)||void 0===b||null===(y=b.plot)||void 0===y?void 0:y.area,null==k||null===(C=k.planDetail)||void 0===C?void 0:C.blocks),serviceType:(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.serviceType)||(null==k?void 0:k.applicationSubType)},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(D=e.landInfo)||void 0===D?void 0:D.owners,ownershipCategory:{active:!0,code:null==e||null===(P=e.landInfo)||void 0===P?void 0:P.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(N=e.landInfo)||void 0===N?void 0:N.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==t||null===(I=t.BPA)||void 0===I?void 0:I.RiskTypeComputation,null==k||null===(L=k.planDetail)||void 0===L||null===(B=L.plot)||void 0===B?void 0:B.area,null==k||null===(O=k.planDetail)||void 0===O?void 0:O.blocks),e.subOccupancy=(e=>{let t=[],l=[],i={};return e&&e.map((e,o)=>{var a,r;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&(null===(r=t)||void 0===r?void 0:r.length)>0&&""!=t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:n("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),i["Block_"+(o+1)]=l}),i})(null==e||null===(R=e.landInfo)||void 0===R?void 0:R.unit),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(x=e.businessService)||void 0===x?void 0:x.split(".")[0],applicationType:(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.applicationType)||(null==k?void 0:k.appliactionType),serviceType:(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.serviceType)||(null==k?void 0:k.applicationSubType)},null!=e&&e.businessService.includes("OC")?(sessionStorage.setItem("BPAintermediateValue",JSON.stringify({...e})),l.push(`/digit-ui/citizen/obps/ocbpa/${null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.applicationType.toLowerCase()}/${null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.serviceType.toLowerCase()}`)):(sessionStorage.setItem("BPAintermediateValue",JSON.stringify({...e})),l.push(`/digit-ui/citizen/obps/bpa/${null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.applicationType.toLowerCase()}/${null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.serviceType.toLowerCase()}`))})}catch(e){return Promise.reject(e)}},_t=(e,t)=>{let l=[];return e&&e.map(e=>{l.push(e.id?{documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{},id:e.id}:{documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{}})}),l=[...l,...t||[]],l};function gt(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}const At=e=>{var t;let l=[],n=null==e?void 0:e.subOccupancy;if(n){var i;let t=Object.entries(n);null==e||null===(i=e.landInfo)||void 0===i||i.unit.map((e,n)=>{t.map((t,n)=>{var i;e.id&&e.floorNo===(null===(i=t[0])||void 0===i?void 0:i.split("_")[1])&&l.push({...e,usageCategory:gt(t[1])})})}),t&&t.map((e,t)=>{var n;l.length>0&&(null==l?void 0:l.some(t=>{var l;return(null==t?void 0:t.floorNo)===(null===(l=e[0])||void 0===l?void 0:l.split("_")[1])}))||l.push({blockIndex:t,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:gt(e[1])})})}return l.length>0?l:null==e||null===(t=e.landInfo)||void 0===t?void 0:t.unit},St=(e,t)=>{var l,n,i;if(t)return e.landInfo.owners;let o=ct(null==e||null===(l=e.owners)||void 0===l?void 0:l.owners);return o&&(null==o||o.forEach(e=>{var t,l;null!=e&&null!==(t=e.gender)&&void 0!==t&&t.code&&(e.gender=null===(l=e.gender)||void 0===l?void 0:l.code),null!=e&&e.fatherOrHusbandName||(e.fatherOrHusbandName="NAME"),e.active=!0})),null==e||null===(n=e.landInfo)||void 0===n||null===(i=n.owners)||void 0===i||i.map(e=>{(null==o?void 0:o.length)>0&&(null==o?void 0:o.some(t=>t.id===e.id))||null==o||o.push({...e,active:!1})}),o},ht=(e,t)=>{var l,n;return t?null==e||null===(l=e.landInfo)||void 0===l?void 0:l.ownershipCategory:e.owners.ownershipCategory.code||(null==e||null===(n=e.landInfo)||void 0===n?void 0:n.ownershipCategory)},bt=function(e,t,l){var n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I;return void 0===t&&(t=!1),void 0===l&&(l=!1),t?(e.landInfo=e.landInfo,e.landInfo.owners.forEach((t,l)=>{var n,i;null!=t&&null!==(n=t.gender)&&void 0!==n&&n.code&&(e.landInfo.owners[l].gender=null==t||null===(i=t.gender)||void 0===i?void 0:i.code)})):(e.landInfo.owners.map((t,l)=>{var n;e.landInfo.owners[l].gender=null==t||null===(n=t.gender)||void 0===n?void 0:n.code}),e.landInfo.address.pincode=null==e||null===(E=e.address)||void 0===E?void 0:E.pincode,e.landInfo.address.city=null==e||null===(f=e.address)||void 0===f||null===(_=f.city)||void 0===_?void 0:_.code,e.landInfo.address.locality=null==e||null===(g=e.address)||void 0===g?void 0:g.locality,e.landInfo.address.landmark=null==e||null===(A=e.address)||void 0===A?void 0:A.landmark,e.landInfo.address.street=null!=e&&null!==(S=e.address)&&void 0!==S&&S.street?null==e||null===(h=e.address)||void 0===h?void 0:h.street:null,e.landInfo.address.city=(null==e||null===(b=e.landInfo)||void 0===b||null===(y=b.address)||void 0===y||null===(C=y.city)||void 0===C?void 0:C.code)||(null==e||null===(T=e.landInfo)||void 0===T||null===(D=T.address)||void 0===D?void 0:D.tenantId),e.landInfo.unit=null!=e&&null!==(P=e.landInfo)&&void 0!==P&&P.unit&&(null==e||null===(N=e.landInfo)||void 0===N?void 0:N.unit.length)>0?(e=>{let t=[];return e&&e.map((e,l)=>{t.push({blockIndex:l,usageCategory:e.usageCategory,occupancyType:e.occupancyType,floorNo:e.floorNo,unitType:e.unitType,id:e.id})}),t})(null==e||null===(I=e.landInfo)||void 0===I?void 0:I.unit):null!=e&&e.subOccupancy?(e=>{let t=[];return e&&Object.entries(e).map((e,l)=>{var n;t.push({blockIndex:l,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:gt(e[1])})}),t})(null==e?void 0:e.subOccupancy):[]),{BPA:{id:null==e?void 0:e.id,applicationNo:null==e?void 0:e.applicationNo,approvalNo:null==e?void 0:e.approvalNo,accountId:null==e?void 0:e.accountId,edcrNumber:null==e?void 0:e.edcrNumber,riskType:null==e?void 0:e.riskType,businessService:null==e?void 0:e.businessService,landId:null==e?void 0:e.landId,tenantId:(null==e?void 0:e.tenantId)||(null==e||null===(n=e.address)||void 0===n?void 0:n.tenantId),approvalDate:null==e?void 0:e.approvalDate,applicationDate:null==e?void 0:e.applicationDate,status:l||e.status?e.status:"INITIATED",documents:_t(null==e||null===(i=e.documents)||void 0===i?void 0:i.documents,null==e?void 0:e.PrevStateDocuments),landInfo:t?null==e?void 0:e.landInfo:{...null==e?void 0:e.landInfo,ownershipCategory:ht(e,t),owners:St(e,t),unit:At(e)},assignee:l?e.assignee:[],workflow:{action:"SEND_TO_CITIZEN",assignes:null,comments:null,varificationDocuments:null},auditDetails:null==e?void 0:e.auditDetails,additionalDetails:{...null==e?void 0:e.additionalDetails,selfCertificationCharges:{BPA_MALBA_CHARGES:sessionStorage.getItem("Malbafees"),BPA_LABOUR_CESS:sessionStorage.getItem("LabourCess"),BPA_WATER_CHARGES:sessionStorage.getItem("WaterCharges"),BPA_GAUSHALA_CHARGES_CESS:sessionStorage.getItem("GaushalaFees"),BPA_LESS_ADJUSMENT_PLOT:sessionStorage.getItem("lessAdjusment"),BPA_DEVELOPMENT_CHARGES:sessionStorage.getItem("development"),BPA_OTHER_CHARGES:sessionStorage.getItem("otherCharges")},GISPlaceName:null==e||null===(o=e.address)||void 0===o?void 0:o.placeName,holdingNo:null!=e&&null!==(a=e.data)&&void 0!==a&&a.holdingNumber?null==e||null===(r=e.data)||void 0===r?void 0:r.holdingNumber:null==e||null===(u=e.additionalDetails)||void 0===u?void 0:u.holdingNo,boundaryWallLength:null!=e&&null!==(d=e.data)&&void 0!==d&&d.boundaryWallLength?null==e||null===(s=e.data)||void 0===s?void 0:s.boundaryWallLength:null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.boundaryWallLength,registrationDetails:null!=e&&null!==(p=e.data)&&void 0!==p&&p.registrationDetails?null==e||null===(v=e.data)||void 0===v?void 0:v.registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails},applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",occupancyType:"A"}}},yt=e=>{var t;let l=[];return null===(t=e.documents)||void 0===t||t.documents.map(t=>{var n,i;l.push({fileStoreId:t.fileStoreId,fileStore:t.fileStoreId,fileName:t.fileName,fileUrl:"",documentType:t.documentType,tenantId:null==e||null===(n=e.result)||void 0===n||null===(i=n.Licenses[0])||void 0===i?void 0:i.tenantId})}),l},Ct=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}},Tt=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()}`},Dt=function(e,t,l,n,i){try{var o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O;const R=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),n["Block_"+(o+1)]=l}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.data={applicantName:null==t||null===(r=t.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.applicantName,applicationDate:null==e||null===(d=e.auditDetails)||void 0===d?void 0:d.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.holdingNo,boundaryWallLength:null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.boundaryWallLength,occupancyType:null==t||null===(p=t.planDetail)||void 0===p||null===(v=p.planInformation)||void 0===v?void 0:v.occupancy,registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(E=l.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==t||null===(f=t.planDetail)||void 0===f||null===(_=f.plot)||void 0===_?void 0:_.area,null==t||null===(g=t.planDetail)||void 0===g?void 0:g.blocks),serviceType:(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}};let x=[];null==e||e.documents.map(e=>x.push(e)),e.PrevStateDocuments=ct(x),e.documents={documents:[]};let w=[];n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{w.push(e)})}),e.PrevStateNocDocuments=w,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(S=e.landInfo)||void 0===S?void 0:S.owners,ownershipCategory:{active:!0,code:null==e||null===(h=e.landInfo)||void 0===h?void 0:h.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(b=e.landInfo)||void 0===b?void 0:b.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(y=l.BPA)||void 0===y?void 0:y.RiskTypeComputation,null==t||null===(C=t.planDetail)||void 0===C||null===(T=C.plot)||void 0===T?void 0:T.area,null==t||null===(D=t.planDetail)||void 0===D?void 0:D.blocks),e.subOccupancy=R(null==e||null===(P=e.landInfo)||void 0===P?void 0:P.unit);let M="BPA";return null==l||null===(N=l.BPA)||void 0===N||null===(I=N.homePageUrlLinks)||void 0===I||I.map(e=>{(null==t?void 0:t.appliactionType)===(null==e?void 0:e.applicationType)&&(null==t?void 0:t.applicationSubType)===(null==e?void 0:e.serviceType)&&(M=null==e?void 0:e.flow)}),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(L=e.businessService)||void 0===L?void 0:L.split(".")[0],applicationType:(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}},Pt=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),Nt=e=>{try{const t=e.match(/(\d{2})-(\d{2})-(\d{4}) (\d{2}):(\d{2}):(\d{2})/);return Date.UTC(+t[3],t[2]-1,+t[1],+t[4],+t[5])}catch(t){return e}},It=(e,t)=>{let l="BPA.NC_APP_FEE";return"BPA_LOW"===e?l="BPA.LOW_RISK_PERMIT_FEE":"BPA"===e?l="PENDING_APPL_FEE"==t?"BPA.NC_APP_FEE":"BPA.NC_SAN_FEE":"BPA_OC"===e&&(l="PENDING_APPL_FEE"==t?"BPA.NC_OC_APP_FEE":"BPA.NC_OC_SAN_FEE"),l},Lt=(e,t)=>{if(window.mSewaApp&&window.mSewaApp.isMsewaApp()&&window.mSewaApp.downloadBase64File){var l=new FileReader;l.readAsDataURL(e),l.onloadend=function(){mSewaApp.downloadBase64File(l.result,t)}}else{const l=document.createElement("a");l.href=URL.createObjectURL(e),l.download=t,document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(l.href),7e3)}},Bt=e=>{const t=URL.createObjectURL(e);var l=window.open(t);null!=l&&l.addEventListener("load",e=>{l.focus(),l.print()})},Ot=function(e,t,l,n,i,o){void 0===i&&(i="download");try{function a(){return Promise.resolve(Digit.PaymentService.printReciept(l,{fileStoreIds:e.filestoreIds[0]})).then(function(l){var n;window.open(l[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank");const o=parseInt(e.status,10);201!==o&&200!==o||("print"==i?Bt(new Blob([e.data],{type:"application/pdf"})):Lt(new Blob([e.data],{type:"application/pdf"}),`RECEIPT-${t}.pdf`))})}let e=null;console.log("payments",n);const o=function(t){if(null===(t=n[0])||void 0===t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(l,{Payments:n},"bpa-receipt")).then(function(t){e=t});var i;e={filestoreIds:[null===(i=n[0])||void 0===i?void 0:i.fileStoreId]}}();return Promise.resolve(o&&o.then?o.then(a):a())}catch(e){return Promise.reject(e)}},Rt=function(e,t){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e})).then(function(l){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,n,i,o,a,r,u,d,s,c,p,v;return 0==(null==e||null===(t=e.BPA)||void 0===t?void 0:t.length)?null!=l&&null!==(s=l.edcrDetail)&&void 0!==s&&s[0]?null==l||null===(c=l.edcrDetail)||void 0===c?void 0:c[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&("INITIATED"==(null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.status)||"REJECTED"==(null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.status)||"PERMIT REVOCATION"==(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.status))?null!=l&&null!==(p=l.edcrDetail)&&void 0!==p&&p[0]?null==l||null===(v=l.edcrDetail)||void 0===v?void 0:v[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:"APPLICATION_NUMBER_ALREADY_EXISTS"}})})}catch(e){return Promise.reject(e)}},xt=function(e,t){void 0===t&&(t=!1);let l=[];if((null==e?void 0:e.length)>0){let n=e.filter((t,l)=>e.findIndex(e=>{var l,n,i,o,a,r;return(null==e||null===(l=e.documentType)||void 0===l||null===(n=l.split("."))||void 0===n||null===(i=n.slice(0,2))||void 0===i?void 0:i.join("_"))===(null==t||null===(o=t.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))})===l);null==n||n.map(n=>{var i,o,a,r;const u=null==e?void 0:e.filter(e=>{var t,l,i,o,a,r;return(null==n||null===(t=n.documentType)||void 0===t||null===(l=t.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))==(null==e||null===(o=e.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))});null==u||u.forEach(e=>e.title=e.documentType),l.push({title:t?"":null==u||null===(i=u[0])||void 0===i||null===(o=i.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"),values:u})})}return l},wt=e=>{var n,i,r,u,d,s,c;let{formState:p,Controller:v,register:m,control:E,t:f,reset:_,previousPage:g}=e;const A=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),h=sessionStorage.getItem("Digit.citizen.userRequestObject"),b=h?JSON.parse(h):{},y=null==b||null===(n=b.value)||void 0===n?void 0:n.info,C=null==y?void 0:y.mobileNumber,T=a.useWatch({control:E,name:"applicationType"}),D=sessionStorage.getItem("search_application")||"";D&&"undefined"!=D&&(null===(i=JSON.parse(D))||void 0===i?void 0:i.code)!==(null==T?void 0:T.code)&&E.setValue("status",""),sessionStorage.setItem("search_application",JSON.stringify(T));const{applicationTypes:P,ServiceTypes:N}=Digit.Hooks.obps.useServiceTypeFromApplicationType({Applicationtype:(null==T?void 0:T.code)||((null==y||null===(r=y.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPAREG_")).length)>0&&(null==y||null===(u=y.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY"),tenantId:A}),{data:I}=Digit.Hooks.obps.useBusinessServiceData(S,"BPA,BPA_LOW,BPA_OC,ARCHITECT,BUILDER,ENGINEER,STRUCTURALENGINEER",{});let L=[],B=[],O=[],R=[];null==I||null===(d=I.BusinessServices)||void 0===d||d.map(e=>{e.states.map(t=>{t.state&&t.applicationStatus&&("BPAREG"==e.business?O.push({code:t.applicationStatus,i18nKey:"WF_ARCHITECT_"+t.state,module:e.business}):"BPA_OC"==(null==e?void 0:e.businessService)?B.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}):L.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}))})});let x,w=[],M=[];for(x=0;x<L.length;x++)w[L[x].code]||(w[L[x].code]=!0,M.push(L[x].code));let k,F=[],U=[];for(k=0;k<B.length;k++)F[B[k].code]||(F[B[k].code]=!0,U.push(B[k].code));let H,W=[],j=[];for(H=0;H<O.length;H++)W[O[H].code]||(W[O[H].code]=!0,j.push(O[H].code));const $=[],z=[],Y=[];return M.forEach(e=>$.push({i18nKey:"WF_BPA_"+e,code:e})),U.forEach(e=>z.push({i18nKey:"WF_BPA_"+e,code:e})),j.forEach(e=>Y.push({i18nKey:"WF_BPA_"+e,code:e})),$.forEach(e=>{L.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),z.forEach(e=>{B.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),Y.forEach(e=>{O.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),R="BPA_STAKEHOLDER_REGISTRATION"===(null==T?void 0:T.code)?Y:"BUILDING_PLAN_SCRUTINY"===(null==T?void 0:T.code)?$:"BUILDING_OC_PLAN_SCRUTINY"===(null==T?void 0:T.code)?z:[],l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_NO_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:m({})})),!window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(o.MobileNumber,{name:"mobileNumber",disable:!!window.location.href.includes("obps/search/obps-application"),inputRef:m({minLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:f("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(o.CardLabelError,null,null==p||null===(s=p.errors)||void 0===s||null===(c=s.mobileNumber)||void 0===c?void 0:c.message)),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(v,{control:E,name:"applicationType",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:f})})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(v,{control:E,name:"serviceType",render:e=>l.createElement(o.Dropdown,{selected:N&&(null==N?void 0:N.length)>0?e.value:N[0],select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:f,isBPAREG:!!(N&&(null==N?void 0:N.length)>0)})})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_FROM_DATE_SEARCH_PARAM")),l.createElement(v,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_TO_DATE_SEARCH_PARAM")),l.createElement(v,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_STATUS_LABEL")),l.createElement(v,{control:E,name:"status",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:R,optionKey:"i18nKey",t:f})})),window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null),l.createElement(o.SearchField,{className:"submit"},l.createElement(o.SubmitBar,{label:f("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var e,t,l,n,i,o,a,r,u,d,s,c;_({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?C:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==y||null===(e=y.roles)||void 0===e||null===(t=e.filter(e=>e.code.includes("BPAREG_")))||void 0===t?void 0:t.length)<=0&&(null==y||null===(l=y.roles)||void 0===l?void 0:l.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==y||null===(n=y.roles)||void 0===n||null===(i=n.filter(e=>e.code.includes("BPAREG_")))||void 0===i?void 0:i.length)>0&&(null==y||null===(o=y.roles)||void 0===o?void 0:o.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==y||null===(a=y.roles)||void 0===a||null===(r=a.filter(e=>e.code.includes("BPAREG_")))||void 0===r?void 0:r.length)<=0&&(null==y||null===(u=y.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==y||null===(d=y.roles)||void 0===d||null===(s=d.filter(e=>e.code.includes("BPAREG_")))||void 0===s?void 0:s.length)>0&&(null==y||null===(c=y.roles)||void 0===c?void 0:c.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},isSubmitSuccessful:!1}),g()}},f("ES_COMMON_CLEAR_ALL"))))},Mt=e=>{var o,a;const r=sessionStorage.getItem("Digit.citizen.userRequestObject"),u=r?JSON.parse(r):{},d=null==u||null===(o=u.value)||void 0===o?void 0:o.info,{t:s}=n.useTranslation(),c=Digit.ULBService.getCurrentTenantId(),p=i.useLocation(),[v,m]=t.useState((null==d||null===(E=d.roles)||void 0===E||null===(f=E.filter(e=>e.code.includes("BPAREG_")))||void 0===f?void 0:f.length)<=0&&(null==d||null===(_=d.roles)||void 0===_?void 0:_.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?"BUILDING_PLAN_SCRUTINY":(null==d||null===(g=d.roles)||void 0===g||null===(A=g.filter(e=>e.code.includes("BPAREG_")))||void 0===A?void 0:A.length)>0&&(null==d||null===(S=d.roles)||void 0===S?void 0:S.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY");var E,f,_,g,A,S;const[h,b]=t.useState({}),[y,C]=t.useState({});t.useEffect(()=>{"/digit-ui/citizen/obps/search/application"!==p.pathname&&"/digit-ui/employee/obps/search/application"!==p.pathname||(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[p.pathname]);const T=Digit.ComponentRegistryService.getComponent("OBPSSearchApplication"),[D,P]=t.useState("");let N={},I={};if(v&&v.includes("STAKEHOLDER")||Object.keys(h).length>0&&null!=h&&h.applicationType&&null!=h&&h.applicationType.includes("STAKEHOLDER"))Object.entries(h).length<=2&&0==Object.keys(h).filter(e=>"applicationType"===e).length||(h.applicationNo&&(h.applicationNumber=h.applicationNo,h.applicationNo=""),h&&h.applicationType&&delete h.applicationType,h&&h.serviceType&&(h.tradeType=h.serviceType,delete h.serviceType),N={...h,tenantId:Digit.ULBService.getStateId()});else{if(0===Object.keys(h).length){var L,B;let e={applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",...window.location.href.includes("/search/obps-application")&&{mobileNumber:null===(L=Digit.UserService.getUser())||void 0===L||null===(B=L.info)||void 0===B?void 0:B.mobileNumber}};b({...h,...e})}I=h}const{data:O=[],isLoading:R,isSuccess:x}=Digit.Hooks.obps.useOBPSSearch(v,h,c,I,N,{enabled:""===D});return l.createElement(T,{t:s,tenantId:c,onSubmit:function(e){var t,l,n;"BPA_STAKEHOLDER_REGISTRATION"===(null==e||null===(t=e.applicationType)||void 0===t?void 0:t.code)&&((e=>""!==(null==e?void 0:e.applicationNo)||""!==(null==e?void 0:e.fromDate)||""!==(null==e?void 0:e.mobileNumber)||""!==(null==e?void 0:e.serviceType)||""!==(null==e?void 0:e.status)||""!==(null==e?void 0:e.toDate))(e)||P("BPA_ADD_MORE_PARAM_STAKEHOLDER")),C(e);var i=new Date(null==e?void 0:e.fromDate);null==i||i.setSeconds((null==i?void 0:i.getSeconds())-19800);var o=new Date(null==e?void 0:e.toDate);m(null!=e&&null!==(l=e.applicationType)&&void 0!==l&&l.code?null==e||null===(n=e.applicationType)||void 0===n?void 0:n.code:v),null==o||o.setSeconds((null==o?void 0:o.getSeconds())+86399-19800);const a={...e,...e.toDate?{toDate:null==o?void 0:o.getTime()}:{},...e.fromDate?{fromDate:null==i?void 0:i.getTime()}:{}};b(Object.keys(a).filter(e=>a[e]).reduce((e,t)=>({...e,[t]:"object"==typeof a[t]?a[t].code:a[t]}),{}))},searchData:y,isLoading:R,Count:null==O||null===(a=O[0])||void 0===a?void 0:a.Count,error:D,data:!R&&x&&(null==O?void 0:O.length)>0?O:[{display:"ES_COMMON_NO_DATA"}],setparamerror:P})},kt=()=>{var e,a,r,u;const{t:d}=n.useTranslation(),s=i.useHistory(),[c,p]=t.useState([]),[v,m]=t.useState(!1),E=Digit.ULBService.getCurrentTenantId(),f=sessionStorage.getItem("Digit.citizen.userRequestObject"),_=f?JSON.parse(f):{},g=null==_?void 0:_.value,A=null==g||null===(e=g.info)||void 0===e?void 0:e.mobileNumber,{data:S,isLoading:h,revalidate:b}=Digit.Hooks.obps.useBPAREGSearch(E,{},{mobileNumber:A},{cacheTime:0}),{data:y,isLoading:C,revalidate:T}=Digit.Hooks.obps.useBPASearch(E,{requestor:A,mobileNumber:A,limit:50-(null!=S&&null!==(a=S.Licenses)&&void 0!==a&&a.length?Number(null==S||null===(r=S.Licenses)||void 0===r?void 0:r.length):0),offset:0},{enabled:!h}),{data:D}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]);return t.useEffect(()=>()=>{p([]),null==b||b(),null==T||T()},[]),t.useEffect(()=>{if(!h&&!C){var e,t,l,n,i,o,a,r;let d=[],s=[];var u;null!=S&&null!==(e=S.Licenses)&&void 0!==e&&e.length&&(null==S||null===(u=S.Licenses)||void 0===u||u.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPAREG",d.push(e)})),null!=y&&y.length&&(null==y||y.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPA",d.push(e)})),s=[].slice.call(d).sort(function(e,t){return new Date(t.modifiedTime)-new Date(e.modifiedTime)||e.sortNumber-t.sortNumber}),p(s);let c=sessionStorage.getItem("Digit.citizen.userRequestObject");const v=c?JSON.parse(c):{};1==(null==v||null===(t=v.value)||void 0===t||null===(l=t.info)||void 0===l||null===(n=l.roles)||void 0===n?void 0:n.length)&&"CITIZEN"==(null==v||null===(i=v.value)||void 0===i||null===(o=i.info)||void 0===o||null===(a=o.roles)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.code)&&m(!0)}},[h,C,y,S]),h||C?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Header,{styles:{marginLeft:"10px"}},`${d("BPA_MY_APPLICATIONS")} ${((e,t)=>{let l=0;return"number"==typeof e&&(l+=e),"number"==typeof t&&(l+=t),l>0?`(${l})`:""})(null==S||null===(u=S.Licenses)||void 0===u?void 0:u.length,null==y?void 0:y.length)}`),null==c?void 0:c.map((e,t)=>{var n,a,r,u,c,p,m,E,f,_,g,A,S;return"BPAREG"===e.type?l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNumber}),l.createElement(o.KeyNote,{keyValue:d("BPA_LICENSE_TYPE"),note:d("TRADELICENSE_TRADETYPE_"+(null==e||null===(n=e.tradeLicenseDetail)||void 0===n||null===(a=n.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0]))}),(null==e||null===(c=e.tradeLicenseDetail)||void 0===c||null===(p=c.tradeUnits)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.tradeType.includes("ARCHITECT"))&&l.createElement(o.KeyNote,{keyValue:d("BPA_COUNCIL_OF_ARCH_NO_LABEL"),note:null==e||null===(E=e.tradeLicenseDetail)||void 0===E||null===(f=E.additionalDetail)||void 0===f?void 0:f.counsilForArchNo}),l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICANT_NAME_LABEL"),note:null==e||null===(_=e.tradeLicenseDetail)||void 0===_||null===(g=_.owners)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.name}),l.createElement(o.KeyNote,{keyValue:d("TL_COMMON_TABLE_COL_STATUS"),note:d("WF_ARCHITECT_"+(null==e?void 0:e.status)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/stakeholder/"+(null==e?void 0:e.applicationNumber),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:d("BPA_COMP_WORKFLOW"),onSubmit:()=>(e=>{var t,l,n,i,o,a,r,u,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W,j,$,z,Y,G,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,pe,ve,me;let Ee=e,fe={Correspondenceaddress:(null==Ee||null===(t=Ee.tradeLicenseDetail)||void 0===t||null===(l=t.owners)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.correspondenceAddress)||`${null!=Ee&&null!==(i=Ee.tradeLicenseDetail)&&void 0!==i&&null!==(o=i.address)&&void 0!==o&&o.doorNo?(null==Ee||null===(a=Ee.tradeLicenseDetail)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.doorNo)+", ":""} ${null!=Ee&&null!==(u=Ee.tradeLicenseDetail)&&void 0!==u&&null!==(c=u.address)&&void 0!==c&&c.street?(null==Ee||null===(p=Ee.tradeLicenseDetail)||void 0===p||null===(v=p.address)||void 0===v?void 0:v.street)+", ":""}${null!=Ee&&null!==(m=Ee.tradeLicenseDetail)&&void 0!==m&&null!==(E=m.address)&&void 0!==E&&E.landmark?(null==Ee||null===(f=Ee.tradeLicenseDetail)||void 0===f||null===(_=f.address)||void 0===_?void 0:_.landmark)+", ":""}${d(null==Ee||null===(g=Ee.tradeLicenseDetail)||void 0===g||null===(A=g.address)||void 0===A?void 0:A.locality.code)}, ${d(null!=Ee&&null!==(S=Ee.tradeLicenseDetail)&&void 0!==S&&null!==(h=S.address)&&void 0!==h&&h.city?null==Ee||null===(b=Ee.tradeLicenseDetail)||void 0===b||null===(y=b.address)||void 0===y?void 0:y.city.code:"")},${d(null==Ee||null===(C=Ee.tradeLicenseDetail)||void 0===C||null===(T=C.address)||void 0===T?void 0:T.pincode)?""+(null===(D=Ee.tradeLicenseDetail)||void 0===D||null===(P=D.address)||void 0===P?void 0:P.pincode):" "}`,formData:{LicneseDetails:{PanNumber:null==Ee||null===(N=Ee.tradeLicenseDetail)||void 0===N||null===(I=N.owners)||void 0===I||null===(L=I[0])||void 0===L?void 0:L.pan,PermanentAddress:null==Ee||null===(B=Ee.tradeLicenseDetail)||void 0===B||null===(O=B.owners)||void 0===O||null===(R=O[0])||void 0===R?void 0:R.permanentAddress,email:null==Ee||null===(x=Ee.tradeLicenseDetail)||void 0===x||null===(w=x.owners)||void 0===w||null===(M=w[0])||void 0===M?void 0:M.emailId,gender:{code:null==Ee||null===(k=Ee.tradeLicenseDetail)||void 0===k||null===(F=k.owners)||void 0===F||null===(U=F[0])||void 0===U?void 0:U.gender,i18nKey:"COMMON_GENDER_"+(null==Ee||null===(H=Ee.tradeLicenseDetail)||void 0===H||null===(W=H.owners)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.gender),value:null==Ee||null===($=Ee.tradeLicenseDetail)||void 0===$||null===(z=$.owners)||void 0===z||null===(Y=z[0])||void 0===Y?void 0:Y.gender},mobileNumber:null==Ee||null===(G=Ee.tradeLicenseDetail)||void 0===G||null===(K=G.owners)||void 0===K||null===(V=K[0])||void 0===V?void 0:V.mobileNumber,name:null==Ee||null===(q=Ee.tradeLicenseDetail)||void 0===q||null===(X=q.owners)||void 0===X||null===(J=X[0])||void 0===J?void 0:J.name},LicneseType:{LicenseType:{i18nKey:"TRADELICENSE_TRADETYPE_"+(null==Ee||null===(Z=Ee.tradeLicenseDetail)||void 0===Z||null===(Q=Z.tradeUnits)||void 0===Q||null===(ee=Q[0])||void 0===ee?void 0:ee.tradeType.split(".")[0]),role:["BPA_"+(null==Ee||null===(te=Ee.tradeLicenseDetail)||void 0===te||null===(le=te.tradeUnits)||void 0===le||null===(ne=le[0])||void 0===ne?void 0:ne.tradeType.split(".")[0])],tradeType:null==Ee||null===(ie=Ee.tradeLicenseDetail)||void 0===ie||null===(oe=ie.tradeUnits)||void 0===oe||null===(ae=oe[0])||void 0===ae?void 0:ae.tradeType},ArchitectNo:(null==Ee||null===(re=Ee.tradeLicenseDetail)||void 0===re||null===(ue=re.additionalDetail)||void 0===ue?void 0:ue.counsilForArchNo)||null}},isAddressSame:(null==Ee||null===(de=Ee.tradeLicenseDetail)||void 0===de||null===(se=de.owners)||void 0===se||null===(ce=se[0])||void 0===ce?void 0:ce.correspondenceAddress)===(null==Ee||null===(pe=Ee.tradeLicenseDetail)||void 0===pe||null===(ve=pe.owners)||void 0===ve||null===(me=ve[0])||void 0===me?void 0:me.permanentAddress),result:{Licenses:[{...e}]},initiationFlow:!0};sessionStorage.setItem("BPAREGintermediateValue",JSON.stringify(fe)),s.push("/digit-ui/citizen/obps/stakeholder/apply/stakeholder-docs-required")})(e)}),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==e?void 0:e.businessService}/${null==e?void 0:e.applicationNumber}`}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:d("COMMON_MAKE_PAYMENT")}))):null):l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNo}),l.createElement(o.KeyNote,{keyValue:d("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),note:d("BPA_OC"!==(null==e?void 0:e.businessService)?"WF_BPA_BUILDING_PLAN_SCRUTINY":"WF_BPA_BUILDING_OC_PLAN_SCRUTINY")}),l.createElement(o.KeyNote,{keyValue:d("BPA_COMMON_SERVICE"),note:d("BPA_SERVICETYPE_NEW_CONSTRUCTION")}),l.createElement(o.KeyNote,{keyValue:d("TL_COMMON_TABLE_COL_STATUS"),note:d("WF_BPA_"+(null==e?void 0:e.state)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.KeyNote,{keyValue:d("BPA_COMMON_SLA"),note:"string"==typeof(null==e?void 0:e.sla)&&null!=e&&null!==(S=e.sla)&&void 0!==S&&S.includes("NA")?d("CS_NA"):null==e?void 0:e.sla}),"SEND_TO_ARCHITECT"===e.action||"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement("div",null,v?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:d("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:d("BPA_COMP_WORKFLOW"),onSubmit:()=>ft(e,D,s,d)})),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==e?void 0:e.businessService}/${null==e?void 0:e.applicationNumber}`}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:d("COMMON_MAKE_PAYMENT")}))):null)}),l.createElement("div",{style:{marginLeft:"16px",marginTop:"16px",marginBottom:"46px"}},l.createElement("span",null,d("BPA_NOT_ABLE_TO_FIND_APP_MSG")+" "," "),l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/citizen/obps/search/obps-application"},d("BPA_CLICK_HERE_TO_SEARCH_LINK")))))},Ft=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Ut=e=>{var t,i,a;let{data:r,OpenImage:u}=e;const{t:d}=n.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(o.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,d("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Ft,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(t=r.wfComment)||void 0===t?void 0:t.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("WF_COMMON_COMMENTS")),l.createElement("p",null,e)))):null,(null==r||null===(i=r.thumbnailsToShow)||void 0===i||null===(a=i.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)},Ht=e=>{var a,r,u,d,s;let{id:c,tenantId:p}=e;const{t:v}=n.useTranslation(),[m,E]=t.useState(!1),{isLoading:f,data:_}=Digit.Hooks.useWorkflowDetails({tenantId:p,id:c,moduleCode:"OBPS"});if(f)return l.createElement(o.Loader,null);function g(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const A=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:v(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Ut,{data:r,OpenImage:g})};return l.createElement(l.Fragment,null,!f&&l.createElement(t.Fragment,null,(null==_||null===(a=_.timeline)||void 0===a?void 0:a.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=_&&_.timeline&&1===(null==_||null===(r=_.timeline)||void 0===r?void 0:r.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:v((null==_||null===(u=_.timeline[0])||void 0===u?void 0:u.state)&&"WF_ARCHITECT_"+_.timeline[0].state||"NA"),customChild:A(null==_?void 0:_.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==_?void 0:_.timeline)&&(null==_?void 0:_.timeline.slice(0,m?_.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=_&&null!==(a=_.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=_&&null!==(u=_.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?v(`WF_ARCHITECT_${e.state}${i}`):"NA",customChild:A(e)}))}))),(null==_||null===(d=_.timeline)||void 0===d?void 0:d.length)>2&&l.createElement(o.LinkButton,{label:v(m?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{E(e=>!e)}})),_&&(e=>{var t,n,a,r,u,d;switch(null==e?void 0:e.action){case"PAY":return l.createElement("div",{style:{marginTop:"24px"},className:"action-bar-wrap"},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${null==_||null===(t=_.processInstances)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.moduleName}/${null==_||null===(a=_.processInstances)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.businessId}`,state:{tenantId:null==_||null===(u=_.processInstances)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.tenantId}}},l.createElement(o.SubmitBar,{label:v("TL_COMMON_BUTTON_CITIZEN_MAKE_PAYMENT")})));case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(i.Link,{to:"/digit-ui/citizen/fsm/rate/"+props.id},l.createElement(o.SubmitBar,{label:v("CS_APPLICATION_DETAILS_RATE")})))}})(null==_||null===(s=_.nextActions)||void 0===s?void 0:s[0]))},Wt=()=>{var e,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W,j,$,z;const{id:Y}=i.useParams(),{t:G}=n.useTranslation(),[K,V]=t.useState({}),q=Digit.ULBService.getCurrentTenantId(),[X,J]=t.useState(!1),[Z,Q]=t.useState([]),{id:ee}=i.useParams(),te={applicationNumber:ee},le=Digit.ULBService.getStateId(),ne=window.Digit.Utils.browser.isMobile(),{data:ie,isLoading:oe}=Digit.Hooks.obps.useBPAREGSearch(le,{},te);let ae=null==ie||null===(e=ie.Licenses)||void 0===e?void 0:e[0];const{data:re}=Digit.Hooks.obps.useMDMS(le,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:ue}=Digit.Hooks.useRecieptSearch({tenantId:le,businessService:"BPAREG",consumerCodes:Y,isEmployee:!1},{}),[de,se]=t.useState(!1);var ce,pe;return t.useEffect(()=>{var e,t;if(null!=ae&&null!==(e=ae.tradeLicenseDetail)&&void 0!==e&&null!==(t=e.applicationDocuments)&&void 0!==t&&t.length){var l,n;const e=null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.applicationDocuments)||void 0===n?void 0:n.map(e=>null==e?void 0:e.fileStoreId);Digit.UploadServices.Filefetch(e,q.split(".")[0]).then(e=>V(null==e?void 0:e.data))}},[ae]),t.useEffect(()=>{var e,t,l;ae&&((null==ue||null===(e=ue.Payments)||void 0===e?void 0:e.length)>0&&Q([{label:G("TL_RECEIPT"),onClick:()=>Ot(0,null==ae?void 0:ae.applicationNumber,null==ae?void 0:ae.tenantId,null==ue?void 0:ue.Payments)}]),null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.map(e=>null==e?void 0:e.fileStoreId))},[ae,ue]),null!=ae&&null!==(a=ae.tradeLicenseDetail)&&void 0!==a&&null!==(r=a.applicationDocuments)&&void 0!==r&&r.length&&(null==re||null===(u=re.StakeholderRegistraition)||void 0===u||null===(d=u.TradeTypetoRoleMapping)||void 0===d?void 0:d.length)>0&&(null==re||null===(ce=re.StakeholderRegistraition)||void 0===ce||null===(pe=ce.TradeTypetoRoleMapping)||void 0===pe||pe.map(e=>{var t,l,n,i,o;(null==e||null===(t=e.docTypes)||void 0===t?void 0:t.length)>0&&(null==e?void 0:e.tradeType)==(null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.tradeUnits)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.tradeType)&&(null==e||null===(o=e.docTypes)||void 0===o||o.map(e=>{var t,l;null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.forEach(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.documentType)&&null!=e&&e.info&&(t.info=null==e?void 0:e.info)})}))})),oe?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:ne?{}:{maxWidth:"980px"}},l.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:ne?"0px":"10px"}},G("BPA_TASK_DETAILS_HEADER")),l.createElement("div",{style:{display:"flex",alignItems:"center",color:"#A52A2A"}}),l.createElement(o.LinkButton,{label:G("VIEW_TIMELINE"),styles:{fontSize:"32px",marginLeft:ne?"0px":"10px"},onClick:()=>{se(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}})),(null==ue||null===(s=ue.Payments)||void 0===s?void 0:s.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>J(!X),displayOptions:X,options:Z,style:{top:"90px"}})),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICATION_NUMBER_LABEL"),text:(null==ae?void 0:ae.applicationNumber)||"NA"}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:G("BPA_LICENSE_TYPE"),text:G("TRADELICENSE_TRADETYPE_"+(null==ae||null===(c=ae.tradeLicenseDetail)||void 0===c||null===(p=c.tradeUnits)||void 0===p||null===(v=p[0])||void 0===v||null===(m=v.tradeType)||void 0===m?void 0:m.split(".")[0]))}),(null==ae||null===(E=ae.tradeLicenseDetail)||void 0===E||null===(f=E.tradeUnits)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.tradeType.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:G("BPA_COUNCIL_OF_ARCH_NO_LABEL"),text:null==ae||null===(g=ae.tradeLicenseDetail)||void 0===g||null===(A=g.additionalDetail)||void 0===A?void 0:A.counsilForArchNo}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSE_DET_CAPTION")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_NAME_LABEL"),text:G(null==ae||null===(S=ae.tradeLicenseDetail)||void 0===S||null===(h=S.owners)||void 0===h||null===(b=h[0])||void 0===b?void 0:b.name)}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_GENDER_LABEL"),text:G(null==ae||null===(y=ae.tradeLicenseDetail)||void 0===y||null===(C=y.owners)||void 0===C||null===(T=C[0])||void 0===T?void 0:T.gender)}),l.createElement(o.Row,{className:"border-none",label:G("BPA_OWNER_MOBILE_NO_LABEL"),text:null==ae||null===(D=ae.tradeLicenseDetail)||void 0===D||null===(P=D.owners)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_EMAIL_LABEL"),text:(null==ae||null===(I=ae.tradeLicenseDetail)||void 0===I||null===(L=I.owners)||void 0===L||null===(B=L[0])||void 0===B?void 0:B.emailId)||G("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_PAN_NO"),text:(null==ae||null===(O=ae.tradeLicenseDetail)||void 0===O||null===(R=O.owners)||void 0===R||null===(x=R[0])||void 0===x?void 0:x.pan)||G("CS_NA")}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSEE_PERMANENT_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(w=ae.tradeLicenseDetail)||void 0===w||null===(M=w.owners)||void 0===M||null===(k=M[0])||void 0===k?void 0:k.permanentAddress)||G("CS_NA")})),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_CORRESPONDANCE_ADDRESS_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(F=ae.tradeLicenseDetail)||void 0===F||null===(U=F.owners)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.correspondenceAddress)||G("CS_NA")})),(null==ae||null===(W=ae.tradeLicenseDetail)||void 0===W||null===(j=W.applicationDocuments)||void 0===j?void 0:j.length)>0&&l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_DOC_DETAILS_SUMMARY")),null==ae||null===($=ae.tradeLicenseDetail)||void 0===$||null===(z=$.applicationDocuments)||void 0===z?void 0:z.map((e,n)=>{var i,a,r,u,d;return l.createElement(t.Fragment,null,l.createElement("div",null,l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},G("BPAREG_HEADER_"+vt(null==e||null===(i=e.documentType)||void 0===i?void 0:i.toUpperCase(),".","_"))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",margin:"10px 0px"}},""+G(null==e?void 0:e.info)):null,l.createElement("a",{target:"_blank",href:null===(a=K[e.fileStoreId])||void 0===a?void 0:a.split(",")[0]},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},G("BPAREG_HEADER_"+vt(null==e||null===(r=e.documentType)||void 0===r?void 0:r.toUpperCase(),".","_")))),(null==ae||null===(u=ae.tradeLicenseDetail)||void 0===u||null===(d=u.applicationDocuments)||void 0===d?void 0:d.length)!=n+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),l.createElement("div",{id:"timeline"},l.createElement(o.Card,null,l.createElement(Ht,{id:Y,tenantId:null==ae?void 0:ae.tenantId})))))},jt=e=>{var a,r;const{state:u}=e.location,{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=null==u||null===(a=u.data)||void 0===a||null===(r=a.BPA)||void 0===r?void 0:r[0],[p,v]=t.useState({}),[m,E]=t.useState(!0),f=i.useHistory(),[_,g]=t.useState(""),[A,S]=t.useState(null);let h=null==p?void 0:p.businessService,b=null==p?void 0:p.status;"BPA_LOW"==h&&(h="BPA");let y=Digit.Hooks.useWorkflowDetails({tenantId:null==c?void 0:c.tenantId,id:null==c?void 0:c.applicationNo,moduleCode:"BPA"});t.useEffect(function(){try{return E(!0),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==c?void 0:c.applicationNo})).then(function(e){var t,l,n,i;return Promise.resolve(It(null==e||null===(t=e.BPA)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.businessService,null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.status)).then(function(t){var l,n;return Promise.resolve(Digit.PaymentService.fetchBill(s,{consumerCode:null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo,businessService:t})).then(function(t){var l,n,i,o;"APPROVED"==(null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.status)&&null!=t&&t.Bill[0]&&0!=(null==t||null===(i=t.Bill[0])||void 0===i?void 0:i.totalAmount)&&g("_SAN_FEE"),E(!1),v(null==e||null===(o=e.BPA)||void 0===o?void 0:o[0]),S(null==t?void 0:t.Bill)})})})}catch(e){return Promise.reject(e)}},[]);let C=!1;var T,D,P,N,I,L;return!y||null==y||!y.data||null!=y&&y.isLoading||null==y||null===(T=y.data)||void 0===T||null===(D=T.nextActions)||void 0===D||D.forEach(e=>{"PAY"!=e.action||C||(C=!0)}),l.createElement("div",null,m||null!=y&&y.isLoading?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(o.Banner,{message:d(`BPA_HEADER_${h}_${null==c||null===(L=c.workflow)||void 0===L?void 0:L.action}_${vt(b," ","_").toUpperCase()}${_||""}`),applicationNumber:null==p?void 0:p.applicationNo,info:d("BPA"==h?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:"PERMIT REVOCATION"!=(null==p?void 0:p.status)&&"REJECTED"!=(null==p?void 0:p.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},d(`BPA_SUB_HEADER_${h}_${null==c||null===(P=c.workflow)||void 0===P?void 0:P.action}_${null!=c&&null!==(N=c.additionalDetails)&&void 0!==N&&N.typeOfArchitect?null==c||null===(I=c.additionalDetails)||void 0===I?void 0:I.typeOfArchitect:"ARCHITECT"}_${vt(b," ","_").toUpperCase()}${_||""}`)),"PERMIT REVOCATION"==(null==p?void 0:p.status)?l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:function(){try{return Promise.resolve(Digit.PaymentService.generatePdf(s,{Bpa:[p]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(s,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),d("BPA_REVOCATION_PDF_LABEL")):null,window.location.href.includes("/citizen")?l.createElement("div",null,("PENDING_APPL_FEE"==(null==p?void 0:p.status)||"PENDING_FEE"==(null==p?void 0:p.status)||"PENDING_SANC_FEE_PAYMENT"==(null==p?void 0:p.status))&&(null==A?void 0:A.length)>0&&C?l.createElement("div",null,l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${It(null==p?void 0:p.businessService,null==p?void 0:p.status)}/${null==p?void 0:p.applicationNo}/${null==p?void 0:p.tenantId}?tenantId=${null==p?void 0:p.tenantId}`}},l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),style:{margin:"10px 0px 0px 0px"}})),l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")}))):l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),style:{margin:"10px 10px 0px 0px"}}))):l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement("div",null,("PENDING_APPL_FEE"==(null==p?void 0:p.status)||"PENDING_FEE"==(null==p?void 0:p.status)||"PENDING_SANC_FEE_PAYMENT"==(null==p?void 0:p.status))&&(null==A?void 0:A.length)>0&&C?l.createElement("div",null,l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),onSubmit:()=>{f.push(`/digit-ui/employee/payment/collect/${It(null==p?void 0:p.businessService,null==p?void 0:p.status)}/${null==p?void 0:p.applicationNo}/${null==p?void 0:p.tenantId}?tenantId=${null==p?void 0:p.tenantId}`)},style:{margin:"10px 0px 0px 0px"}}),l.createElement(i.Link,{to:"/digit-ui/employee"},l.createElement("span",{style:{color:"#a82227",margin:"0px 10px"}},d("CORE_COMMON_GO_TO_HOME")))):l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{f.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}})))))},$t=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d,filterFormState:s,localitiesForEmployeesCurrentTenant:c,loadingLocalitiesForEmployeesCurrentTenant:p}=e;const{t:v}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),{data:E,isLoading:f}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(m),_=[{code:"ASSIGNED_TO_ME",name:""+v("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+v("ES_INBOX_ASSIGNED_TO_ALL")}],g=a.useWatch({control:u,name:"applicationType",defaultValue:(null==s?void 0:s.applicationType)||null}),A=Digit.Hooks.obps.useBusinessServiceBasedOnServiceType({applicationType:g}),S=a.useWatch({control:u,name:"businessService",defaultValue:(null==s?void 0:s.businessService)||null}),h=(e,t)=>{const l=e.map(e=>e[1]);return t.onChange(l)};return l.createElement(t.Fragment,null,window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:_.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:_})})),window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"locality",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==e||null===(t=e.value)||void 0===t?void 0:t.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:t.i18nkey,onClick:()=>{var l;e.onChange(null==e||null===(l=e.value)||void 0===l?void 0:l.filter(e=>e.code!==t.code))}}))},[null==e?void 0:e.value]);return p?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("ES_INBOX_LOCALITY")),l.createElement(o.MultiSelectDropdown,{options:c||[],optionsKey:"i18nkey",props:e,isPropsNeeded:!0,onSelect:h,selected:null==e?void 0:e.value,defaultLabel:v("ES_BPA_ALL_SELECTED"),defaultUnit:v("BPA_SELECTED_TEXT")}),l.createElement("div",{className:"tag-container"},n))}})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"applicationType",control:u,render:e=>f?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[]),d("businessService",[])},selectedOption:E.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"applicationType",options:E}))})),(null==g?void 0:g.length)>0&&"BUILDING_OC_PLAN_SCRUTINY"!=g?l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("ES_INBOX_RISK_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[])},selectedOption:A.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"businessService",options:A}))})):null,"BUILDING_OC_PLAN_SCRUTINY"==g||(null==g?void 0:g.length)>0&&(null==S?void 0:S.length)>0?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{function n(t){e.onChange(t)}const a=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>{let t=ct(S);return"BUILDING_OC_PLAN_SCRUTINY"==g&&(t="BPA_OC"),e.businessservice===t}))||void 0===t?void 0:t.map((t,i)=>{var a;return l.createElement(o.CheckBox,{key:i,onChange:l=>{if(l.target.checked&&null!=e&&e.value)n([...null==e?void 0:e.value,null==t?void 0:t.statusid]);else if(l.target.checked)n([null==t?void 0:t.statusid]);else{var i;n(null==e||null===(i=e.value)||void 0===i?void 0:i.filter(e=>e!==(null==t?void 0:t.statusid)))}},checked:null==e||null===(a=e.value)||void 0===a?void 0:a.includes(null==t?void 0:t.statusid),label:`${v(`WF_STATE_${t.businessservice}_${t.applicationstatus}`)} (${t.count})`})})},[e.value,i,S,g]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,a))}})):null)},zt=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:p}=n.useTranslation();var v,m,E,f;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:window.location.href.includes("/citizen")?{gridTemplateColumns:"33.33% 67.33%",textAlign:"start"}:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(v=s.errors)&&void 0!==v&&null!==(m=v.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(f=E.mobileNumber)||void 0===f?void 0:f.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};function Yt(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 Gt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Kt(e){Gt(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 Vt(e,t){Gt(2,arguments);var l=Kt(e).getTime(),n=Yt(t);return new Date(l+n)}function qt(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 Xt(e){return Gt(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Jt(e){if(Gt(1,arguments),!Xt(e)&&"number"!=typeof e)return!1;var t=Kt(e);return!isNaN(Number(t))}var Zt={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 Qt(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 el={date:Qt({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Qt({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:Qt({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},tl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ll(e){return function(t,l){var n,i=l||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;n=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function nl(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?ol(u,function(e){return e.test(r)}):il(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 il(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function ol(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var al,rl={code:"en-US",formatDistance:function(e,t,l){var n,i=Zt[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=l&&l.addSuffix?l.comparison&&l.comparison>0?"in "+n:n+" ago":n},formatLong:el,formatRelative:function(e,t,l,n){return tl[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:ll({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ll({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:ll({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:ll({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:ll({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:(al={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(al.matchPattern);if(!l)return null;var n=l[0],i=e.match(al.parsePattern);if(!i)return null;var o=al.valueCallback?al.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}),era:nl({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:nl({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:nl({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:nl({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:nl({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 ul(e,t){Gt(2,arguments);var l=Yt(t);return Vt(e,-l)}function dl(e){Gt(1,arguments);var t=1,l=Kt(e),n=l.getUTCDay(),i=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-i),l.setUTCHours(0,0,0,0),l}function sl(e){Gt(1,arguments);var t=Kt(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var i=dl(n),o=new Date(0);o.setUTCFullYear(l,0,4),o.setUTCHours(0,0,0,0);var a=dl(o);return t.getTime()>=i.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function cl(e){Gt(1,arguments);var t=sl(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=dl(l);return n}function pl(e,t){Gt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:Yt(i),a=null==l.weekStartsOn?o:Yt(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Kt(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 vl(e,t){Gt(1,arguments);var l=Kt(e),n=l.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:Yt(a),u=null==i.firstWeekContainsDate?r:Yt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(n+1,0,u),d.setUTCHours(0,0,0,0);var s=pl(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var p=pl(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=p.getTime()?n:n-1}function ml(e,t){Gt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:Yt(i),a=null==l.firstWeekContainsDate?o:Yt(l.firstWeekContainsDate),r=vl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=pl(u,t);return d}function El(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var fl={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 El("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var i=vl(e,n),o=i>0?i:1-i;return"YY"===t?El(o%100,2):"Yo"===t?l.ordinalNumber(o,{unit:"year"}):El(o,t.length)},R:function(e,t){return El(sl(e),t.length)},u:function(e,t){return El(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 El(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 El(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):El(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 El(n+1,2);case"Lo":return l.ordinalNumber(n+1,{unit:"month"});case"LLL":return l.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return l.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return l.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,l,n){var i=function(e,t){Gt(1,arguments);var l=Kt(e),n=pl(l,t).getTime()-ml(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(i,{unit:"week"}):El(i,t.length)},I:function(e,t,l){var n=function(e){Gt(1,arguments);var t=Kt(e),l=dl(t).getTime()-cl(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):El(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return El(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){Gt(1,arguments);var t=Kt(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=l-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):El(n,t.length)},E:function(e,t,l){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return l.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return l.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return l.day(n,{width:"short",context:"formatting"});case"EEEE":default:return l.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return El(o,2);case"eo":return l.ordinalNumber(o,{unit:"day"});case"eee":return l.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(i,{width:"short",context:"formatting"});case"eeee":default:return l.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return El(o,t.length);case"co":return l.ordinalNumber(o,{unit:"day"});case"ccc":return l.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(i,{width:"narrow",context:"standalone"});case"cccccc":return l.day(i,{width:"short",context:"standalone"});case"cccc":default:return l.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return El(i,t.length);case"io":return l.ordinalNumber(i,{unit:"day"});case"iii":return l.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return l.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return l.day(n,{width:"short",context:"formatting"});case"iiii":default:return l.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,l){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,l){var n,i=e.getUTCHours();switch(n=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,l){var n,i=e.getUTCHours();switch(n=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,l){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),l.ordinalNumber(n,{unit:"hour"})}return function(e,t){return El(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 El(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):El(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):El(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return El(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return El(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return El(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return gl(i);case"XXXX":case"XX":return Al(i);case"XXXXX":case"XXX":default:return Al(i,":")}},x:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return gl(i);case"xxxx":case"xx":return Al(i);case"xxxxx":case"xxx":default:return Al(i,":")}},O:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_l(i,":");case"OOOO":default:return"GMT"+Al(i,":")}},z:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_l(i,":");case"zzzz":default:return"GMT"+Al(i,":")}},t:function(e,t,l,n){return El(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return El((n._originalDate||e).getTime(),t.length)}};function _l(e,t){var l=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return l+String(i);var a=t||"";return l+String(i)+a+El(o,2)}function gl(e,t){return e%60==0?(e>0?"-":"+")+El(Math.abs(e)/60,2):Al(e,t)}function Al(e,t){var l=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+El(Math.floor(i/60),2)+l+El(i%60,2)}function Sl(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 hl(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 bl={p:hl,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return Sl(e,t);switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"})}return l.replace("{{date}}",Sl(i,t)).replace("{{time}}",hl(o,t))}},yl=["D","DD"],Cl=["YY","YYYY"];function Tl(e){return-1!==yl.indexOf(e)}function Dl(e){return-1!==Cl.indexOf(e)}function Pl(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 Nl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Il=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ll=/^'([^]*?)'?$/,Bl=/''/g,Ol=/[a-zA-Z]/;function Rl(e,t,l){Gt(2,arguments);var n=String(t),i=l||{},o=i.locale||rl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:Yt(a),u=null==i.firstWeekContainsDate?r:Yt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=o.options&&o.options.weekStartsOn,s=null==d?0:Yt(d),c=null==i.weekStartsOn?s:Yt(i.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var p=Kt(e);if(!Jt(p))throw new RangeError("Invalid time value");var v=qt(p),m=ul(p,v),E={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:p},f=n.match(Il).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,bl[t])(e,o.formatLong,E):e}).join("").match(Nl).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return xl(l);var a=fl[n];if(a)return!i.useAdditionalWeekYearTokens&&Dl(l)&&Pl(l,t,e),!i.useAdditionalDayOfYearTokens&&Tl(l)&&Pl(l,t,e),a(m,l,o.localize,E);if(n.match(Ol))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return f}function xl(e){return e.match(Ll)[1].replace(Bl,"'")}const wl=e=>{let{parentRoute:r}=e;window.scroll(0,0);const{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c={},p={moduleName:"bpa-services",applicationStatus:[],locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},v={sortBy:"",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("OBPS.INBOX"),E=t.useMemo(()=>m||{filterForm:p,searchForm:c,tableForm:v},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[f,_]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("OBPS.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},E),{data:g,isLoading:A}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},d),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:s,filters:{...f}}),C={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:d("BPA_SEARCH_PAGE_TITLE"),link:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},T=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(zt,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),D=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement($t,{statuses:b,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==f?void 0:f.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),P={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==f?void 0:f.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:c})}},N={FilterFormFields:D,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==f?void 0:f.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),_({action:"mutateFilterForm",data:p})}},I=(e=>{var o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:p,table:v,dispatch:m,onSortingByData:E}=e;const{t:f}=n.useTranslation(),_=t.useMemo(()=>[{Header:f("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:window.location.href.includes("/citizen")?`${d}/bpa/${t.original.applicationId}`:`${d}/inbox/bpa/${t.original.applicationId}`},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:f("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Rl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:f("ES_INBOX_LOCALITY"),accessor:e=>f(null==e?void 0:e.locality),disableSortBy:!0},{Header:f("EVENTS_STATUS_LABEL"),accessor:e=>f(null!=e&&e.state?`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.state}`:`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.status}`),disableSortBy:!0},{Header:f("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>f(null==e?void 0:e.owner),disableSortBy:!0},{Header:f("BPA_SEARCH_APPLICATION_TYPE_LABEL"),accessor:e=>f(null==e?void 0:e.applicationType),disableSortBy:!0},{Header:f("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>"CS_NA"===e?f(e):l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:s,currentPage:(null===(o=c.tableForm)||void 0===o?void 0:o.offset)/(null===(a=c.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(r=c.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:p,onSearch:null==c||null===(u=c.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(p/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:v,columns:_}})({parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:{...f.tableForm,limit:e.target.value}})},formState:f,totalCount:y,table:h,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";f.tableForm.sortBy===t&&f.tableForm.sortOrder===n||_({action:"mutateTableForm",data:{...f.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),L=(e=>{let{table:t,getRedirectionLink:i}=e;const{t:r}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,date:l,applicationType:n,businessService:i,locality:o,status:a,owner:u,sla:d,state:s}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Rl(new Date(l),"dd/MM/yyyy"),[r("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:r(n),[r("ES_INBOX_LOCALITY")]:r(o),[r("EVENTS_STATUS_LABEL")]:r(s?`WF_${i}_${s}`:`WF_${i}_${a}`),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:u,[r("ES_INBOX_SLA_DAYS_REMAINING")]:d}}),isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:i,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h,getRedirectionLink:e=>{let t="";return t="BPAREG"===e?"search/application/stakeholder":window.location.href.includes("/citizen")?"bpa":"search/application/bpa",t}}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:{...f.tableForm,sortOrder:t}})},sortFormDefaultValues:null==f?void 0:f.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:v})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,d("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},d("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,u({isInboxLoading:S,PropsForInboxLinks:C},P,N,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:f})))},Ml=e=>{var t,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I;let{path:L}=e;const B=i.useLocation(),{t:O}=n.useTranslation();window.location.href.includes("/ws/create-application/property-details"),window.location.href.includes("/acknowledgement")||window.location.href.includes("/disconnect-acknowledge");const R=null===(t=Digit)||void 0===t||null===(a=t.ComponentRegistryService)||void 0===a?void 0:a.getComponent("BPACitizenHomeScreen"),x=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("ObpsCreateEDCR"),w=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ObpsCreateOCEDCR"),M=null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v?void 0:v.getComponent("ObpsNewBuildingPermit"),k=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("ObpsOCBuildingPermit"),F=null===(f=Digit)||void 0===f||null===(_=f.ComponentRegistryService)||void 0===_?void 0:_.getComponent("ObpsStakeholderRegistration"),U=null===(g=Digit)||void 0===g||null===(A=g.ComponentRegistryService)||void 0===A?void 0:A.getComponent("ObpsEdcrInbox"),H=null===(S=Digit)||void 0===S||null===(h=S.ComponentRegistryService)||void 0===h?void 0:h.getComponent("ObpsCitizenBpaApplicationDetail"),W=null===(b=Digit)||void 0===b||null===(y=b.ComponentRegistryService)||void 0===y?void 0:y.getComponent("ObpsBPASendToArchitect"),j=null===(C=Digit)||void 0===C||null===(T=C.ComponentRegistryService)||void 0===T?void 0:T.getComponent("ObpsOCSendToArchitect"),$=null===(D=Digit)||void 0===D||null===(P=D.ComponentRegistryService)||void 0===P?void 0:P.getComponent("ObpsBPASendBackToCitizen"),z=null===(N=Digit)||void 0===N||null===(I=N.ComponentRegistryService)||void 0===I?void 0:I.getComponent("ObpsOCSendBackToCitizen"),Y="true"===sessionStorage.getItem("clickOnBPAApplyAfterEDCR");return l.createElement(l.Fragment,null,l.createElement("div",{className:"ws-citizen-wrapper"},!B.pathname.includes("response")&&!B.pathname.includes("openlink/stakeholder")&&!B.pathname.includes("/acknowledgement")&&!Y&&l.createElement(o.BackButton,{style:{border:"none"}},O("CS_COMMON_BACK")),l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:L+"/home",component:R}),l.createElement(o.PrivateRoute,{path:L+"/search/application",component:e=>l.createElement(Mt,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/search/obps-application",component:e=>l.createElement(Mt,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/apply",component:x}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/oc-apply",component:w}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:applicationType/:serviceType",component:M}),l.createElement(o.PrivateRoute,{path:L+"/ocbpa/:applicationType/:serviceType",component:k}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/apply",component:F}),l.createElement(i.Route,{path:L+"/openlink/stakeholder/apply",component:F}),l.createElement(o.PrivateRoute,{path:L+"/my-applications",component:kt}),l.createElement(o.PrivateRoute,{path:L+"/bpa/inbox",component:e=>l.createElement(wl,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcr/inbox",component:e=>l.createElement(U,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/:id",component:Wt}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:id",component:H}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/bpa/:tenantId/:applicationNo",component:W}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/ocbpa/:tenantId/:applicationNo",component:j}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/bpa/:tenantId/:applicationNo",component:$}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/ocbpa/:tenantId/:applicationNo",component:z}),l.createElement(o.PrivateRoute,{path:L+"/response",component:jt}))))},kl=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d}=e;const{t:s}=n.useTranslation(),c=[{code:"ASSIGNED_TO_ME",name:""+s("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+s("ES_INBOX_ASSIGNED_TO_ALL")}],p=Digit.ULBService.getStateId(),{data:v,isLoading:m}=Digit.Hooks.obps.useMDMS(p,"StakeholderRegistraition","TradeTypetoRoleMapping",{select:e=>{var t;return null==e||null===(t=e.StakeholderRegistraition)||void 0===t?void 0:t.TradeTypetoRoleMapping.reduce((e,t)=>{const l=t.tradeType.split(".")[0];return e.find(e=>e.i18nKey.includes(l))?e:[...e,{role:t.role[0],i18nKey:"TRADELICENSE_TRADETYPE_"+t.tradeType.split(".")[0],tradeType:t.tradeType,identifier:l}]},[])}}),E=a.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:c})})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>m?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("BPA_LICENSE_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{d("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:v}))})),E?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>e.businessservice===E.identifier))||void 0===t?void 0:t.map((t,n)=>{var i;return l.createElement(o.CheckBox,{key:n,onChange:l=>{var n;return function(t){e.onChange(t)}(l.target.checked?[...e.value,null==t?void 0:t.statusid]:null===(n=e.value)||void 0===n?void 0:n.filter(e=>e!==(null==t?void 0:t.statusid)))},checked:null===(i=e.value)||void 0===i?void 0:i.includes(null==t?void 0:t.statusid),label:`${s(`WF_${t.businessservice}_${t.applicationstatus}`)} (${t.count})`})})},[e.value,i,E]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,n))}})):null)},Fl=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:p}=n.useTranslation();var v,m,E,f;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(v=s.errors)&&void 0!==v&&null!==(m=v.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(f=E.mobileNumber)||void 0===f?void 0:f.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};let Ul=[];const Hl=e=>{let{currentStep:t=1,flow:i=""}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":Ul=["BPA_LICENSE_DETAILS_LABEL","BPA_NEW_ADDRESS_HEADER_DETAILS","BPA_DOC_DETAILS_SUMMARY","BPA_STEPPER_SUMMARY_HEADER"];break;case"OCBPA":Ul=["BPA_BASIC_AND_PLOT_DETAILS_LABEL","BPA_SCRUTINY_DETAILS","BPA_DOCUMENT_AND_NOC_DETAILS_LABEL","BPA_STEPPER_SUMMARY_HEADER"];break;default:Ul=["BPA_STEPPER_SCRUTINY_DETAILS_HEADER","BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL","BPA_NOC_DETAILS_SUMMARY","BPA_STEPPER_SUMMARY_HEADER"]}})(i),l.createElement("div",{className:"timeline-container",style:r?{}:{margin:"0 8px 15px"}},Ul.map((e,n,i)=>l.createElement("div",{className:"timeline-checkpoint",key:n},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(n<=t-1&&"active")},n<t-1?l.createElement(o.TickMark,null):n+1),l.createElement("span",{className:"secondary-color"},a(e))),n<i.length-1&&l.createElement("span",{className:"line "+(n<t-1&&"active")}))))};function Wl(e){let{documents:t,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=n.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!s&&(null==t?void 0:t.map((e,n)=>{var i,s,c;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((t,n)=>{var i;return l.createElement("div",{style:{width:"180px"}},l.createElement(o.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==t?void 0:t.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==t?void 0:t.title)),a?null!=t&&null!==(i=t.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(o.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.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"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==t?void 0:t.length)!=n+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:t},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const jl=l.memo(function(e){var n,i,a;let{t:r,document:u,setDocuments:d,documents:s,formData:c,beforeUploadDocuments:p}=e;const v=(null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||(null==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0]),m=Digit.ULBService.getStateId(),[E,f]=t.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n.length)>0?null==u?void 0:u.dropdownData[0]:{}),[_,g]=t.useState(null),[A,S]=t.useState(()=>(null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)}).map(e=>({fileStoreId:null==e?void 0:e.fileStoreId,fileName:(null==e?void 0:e.fileName)||""})))||null),[h,b]=t.useState([]),[y,C]=t.useState([]),[T,D]=t.useState([]||(null==c||null===(i=c.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===E.code)));t.useEffect(()=>{y.length>0&&null!=E&&E.code&&(d(e=>{if(null===A||null==(null==A?void 0:A.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==A.fileStoreId);let l=[];return y&&y.map((e,t)=>{var n,i;l.push({documentType:null==E?void 0:E.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==E?void 0:E.code.split(".").slice(0,2).join("_")},documentUid:e.fileStoreId,fileName:(null===(n=T[t])||void 0===n?void 0:n.name)||"",id:s?null===(i=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===i?void 0:i.id:void 0})}),[...t,...l]}),C([])),null!=E&&E.code&&d(e=>{var t;return null===A||null==(null==A?void 0:A.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,l,n,i,o;`${null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0]}.${null==e||null===(l=e.documentType)||void 0===l?void 0:l.split(".")[1]}`==`${null==E||null===(n=E.code)||void 0===n?void 0:n.split(".")[0]}.${null==E||null===(i=E.code)||void 0===i?void 0:i.split(".")[1]}`&&(null!=e&&e.documentType&&(e.documentType=null==E?void 0:E.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==E?void 0:E.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==A.fileStoreId),{documentType:null==E?void 0:E.code,fileStoreId:A.fileStoreId,documentUid:A.fileStoreId,fileName:(null==_?void 0:_.name)||A.fileName||"document",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[A,E]),t.useEffect(()=>{E.code||null===A||C([...y,A])},[A]);const P=t.useMemo(()=>{var e,t;let l=[];return null==c||null===(e=c.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===E.code).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:m}}])),l},[c]);return l.createElement("div",null,l.createElement(o.CardLabel,null,null!=u&&u.required?r(null==u?void 0:u.code)+" *":""+r(null==u?void 0:u.code)),l.createElement(o.Dropdown,{t:r,isMandatory:!1,option:Digit.Utils.locale.sortDropdownNames(null==u?void 0:u.dropdownData,"i18nKey",r),selected:E,optionKey:"i18nKey",select:e=>{if(null!=v&&v.documentType){v.documentType=null==e?void 0:e.code;let t=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)});t.map(t=>t.documentType=null==e?void 0:e.code);let l=[...null==s?void 0:s.filter(e=>{var t;return!(null!=e&&null!==(t=e.documentType)&&void 0!==t&&t.includes(null==u?void 0:u.code))}),...t];d(l)}f(e)}}),l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:function(e){var t;let l,n,i=E.code;if((null==e?void 0:e.length)>0){var o,a;l=Object.fromEntries(e),n=Object.values(l),n=null==c||null===(o=c.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===E.code),b(n);let t=[];null==e||e.map((e,l)=>{var n,i,o,a;t.push({documentType:null==E?void 0:E.code,additionalDetails:{category:null==E?void 0:E.code.split(".").slice(0,2).join("_")},fileStoreId:null==e||null===(n=e[1])||void 0===n||null===(i=n.fileStoreId)||void 0===i?void 0:i.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:s?null===(a=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===a?void 0:a.id:void 0})});const r=[...s.filter(e=>e.documentType!==i),...t];d(r)}else if(0==(null==e?void 0:e.length)){const e=[...s.filter(e=>e.documentType!==i)];d(e)}null===(t=n)||void 0===t||t.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=i,function(e,t){e&&g(e.file),e&&D([...T,e.file])}(e)})},setuploadedstate:P,t:r,extraStyleName:"OBPS",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(Wl,{isSendBackFlow:!0,documents:null==u?void 0:u.uploadedDocuments}))});function $l(e){let{documents:i,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=n.useTranslation(),[d,s]=t.useState(()=>[]),[c,p]=(Digit.ULBService.getCurrentTenantId(),t.useState({}));t.useEffect(()=>{var e;let t=[];null==i||i.forEach((e,l,n)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[i]),t.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==i||null===(e=i[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[d]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==i?void 0:i.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n,i;return l.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==i?void 0:i.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:t},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function zl(e){var n,i,a;let{t:r,document:u,setNocDocuments:d,nocDocuments:s,formData:c,beforeUploadNocDocuments:p,pdfLoading:v}=e;(null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||null==p||p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)});const m=Digit.ULBService.getStateId(),[E,f]=t.useState(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n[0]),[_,g]=t.useState(null),[A,S]=t.useState(()=>{var e,t;return{fileStoreId:null==s||null===(e=s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||void 0===e?void 0:e.fileStoreId,fileName:null==s||null===(t=s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||void 0===t?void 0:t.fileName}||null}),[h,b]=t.useState([]);t.useEffect(()=>{null==E||!E.documentType||0!=s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length&&h.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==E?void 0:E.documentType)}).length===s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length||d(e=>{var t,l;return null===A||null==(null==A?void 0:A.fileStoreId)?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==A.fileStoreId),{documentType:null==u||null===(t=u.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code,fileStoreId:A.fileStoreId,documentUid:A.fileStoreId,fileName:(null==A?void 0:A.fileName)||""}]})},[A,E]);const y=t.useMemo(()=>{var e,t;let l=[];const n=E.code;return null==c||null===(e=c.nocDocuments)||void 0===e||null===(t=e.nocDocuments)||void 0===t||t.filter(e=>e.documentType===n).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:m}}])),l},[c]);return l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 8px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",marginTop:"5px"}},l.createElement("div",null,l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"37px",fontWeight:"700",fontSize:"32px",fontFamily:"Roboto Condensed",paddingBottom:"24px"}},r(`BPA_${null==u?void 0:u.nocType}_HEADER`)),l.createElement("div",{style:{display:"flex",paddingBottom:"24px"}},l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"19px",fontWeight:"700",fontSize:"16px",fontFamily:"Roboto",marginRight:"10px"}},r(`BPA_${null==u?void 0:u.nocType}_LABEL`)),l.createElement("h1",null,null==u||null===(i=u.additionalDetails)||void 0===i?void 0:i.appNumberLink))),!window.location.href.includes("sendbacktocitizen")&&l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>function(e,t){var l;let n,i;if((null==e?void 0:e.length)>0){var o;n=Object.fromEntries(e),i=Object.values(n),i=null==c||null===(o=c.nocDocuments)||void 0===o?void 0:o.nocDocuments.filter(e=>e.documentType===t),b(i);let l=[];null==e||e.map((e,n)=>{var i,o,a,r;l.push({documentType:t,fileStoreId:null==e||null===(i=e[1])||void 0===i||null===(o=i.fileStoreId)||void 0===o?void 0:o.fileStoreId,documentUid:null==e||null===(a=e[1].fileStoreId)||void 0===a?void 0:a.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:s?null===(r=s.find(e=>e.documentType===t))||void 0===r?void 0:r.id:void 0})});const a=[...s.filter(e=>e.documentType!==t),...l];d(a)}null===(l=i)||void 0===l||l.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=t,function(e,t){e&&f({documentType:t}),e&&g(e.file)}(e,t)})}(e,u.dropdownData[0].code),setuploadedstate:y,t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&!v&&l.createElement(Wl,{documents:null==u?void 0:u.uploadedDocuments,svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))}const Yl=e=>{var n,i;let{t:a,onSelect:r,formData:u={},handleRemove:d,onSave:s}=e;const[c,p]=t.useState((null==u||null===(n=u.address)||void 0===n?void 0:n.pincode)||""),[v,m]=t.useState((null==u||null===(i=u.address)||void 0===i?void 0:i.geoLocation)||{}),E=Digit.Hooks.obps.useTenants(),[f,_]=t.useState(null),[g,A]=t.useState("");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let S=!Digit.Utils.browser.isMobile();return l.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0"}},l.createElement("div",{style:{position:"relative",marginTop:"60px"}},l.createElement("div",{style:S?{marginLeft:"25%",marginRight:"25%"}:{}},l.createElement(o.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:a("BPA_GIS_LABEL"),cardText:a(""),nextText:a("BPA_PIN_LOCATION_LABEL"),skip:()=>r(),t:a,position:v,onSave:()=>s(v,c,g),onChange:(e,t,l)=>((e,t,l)=>{_(null),(null==E?void 0:E.find(t=>{var l;return null===(l=t.pincode)||void 0===l?void 0:l.find(t=>t==e)}))?(p(e),m(t),A(l)):(_("BPA_COMMON_PINCODE_NOT_SERVICABLE"),p(""),m({}),A(""))})(e,t,l),disabled:""===c,forcedError:a(f),isPlaceRequired:!0,handleRemove:d,Webview:S,isPopUp:!0}))))},Gl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"home",component:"EDCRForm",nextStep:"",hideInEmployee:!0,key:"ScrutinyDetails",texts:{headerCaption:"",header:"EDCR_COMMON_APPL_NEW",cardText:"BPA_PROVIDE_REQ_FOR_NEW_BPA",submitBarLabel:"EDCR_SCRUTINY_SUBMIT_BUTTON",skipText:"EDCR_CLEAR_FORM"}}]}],Kl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"OCEDCRDocsRequired",key:"data",nextStep:"home"},{route:"home",component:"OCeDCRScrutiny",nextStep:"upload-diagram",hideInEmployee:!0,key:"ScrutinyDetails"},{route:"upload-diagram",component:"OCUploadPlanDiagram",nextStep:null,hideInEmployee:!0,key:"uploadData",texts:{headerCaption:"BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL",header:"BPA_UPLOAD_OC_PLAN_DIAGRAM_LABEL",cardText:"",submitBarLabel:"BPA_COMMON_BUTTON_SUBMIT",skipText:""}}]}],Vl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL",type:"text",validation:{},name:"boundaryWallLength"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{route:"location",component:"LocationDetails",nextStep:"owner-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"owner-details",component:"OwnerDetails",nextStep:"document-details",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}]}],ql=[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL",type:"text",validation:{},name:"boundaryWallLength"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{type:"component",route:"search-property",isMandatory:!0,component:"CPTSearchProperty",key:"cptsearchproperty",withoutLabel:!0,nextStep:"search-results",hideInEmployee:!0},{type:"component",route:"search-results",isMandatory:!0,component:"CPTSearchResults",key:"cptsearchresults",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{type:"component",route:"create-property",isMandatory:!0,component:"CPTCreateProperty",key:"cptcreateproperty",withoutLabel:!0,nextStep:"acknowledge-create-property",hideInEmployee:!0},{type:"component",route:"acknowledge-create-property",isMandatory:!0,component:"CPTAcknowledgement",key:"cptacknowledgement",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{route:"location",component:"LocationDetails",nextStep:"owner-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"owner-details",component:"OwnerDetails",nextStep:"noc-number",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-number",component:"NOCNumber",nextStep:"document-details",key:"nocnumber",texts:{headerCaption:"BPA_NOC_NUMBER_DETAILS",header:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_NOC_NUMBER",type:"text",validation:{},name:"nocNumber"}]},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}],Xl=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),Jl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"OCBasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"document-details",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}]}],Zl=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),Ql=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"stakeholder-docs-required",component:"StakeholderDocsRequired",key:"data",nextStep:"provide-license-type"},{type:"component",route:"provide-license-type",isMandatory:!0,component:"LicenseType",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_TYPE",cardText:"BPA_LICENSE_TYPE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"license-details",key:"LicneseType",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"license-details",isMandatory:!0,component:"LicenseDetails",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_DET_CAPTION",cardText:"BPA_LICENSE_DETAILS_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"Permanent-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"Permanent-address",isMandatory:!0,component:"PermanentAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_PERM_ADDR_HEADER",cardText:"BPA_LICENSEE_PERMANENT_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"correspondence-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"correspondence-address",isMandatory:!0,component:"CorrospondenceAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_CORRESPONDENCE_LABEL",cardText:"BPA_LICENSEE_CORRESPONDENCE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"stakeholder-document-details",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{route:"stakeholder-document-details",component:"StakeholderDocuments",nextStep:null,key:"documents",texts:{headerCaption:"BPA_DOCUMENT_DETAILS_LABEL",header:"BPA_LICENSEE_DOCUMENT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}}]}],en=e=>{var i,a,r,u,d,s;const{t:c}=n.useTranslation(),p=null===(i=e.application)||void 0===i?void 0:i.businessService,{isLoading:v,data:m}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id,moduleCode:p}),[E,f]=t.useState(!1);function _(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const g=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:c(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Ut,{data:r,OpenImage:_})};return v?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,!v&&l.createElement(t.Fragment,null,(null==m||null===(r=m.timeline)||void 0===r?void 0:r.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},c("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=m&&m.timeline&&1===(null==m||null===(u=m.timeline)||void 0===u?void 0:u.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:c((null==m||null===(d=m.timeline[0])||void 0===d?void 0:d.state)&&`WF_${p}_${m.timeline[0].state}`||"NA"),customChild:g(null==m?void 0:m.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==m?void 0:m.timeline)&&(null==m?void 0:m.timeline.slice(0,E?m.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=m&&null!==(a=m.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=m&&null!==(u=m.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?c(`WF_${p}_${e.state}${i}`):"NA",customChild:g(e)}))}))),(null==m||null===(s=m.timeline)||void 0===s?void 0:s.length)>2&&l.createElement(o.LinkButton,{label:c(E?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{f(e=>!e)}})))},tn=e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,error:r,isCommentRequired:u=!0,setUploadedFile:d}=e;return{label:{heading:"BPA_FORWARD_APPLICATION_HEADER",submit:`BPA_${n}_BUTTON`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:t("ES_OBPS_ACTION_COMMENTS"),isMandatory:u,type:"textarea",populators:{name:"comments",validation:{required:u}}},{label:""+t("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{d(null)},message:a?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:r})}]}]}},ln=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),nn=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"#FFFFFF",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"#0B0C0C"})),on=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick,style:{backgroundColor:"#FFFFFF"}},l.createElement(nn,null)),an=e=>{var n,i,a,r,u;let{t:s,closeModal:c,submitAction:p,action:v,applicationData:m}=e;const[E,f]=t.useState({}),[_,g]=t.useState(null),[A,S]=t.useState(null),[h,b]=t.useState({}),[y,C]=t.useState(null),[T,D]=t.useState(!1),P=!!Digit.Utils.browser.isMobile(),N=e=>{g(e.target.files[0])};return t.useEffect(()=>{switch(v){case"APPROVE":f(tn({t:s,action:v,selectFile:N,uploadedFile:A,error:y,isCommentRequired:!1,setUploadedFile:S,file:_,error:y}));break;case"SEND_TO_ARCHITECT":f(tn({t:s,action:v,selectFile:N,uploadedFile:A,error:y,setUploadedFile:S,file:_,error:y}));break;case"TERMS_AND_CONDITIONS":D(!0),f((e=>{let{t:t,applicationData:l}=e;return{label:{heading:"",submit:null,cancel:null,hideSubmit:!0},data:[((e,t)=>"CITIZEN_APPROVAL_INPROCESS"==(null==t?void 0:t.status)?`${e("BPA_CITIZEN_1_DECLARAION_LABEL")}${e("BPA_CITIZEN_2_DECLARAION_LABEL")}`:"INPROGRESS"==(null==t?void 0:t.status)?`${e("BPA_STAKEHOLDER_1_DECLARAION_LABEL")}${e("BPA_STAKEHOLDER_2_DECLARAION_LABEL")}`:void 0)(t,l)]}})({t:s,applicationData:m}));break;default:f(tn({t:s,action:v,selectFile:N,uploadedFile:A,error:y,isCommentRequired:!1,setUploadedFile:S,file:_,error:y}))}},[v,A,y]),t.useEffect(()=>{!function(){try{C(null);const e=function(){if(_){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(_.size>=5242880)C(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=_&&_.type&&!e.test(null==_?void 0:_.type))C(s("NOT_SUPPORTED_FILE_TYPE"));else{const e=d(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("BPA",_,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?S(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):C(s("CS_FILE_UPLOAD_ERROR"))})},function(){C(s("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)}}()},[_]),l.createElement(o.Modal,{headerBarMain:l.createElement(ln,{label:s(null==E||null===(n=E.label)||void 0===n?void 0:n.heading)}),headerBarEnd:l.createElement(on,{onClick:c}),actionCancelLabel:s(null==E||null===(i=E.label)||void 0===i?void 0:i.cancel),actionCancelOnSubmit:c,actionSaveLabel:s(null==E||null===(a=E.label)||void 0===a?void 0:a.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:!1,isOBPSFlow:!0,popupStyles:P?{width:"720px"}:{},style:P?{minHeight:"45px",height:"auto",width:"160px"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},hideSubmit:!(null==E||null===(r=E.label)||void 0===r||!r.hideSubmit),popupModuleMianStyles:"TERMS_AND_CONDITIONS"==v?{height:"92%",boxSizing:"border-box"}:P?{paddingLeft:"0px"}:{},headerBarMainStyle:"TERMS_AND_CONDITIONS"==v?{margin:"0px",height:"35px"}:{}},null!=E&&E.form?l.createElement(o.FormComposer,{cardStyle:{minWidth:"unset",paddingRight:"unset",marginRight:"18px",paddingBottom:"64px"},config:null==E?void 0:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:e=>{let t={action:v};A&&(t.varificationDocuments=[{documentType:"Document - 1",fileName:(null==_?void 0:_.name)||"",fileStoreId:A}]),null!=e&&e.comments||delete e.comments,p({...e,...t})},defaultValues:h,formId:"modal-action"}):null,T?l.createElement("div",{style:{height:"100%"}},l.createElement("div",{style:{height:"95%"}},l.createElement("div",{style:{fontSize:"18px",paddingBottom:"16px",color:"#000000",fontWeight:"700"}},s("TERMS_AND_CONDITIONS")),(null==E?void 0:E.data)&&(null==E||null===(u=E.data)||void 0===u?void 0:u.map((e,t)=>l.createElement("div",{style:{height:"90%",overflow:"auto"}},""+e)))),l.createElement("div",{style:{display:"flex",justifyContent:"center",minHeight:"5%"}},l.createElement(o.ButtonSelector,{label:s("BPA_GO_BACK_LABEL"),onSubmit:c,style:{minWidth:"240px"}}))):null)};function rn(e){let{value:t={},Code:i,index:a,isNOC:r=!1,svgStyles:u={width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"},isStakeHolder:d=!1}=e;const{t:s}=n.useTranslation(),{isLoading:c,data:p}=Digit.Hooks.obps.useOBPSDocumentSearch({value:t},{value:t},i,a,r);let v=[];var m,E,f;return r?null!=t&&t.nocDocuments?(null==t||null===(m=t.nocDocuments)||void 0===m?void 0:m.nocDocuments.length)>0&&(null==t||null===(E=t.nocDocuments)||void 0===E||E.nocDocuments.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{v.push(e)})):(null==t?void 0:t.length)>0&&(null==t||t.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{v.push(e)})):null!=t&&t.documents?null==t||null===(f=t.documents)||void 0===f||f.documents.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{v.push(e)}):t.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{v.push(e)}),c?l.createElement(o.Loader,null):l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},v.length>0?l.createElement("div",{style:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap"}},null==v?void 0:v.map((e,t)=>{let n=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",i=(null==n?void 0:n.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o}(p.pdfFiles,null==e?void 0:e.fileStoreId);return l.createElement("a",{target:"_blank",href:n,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(o.PDFSvg,null)),d?l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},s("BPAREG_HEADER_"+vt(null==i?void 0:i.toUpperCase(),".","_"))):null," ",d?null:l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},""+s(i)))})):l.createElement(o.CardText,null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}const un=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:p}=n.useTranslation(),v=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=t.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:E(e.id),id:e.id})));function _(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),l}function g(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+p("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 l.createElement(t.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(o.StatusTable,null,null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isHeader?l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},p(null==e?void 0:e.title)):l.createElement(o.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(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,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==s||null===(n=s.subOccupancyTableDetails)||void 0===n||null===(i=n[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"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},p("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:g(t)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:f,getCellProps:e=>({style:{}})})))})))};function dn(e){let{fiReport:t,isCitizen:i=!1}=e;const{t:a}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?o.CardHeader:o.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),t.map((e,n)=>{var i,r,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==t?void 0:t.length)?""+a("BPA_FI_REPORT"):`${a("BPA_FI_REPORT")} - ${n+1}`),l.createElement(o.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"}),l.createElement(o.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=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(o.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(o.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Wl,{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"}})))})))}const sn=e=>{var i,a,r,u,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N;let{scrutinyDetails:I,paymentsList:L=[],additionalDetails:B,applicationData:O}=e;const R=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==O?void 0:O.status))&&window.location.href.includes("bpa"),[x,w]=t.useState(),[M,k]=t.useState(),[F,U]=t.useState(),H=Digit.ULBService.getStateId(),[W,j]=t.useState(),[$,z]=t.useState(),[Y,G]=t.useState([]),[K,V]=t.useState(),[q,X]=t.useState(""),[J,Z]=t.useState(null),[Q,ee]=t.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[le,ne]=t.useState(!1),[ie,oe]=t.useState(!1);t.useEffect(()=>{!function(){try{Z(null);const e=function(){if(K&&null!=K&&K.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==K||null===(t=K.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(K.size>=2e6)Z(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",K,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?G([...Y,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):Z(ae("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Z(ae("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[K]),t.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(Y))},[Y]),t.useEffect(()=>{var e,t,l,n,i,o,a;if(null!=B&&null!==(e=B.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==B?void 0:B.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i;return t===(null==B||null===(l=B.lessAdjustmentFeeFiles)||void 0===l?void 0:l.length)-1?null==B||null===(n=B.lessAdjustmentFeeFiles[(null==B||null===(i=B.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}w(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_DEVELOPMENT_CHARGES),k(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==B||null===(i=B.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==B||null===(o=B.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==B||null===(a=B.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),j(null==B?void 0:B.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==B?void 0:B.otherFeesDiscription),G(null==B?void 0:B.lessAdjustmentFeeFiles)},[B]);const{t:ae}=n.useTranslation(),re=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ae(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ae(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ae("NA");return l.createElement(t.Fragment,null,!(null!=I&&I.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement("div",null,null==I||null===(i=I.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isUnit?l.createElement(o.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:""+ae(""+e.title),text:null!=e&&e.value?`${re(e)} ${ae(null==e?void 0:e.isUnit)}`:ae("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(o.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:""+ae(""+e.title),text:re(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ae(null==e?void 0:e.title)):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ae(null==e?void 0:e.title))),null==I||null===(a=I.permit)||void 0===a?void 0:a.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(r=I.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ae("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ae("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==B?void 0:B.builtUpArea)*2.5)}),l.createElement(o.Row,{className:"border-none",label:ae("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==B?void 0:B.boundaryWallLength)}),l.createElement(o.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==I||null===(u=I.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ae("SHOW_P2_FEES_DETAILS"))),le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ae("HIDE_P2_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==B||null===(s=B.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==B||null===(c=B.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==B||null===(p=B.selfCertificationCharges)||void 0===p?void 0:p.BPA_WATER_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==B||null===(v=B.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,ae("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==B||null===(m=B.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:x,disabled:!R,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(w(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==B||null===(E=B.selfCertificationCharges)||void 0===E?void 0:E.BPA_OTHER_CHARGES)||0,value:M,disabled:!R,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(k(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(o.TextArea,{t:ae,type:"text",name:"otherChargesDiscription",defaultValue:null==B||null===(f=B.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!R,onChange:e=>{!function(e){j(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==B||null===(_=B.selfCertificationCharges)||void 0===_?void 0:_.BPA_LESS_ADJUSMENT_PLOT)||"",value:F,disabled:!R,onChange:e=>{!function(e){var t,l,n,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(x)?parseFloat(x):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_LABOUR_CESS)+parseFloat(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_WATER_CHARGES)+parseFloat(null==B||null===(i=B.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0&&R?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT_FILE")),l.createElement(o.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){z(e.target.files[0]),V(e.target.files[0])},disabled:!R,onDelete:()=>{z(null),V("")},message:$?"1 "+ae("FILEUPLOADED"):ae("ES_NO_FILE_SELECTED_LABEL"),error:J,uploadMessage:q})):null,(null==Q||null===(g=Q.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==B||null===(A=B.selfCertificationCharges)||void 0===A?void 0:A.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(o.CardLabel,{style:{marginTop:"15px"}},ae("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(S=Q.fileStoreIds)||void 0===S?void 0:S.length)&&parseInt(null==B||null===(h=B.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(b=Q.fileStoreIds[(null==Q||null===(y=Q.fileStoreIds)||void 0===y?void 0:y.length)-1])||void 0===b?void 0:b.url},l.createElement(o.PDFSvg,null)),l.createElement(o.Row,{className:"border-none"}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(x)?parseFloat(x):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(C=B.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(T=B.selfCertificationCharges)||void 0===T?void 0:T.BPA_LABOUR_CESS)+parseFloat(null==B||null===(D=B.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==B||null===(P=B.selfCertificationCharges)||void 0===P?void 0:P.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(F)?parseFloat(F):0))}))),l.createElement("div",null,null==I||null===(N=I.scruntinyDetails)||void 0===N?void 0:N.map((e,n)=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:""+ae(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(o.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ae(null==e?void 0:e.text))))))))},cn=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),pn=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),vn=e=>{let{controlFilterForm:i}=e;const{t:r}=n.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),{data:d,isLoading:s}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(u),c=[{code:"Accepted",name:""+r("EDCR_ACCEPTED")},{code:"Not Accepted",name:""+r("EDCR_NOT_ACCEPTED")}];return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"status",control:i,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_COMMON_TABLE_COL_APP_STATUS_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"status",options:c}))})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"appliactionType",control:i,render:e=>s?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(o.Dropdown,{t:r,option:d,selected:d.filter(t=>t.code===e.value)[0],optionKey:"i18nKey",select:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")}}))})))},mn=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=n.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",inputRef:i({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},En=e=>{let{dowloadOptions:n}=e;const[i,a]=t.useState(!1);return l.createElement("div",null,l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>a(!i),displayOptions:i,options:n,style:{right:"0",position:"unset",top:"0px",margin:"0px"},optionsStyle:{right:"10px",top:"unset",margin:"0px",position:"absolute"}}))},fn={ARCHITECT:"The registered architect shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign all plans, sub-division/layout plans and information connected with building permit.\nb. Layout Plans of plots measuring upto 1 Ha. in size.\nc. Issuing certificate of supervision and completion of all buildings.\nd. Issuing certificate of supervision for development permit of Layout Plans of plots measuring upto 1 Ha. in size.",ENGINEER:"The registered engineer shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\na. Preparation of structural drawings, details and calculations of buildings on plot up to 500 m2 and up to 5 storeys or 16 m in height, all service plans and related information.\nb. Issuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings) pertaining including structure and building services.",STRUCTURALENGINEER:"The registered structural engineer shall be competent to prepare the structural design, calculations and details for all buildings and undertake their supervision.\nIn case of buildings having special structural features, as decided by the Authority, they shall be designed only by Structural engineers.",TOWNPLANNER:"The registered town planner shall be competent to carry out the work related to the development permit as given below:\na. Preparation of plans for land sub-division/ layout and related information connected development permit for all areas more than 1 Hectare.\nb. Issuing of certificate of supervision for development of land of all areas.\nc. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\nIssuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings).\nNOTE — However, for land layouts for development permit above 5 hectare in area, landscape architect shall also be associated, and for land development infrastructural services for roads, water supplies, sewerage / drainage, electrification, etc, the registered engineers for utility services shall be associated.","LANDSCAPE ARCHITECT":"The registered landscape architect shall be competent to carry out the work related to landscape design for building/development permit for land areas 5 hectares and above. In case of metro-cities, this limit of land area shall be 2 hectares and above.\nNOTE — For smaller areas below the limits indicated above, association of landscape architect may also be considered from the point of view of desired landscape development.","URBAN DESIGNER":"The registered urban designer shall be competent to carry out the work related to urban design for city areas more than 5 hectares and campus area more than 2 hectares. He/She shall also be competent to carry out the work of urban renewal for all blighted/congested areas.\nNOTE — For smaller areas below the limits indicated above, association of urban designer may be considered from the point of view of desired urban design.","BUILDING DESIGNER & SUPERVISOR":"The Registered Building Designer and Supervisor shall be competent to carry out the work related to the building / development permit.\nA. Prepare and (sign in case of plots upto 250 Sq.Mtr. Only) plans, sub division/layout plans and information connected with building permit.\nB. Issuing certificate of supervision and completion of (In case of plots upto 250 Sq.mtr. only) buildings."};function _n(e){var n,i,a;let{t:r,document:u,setDocuments:s,error:c,setError:p,documents:v,setCheckRequiredFields:m}=e;const E=null==v?void 0:v.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0],f=Digit.ULBService.getCurrentTenantId(),[_,g]=t.useState(E?{...E,active:!0,code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}:1===(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n.length)?null==u?void 0:u.dropdownData[0]:{}),[A,S]=t.useState(null),[h,b]=t.useState(()=>(null==E?void 0:E.fileStoreId)||null);return t.useEffect(()=>{s(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==u?void 0:u.code));return 0===(null==h?void 0:h.length)||null===h?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==h),{documentType:null==u?void 0:u.code,fileStoreId:h,documentUid:h,fileName:(null==A?void 0:A.name)||"",info:(null==u?void 0:u.info)||""}]})},[h,A]),t.useEffect(()=>{!function(){try{p(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)p(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))p(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=d(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",A,null==f?void 0:f.split(".")[0])).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?b(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):p(r("CS_FILE_UPLOAD_ERROR"))})},function(){p(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.CardLabel,{style:{marginBottom:"10px"}},null!=u&&u.required?r("BPAREG_HEADER_"+(null==u||null===(i=u.code)||void 0===i?void 0:i.replace(".","_")))+" *":""+r("BPAREG_HEADER_"+(null==u||null===(a=u.code)||void 0===a?void 0:a.replace(".","_")))),null!=u&&u.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+r(null==u?void 0:u.info)):null,l.createElement(o.UploadFile,{extraStyleName:"OBPS",accept:"image/*, .pdf, .png, .jpeg, .jpg",onUpload:function(e){S(e.target.files[0])},onDelete:()=>{b(null),m(!0)},message:h?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),iserror:c}))}const gn=e=>{var t,a,r,u,d,s;const{state:c}=e.location,{t:p}=n.useTranslation(),v=i.useHistory(),m=null==c||null===(t=c.data)||void 0===t||null===(a=t.Licenses)||void 0===a?void 0:a[0];return null==m||null===(r=m.tradeLicenseDetail)||void 0===r||null===(u=r.tradeUnits)||void 0===u||null===(d=u[0])||void 0===d||null===(s=d.tradeType)||void 0===s||s.split("."),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:p(`BPA_ARCHITECT_${null==m?void 0:m.status}_MAIN_HEAD`),applicationNumber:null==m?void 0:m.applicationNumber,info:p("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL"),successful:"REJECTED"!=(null==m?void 0:m.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},p(`BPA_ARCHITECT_${null==m?void 0:m.status}_SUB_MAIN_HEAD`)),l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/employee")}}))))},An=e=>{let{location:t}=e;const{t:i}=n.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/obps/inbox",content:i("ES_COMMON_OBPS_INBOX_LABEL"),show:!!t.pathname.includes("obps/inbox")},{path:"/digit-ui/employee/obps/stakeholder-inbox",content:i("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),show:!!t.pathname.includes("obps/stakeholder-inbox")},{path:"/digit-ui/employee/obps/inbox/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/inbox/bpa")},{path:"/digit-ui/employee/obps/inbox/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/stakeholder-inbox/stakeholder")},{path:"/digit-ui/employee/obps/search/application",content:i("ES_OBPS_SEARCH"),show:!!t.pathname.includes("/obps/search/application")},{path:"/digit-ui/employee/obps/search/application/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/bpa")},{path:"/digit-ui/employee/obps/search/application/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/stakeholder/")}];return l.createElement(o.BreadCrumb,{crumbs:a})},Sn=e=>{let{path:a}=e;const r=i.useLocation(),{t:d}=n.useTranslation(),s=Digit.ComponentRegistryService.getComponent("BPAInbox"),c=Digit.ComponentRegistryService.getComponent("StakeholderInbox"),p=Digit.ComponentRegistryService.getComponent("ObpsEmpApplicationDetail"),v=Digit.ComponentRegistryService.getComponent("ObpsEmployeeBpaApplicationDetail"),m=window.location.href.includes("bpa")||window.location.href.includes("stakeholder-inbox/stakeholder")||window.location.href.includes("application"),E=window.location.href.includes("digit-ui/employee/obps/bpa/"),f=window.location.href.includes("obps/response")||window.location.href.includes("obps/stakeholder-response");return l.createElement(t.Fragment,null,E||f?null:l.createElement("div",{style:m?{marginLeft:"10px"}:{}},l.createElement(An,{location:r})),E?l.createElement(o.BackButton,{style:{border:"none",margin:"0",padding:"0"}},d("CS_COMMON_BACK")):null,l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox/stakeholder/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application/stakeholder/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application/bpa/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application",component:e=>l.createElement(Mt,u({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/inbox/bpa/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/inbox",component:e=>l.createElement(s,u({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox",component:e=>l.createElement(c,u({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/bpa/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/response",component:jt}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-response",component:gn})))};var hn=f(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",p="[object Map]",v="[object Number]",m="[object Object]",f="[object RegExp]",_="[object Set]",g="[object String]",A="[object Symbol]",S="[object WeakMap]",h="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",D="[object Int16Array]",P="[object Int32Array]",N="[object Uint8Array]",I="[object Uint16Array]",L="[object Uint32Array]",B=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,w=/[&<>"']/g,M=RegExp(x.source),k=RegExp(w.source),F=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(z.source),G=/^\s+/,K=/\s/,V=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,q=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Z=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+ce+"]",ve="["+se+"]",me="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",fe="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",Ae="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+Ee+"|"+fe+")",ye="(?:"+he+"|"+fe+")",Ce="(?:"+ve+"|"+_e+")?",Te="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,Ae,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",Ae,Se].join("|")+")"+Te,Pe="(?:"+[ge+ve+"?",ve,Ae,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),Ie=RegExp(ve,"g"),Le=RegExp(_e+"(?="+_e+")|"+Pe+Te,"g"),Be=RegExp([he+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,he,"$"].join("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,he+be,"$"].join("|")+")",he+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,De].join("|"),"g"),Oe=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"],we=-1,Me={};Me[y]=Me[C]=Me[T]=Me[D]=Me[P]=Me[N]=Me["[object Uint8ClampedArray]"]=Me[I]=Me[L]=!0,Me[o]=Me[a]=Me[h]=Me[r]=Me[b]=Me[u]=Me[d]=Me[s]=Me[p]=Me[v]=Me[m]=Me[f]=Me[_]=Me[g]=Me[S]=!1;var ke={};ke[o]=ke[a]=ke[h]=ke[b]=ke[r]=ke[u]=ke[y]=ke[C]=ke[T]=ke[D]=ke[P]=ke[p]=ke[v]=ke[m]=ke[f]=ke[_]=ke[g]=ke[A]=ke[N]=ke["[object Uint8ClampedArray]"]=ke[I]=ke[L]=!0,ke[d]=ke[s]=ke[S]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,We="object"==typeof E&&E&&E.Object===Object&&E,je="object"==typeof self&&self&&self.Object===Object&&self,$e=We||je||Function("return this")(),ze=t&&!t.nodeType&&t,Ye=ze&&e&&!e.nodeType&&e,Ge=Ye&&Ye.exports===ze,Ke=Ge&&We.process,Ve=function(){try{return Ye&&Ye.require&&Ye.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),qe=Ve&&Ve.isArrayBuffer,Xe=Ve&&Ve.isDate,Je=Ve&&Ve.isMap,Ze=Ve&&Ve.isRegExp,Qe=Ve&&Ve.isSet,et=Ve&&Ve.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function pt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function vt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var mt=ht("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,At,l)}function gt(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function At(e){return e!=e}function St(e,t){var l=null==e?0:e.length;return l?Ct(e,t)/l:NaN}function ht(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function yt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Ct(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function Tt(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,zt(e)+1).replace(G,""):e}function Pt(e){return function(t){return e(t)}}function Nt(e,t){return dt(t,function(t){return e[t]})}function It(e,t){return e.has(t)}function Lt(e,t){for(var l=-1,n=e.length;++l<n&&_t(t,e[l],0)>-1;);return l}function Bt(e,t){for(var l=e.length;l--&&_t(t,e[l],0)>-1;);return l}function Ot(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Rt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function wt(e){return"\\"+Fe[e]}function Mt(e){return Oe.test(e)}function kt(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function Ft(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Mt(e)?function(e){for(var t=Le.lastIndex=0;Le.test(e);)++t;return t}(e):mt(e)}function $t(e){return Mt(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.split("")}(e)}function zt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var Yt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var E=(t=null==t?$e:Gt.defaults($e.Object(),t,Gt.pick($e,xe))).Array,K=t.Date,se=t.Error,ce=t.Function,pe=t.Math,ve=t.Object,me=t.RegExp,Ee=t.String,fe=t.TypeError,_e=E.prototype,ge=ve.prototype,Ae=t["__core-js_shared__"],Se=ce.prototype.toString,he=ge.hasOwnProperty,be=0,ye=function(){var e=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,Te=Se.call(ve),De=$e._,Pe=me("^"+Se.call(he).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ge?t.Buffer:void 0,Oe=t.Symbol,Fe=t.Uint8Array,We=Le?Le.allocUnsafe:void 0,je=Ft(ve.getPrototypeOf,ve),ze=ve.create,Ye=ge.propertyIsEnumerable,Ke=_e.splice,Ve=Oe?Oe.isConcatSpreadable:void 0,mt=Oe?Oe.iterator:void 0,bt=Oe?Oe.toStringTag:void 0,Kt=function(){try{var e=Ji(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Vt=t.clearTimeout!==$e.clearTimeout&&t.clearTimeout,qt=K&&K.now!==$e.Date.now&&K.now,Xt=t.setTimeout!==$e.setTimeout&&t.setTimeout,Jt=pe.ceil,Zt=pe.floor,Qt=ve.getOwnPropertySymbols,el=Le?Le.isBuffer:void 0,tl=t.isFinite,ll=_e.join,nl=Ft(ve.keys,ve),il=pe.max,ol=pe.min,al=K.now,rl=t.parseInt,ul=pe.random,dl=_e.reverse,sl=Ji(t,"DataView"),cl=Ji(t,"Map"),pl=Ji(t,"Promise"),vl=Ji(t,"Set"),ml=Ji(t,"WeakMap"),El=Ji(ve,"create"),fl=ml&&new ml,_l={},gl=Po(sl),Al=Po(cl),Sl=Po(pl),hl=Po(vl),bl=Po(ml),yl=Oe?Oe.prototype:void 0,Cl=yl?yl.valueOf:void 0,Tl=yl?yl.toString:void 0;function Dl(e){if(za(e)&&!Ra(e)&&!(e instanceof Ll)){if(e instanceof Il)return e;if(he.call(e,"__wrapped__"))return No(e)}return new Il(e)}var Pl=function(){function e(){}return function(t){if(!$a(t))return{};if(ze)return ze(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Nl(){}function Il(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ll(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Bl(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 Ol(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 wl(e){var t=this.__data__=new Ol(e);this.size=t.size}function Ml(e,t){var l=Ra(e),n=!l&&Oa(e),i=!l&&!n&&ka(e),o=!l&&!n&&!i&&Za(e),a=l||n||i||o,r=a?Tt(e.length,Ee):[],u=r.length;for(var d in e)!t&&!he.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function kl(e){var t=e.length;return t?e[xn(0,t-1)]:void 0}function Fl(e,t){return bo(Ei(e),Kl(t,0,e.length))}function Ul(e){return bo(Ei(e))}function Hl(e,t,l){(void 0!==l&&!Ia(e[t],l)||void 0===l&&!(t in e))&&Yl(e,t,l)}function Wl(e,t,l){var n=e[t];he.call(e,t)&&Ia(n,l)&&(void 0!==l||t in e)||Yl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Ia(e[l][0],t))return l;return-1}function $l(e,t,l,n){return Zl(e,function(e,i,o){t(n,e,l(e),o)}),n}function zl(e,t){return e&&fi(t,Sr(t),e)}function Yl(e,t,l){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Gl(e,t){for(var l=-1,n=t.length,i=E(n),o=null==e;++l<n;)i[l]=o?void 0:Er(e,t[l]);return i}function Kl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function Vl(e,t,l,n,i,a){var d,E=1&t,S=2&t,B=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!$a(e))return e;var O=Ra(e);if(O){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&he.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!E)return Ei(e,d)}else{var R=eo(e),x=R==s||R==c;if(ka(e))return di(e,E);if(R==m||R==o||x&&!i){if(d=S||x?{}:lo(e),!E)return S?function(e,t){return fi(e,Qi(e),t)}(e,function(e,t){return e&&fi(t,hr(t),e)}(d,e)):function(e,t){return fi(e,Zi(e),t)}(e,zl(d,e))}else{if(!ke[R])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case h:return si(e);case r:case u:return new n(+e);case b:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case y:case C:case T:case D:case P:case N:case"[object Uint8ClampedArray]":case I:case L:return ci(e,l);case p:return new n;case v:case g:return new n(e);case f:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case _:return new n;case A:return Cl?ve(Cl.call(e)):{}}}(e,R,E)}}a||(a=new wl);var w=a.get(e);if(w)return w;a.set(e,d),qa(e)?e.forEach(function(n){d.add(Vl(n,t,l,n,e,a))}):Ya(e)&&e.forEach(function(n,i){d.set(i,Vl(n,t,l,i,e,a))});var M=O?void 0:(B?S?zi:$i:S?hr:Sr)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Wl(d,i,Vl(n,t,l,i,e,a))}),d}function ql(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Xl(e,t,n){if("function"!=typeof e)throw new fe(l);return go(function(){e.apply(void 0,n)},t)}function Jl(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Pt(l))),n?(o=ut,a=!1):t.length>=200&&(o=It,a=!1,t=new xl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var p=d;p--;)if(t[p]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Dl.templateSettings={escape:F,evaluate:U,interpolate:H,variable:"",imports:{_:Dl}},(Dl.prototype=Nl.prototype).constructor=Dl,(Il.prototype=Pl(Nl.prototype)).constructor=Il,(Ll.prototype=Pl(Nl.prototype)).constructor=Ll,Bl.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},Bl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bl.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return he.call(t,e)?t[e]:void 0},Bl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:he.call(t,e)},Bl.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},Ol.prototype.clear=function(){this.__data__=[],this.size=0},Ol.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():Ke.call(t,l,1),--this.size,0))},Ol.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},Ol.prototype.has=function(e){return jl(this.__data__,e)>-1},Ol.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 Bl,map:new(cl||Ol),string:new Bl}},Rl.prototype.delete=function(e){var t=qi(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return qi(this,e).get(e)},Rl.prototype.has=function(e){return qi(this,e).has(e)},Rl.prototype.set=function(e,t){var l=qi(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)},wl.prototype.clear=function(){this.__data__=new Ol,this.size=0},wl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},wl.prototype.get=function(e){return this.__data__.get(e)},wl.prototype.has=function(e){return this.__data__.has(e)},wl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Ol){var n=l.__data__;if(!cl||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new Rl(n)}return l.set(e,t),this.size=l.size,this};var Zl=Ai(rn),Ql=Ai(un,!0);function en(e,t){var l=!0;return Zl(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!Ja(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return Zl(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Si(),an=Si(!0);function rn(e,t){return e&&on(e,t,Sr)}function un(e,t){return e&&an(e,t,Sr)}function dn(e,t){return at(t,function(t){return Ha(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[Do(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return Ra(e)?n:st(n,l(e))}function pn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=he.call(e,bt),l=e[bt];try{e[bt]=void 0;var n=!0}catch(e){}var i=Ce.call(e);return n&&(t?e[bt]=l:delete e[bt]),i}(e):function(e){return Ce.call(e)}(e)}function vn(e,t){return e>t}function mn(e,t){return null!=e&&he.call(e,t)}function En(e,t){return null!=e&&t in ve(e)}function fn(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=E(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Pt(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new xl(a&&s):void 0}s=e[0];var c=-1,p=r[0];e:for(;++c<i&&d.length<u;){var v=s[c],m=t?t(v):v;if(v=l||0!==v?v:0,!(p?It(p,m):n(d,m,l))){for(a=o;--a;){var f=r[a];if(!(f?It(f,m):n(e[a],m,l)))continue e}p&&p.push(m),d.push(v)}}return d}function _n(e,t,l){var n=null==(e=mo(e,t=oi(t,e)))?e:e[Do(Uo(t))];return null==n?void 0:tt(n,e,l)}function gn(e){return za(e)&&pn(e)==o}function An(e,t,l,n,i){return e===t||(null==e||null==t||!za(e)&&!za(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=Ra(e),E=Ra(t),S=c?a:eo(e),y=E?a:eo(t),C=(S=S==o?m:S)==m,T=(y=y==o?m:y)==m,D=S==y;if(D&&ka(e)){if(!ka(t))return!1;c=!0,C=!1}if(D&&!C)return s||(s=new wl),c||Za(e)?Wi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case h:return!(e.byteLength!=t.byteLength||!o(new Fe(e),new Fe(t)));case r:case u:case v:return Ia(+e,+t);case d:return e.name==t.name&&e.message==t.message;case f:case g:return e==t+"";case p:var s=kt;case _: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 m=Wi(s(e),s(t),n,i,o,a);return a.delete(e),m;case A:if(Cl)return Cl.call(e)==Cl.call(t)}return!1}(e,t,S,l,n,i,s);if(!(1&l)){var P=C&&he.call(e,"__wrapped__"),N=T&&he.call(t,"__wrapped__");if(P||N){var I=P?e.value():e,L=N?t.value():t;return s||(s=new wl),i(I,L,l,n,s)}}return!!D&&(s||(s=new wl),function(e,t,l,n,i,o){var a=1&l,r=$i(e),u=r.length;if(u!=$i(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:he.call(t,s)))return!1}var c=o.get(e),p=o.get(t);if(c&&p)return c==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var _=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===_?E===f||i(E,f,l,n,o):_)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var g=e.constructor,A=t.constructor;g==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof A&&A instanceof A||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,s))}(e,t,l,n,An,i))}function Sn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=ve(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new wl;if(n)var p=n(d,s,u,e,t,c);if(!(void 0===p?An(s,d,3,n,c):p))return!1}}return!0}function hn(e){return!(!$a(e)||(t=e,ye&&ye in t))&&(Ha(e)?Pe:ie).test(Po(e));var t}function bn(e){return"function"==typeof e?e:null==e?Gr:"object"==typeof e?Ra(e)?Pn(e[0],e[1]):Dn(e):tu(e)}function yn(e){if(!so(e))return nl(e);var t=[];for(var l in ve(e))he.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Cn(e,t){return e<t}function Tn(e,t){var l=-1,n=wa(e)?E(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Dn(e){var t=Xi(e);return 1==t.length&&t[0][2]?po(t[0][0],t[0][1]):function(l){return l===e||Sn(l,e,t)}}function Pn(e,t){return ao(e)&&co(t)?po(Do(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?fr(l,e):An(t,n,3)}}function Nn(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new wl),$a(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),u=fo(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var p=Ra(u),v=!p&&ka(u),m=!p&&!v&&Za(u);s=u,p||v||m?Ra(r)?s=r:Ma(r)?s=Ei(r):v?(c=!1,s=di(u,!0)):m?(c=!1,s=ci(u,!0)):s=[]:Ka(u)||Oa(u)?(s=r,Oa(r)?s=ar(r):$a(r)&&!Ha(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,Nn,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hl(e,a,r)}},hr)}function In(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function Ln(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}):[Gr];var n=-1;return t=dt(t,Pt(Vi())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=pi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(Tn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function Bn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function On(e,t,l,n){var i=n?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=dt(e,Pt(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&Ke.call(r,u,1),Ke.call(e,u,1);return e}function Rn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?Ke.call(e,i,1):Jn(e,i)}}return e}function xn(e,t){return e+Zt(ul()*(t-e+1))}function wn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=Zt(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return Ao(vo(e,t,Gr),e+"")}function kn(e){return kl(Ir(e))}function Fn(e,t){var l=Ir(e);return bo(l,Kl(t,0,l.length))}function Un(e,t,l,n){if(!$a(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=$a(s)?s:io(t[i+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=fl?function(e,t){return fl.set(e,t),e}:Gr,Wn=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:$r(t),writable:!0})}:Gr;function jn(e){return bo(Ir(e))}function $n(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=E(i);++n<i;)o[n]=e[n+t];return o}function zn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Yn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Ja(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Gn(e,t,Gr,l)}function Gn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Ja(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),p=void 0!==c,v=null===c,m=c==c,E=Ja(c);if(a)var f=n||m;else f=d?m&&(n||p):r?m&&p&&(n||!v):u?m&&p&&!v&&(n||!E):!v&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function Kn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Ia(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Vn(e){return"number"==typeof e?e:Ja(e)?NaN:+e}function qn(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,qn)+"";if(Ja(e))return Tl?Tl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:wi(e);if(d)return Ht(d);a=!1,i=It,u=new xl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var p=u.length;p--;)if(u[p]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Jn(e,t){return null==(e=mo(e,t=oi(t,e)))||delete e[Do(Uo(t))]}function Zn(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Qn(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?$n(e,n?0:o,n?o+1:i):$n(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ll&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Xn(e[0]):[];for(var i=-1,o=E(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Jl(o[i]||a,e[r],t,l));return Xn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ma(e)?e:[]}function ii(e){return"function"==typeof e?e:Gr}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:To(rr(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:$n(e,t,l)}var ui=Vt||function(e){return $e.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=We?We(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new Fe(t).set(new Fe(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Ja(e),a=void 0!==t,r=null===t,u=t==t,d=Ja(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function vi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=E(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function mi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=E(s+d),p=!n;++i<s;)c[i]=e[i];for(var v=i;++u<d;)c[v+u]=t[u];for(;++a<r;)(p||i<o)&&(c[v+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=E(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?Yl(l,r,u):Wl(l,r,u)}return l}function _i(e,t){return function(l,n){var i=Ra(l)?lt:$l,o=t?t():{};return i(l,e,Vi(n,2),o)}}function gi(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function Ai(e,t){return function(l,n){if(null==l)return l;if(!wa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=ve(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Si(e){return function(t,l,n){for(var i=-1,o=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function hi(e){return function(t){var l=Mt(t=rr(t))?$t(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function bi(e){return function(t){return ct(Hr(Or(t).replace(Ne,"")),e,"")}}function yi(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=Pl(e.prototype),n=e.apply(l,t);return $a(n)?n:l}}function Ci(e){return function(t,l,n){var i=ve(t);if(!wa(t)){var o=Vi(l,3);t=Sr(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function Ti(e){return ji(function(t){var n=t.length,i=n,o=Il.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==Gi(a))var r=new Il([],!0)}for(i=r?i:n;++i<n;){var u=Gi(a=t[i]),d="wrapper"==u?Yi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Gi(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&Ra(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Di(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:yi(e);return function _(){for(var g=arguments.length,A=E(g),S=g;S--;)A[S]=arguments[S];if(v)var h=Ki(_),b=Ot(A,h);if(n&&(A=vi(A,n,i,v)),o&&(A=mi(A,o,a,v)),g-=b,v&&g<d){var y=Ut(A,h);return Ri(e,t,Di,_.placeholder,l,A,y,r,u,d-g)}var C=c?l:this,T=p?C[e]:e;return g=A.length,r?A=Eo(A,r):m&&g>1&&A.reverse(),s&&u<g&&(A.length=u),this&&this!==$e&&this instanceof _&&(T=f||yi(T)),T.apply(C,A)}}function Pi(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Ni(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=qn(l),n=qn(n)):(l=Vn(l),n=Vn(n)),i=e(l,n)}return i}}function Ii(e){return ji(function(t){return t=dt(t,Pt(Vi())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Li(e,t){var l=(t=void 0===t?" ":qn(t)).length;if(l<2)return l?wn(t,e):t;var n=wn(t,Jt(e/jt(t)));return Mt(t)?ri($t(n),0,e).join(""):n.slice(0,e)}function Bi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l,n){for(var i=-1,o=il(Jt((t-e)/(l||1)),0),a=E(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function Oi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=or(t),l=or(l)),e(t,l)}}function Ri(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],p=l.apply(void 0,c);return ro(e)&&_o(p,c),p.placeholder=n,So(p,e,t)}function xi(e){var t=pe[e];return function(e,l){if(e=or(e),(l=null==l?0:ol(nr(l),292))&&tl(e)){var n=(rr(e)+"e").split("e");return+((n=(rr(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var wi=vl&&1/Ht(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:Jr;function Mi(e){return function(t){var l=eo(t);return l==p?kt(t):l==_?Wt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function ki(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var p=o,v=a;o=a=void 0}var m=s?void 0:Yi(e),f=[e,t,i,o,a,p,v,r,u,d];if(m&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?mi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(d=f[9]=void 0===f[9]?s?0:e.length:il(f[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,l){var n=yi(e);return function i(){for(var o=arguments.length,a=E(o),r=o,u=Ki(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Ri(e,t,Di,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==$e&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Di.apply(void 0,f):function(e,t,l,n){var i=1&t,o=yi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=E(d+r),c=this&&this!==$e&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var _=function(e,t,l){var n=1&t,i=yi(e);return function t(){var o=this&&this!==$e&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return So((m?Hn:_o)(_,f),e,t)}function Fi(e,t,l,n){return void 0===e||Ia(e,ge[l])&&!he.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return $a(e)&&$a(t)&&(o.set(t,e),Nn(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return Ka(e)?void 0:e}function Wi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,p=!0,v=2&l?new xl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var f=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==f){if(f)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!It(v,t)&&(m===e||i(m,e,l,n,o)))return v.push(t)})){p=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function ji(e){return Ao(vo(e,void 0,xo),e+"")}function $i(e){return cn(e,Sr,Zi)}function zi(e){return cn(e,hr,Qi)}var Yi=fl?function(e){return fl.get(e)}:Jr;function Gi(e){for(var t=e.name+"",l=_l[t],n=he.call(_l,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(he.call(Dl,"placeholder")?Dl:e).placeholder}function Vi(){var e=Dl.iteratee||Kr;return e=e===Kr?bn:e,arguments.length?e(arguments[0],arguments[1]):e}function qi(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 Xi(e){for(var t=Sr(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Ji(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return hn(l)?l:void 0}var Zi=Qt?function(e){return null==e?[]:(e=ve(e),at(Qt(e),function(t){return Ye.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:iu,eo=pn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=Do(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Ra(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Pl(je(e))}function no(e){return Ra(e)||Oa(e)||!!(Ve&&e&&e[Ve])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!$a(l))return!1;var n=typeof t;return!!("number"==n?wa(l)&&io(t,l.length):"string"==n&&t in l)&&Ia(l[t],e)}function ao(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Ja(e))||j.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ro(e){var t=Gi(e),l=Dl[t];if("function"!=typeof l||!(t in Ll.prototype))return!1;if(e===l)return!0;var n=Yi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=b||cl&&eo(new cl)!=p||pl&&"[object Promise]"!=eo(pl.resolve())||vl&&eo(new vl)!=_||ml&&eo(new ml)!=S)&&(eo=function(e){var t=pn(e),l=t==m?e.constructor:void 0,n=l?Po(l):"";if(n)switch(n){case gl:return b;case Al:return p;case Sl:return"[object Promise]";case hl:return _;case bl:return S}return t});var uo=Ae?Ha:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!$a(e)}function po(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=E(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=E(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function mo(e,t){return t.length<2?e:sn(e,$n(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=ho(Hn),go=Xt||function(e,t){return $e.setTimeout(e,t)},Ao=ho(Wn);function So(e,t,l){var n=t+"";return Ao(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(V,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(q);return t?t[1].split(X):[]}(n),l)))}function ho(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=xn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var yo,Co,To=(yo=ya(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($,function(e,l,n,i){t.push(n?i.replace(Q,"$1"):l||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=yo.cache,yo);function Do(e){if("string"==typeof e||Ja(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Ll)return e.clone();var t=new Il(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Mn(function(e,t){return Ma(e)?Jl(e,nn(t,1,Ma,!0)):[]}),Lo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Jl(e,nn(t,1,Ma,!0),Vi(l,2)):[]}),Bo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Jl(e,nn(t,1,Ma,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),ft(e,Vi(t,3),i)}function Ro(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=nr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,Vi(t,3),i,!0)}function xo(e){return null!=e&&e.length?nn(e,1):[]}function wo(e){return e&&e.length?e[0]:void 0}var Mo=Mn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),ko=Mn(function(e){var t=Uo(e),l=dt(e,ni);return t===Uo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,Vi(t,2)):[]}),Fo=Mn(function(e){var t=Uo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Mn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?On(e,t):e}var jo=ji(function(e,t){var l=null==e?0:e.length,n=Gl(e,t);return Rn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(pi)),n});function $o(e){return null==e?e:dl.call(e)}var zo=Mn(function(e){return Xn(nn(e,1,Ma,!0))}),Yo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),Xn(nn(e,1,Ma,!0),Vi(t,2))}),Go=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Xn(nn(e,1,Ma,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ma(e))return t=il(e.length,t),!0}),Tt(t,function(t){return dt(e,ht(t))})}function Vo(e,t){if(!e||!e.length)return[];var l=Ko(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var qo=Mn(function(e,t){return Ma(e)?Jl(e,t):[]}),Xo=Mn(function(e){return ti(at(e,Ma))}),Jo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),ti(at(e,Ma),Vi(t,2))}),Zo=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ma),void 0,t)}),Qo=Mn(Ko),ea=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,Vo(e,l)});function ta(e){var t=Dl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Gl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ll&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new Il(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=_i(function(e,t,l){he.call(e,l)?++e[l]:Yl(e,l,1)}),oa=Ci(Oo),aa=Ci(Ro);function ra(e,t){return(Ra(e)?nt:Zl)(e,Vi(t,3))}function ua(e,t){return(Ra(e)?it:Ql)(e,Vi(t,3))}var da=_i(function(e,t,l){he.call(e,l)?e[l].push(t):Yl(e,l,[t])}),sa=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=wa(e)?E(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):_n(e,t,l)}),o}),ca=_i(function(e,t,l){Yl(e,l,t)});function pa(e,t){return(Ra(e)?dt:Tn)(e,Vi(t,3))}var va=_i(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),ma=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Ln(e,nn(t,1),[])}),Ea=qt||function(){return $e.Date.now()};function fa(e,t,l){return t=l?void 0:t,ki(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=nr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ga=Mn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,Ki(ga));n|=32}return ki(e,n,t,l,i)}),Aa=Mn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,Ki(Aa));n|=32}return ki(t,n,e,l,i)});function Sa(e,t,n){var i,o,a,r,u,d,s=0,c=!1,p=!1,v=!0;if("function"!=typeof e)throw new fe(l);function m(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=go(_,t),c?m(e):r}function f(e){var l=e-d;return void 0===d||l>=t||l<0||p&&e-s>=a}function _(){var e=Ea();if(f(e))return g(e);u=go(_,function(e){var l=t-(e-d);return p?ol(l,a-(e-s)):l}(e))}function g(e){return u=void 0,v&&i?m(e):(i=o=void 0,r)}function A(){var e=Ea(),l=f(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(p)return ui(u),u=go(_,t),m(d)}return void 0===u&&(u=go(_,t)),r}return t=or(t)||0,$a(n)&&(c=!!n.leading,a=(p="maxWait"in n)?il(or(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),A.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},A.flush=function(){return void 0===u?r:g(Ea())},A}var ha=Mn(function(e,t){return Xl(e,1,t)}),ba=Mn(function(e,t,l){return Xl(e,or(t)||0,l)});function ya(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(ya.Cache||Rl),n}function Ca(e){if("function"!=typeof e)throw new fe(l);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ya.Cache=Rl;var Ta=ai(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Pt(Vi())):dt(nn(t,1),Pt(Vi()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Da=Mn(function(e,t){return ki(e,32,void 0,t,Ut(t,Ki(Da)))}),Pa=Mn(function(e,t){return ki(e,64,void 0,t,Ut(t,Ki(Pa)))}),Na=ji(function(e,t){return ki(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var La=Oi(vn),Ba=Oi(function(e,t){return e>=t}),Oa=gn(function(){return arguments}())?gn:function(e){return za(e)&&he.call(e,"callee")&&!Ye.call(e,"callee")},Ra=E.isArray,xa=qe?Pt(qe):function(e){return za(e)&&pn(e)==h};function wa(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ma(e){return za(e)&&wa(e)}var ka=el||ou,Fa=Xe?Pt(Xe):function(e){return za(e)&&pn(e)==u};function Ua(e){if(!za(e))return!1;var t=pn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ka(e)}function Ha(e){if(!$a(e))return!1;var t=pn(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 $a(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function za(e){return null!=e&&"object"==typeof e}var Ya=Je?Pt(Je):function(e){return za(e)&&eo(e)==p};function Ga(e){return"number"==typeof e||za(e)&&pn(e)==v}function Ka(e){if(!za(e)||pn(e)!=m)return!1;var t=je(e);if(null===t)return!0;var l=he.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Se.call(l)==Te}var Va=Ze?Pt(Ze):function(e){return za(e)&&pn(e)==f},qa=Qe?Pt(Qe):function(e){return za(e)&&eo(e)==_};function Xa(e){return"string"==typeof e||!Ra(e)&&za(e)&&pn(e)==g}function Ja(e){return"symbol"==typeof e||za(e)&&pn(e)==A}var Za=et?Pt(et):function(e){return za(e)&&ja(e.length)&&!!Me[pn(e)]},Qa=Oi(Cn),er=Oi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(wa(e))return Xa(e)?$t(e):Ei(e);if(mt&&e[mt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[mt]());var t=eo(e);return(t==p?kt:t==_?Ht:Ir)(e)}function lr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function nr(e){var t=lr(e),l=t%1;return t==t?l?t-l:t:0}function ir(e){return e?Kl(nr(e),0,4294967295):0}function or(e){if("number"==typeof e)return e;if(Ja(e))return NaN;if($a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var l=ne.test(e);return l||oe.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return fi(e,hr(e))}function rr(e){return null==e?"":qn(e)}var ur=gi(function(e,t){if(so(t)||wa(t))fi(t,Sr(t),e);else for(var l in t)he.call(t,l)&&Wl(e,l,t[l])}),dr=gi(function(e,t){fi(t,hr(t),e)}),sr=gi(function(e,t,l,n){fi(t,hr(t),e,n)}),cr=gi(function(e,t,l,n){fi(t,Sr(t),e,n)}),pr=ji(Gl),vr=Mn(function(e,t){e=ve(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Ia(s,ge[d])&&!he.call(e,d))&&(e[d]=o[d])}return e}),mr=Mn(function(e){return e.push(void 0,Ui),tt(yr,void 0,e)});function Er(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function fr(e,t){return null!=e&&to(e,t,En)}var _r=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=l},$r(Gr)),gr=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),he.call(e,t)?e[t].push(l):e[t]=[l]},Vi),Ar=Mn(_n);function Sr(e){return wa(e)?Ml(e):yn(e)}function hr(e){return wa(e)?Ml(e,!0):function(e){if(!$a(e))return function(e){var t=[];if(null!=e)for(var l in ve(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&he.call(e,n))&&l.push(n);return l}(e)}var br=gi(function(e,t,l){Nn(e,t,l)}),yr=gi(function(e,t,l,n){Nn(e,t,l,n)}),Cr=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,zi(e),l),n&&(l=Vl(l,7,Hi));for(var i=t.length;i--;)Jn(l,t[i]);return l}),Tr=ji(function(e,t){return null==e?{}:function(e,t){return Bn(e,t,function(t,l){return fr(e,l)})}(e,t)});function Dr(e,t){if(null==e)return{};var l=dt(zi(e),function(e){return[e]});return t=Vi(t),Bn(e,l,function(e,l){return t(e,l[0])})}var Pr=Mi(Sr),Nr=Mi(hr);function Ir(e){return null==e?[]:Nt(e,Sr(e))}var Lr=bi(function(e,t,l){return t=t.toLowerCase(),e+(l?Br(t):t)});function Br(e){return Ur(rr(e).toLowerCase())}function Or(e){return(e=rr(e))&&e.replace(re,Rt).replace(Ie,"")}var Rr=bi(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),xr=bi(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),wr=hi("toLowerCase"),Mr=bi(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),kr=bi(function(e,t,l){return e+(l?" ":"")+Ur(t)}),Fr=bi(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=hi("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(Be)||[]}(e):function(e){return e.match(J)||[]}(e):e.match(t)||[]}var Wr=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),jr=ji(function(e,t){return nt(t,function(t){t=Do(t),Yl(e,t,ga(e[t],e))}),e});function $r(e){return function(){return e}}var zr=Ti(),Yr=Ti(!0);function Gr(e){return e}function Kr(e){return bn("function"==typeof e?e:Vl(e,1))}var Vr=Mn(function(e,t){return function(l){return _n(l,e,t)}}),qr=Mn(function(e,t){return function(l){return _n(e,l,t)}});function Xr(e,t,l){var n=Sr(t),i=dn(t,n);null!=l||$a(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,Sr(t)));var o=!($a(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Jr(){}var Zr=Ii(dt),Qr=Ii(ot),eu=Ii(vt);function tu(e){return ao(e)?ht(Do(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=Bi(),nu=Bi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Ni(function(e,t){return e+t},0),uu=xi("ceil"),du=Ni(function(e,t){return e/t},1),su=xi("floor"),cu=Ni(function(e,t){return e*t},1),pu=xi("round"),vu=Ni(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=pr,Dl.before=_a,Dl.bind=ga,Dl.bindAll=jr,Dl.bindKey=Aa,Dl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Dl.chain=ta,Dl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=E(Jt(n/t));i<n;)a[o++]=$n(e,i,i+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=E(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?Ei(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=Vi();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=Sr(e);return function(l){return ql(l,e,t)}}(Vl(e,1))},Dl.constant=$r,Dl.countBy=ia,Dl.create=function(e,t){var l=Pl(e);return null==t?l:zl(l,t)},Dl.curry=function e(t,l,n){var i=ki(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.curryRight=function e(t,l,n){var i=ki(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.debounce=Sa,Dl.defaults=vr,Dl.defaultsDeep=mr,Dl.defer=ha,Dl.delay=ba,Dl.difference=Io,Dl.differenceBy=Lo,Dl.differenceWith=Bo,Dl.drop=function(e,t,l){var n=null==e?0:e.length;return n?$n(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?$n(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,Vi(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!0):[]},Dl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=nr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:nr(n))<0&&(n+=i),n=l>n?0:ir(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(Ra(e)?at:ln)(e,Vi(t,3))},Dl.flatMap=function(e,t){return nn(pa(e,t),1)},Dl.flatMapDeep=function(e,t){return nn(pa(e,t),1/0)},Dl.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(pa(e,t),l)},Dl.flatten=xo,Dl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Dl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Dl.flip=function(e){return ki(e,512)},Dl.flow=zr,Dl.flowRight=Yr,Dl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Dl.functions=function(e){return null==e?[]:dn(e,Sr(e))},Dl.functionsIn=function(e){return null==e?[]:dn(e,hr(e))},Dl.groupBy=da,Dl.initial=function(e){return null!=e&&e.length?$n(e,0,-1):[]},Dl.intersection=Mo,Dl.intersectionBy=ko,Dl.intersectionWith=Fo,Dl.invert=_r,Dl.invertBy=gr,Dl.invokeMap=sa,Dl.iteratee=Kr,Dl.keyBy=ca,Dl.keys=Sr,Dl.keysIn=hr,Dl.map=pa,Dl.mapKeys=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){Yl(l,t(e,n,i),e)}),l},Dl.mapValues=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){Yl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(Vl(e,1))},Dl.matchesProperty=function(e,t){return Pn(e,Vl(t,1))},Dl.memoize=ya,Dl.merge=br,Dl.mergeWith=yr,Dl.method=Vr,Dl.methodOf=qr,Dl.mixin=Xr,Dl.negate=Ca,Dl.nthArg=function(e){return e=nr(e),Mn(function(t){return In(t,e)})},Dl.omit=Cr,Dl.omitBy=function(e,t){return Dr(e,Ca(Vi(t)))},Dl.once=function(e){return _a(2,e)},Dl.orderBy=function(e,t,l,n){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(l=n?void 0:l)||(l=null==l?[]:[l]),Ln(e,t,l))},Dl.over=Zr,Dl.overArgs=Ta,Dl.overEvery=Qr,Dl.overSome=eu,Dl.partial=Da,Dl.partialRight=Pa,Dl.partition=va,Dl.pick=Tr,Dl.pickBy=Dr,Dl.property=tu,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Ho,Dl.pullAll=Wo,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,Vi(l,2)):e},Dl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,void 0,l):e},Dl.pullAt=jo,Dl.range=lu,Dl.rangeRight=nu,Dl.rearg=Na,Dl.reject=function(e,t){return(Ra(e)?at:ln)(e,Ca(Vi(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=Vi(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Rn(e,i),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Mn(e,t=void 0===t?t:nr(t))},Dl.reverse=$o,Dl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),(Ra(e)?Fl:Fn)(e,t)},Dl.set=function(e,t,l){return null==e?e:Un(e,t,l)},Dl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Dl.shuffle=function(e){return(Ra(e)?Ul:jn)(e)},Dl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:nr(t),l=void 0===l?n:nr(l)),$n(e,t,l)):[]},Dl.sortBy=ma,Dl.sortedUniq=function(e){return e&&e.length?Kn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?Kn(e,Vi(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!Va(t))&&!(t=qn(t))&&Mt(e)?ri($t(e),0,l):e.split(t,l):[]},Dl.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(nr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Dl.tail=function(e){var t=null==e?0:e.length;return t?$n(e,1,t):[]},Dl.take=function(e,t,l){return e&&e.length?$n(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?$n(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,Vi(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return $a(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Sa(e,t,{leading:i,maxWait:t,trailing:o})},Dl.thru=la,Dl.toArray=tr,Dl.toPairs=Pr,Dl.toPairsIn=Nr,Dl.toPath=function(e){return Ra(e)?dt(e,Do):Ja(e)?[e]:Ei(To(rr(e)))},Dl.toPlainObject=ar,Dl.transform=function(e,t,l){var n=Ra(e),i=n||ka(e)||Za(e);if(t=Vi(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:$a(e)&&Ha(o)?Pl(je(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Dl.unary=function(e){return fa(e,1)},Dl.union=zo,Dl.unionBy=Yo,Dl.unionWith=Go,Dl.uniq=function(e){return e&&e.length?Xn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Xn(e,Vi(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||Jn(e,t)},Dl.unzip=Ko,Dl.unzipWith=Vo,Dl.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Dl.values=Ir,Dl.valuesIn=function(e){return null==e?[]:Nt(e,hr(e))},Dl.without=qo,Dl.words=Hr,Dl.wrap=function(e,t){return Da(ii(t),e)},Dl.xor=Xo,Dl.xorBy=Jo,Dl.xorWith=Zo,Dl.zip=Qo,Dl.zipObject=function(e,t){return li(e||[],t||[],Wl)},Dl.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Dl.zipWith=ea,Dl.entries=Pr,Dl.entriesIn=Nr,Dl.extend=dr,Dl.extendWith=sr,Xr(Dl,Dl),Dl.add=ru,Dl.attempt=Wr,Dl.camelCase=Lr,Dl.capitalize=Br,Dl.ceil=uu,Dl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=or(l))==l?l:0),void 0!==t&&(t=(t=or(t))==t?t:0),Kl(or(e),t,l)},Dl.clone=function(e){return Vl(e,4)},Dl.cloneDeep=function(e){return Vl(e,5)},Dl.cloneDeepWith=function(e,t){return Vl(e,5,t="function"==typeof t?t:void 0)},Dl.cloneWith=function(e,t){return Vl(e,4,t="function"==typeof t?t:void 0)},Dl.conformsTo=function(e,t){return null==t||ql(e,t,Sr(t))},Dl.deburr=Or,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=qn(t);var n=e.length,i=l=void 0===l?n:Kl(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Dl.eq=Ia,Dl.escape=function(e){return(e=rr(e))&&k.test(e)?e.replace(w,xt):e},Dl.escapeRegExp=function(e){return(e=rr(e))&&Y.test(e)?e.replace(z,"\\$&"):e},Dl.every=function(e,t,l){var n=Ra(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Dl.find=oa,Dl.findIndex=Oo,Dl.findKey=function(e,t){return Et(e,Vi(t,3),rn)},Dl.findLast=aa,Dl.findLastIndex=Ro,Dl.findLastKey=function(e,t){return Et(e,Vi(t,3),un)},Dl.floor=su,Dl.forEach=ra,Dl.forEachRight=ua,Dl.forIn=function(e,t){return null==e?e:on(e,Vi(t,3),hr)},Dl.forInRight=function(e,t){return null==e?e:an(e,Vi(t,3),hr)},Dl.forOwn=function(e,t){return e&&rn(e,Vi(t,3))},Dl.forOwnRight=function(e,t){return e&&un(e,Vi(t,3))},Dl.get=Er,Dl.gt=La,Dl.gte=Ba,Dl.has=function(e,t){return null!=e&&to(e,t,mn)},Dl.hasIn=fr,Dl.head=wo,Dl.identity=Gr,Dl.includes=function(e,t,l,n){e=wa(e)?e:Ir(e),l=l&&!n?nr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),Xa(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&_t(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),_t(e,t,i)},Dl.inRange=function(e,t,l){return t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=or(e),t,l)},Dl.invoke=Ar,Dl.isArguments=Oa,Dl.isArray=Ra,Dl.isArrayBuffer=xa,Dl.isArrayLike=wa,Dl.isArrayLikeObject=Ma,Dl.isBoolean=function(e){return!0===e||!1===e||za(e)&&pn(e)==r},Dl.isBuffer=ka,Dl.isDate=Fa,Dl.isElement=function(e){return za(e)&&1===e.nodeType&&!Ka(e)},Dl.isEmpty=function(e){if(null==e)return!0;if(wa(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||Za(e)||Oa(e)))return!e.length;var t=eo(e);if(t==p||t==_)return!e.size;if(so(e))return!yn(e).length;for(var l in e)if(he.call(e,l))return!1;return!0},Dl.isEqual=function(e,t){return An(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?An(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=Ya,Dl.isMatch=function(e,t){return e===t||Sn(e,t,Xi(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Sn(e,t,Xi(t),l)},Dl.isNaN=function(e){return Ga(e)&&e!=+e},Dl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hn(e)},Dl.isNil=function(e){return null==e},Dl.isNull=function(e){return null===e},Dl.isNumber=Ga,Dl.isObject=$a,Dl.isObjectLike=za,Dl.isPlainObject=Ka,Dl.isRegExp=Va,Dl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Dl.isSet=qa,Dl.isString=Xa,Dl.isSymbol=Ja,Dl.isTypedArray=Za,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return za(e)&&eo(e)==S},Dl.isWeakSet=function(e){return za(e)&&"[object WeakSet]"==pn(e)},Dl.join=function(e,t){return null==e?"":ll.call(e,t)},Dl.kebabCase=Rr,Dl.last=Uo,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=nr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,At,i,!0)},Dl.lowerCase=xr,Dl.lowerFirst=wr,Dl.lt=Qa,Dl.lte=er,Dl.max=function(e){return e&&e.length?tn(e,Gr,vn):void 0},Dl.maxBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),vn):void 0},Dl.mean=function(e){return St(e,Gr)},Dl.meanBy=function(e,t){return St(e,Vi(t,2))},Dl.min=function(e){return e&&e.length?tn(e,Gr,Cn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),Cn):void 0},Dl.stubArray=iu,Dl.stubFalse=ou,Dl.stubObject=function(){return{}},Dl.stubString=function(){return""},Dl.stubTrue=function(){return!0},Dl.multiply=cu,Dl.nth=function(e,t){return e&&e.length?In(e,nr(t)):void 0},Dl.noConflict=function(){return $e._===this&&($e._=De),this},Dl.noop=Jr,Dl.now=Ea,Dl.pad=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Li(Zt(i),l)+e+Li(Jt(i),l)},Dl.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?e+Li(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?Li(t-n,l)+e:e},Dl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace(G,""),t||0)},Dl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return xn(e,t)},Dl.reduce=function(e,t,l){var n=Ra(e)?ct:yt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Zl)},Dl.reduceRight=function(e,t,l){var n=Ra(e)?pt:yt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Ql)},Dl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),wn(rr(e),t)},Dl.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[Do(t[n])];void 0===o&&(n=i,o=l),e=Ha(o)?o.call(e):o}return e},Dl.round=pu,Dl.runInContext=e,Dl.sample=function(e){return(Ra(e)?kl:kn)(e)},Dl.size=function(e){if(null==e)return 0;if(wa(e))return Xa(e)?jt(e):e.length;var t=eo(e);return t==p||t==_?e.size:yn(e).length},Dl.snakeCase=Mr,Dl.some=function(e,t,l){var n=Ra(e)?vt:zn;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Dl.sortedIndex=function(e,t){return Yn(e,t)},Dl.sortedIndexBy=function(e,t,l){return Gn(e,t,Vi(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Yn(e,t);if(n<l&&Ia(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return Yn(e,t,!0)},Dl.sortedLastIndexBy=function(e,t,l){return Gn(e,t,Vi(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Yn(e,t,!0)-1;if(Ia(e[l],t))return l}return-1},Dl.startCase=kr,Dl.startsWith=function(e,t,l){return e=rr(e),l=null==l?0:Kl(nr(l),0,e.length),t=qn(t),e.slice(l,l+t.length)==t},Dl.subtract=vu,Dl.sum=function(e){return e&&e.length?Ct(e,Gr):0},Dl.sumBy=function(e,t){return e&&e.length?Ct(e,Vi(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,Fi);var i,o,a=sr({},t.imports,n.imports,Fi),r=Sr(a),u=Nt(a,r),d=0,s=t.interpolate||ue,c="__p += '",p=me((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(he.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++we+"]")+"\n";e.replace(p,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,wt),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=he.call(t,"variable")&&t.variable;if(m){if(Z.test(m))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(B,""):c).replace(O,"$1").replace(R,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(r,v+"return "+c).apply(void 0,u)});if(E.source=c,Ua(E))throw E;return E},Dl.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=Tt(n,t=Vi(t));++l<e;)t(l);return i},Dl.toFinite=lr,Dl.toInteger=nr,Dl.toLength=ir,Dl.toLower=function(e){return rr(e).toLowerCase()},Dl.toNumber=or,Dl.toSafeInteger=function(e){return e?Kl(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=qn(t)))return e;var n=$t(e),i=$t(t);return ri(n,Lt(n,i),Bt(n,i)+1).join("")},Dl.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,zt(e)+1);if(!e||!(t=qn(t)))return e;var n=$t(e);return ri(n,0,Bt(n,$t(t))+1).join("")},Dl.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace(G,"");if(!e||!(t=qn(t)))return e;var n=$t(e);return ri(n,Lt(n,$t(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if($a(t)){var i="separator"in t?t.separator:i;l="length"in t?nr(t.length):l,n="omission"in t?qn(t.omission):n}var o=(e=rr(e)).length;if(Mt(e)){var a=$t(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),Va(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=me(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(qn(i),r)!=r){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+n},Dl.unescape=function(e){return(e=rr(e))&&M.test(e)?e.replace(x,Yt):e},Dl.uniqueId=function(e){var t=++be;return rr(e)+t},Dl.upperCase=Fr,Dl.upperFirst=Ur,Dl.each=ra,Dl.eachRight=ua,Dl.first=wo,Xr(Dl,(au={},rn(Dl,function(e,t){he.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){Ll.prototype[e]=function(l){l=void 0===l?1:il(nr(l),0);var n=this.__filtered__&&!t?new Ll(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ll.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;Ll.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Vi(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ll.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ll.prototype[e]=function(){return this.__filtered__?new Ll(this):this[l](1)}}),Ll.prototype.compact=function(){return this.filter(Gr)},Ll.prototype.find=function(e){return this.filter(e).head()},Ll.prototype.findLast=function(e){return this.reverse().find(e)},Ll.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ll(this):this.map(function(l){return _n(l,e,t)})}),Ll.prototype.reject=function(e){return this.filter(Ca(Vi(e)))},Ll.prototype.slice=function(e,t){e=nr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ll(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)},Ll.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ll.prototype.toArray=function(){return this.take(4294967295)},rn(Ll.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Dl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Dl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ll,u=a[0],d=r||Ra(t),s=function(e){var t=i.apply(Dl,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,p=!!this.__actions__.length,v=o&&!c,m=r&&!p;if(!o&&d){t=m?t:new Ll(this);var E=e.apply(t,a);return E.__actions__.push({func:la,args:[s],thisArg:void 0}),new Il(E,c)}return v&&m?e.apply(this,a):(E=this.thru(s),v?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ra(i)?i:[],e)}return this[l](function(l){return t.apply(Ra(l)?l:[],e)})}}),rn(Ll.prototype,function(e,t){var l=Dl[t];if(l){var n=l.name+"";he.call(_l,n)||(_l[n]=[]),_l[n].push({name:t,func:l})}}),_l[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],Ll.prototype.clone=function(){var e=new Ll(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ll.prototype.reverse=function(){if(this.__filtered__){var e=new Ll(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ll.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=Ra(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,p=0,v=ol(u,this.__takeCount__);if(!l||!n&&i==u&&v==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&p<v;){for(var E=-1,f=e[d+=t];++E<c;){var _=s[E],g=_.type,A=(0,_.iteratee)(f);if(2==g)f=A;else if(!A){if(1==g)continue e;break e}}m[p++]=f}return m},Dl.prototype.at=na,Dl.prototype.chain=function(){return ta(this)},Dl.prototype.commit=function(){return new Il(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 Nl;){var n=No(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Dl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ll){var t=e;return this.__actions__.length&&(t=new Ll(this)),(t=t.reverse()).__actions__.push({func:la,args:[$o],thisArg:void 0}),new Il(t,this.__chain__)}return this.thru($o)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dl.prototype.first=Dl.prototype.head,mt&&(Dl.prototype[mt]=function(){return this}),Dl}();Ye?((Ye.exports=Gt)._=Gt,ze._=Gt):$e._=Gt}).call(E)});const bn=e=>{var n,a;let{t:r,config:u,formData:d,setError:s,clearErrors:c,formState:p,index:v,setFieldReports:m,documentList:E}=e;Digit.ULBService.getCurrentTenantId();const f=Digit.ULBService.getStateId(),[_,g]=t.useState((null==d||null===(n=d.FeildReports)||void 0===n||null===(a=n[v])||void 0===a?void 0:a.Documents)||[]),[A,S]=t.useState(null),[h,b]=t.useState((null==d?void 0:d.tradedetils1)||[]);let y="create";const{pathname:C}=i.useLocation();C.includes("/modify-application/")&&(y="update");const{isLoading:T}=Digit.Hooks.pt.usePropertyMDMS(f,"TradeLicense",["documentObj"]);window.location.href.includes("renew-application-details");let D=[];return E&&E.map(e=>{D.push({documentType:e.code,code:e.code})}),t.useEffect(()=>{(()=>{let e=d;e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&(null==_?void 0:_.length)>0&&(e.FieldReports[v]={...e.FieldReports[v],Documents:_}),e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&_.length>0&&m(e.FieldReports)})()},[_]),T?l.createElement(o.Loader,null):l.createElement("div",null,null==D?void 0:D.map((e,t)=>l.createElement("div",null,l.createElement(yn,{key:t,document:e,action:y,t:r,id:"obps-doc-"+t,error:A,setError:S,setDocuments:g,documents:_,formData:d,setFormError:s,clearFormErrors:c,config:u,formState:p,stateId:f}))),A&&l.createElement(o.Toast,{label:A,onClose:()=>S(null),error:!0}))};function yn(e){let{t:n,document:i,setDocuments:a,documents:r,formData:u,setFormError:d,clearFormErrors:s,config:c,formState:p,stateId:v={stateId:v}}=e;const m=null==r?void 0:r.filter(e=>null==e?void 0:e.documentType),E=Digit.ULBService.getCurrentTenantId(),[f,_]=t.useState(""),[g,A]=t.useState(null),[S,h]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,y]=t.useState(!1),[C,T]=t.useState([]),D=()=>{var e,t;let l=null===(e=p.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(null==i?void 0:i.documentType)&&(l=l.filter(e=>e!=(null==i?void 0:i.documentType)),l.length?d(c.key,{type:l}):s(c.key))};return t.useEffect(()=>{null==f||!f.documentType||0!=r.filter(e=>e.documentType===(null==f?void 0:f.documentType)).length&&C.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==f?void 0:f.documentType)}).length===r.filter(e=>e.documentType===(null==f?void 0:f.documentType)).length||a(e=>{if(0===(null==S?void 0:S.length)||null===S)return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==S),l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.documentType));if(null!=f&&f.id)return[...t,{documentType:null==f?void 0:f.documentType,fileStoreId:S,tenantId:E,id:null==f?void 0:f.id}];{let e=[];return C.map(t=>{var l,n;e.push({documentType:null==f?void 0:f.documentType,fileStoreId:null==t||null===(l=t.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==t||null===(n=t.fileStoreId)||void 0===n?void 0:n.tenantId})}),[...l,...e]}}),b?b&&D():window.location.href.includes("renew-application-details")||(S&&null!=f&&f.documentType?S&&null!=f&&f.documentType&&D():(()=>{var e,t;let l=null===(e=p.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(i.documentType)||(l.push(i.documentType),d(c.key,{type:l}))})())},[S,f,b]),t.useEffect(()=>{var e,t;if(i&&(null==u||null===(e=u.documents)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.length)>0)for(let e=0;e<(null==u||null===(l=u.documents)||void 0===l||null===(n=l.documents)||void 0===n?void 0:n.length);e++){var l,n,o,a,r,d,s,c,p,v,m,E,f,g;(null==i?void 0:i.documentType)===(null==u||null===(o=u.documents)||void 0===o||null===(a=o.documents)||void 0===a||null===(r=a[e])||void 0===r?void 0:r.documentType)&&(_({documentType:null==u||null===(d=u.documents)||void 0===d||null===(s=d.documents)||void 0===s||null===(c=s[e])||void 0===c?void 0:c.documentType,id:null==u||null===(p=u.documents)||void 0===p||null===(v=p.documents)||void 0===v||null===(m=v[e])||void 0===m?void 0:m.id}),h(null==u||null===(E=u.documents)||void 0===E||null===(f=E.documents)||void 0===f||null===(g=f[e])||void 0===g?void 0:g.fileStoreId))}},[i]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}},"OLDLICENCENO"!=(null==i?void 0:i.documentType)?n(""+(null==i?void 0:i.documentType.replaceAll(".","_")))+"*":""+n(""+(null==i?void 0:i.documentType.replaceAll(".","_")))),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:v,getFormState:e=>function(e,t){let l=Object.fromEntries(e),n=Object.values(l);T(n),r&&n&&r.filter(e=>e.documentType===t).length>n.length&&a(r.filter(e=>e.documentType!==t)),n&&n.map(e=>{e.file.documentType=t,function(e,t){var l;e&&_({documentType:t}),e&&A(e.file),e&&h(null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId)}(e,t)})}(e,null==i?void 0:i.documentType.replaceAll(".","_")),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Cn=()=>({InspectionDate:"",InspectionTime:"",Checklist:[],Documents:[],key:Date.now()}),Tn=e=>{var n;const{unit:i,index:r,allFieldReport:u,removeUnit:d,setFieldReports:s,t:c,formData:p,config:v,onSelect:m,userType:E,setError:f,clearErrors:_,formState:g,isErrors:A,setIsErrors:S,questionList:h,documentList:b}=e,{control:y,formState:C,watch:T,trigger:D,getValues:P}=a.useForm(),N=T(),{errors:I}=C,L=t.useMemo(()=>{var e;return null==p||null===(e=p.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==p||null===(n=p.ownershipCategory)||void 0===n?void 0:n.code]);t.useEffect(()=>{D()},[]),t.useEffect(()=>{const e=Object.keys(N),t={};e.forEach(e=>t[e]=i[e]);let l=L?{}:{ownerType:{code:"NONE"}},n=h?{questionLength:h.length}:{questionLength:0},o=h?{questionList:h}:{questionList:[]};hn.isEqual(N,t)||(Object.keys(N).map(e=>{"key"==e||null==N[e]||""==N[e]||null==N[e]||A||S(!0)}),s(e=>e.map(e=>e.key&&e.key===i.key?{...e,...N,...l,...n,...o}:{...e})),D())},[N]),t.useEffect(()=>{var e;Object.keys(I).length&&!hn.isEqual((null===(e=g.errors[v.key])||void 0===e?void 0:e.type)||{},I)?f(v.key,{type:I}):!Object.keys(I).length&&g.errors[v.key]&&A&&_(v.key)},[I]);let B=window.location.href.includes("renew-application-details");window.location.href.includes("edit-application-details")&&(B=!0);const O=e=>{let t=[];return e.split("/").map(e=>{t.push({i18nKey:"SCORE_"+e,code:e})}),t};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px",maxWidth:"950px"}},l.createElement("div",{className:"fieldInspectionWrapper"},(null==u?void 0:u.length)>1?l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"-6px"},fill:1!=u.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>d(i)}):null,l.createElement(o.CardSectionHeader,null,(null==u?void 0:u.length)>1?`${c("BPA_FI_REPORT")}-${r+1}`:""+c("BPA_FI_REPORT")),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},c("BPA_FI_DATE_LABEL")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionDate",rules:{required:c("REQUIRED_FIELD")},control:y,render:e=>l.createElement(o.DatePicker,{date:e.value,name:"InspectionDate",onChange:e.onChange})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},c("ES_COMMON_TIME")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionTime",rules:{required:c("REQUIRED_FIELD")},control:y,render:e=>l.createElement(o.TextInput,{name:"InspectionTime",type:"time",value:e.value,onChange:e.onChange})}))),l.createElement(o.CardSectionHeader,null,c("BPA_CHECK_LIST_DETAILS")),h&&h.map((e,t)=>l.createElement("div",{key:t,className:"fieldInsepctionInsideWrapper",style:{maxWidth:"100%"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},c(e.question)+"*"),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:y,name:"question_"+t,rules:{required:c("REQUIRED_FIELD")},render:n=>l.createElement(o.Dropdown,{className:"form-field",style:{width:"100%",maxWidth:"100%"},selected:P("question"+t),disable:!1,option:O(e.fieldType),select:e=>{var t;if((null==n||null===(t=n.value)||void 0===t?void 0:t.code)==(null==e?void 0:e.code))return!0;n.onChange(e)},optionKey:"i18nKey",onBlur:n.onBlur,t:c})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},c("BPA_ENTER_REMARKS")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:y,name:"Remarks_"+t,defaultValue:null==i?void 0:i.uomValue,render:e=>l.createElement(o.TextInput,{value:P("Remarks"+t),onChange:t=>{e.onChange(t)},onBlur:e.onBlur})}))))),l.createElement(o.CardSectionHeader,{style:{marginTop:"20px"}},c("BPA_FIELD_INSPECTION_DOCUMENTS")),l.createElement(bn,{t:c,config:v,onSelect:m,userType:E,formData:p,setError:f,clearErrors:_,formState:g,index:r,setFieldReports:s,documentList:b}))))},Dn=e=>l.createElement("h1",{className:"heading-m"},e.label),Pn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Nn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Pn,null)),In=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:g}=Digit.Hooks.pt.useMDMS(u,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[A,S]=t.useState({}),[h,b]=t.useState({}),[y,C]=t.useState([]),[T,D]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState(null),[R,x]=t.useState([]),[w,M]=t.useState(null),[k,F]=t.useState(!1);function U(e){N(e.target.files[0])}return t.useEffect(()=>{var e;g&&g["egf-master"]&&x(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),t.useEffect(()=>{var e;C(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),t.useEffect(()=>{!function(){try{O(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",P,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(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)}}()},[P]),t.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:t,action:n,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:`WF_${n.action}_APPLICATION`,submit:"WF_PT.CREATE_"+n.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:t("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(o.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:R,selectedFinancialYear:w,setSelectedFinancialYear:M}):(e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${v}_${null==i?void 0:i.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:n(p||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${n("ES_PT_ATTACH_FILE")}${i.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:n("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:y,selectedApprover:T,setSelectedApprover:D,selectFile:U,uploadedFile:I,setUploadedFile:L,businessService:v}))},[r,y,R,w,I]),r&&A.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Dn,{label:a(A.label.heading)}),headerBarEnd:l.createElement(Nn,{onClick:s}),actionCancelLabel:a(A.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(A.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!w:f||(null==r?void 0:r.docUploadRequired)&&!I,formId:"modal-action"},_?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:A.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"};p.creationReason="STATUS",c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:{...p,workflow:t}})}else if(null!=r&&r.showFinancialYearsModal)c({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==w?void 0:w.name,propertyId:null==p?void 0:p.propertyId,tenantId:u,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!T?[]:[T],I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:I}]),c({Property:{...p,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(o.Loader,null)},Ln=e=>l.createElement("h1",{className:"heading-m"},e.label),Bn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),On=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bn,null)),Rn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,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]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState({}),[T,D]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState([]),[R,x]=t.useState(null);t.useEffect(()=>{var e;f&&f["egf-master"]&&O(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:w}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function M(e){D(e.target.files[0])}return t.useEffect(()=>{if(m&&w){var e;const t=w["common-masters"].Department;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:`${null==e||null===(i=e.user)||void 0===i?void 0:i.name} - ${null==a?void 0:a.name}`}}))}},[m]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[T]),t.useEffect(()=>{r&&g((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==n?void 0:n.action)&&"APPROVE"!=(null==n?void 0:n.action)||(p=!1),n.isTerminateState&&(p=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:p?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:M,uploadedFile:P,setUploadedFile:N,businessService:v}))},[r,h,B,R,P]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Ln,{label:a(_.label.heading)}),headerBarEnd:l.createElement(On,{onClick:s}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p={...p,action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:null},c({Licenses:[p]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},xn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),wn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Mn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(wn,null)),kn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v}=e;const{data:m,isLoading:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState({}),[C,T]=t.useState(null),[D,P]=t.useState(null),[N,I]=t.useState(null),L=!!Digit.Utils.browser.isMobile();function B(e){T(e.target.files[0])}return t.useEffect(()=>{var e;h(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),t.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==u?void 0:u.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),t.useEffect(()=>{r&&_((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==n?void 0:n.action)&&(v=!1),n.isTerminateState&&(v=!1),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==c?void 0:c.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:B,uploadedFile:D,setUploadedFile:P,businessService:v,error:N}))},[r,S,D,N]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(xn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Mn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:L?{width:"720px"}:{},style:L?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:L?{paddingLeft:"5px"}:{}},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:f.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p={...p,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},c({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},Fn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Un=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Un,null)),Wn=e=>{var n,i,a,u,s,c,p,v,m,E,f,_;let{t:g,action:A,tenantId:S,closeModal:h,submitAction:b,applicationDetails:y,applicationData:C,businessService:T,workflowDetails:D,blockReason:P}=e;console.log("applicationData",C),console.log("workflowDetails",D),Digit.Hooks.obps.useObpsAPI(null!==(n=C)&&void 0!==n&&null!==(i=n.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:S,!1);const{data:N,isLoading:I}=Digit.Hooks.useEmployeeSearch(S,{roles:null==D||null===(p=D.data)||void 0===p||null===(v=p.initialActionState)||void 0===v||null===(m=v.nextActions)||void 0===m||null===(E=m.filter(e=>(null==e?void 0:e.action)==(null==A?void 0:A.action)))||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=A&&A.isTerminateState)}),[L,B]=(r.useQueryClient(),t.useState({})),[O,R]=t.useState({}),[x,w]=t.useState([]),[M,k]=t.useState([]),[F,U]=t.useState({}),[H,W]=t.useState({}),[j,$]=t.useState(null),[z,Y]=t.useState(null),[G,K]=t.useState(null),[V,q]=t.useState(null),X=!!Digit.Utils.browser.isMobile();function J(e){$(e.target.files[0])}t.useEffect(()=>{var e;w(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]),t.useEffect(()=>{!function(){try{K(null);const e=function(){if(j){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(j.size>=5242880)K(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=j&&j.type&&!e.test(null==j?void 0:j.type))K(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",j,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?Y(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):K(g("CS_FILE_UPLOAD_ERROR"))})},function(){K(g("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)}}()},[j]);const Z=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},Q=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},ee=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:Z(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},le=()=>{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 t.useEffect(()=>{k(null==P?void 0:P.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),A&&B((e=>{var t,n,i,a,r,u,d;let{t:s,action:c,approvers:p,selectedApprover:v,setSelectedApprover:m,selectedBlockReason:E,setBlockReason:f,selectFile:_,uploadedFile:g,setUploadedFile:A,assigneeLabel:S,businessService:h,error:b,blockReasonFiltered:y}=e,C=!1;return"REVOCATE"!=(null==c?void 0:c.action)&&"REJECT"!=(null==c?void 0:c.action)&&"SKIP_PAYMENT"!=c.action&&"SEND_BACK_TO_CITIZEN"!=(null==c?void 0:c.action)&&"APPROVE"!=(null==c?void 0:c.action)||(C=!0),{label:{heading:`WF_${null==c?void 0:c.action}_APPLICATION`,submit:`WF_${h}_${null==c?void 0:c.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(t=c.state)||void 0===t?void 0:t.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)?null:s(S||"WF_ROLE_"+(null===(i=c.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(a=c.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(r=c.state)||void 0===r?void 0:r.state)?null:l.createElement(o.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:v})},{label:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(d=c.state)||void 0===d?void 0:d.state)?l.createElement(o.Dropdown,{option:y,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:f,selected:E,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:_,onDelete:()=>{A(null)},message:g?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:g,action:A,approvers:x,selectedApprover:F,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:W,selectFile:J,uploadedFile:z,setUploadedFile:Y,businessService:T,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:G,blockReasonFiltered:M}))},[A,x,V,z,G]),A&&L.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Fn,{label:g(L.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:h}),actionCancelLabel:g(L.label.cancel),actionCancelOnSubmit:h,actionSaveLabel:g(L.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},I?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:L.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,T,P,N,I,L,B,O,R,x,w;C={...C,documents:te(),additionalDetails:{...null===(t=C)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(C),pendingapproval:le(),blockingReason:null==H?void 0:H.name},workflow:{action:null==A?void 0:A.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(i=D.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==D||null===(u=D.data)||void 0===u||null===(d=u.processInstances)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.assigner)||void 0===c?void 0:c.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(p=D.data)||void 0===p||null===(v=p.processInstances)||void 0===v||null===(m=v[0])||void 0===m||null===(E=m.state)||void 0===E?void 0:E.applicationStatus)?[null==D||null===(f=D.data)||void 0===f||null===(_=f.processInstances)||void 0===_||null===(T=_[0])||void 0===T||null===(P=T.assigner)||void 0===P?void 0:P.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,varificationDocuments:z?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:z}]:null},action:null==A?void 0:A.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(N=D.data)||void 0===N||null===(I=N.processInstances)||void 0===I||null===(L=I[0])||void 0===L||null===(B=L.state)||void 0===B?void 0:B.applicationStatus)?[null==D||null===(O=D.data)||void 0===O||null===(R=O.processInstances)||void 0===R||null===(x=R[0])||void 0===x||null===(w=x.assigner)||void 0===w?void 0:w.uuid]:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,wfDocuments:z?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:z}]:null};const M=function(e,t,l,n,i,o,a,r,u,d,s,c){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=C)||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===(n=C)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(a=C)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(u=r.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(d=C)||void 0===d||null===(s=d.additionalDetails)||void 0===s||null===(c=s.selfCertificationCharges)||void 0===c?void 0:c.BPA_GAUSHALA_CHARGES_CESS))){var p,v,m;C.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",C.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",C.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",C.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),C.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==y||null===(p=y.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let t={sourceRefId:null==e||null===(v=e[0])||void 0===v||null===(m=v.Noc)||void 0===m?void 0:m.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var l;let n=!0,i=!0;null==t||null===(l=t.Noc)||void 0===l||l.map(e=>{var t,l,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(l=e.applicationStatus)||void 0===l?void 0:l.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,l,a,r,u,d,s,c,p,v,m,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(l=t.applicationStatus)||void 0===l?void 0:l.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===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(h(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}h(),alert(g("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:O,formId:"modal-action"})):l.createElement(o.Loader,null)},jn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),$n=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),zn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($n,null)),Yn=e=>{var n,a;let{t:u,action:s,tenantId:c,closeModal:p,submitAction:v,applicationData:m,businessService:E}=e;const{data:f,isLoading:_}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(n=s.assigneeRoles)||void 0===n||null===(a=n.map)||void 0===a?void 0:a.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[g,A]=(r.useQueryClient(),t.useState({})),[S,h]=t.useState({}),[b,y]=t.useState([]),[C,T]=t.useState({}),[D,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(null),O=!!Digit.Utils.browser.isMobile();function R(e){P(e.target.files[0])}return i.useHistory(),t.useEffect(()=>{var e;y(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),t.useEffect(()=>{!function(){try{B(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)B(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))B(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",D,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(u("CS_FILE_UPLOAD_ERROR"))})},function(){B(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),t.useEffect(()=>{s&&A((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=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:n(p||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||f?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:T,selectFile:R,uploadedFile:N,setUploadedFile:I,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:L}))},[s,b,N,L]),s&&g.form?l.createElement(o.Modal,{headerBarMain:l.createElement(jn,{label:u(g.label.heading)}),headerBarEnd:l.createElement(zn,{onClick:p}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},_?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:g.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=m)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),m={...m,workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:N?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:N}]:null},documents:o},v({Noc:m},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},Gn=e=>l.createElement("h1",{className:"heading-m"},e.label),Kn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Vn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Kn,null)),qn=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}},Xn=e=>{var n,i;let{t:a,action:r,tenantId:s,closeModal:c,submitAction:p,applicationData:v,businessService:m}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState({}),[T,D]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),B=window.Digit.Utils.browser.isMobile(),O=window.location.href.includes("/employee");function R(e){D(e.target.files[0])}return t.useEffect(()=>{var e;b(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]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",T,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[T]),t.useEffect(()=>{var e,t,n,i;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(t=e.processInstance)||void 0===t?void 0:t.businessService)||"DisconnectSWConnection"==(null===(n=v)||void 0===n||null===(i=n.processInstance)||void 0===i?void 0:i.businessService)?r&&g((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:s,uploadedFile:c,setUploadedFile:p,businessService:v,error:m}=e,E=!0,f=!1;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.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?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r}):null},f&&{label:n("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,t)=>l.createElement(o.DatePicker,u({onChange:e.onChange,date:e.value},t))}:null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:m,error:I})):r&&g((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:v}=e,m=!0;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:m,error:I}))},[r,h,P,I]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Gn,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Vn,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:B&&O?{width:"100%",height:"auto"}:{}},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,u,d,c,m;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var E,f,_,g,A,S,h,b,C;const t={...null===(E=v)||void 0===E||null===(f=E.billAmendmentDetails)||void 0===f?void 0:f.additionalDetails,comments:null!=e&&e.comments?e.comments:null},l={...null===(_=v)||void 0===_?void 0:_.billAmendmentDetails,workflow:{businessId:null===(g=v)||void 0===g||null===(A=g.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:s,businessService:null!==(S=v)&&void 0!==S&&null!==(h=S.applicationType)&&void 0!==h&&h.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=v)&&void 0!==b&&null!==(C=b.applicationType)&&void 0!==C&&C.includes("WATER")?"WS":"SW",assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]}};p({AmendmentUpdate:l})}else{if(v={...v,action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:[],assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:null,processInstance:{...null===(l=v)||void 0===l?void 0:l.processInstance,action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]}},null!=e&&e.date&&null!==(n=v)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=ct(null==e?void 0:e.date);v.disconnectionExecutionDate=qn(t)}else if(null!=e&&e.date){const t=ct(null==e?void 0:e.date);v.connectionExecutionDate=qn(t)}var D;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(u=v)||void 0===u||null===(d=u.processInstance)||void 0===d?void 0:d.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(D=v)||void 0===D?void 0:D.serviceType)?p({WaterConnection:v,disconnectRequest:!0}):p({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(c=v)||void 0===c?void 0:c.applicationType))p({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=v)||void 0===m?void 0:m.applicationType))p({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var N,I,L,B,O,R,x,w,M,k,F,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(N=t.value)&&void 0!==N&&N.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocPenaltyComment)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebateComment)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(H=v)||void 0===H?void 0:H.serviceType)?p({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):p({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},Jn=e=>l.createElement("h1",{className:"heading-m"},e.label),Zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Qn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zn,null)),ei=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;console.log("applicationData",p);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState(null),[C,T]=t.useState(null),[D,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){T(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.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=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),t.useEffect(()=>{r&&_((e=>{let{t:t,action:l,businessService:n}=e;return{label:{heading:`WF_${null==l?void 0:l.action}_APPLICATION`,submit:`WF_${n}_${null==l?void 0:l.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:O,uploadedFile:D,setUploadedFile:P,businessService:v}))},[r,S,D]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Jn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Qn,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==r?void 0:r.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};p.creationReason="CREATE",c({PetRegistrationApplications:[{...p,workflow:t}]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),c({PetRegistrationApplications:[{...p,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},ti=e=>l.createElement("h1",{className:"heading-m"},e.label),li=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ni=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(li,null)),ii=e=>{var n,i,a;let{t:r,action:u,closeModal:d,submitAction:s,applicationData:c,businessService:p}=e;const v=Digit.ULBService.getStateId(),{data:m,isLoading:E}=Digit.Hooks.tl.useTradeLicenseMDMS(v,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==m||null===(n=m.TradeLicense)||void 0===n?void 0:n.TradeType),console.log("applicationData",c);const[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState(""),[C,T]=t.useState([]),[D,P]=t.useState(null),N=null===(i=c)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",N);const I=t.useMemo(()=>{var e;if(E||!m||!N.length)return[];const t=new Set(N.map(e=>e.tradeType)),l=(null===(e=m.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",l),l?["1"]:["1","2","3"]},[E,m,N]);return console.log("years",I),t.useEffect(()=>{u&&_((e=>{let{t:t,action:n,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${null==u?void 0:u.toUpperCase()}_${null==n?void 0:n.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:t("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:u,years:I,selectedApprover:b,setSelectedApprover:y,businessService:p}))},[u,I,C,D]),u&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(ti,{label:r(f.label.heading)}),headerBarEnd:l.createElement(ni,{onClick:d}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=null===(t=c)||void 0===t?void 0:t.financialYear;const n=null==l?void 0:l.split("-")[1],i=`20${Number(n)}-${Number(n)+1}`;c={...c,financialYear:i,action:"INITIATE",additionalDetail:{...c.additionalDetail,validityYears:b.length>0?parseInt(b):""}},s({Licenses:[c]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},oi=e=>l.createElement("h1",{className:"heading-m"},e.label),ai=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ri=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ai,null)),ui=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState(null),[C,T]=t.useState(null),[D,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){B(!0),T(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.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=function(e,t){try{var l=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,u)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}(0,function(e,t){if(B(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),console.log("actyhdesh,jhfsefsef",r,p),t.useEffect(()=>{_((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:"SV_"+(null==n?void 0:n.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==n?void 0:n.action)||"REJECT"===(null==n?void 0:n.action)||"SENDBACKTOCITIZEN"===(null==n?void 0:n.action)?"":{label:t("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:u,t:t,optionKey:"name",select:s,selected:d})},{label:t("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:`${t("SV_ATTATCH_FILE")}${n.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):a?"1 "+t("SV_FILE_UPLOADED"):t("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:O,uploadedFile:D,setUploadedFile:P,businessService:v,isUploading:L}))},[r,S,D]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(oi,{label:a(f.label.heading)}),headerBarEnd:l.createElement(ri,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.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:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null};D&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),c({streetVendingDetail:{...p,workflow:l}})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},di=e=>l.createElement("h1",{className:"heading-m"},e.label),si=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ci=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(si,null)),pi=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:s,submitAction:c,applicationData:p,businessService:v,moduleCode:m}=e;console.log("applicationData",p);const{data:E}=Digit.Hooks.useEmployeeSearch(u,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[f,_]=t.useState({}),[g,A]=t.useState({}),[S,h]=t.useState([]),[b,y]=t.useState(null),[C,T]=t.useState(null),[D,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){T(e.target.files[0])}return t.useEffect(()=>{var e;h(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]),t.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=d(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?P(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),t.useEffect(()=>{r&&_((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${u}_${null==n?void 0:n.action}`,cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:t("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${t("ES_CHB_ATTACH_FILE")}${n.docUploadRequired?" *":""}`,populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{r(null)},showHint:!0,hintText:t("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_CHB_ACTION_FILEUPLOADED"):t("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:O,uploadedFile:D,setUploadedFile:P,businessService:v}))},[r,S,D]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(di,{label:a(f.label.heading)}),headerBarEnd:l.createElement(ci,{onClick:s}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};D&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),c({hallsBookingApplication:[{...p,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},vi=e=>l.createElement("h1",{className:"heading-m"},e.label),mi=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ei=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mi,null)),fi=e=>{var n,a,r;let{t:u,action:d,tenantId:s,closeModal:c,submitAction:p,applicationData:v,businessService:m,moduleCode:E}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(n=d.roles)||void 0===n||null===(a=n[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)}),_=i.useHistory(),[g,A]=t.useState({}),[S,h]=t.useState({}),[b,y]=t.useState([]),[C,T]=t.useState(null),[D,P]=t.useState(null);return t.useEffect(()=>{var e;y(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),t.useEffect(()=>{"INITIATED"===(null==d?void 0:d.state)?_.push("/digit-ui/employee/asset/assetservice/edit/"+(null==v?void 0:v.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:T,uploadedFile:D,setUploadedFile:P,businessService:m}))},[d,b,D]),d&&g.form?l.createElement(o.Modal,{headerBarMain:l.createElement(vi,{label:u(g.label.heading)}),headerBarEnd:l.createElement(Ei,{onClick:c}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==d?void 0:d.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:E};D&&(t.documents=[]),p({Asset:{...v,workflow:t}})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},_i=e=>null!=e&&e.businessService.includes("PT")?l.createElement(In,e):null!=e&&e.businessService.includes("ptr")?l.createElement(ei,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Rn,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(ii,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(kn,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Wn,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Yn,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Xn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(ui,e):null!=e&&e.businessService.includes("chb")?l.createElement(pi,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(fi,e):void 0,gi=e=>{var n,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(n=d.data)||void 0===n?void 0:n.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=t.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,f]=t.useState(null),[_,g]=t.useState([]),[A,S]=t.useState(!0),[h,b]=t.useState(!1),[y,C]=t.useState(!1),{isLoading:T,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:P,data:N}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==N||null===(t=N["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===`${null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0]}.${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),g(d)},[!T,!P]),t.useEffect(()=>{let e=0;_.map(t=>{let l=!1;v.map(e=>{t.required&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,h]),t.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==_?void 0:_.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Ai,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:_,checkEnablingDocs:y}))))};function Ai(e){var n,i;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:p}=e;const v=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],m=Digit.ULBService.getStateId(),[E,f]=t.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[_,g]=t.useState(null),[A,S]=t.useState(()=>(null==v?void 0:v.fileStoreId)||null),[h,b]=t.useState([]);return t.useEffect(()=>{null!=E&&E.code&&u(e=>{var t;const l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==A?void 0:A.length)||null===A?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==A),{documentType:null==E?void 0:E.code,fileStoreId:A,documentUid:A,fileName:(null==_?void 0:_.name)||"",id:d?null===(t=d.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[A,E]),t.useEffect(()=>{try{h.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],h.map(e=>{var t,l,n;null!=E&&E.code&&r.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.tenantId})}),c[s]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)))}catch(e){Promise.reject(e)}},[h,E]),t.useEffect(()=>{},[_]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(o.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)&&l.createElement(Wl,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(o.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>f(e),style:{width:"100%"}})),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&b(n),(i=n[n.length-1])&&g(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Si(e){let{t:n,document:i,setNocDocuments:a,setError:r,nocDocuments:u}=e;const s=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],c=Digit.ULBService.getStateId(),[p,v]=t.useState(),[m,E]=t.useState(null),[f,_]=t.useState(()=>(null==s?void 0:s.fileStoreId)||null);return t.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==f?void 0:f.length)||null===f?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),t.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(n("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(n("NOT_SUPPORTED_FILE_TYPE"));else{const e=d(function(){return _(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,l,i,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?_(null==e||null===(i=e.data)||void 0===i||null===(o=i.files[0])||void 0===o?void 0:o.fileStoreId):r(n("CS_FILE_UPLOAD_ERROR"))})},function(){r(n("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)}}()},[m]),l.createElement("div",{style:{}},l.createElement(o.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(o.CardLabel,{style:{width:"100%"}},null!=i&&i.required?n("TL_BUTTON_UPLOAD FILE")+"*":""+n("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&E(n.file)})(e),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const hi=e=>{var n;let{t:i,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",m=(null==c||null===(n=c.data)||void 0===n?void 0:n.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[g,A]=t.useState([]),[S,h]=t.useState([]),[b,y]=t.useState(!1),[C,T]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,P]=t.useState(null),N=window.location.href.includes("/employee/");return t.useEffect(()=>{var e;A(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),t.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=u?null==E||null===(o=E.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==d||null===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(n[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),p.push(e)}),h(p))},[E,g]),t.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:N?""+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,t)=>{if(null!=e&&e.value)return l.createElement(o.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:N?""+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:N?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Wl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(Si,{key:t,document:e,t:i,error:D,setError:P,setNocDocuments:T,nocDocuments:C,checkEnablingDocs:b}))))},bi=e=>{let{permissions:n,t:i}=e;const[a,r,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==n?void 0:n.map(e=>({label:e,checked:!1}))),[d,s,c]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);t.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,t)=>l.createElement(o.CheckBox,{key:t,styles:{margin:"20px 0 40px",maxWidth:p?"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?{...e,checked:n}:e))})(e,0,t),isLabelFirst:!0,index:t})),null==d?void 0:d.map((e,t)=>l.createElement("div",null,l.createElement(o.TextInput,{key:t,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==d?void 0:d.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,t),textInputStyle:{maxWidth:p?"96%":"830px",width:p?"96%":"830px"},style:p?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(o.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...d];t.splice(e,1),s([...t])})(t)}))),l.createElement(o.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function yi(e){let{taxHeadEstimatesCalculation:t}=e;const{taxHeadEstimates:i}=t,{t:a}=n.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,t)=>l.createElement(o.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:t===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(o.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==t?void 0:t.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ci(e){let{floors:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map(e=>{var t;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==t?"16px":"revert"}},i(e.title)),l.createElement(o.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Ti(e){let{owners:t}=e,i={};i=window.location.href.includes("/employee/pt/")?t.slice().reverse():t;const{t:a}=n.useTranslation(),r=(null==t?void 0:t.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",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},d={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),t.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)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,t)=>{var n;return l.createElement("div",{key:a(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(o.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)} ${t+1}`:a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:d},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return!0===e.map&&"N/A"!==e.value?l.createElement(o.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(o.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Di=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Pi=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,p]=t.useState(!1),{t:v}=n.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(o.TelePhone,{mobile:u.mobileNumber,privacy:s}),l.createElement("p",null,"    ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Di,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},v("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!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?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Ni(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${i(null==e?void 0:e.title)} ${t+1}`),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Ii(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${i(null==e?void 0:e.title)} ${t+1}`),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Li=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=n.useTranslation();let p=(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 m=null==p?void 0:p.mode;var{connectionDetails:E,plumberDetails:f,roadCuttingDetails:_,roadCuttingAddlDetails:g,activationDetails:A}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(i=s.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==E?void 0:E.map((e,t)=>l.createElement("div",null,l.createElement(o.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"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,t)=>l.createElement(o.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"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==_?void 0:_.map(e=>{var t;return l.createElement("div",{style:(null==_?void 0:_.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(t=e.values)||void 0===t?void 0:t.map(e=>l.createElement(o.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)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,t)=>l.createElement("div",null,l.createElement(o.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)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==A?void 0:A.map((e,t)=>l.createElement(o.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:""})))))))},Bi=[{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"}],Oi=[{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"}],Ri=e=>{var i,a,r,d;let{wsAdditionalDetails:s}=e;const{t:c}=n.useTranslation(),[p,v,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),A=!(null==s||null===(i=s.additionalDetails)||void 0===i||!i.isPaid),[S,h]=t.useState(!1),[b,y]=t.useState(p||{}),[C,T]=t.useState(null),[D,P]=t.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[N,I]=t.useState(s.additionalDetails.values?s.additionalDetails.values:[]),L=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(L,"BillingService",["TaxHeadMaster"]),t.useEffect(()=>{var e,t,n;const i={...null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,d,c,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(r=p.billDetails)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(c=d[0])||void 0===c?void 0:c.taxAmount)}];I(e),P(null==p||null===(m=p.billDetails)||void 0===m?void 0:m[0])}else v(i),y(i)},[]);let B={};const O=e=>l.createElement("h1",{className:"heading-m"},e.label),R=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(R,null)),w=function(e,t,l){void 0===t&&(t=!1);let n={...b};if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}y(n)};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},N&&l.createElement(o.StatusTable,null,l.createElement("div",null,null==N?void 0:N.map((e,t)=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(o.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(o.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(A?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:A?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{h(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(o.Modal,{headerBarMain:l.createElement(O,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{y(p),h(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{y(p),h(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,l=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var n,i;if(t||l)if(l>(null==s||null===(n=s.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))T({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,d,p,m,E,g,A;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l={...null==s||null===(d=s.additionalDetails)||void 0===d||null===(p=d.appDetails)||void 0===p?void 0:p.additionalDetails,...b};s.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==s||null===(m=s.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(g=s.additionalDetails)||void 0===g||null===(A=g.appDetails)||void 0===A?void 0:A.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,p,m,E,g,A;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(g=E[0])||void 0===g||null===(A=g.taxHeadEstimates)||void 0===A||A.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{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===(p=c[0])||void 0===p?void 0:p.taxAmount}];f(ct(e.Calculation[0])),P(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),I(S),b.billDetails=null==e?void 0:e.Calculation,v(b),h(!1)}).catch(e=>{var t,l,n,i,o,a;T({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?c(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else T({isError:!1,isWarning:!0,key:"warning",message:c("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_PENALTY")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:Bi,optionKey:"title",select:e=>w("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==b||null===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(o.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>w("adhocPenaltyComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>w("adhocPenalty",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_REBATE")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:Oi,optionKey:"title",select:e=>w("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==b||null===(d=b.adhocRebateReason_data)||void 0===d?void 0:d.title)&&l.createElement("div",{className:"field"},l.createElement(o.CardLabel,null,c("PT_REASON")),l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>w("adhocRebateComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>w("adhocRebate",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(o.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:c(null==C?void 0:C.message),onClose:()=>{T(!1)},isDleteBtn:!0})))},xi=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},wi=e=>{let{t:t,userType:n=!1,infoBannerLabel:i="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;n=n||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(o.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},t(i))),t(a)+" ",l.createElement(xi,{style:{display:"inline",marginBottom:"5px"}})," "+t(r),l.createElement("div",null," "+t(u)))))},Mi=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:p}=e;const{t:v}=n.useTranslation(),[m,E]=t.useState(!1),[f,_]=t.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),A=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(A,null));return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=p&&null!==(i=p.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=p.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),_(t),E(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(o.Modal,{headerBarMain:l.createElement(g,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(o.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(o.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=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(o.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=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==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=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ki={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},Fi=e=>{let{className:t="table",headers:i=[],values:o=[],arrears:a=0}=e;const{t:r}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:ki.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:ki.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...ki.cell,...ki.cellLeft,...ki.cellHeader}},r("CS_BILL_PERIOD")),i.map((e,t)=>l.createElement("th",{style:{...ki.cell,...i.length==t+1?ki.cellRight:{},...ki.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...ki.cell,...ki.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),i.map((t,n)=>l.createElement("td",{style:{...ki.cell,textAlign:"left",...i.length==n+1?ki.cellRight:{},whiteSpace:"pre"},key:n,numeric:!0},n>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...ki.cell,...ki.cellLeft}}),i.map((e,t)=>t==i.length-1?l.createElement("td",{style:{...ki.cell,...ki.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==i.length-2?l.createElement("td",{style:{...ki.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:ki.cell,key:t,numeric:!0})))))))},Ui={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},Hi=e=>{var i,o,a;let{bill:r={}}=e;const{t:u}=n.useTranslation();let d={},s=(null==r||null===(i=r.billDetails)||void 0===i?void 0:i.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,l)=>e+t.amount,0))||0;let p="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.map(e=>{let t=function(e){var t,l,n;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?`FY${l.getYear()+1900}-${n.getYear()-100}`:`${l.toLocaleDateString()}-${n.toLocaleDateString()}`})(e.fromPeriod,e.toPeriod)]=t});let v={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{v[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[t]);const[E,f]=t.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Ui.headerStyle},u("CS_ARREARS_DETAILS")),E&&l.createElement(Fi,{headers:[...m],values:d,arrears:p}),!E&&l.createElement("div",{style:Ui.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!0)}},u("CS_SHOW_CARD"))),E&&l.createElement("div",{style:Ui.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!1)}},u("CS_HIDE_CARD"))))},Wi=e=>{let{demandData:t,totalDemandTax:n,totalDemandPenality:i,totalCollectionTax:a,totalCollectionInterest:r,totalCollectionPenality:u,totalBalanceTax:d}=e;const s={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}};return l.createElement("div",null,l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:s.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:s.th},"Installments"),l.createElement("th",{colSpan:"3",style:s.th},"Demand"),l.createElement("th",{colSpan:"3",style:s.th},"Collection"),l.createElement("th",{colSpan:"3",style:s.th},"Balance"),l.createElement("th",{style:s.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:s.th}),l.createElement("th",{style:s.th},"Tax"),l.createElement("th",{style:s.th},"Interest"),l.createElement("th",{style:s.th},"Penalty"),l.createElement("th",{style:s.th},"Tax"),l.createElement("th",{style:s.th},"Interest"),l.createElement("th",{style:s.th},"Penalty"),l.createElement("th",{style:s.th},"Tax"),l.createElement("th",{style:s.th},"Interest"),l.createElement("th",{style:s.th},"Penalty"),l.createElement("th",{style:s.th},"Advance"))),l.createElement("tbody",null,null==t?void 0:t.map(e=>l.createElement("tr",null,l.createElement("td",{style:s.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:s.td},e.demandTax),l.createElement("td",{style:s.td},e.demandInterest),l.createElement("td",{style:s.td},e.demandPenality),l.createElement("td",{style:s.td},e.collectionTax),l.createElement("td",{style:s.td},e.collectionInterest),l.createElement("td",{style:s.td},e.collectionPenality),l.createElement("td",{style:s.td},e.balanceTax),l.createElement("td",{style:s.td},e.balanceInterest),l.createElement("td",{style:s.td},e.balancePenality),l.createElement("td",{style:s.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:s.th},"Total"),l.createElement("td",{style:s.td},n),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td},i),l.createElement("td",{style:s.td},a),l.createElement("td",{style:s.td},r),l.createElement("td",{style:s.td},u),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td})),l.createElement("tr",null,l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("th",{style:s.th},"Total"),l.createElement("td",{style:s.td},d),l.createElement("td",{style:s.td},"0"),l.createElement("td",{style:s.td},"0"),l.createElement("td",{style:s.td},"0")),l.createElement("tr",null,l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("th",{style:s.th},"Total Balance"),l.createElement("td",{style:s.td})))))};function ji(e){var a,r,u,d,s,c,p,v,m,E,f,g,A,S;let{applicationDetails:h,demandData:b,workflowDetails:y,isDataLoading:C,applicationData:T,totalDemandTax:D,businessService:P,timelineStatusPrefix:N,showTimeLine:I=!0,statusAttribute:L="status",paymentsList:B,oldValue:O,isInfoLabel:R=!1}=e;const{t:x}=n.useTranslation();let w=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function M(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}console.log("appl",h);const[k,F]=t.useState({}),[U,H]=t.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==T?void 0:T.status)||U.loading||U.loaded||U.canLoad||H({loading:!1,loaded:!1,canLoad:!0}),null==U||!U.canLoad||U.loading||U.loaded||(H({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==T?void 0:T.tenantId)||tenantId,null==T?void 0:T.propertyId,F,H));const W=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()}`},j=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:W(null==T||null===(i=T.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==T?void 0:T.channel)||""};return l.createElement(Pi,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,p,v,m,E,f,g,A,S,b,y,C;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==h?void 0:h.tenantId,businessIds:null==h?void 0:h.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,`ProcessInstances[${t}].assignes[0].mobileNumber`),l}}},D=n[t-1],P={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==T||null===(s=T.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid)&&null!=T&&null!==(E=T.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==T||null===(A=T.processInstance)||void 0===A||null===(S=A.assignes)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(C=y[0])||void 0===C?void 0:C.mobileNumber,comment:x(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Pi,{data:P,OpenImage:M,privacy:i})}{var D,P,N,I,L;const t={date:W(null==T||null===(D=T.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(P=e.assignes)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(I=e.assignes)||void 0===I||null===(L=I[0])||void 0===L?void 0:L.mobileNumber};return l.createElement(Pi,{data:t})}},$=(e,t)=>e?t?e:x(e):x("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),Y=window.location.href.includes("employee/noc"),G=window.location.href.includes("employee/obps"),K=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),V=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${$(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${x(null==e?void 0:e.isUnit)}`:x("N/A"):null!=e&&e.value?$(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):x("N/A"),[q,X]=t.useState(!1);console.log("demand Data arr",b);const J=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),Z=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),le=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceInterest,0),ie=null==b?void 0:b.reduce((e,t)=>e+t.balancePenality,0);return l.createElement(o.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(wi,{t:x,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==h||null===(a=h.applicationDetails)||void 0===a?void 0:a.map((e,n)=>{var a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,b,C,T,D,P,N,I,L,R,M,F,U,H,W,j,$,q,X,J,Z,Q,ee,te,le,ne;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:z?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(o.CardSectionHeader,{style:0==n&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},Y?""+x(e.title):x(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},x(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},x(e)))),null==e?void 0:e.tableRows.map((n,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(t.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{textAlign:"left"}},x(e))))):l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},x(e)))))),l.createElement(o.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(a=e.values)||void 0===a?void 0:a.map((t,n)=>{var a,r,u;return!0===t.map&&"N/A"!==t.value?l.createElement(o.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:x(t.title),label:x(t.title),text:l.createElement("img",{src:x(t.value),alt:"",privacy:null==t?void 0:t.privacy})}):1==(null==t?void 0:t.isLink)?l.createElement(o.Row,{key:x(t.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},x(null==t?void 0:t.title)))):Y||G?""+x(t.title):x(t.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==t?void 0:t.value))),last:n===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:t.caption,className:"border-none",rowContainerStyle:K(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(o.Row,{className:"border-none",key:""+t.title,label:""+x(""+t.title),privacy:null==t?void 0:t.privacy,text:null!=t&&t.oldValue?null==t?void 0:t.oldValue:null!=t&&t.value?null==t?void 0:t.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(o.Row,{key:x(t.title),label:x(t.title),text:V(t),last:n===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:t.caption,className:"border-none",privacy:null==t?void 0:t.privacy,rowContainerStyle:K(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===t.title?l.createElement(Hi,{bill:null===(r=k.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(sn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:B,additionalDetails:null==h||null===(u=h.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==h?void 0:h.applicationData}),(null==h||null===(d=h.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===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(dn,{fiReport:null==h||null===(v=h.applicationData)||void 0===v||null===(m=v.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors)&&l.createElement(Ci,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners)&&l.createElement(Ti,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units)&&l.createElement(Ii,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(Ni,{units:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.accessories}),!w&&(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.permissions)&&(null==y||null===(D=y.data)||void 0===D||null===(P=D.nextActions)||void 0===P?void 0:P.length)>0&&l.createElement(bi,{applicationData:null==h?void 0:h.applicationData,t:x,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(gi,{t:x,applicationData:null==h?void 0:h.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:y})),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.noc)&&l.createElement(hi,{t:x,isNoc:!0,NOCdata:e.values,applicationData:null==h?void 0:h.applicationData,docs:e.additionalDetails.noc,noc:null===(R=e.additionalDetails)||void 0===R?void 0:R.data,bpaActionsDetails:y}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.scruntinyDetails)&&l.createElement(sn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(sn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(un,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==h?void 0:h.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&l.createElement(Wl,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents)&&l.createElement($l,{documents:null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.documents}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation)&&l.createElement(yi,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Li,{wsAdditionalDetails:e,oldValue:O}),(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===(Z=e.additionalDetails)||void 0===Z||null===(Q=Z.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(Ri,{wsAdditionalDetails:e,workflowDetails:y}),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Mi,{wsAdditionalDetails:e,workflowDetails:y}))}),I&&(null==y||null===(r=y.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(o.BreakLine,null),((null==y?void 0:y.isLoading)||C)&&l.createElement(o.Loader,null),!(null!=y&&y.isLoading)&&!C&&l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},x("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=y&&null!==(d=y.data)&&void 0!==d&&d.timeline&&1===(null==y||null===(s=y.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:x(`${N}${null==y||null===(p=y.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state}`),customChild:j(null==y||null===(m=y.data)||void 0===m?void 0:m.timeline[0],null==y||null===(E=y.data)||void 0===E?void 0:E.timeline)}):l.createElement(o.ConnectingCheckPoints,null,(null==y||null===(f=y.data)||void 0===f?void 0:f.timeline)&&(null==y||null===(g=y.data)||void 0===g?void 0:g.timeline.slice(0,q?null==y?void 0:y.data.timeline.length:2).map((e,t,n)=>{var i;let a="";var r,u,d,s,c,p;return window.location.href.includes("/obps/")&&(a=null!=y&&null!==(r=y.data)&&void 0!==r&&null!==(u=r.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=y&&null!==(s=y.data)&&void 0!==s&&null!==(c=s.timeline[t-1])&&void 0!==c&&null!==(p=c.state)&&void 0!==p&&p.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,info:e.comment,label:x(`${N}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[L]}${a}`),customChild:j(e,t,null==y||null===(i=y.data)||void 0===i?void 0:i.timeline)}))}))),(null==y||null===(A=y.data)||void 0===A||null===(S=A.timeline)||void 0===S?void 0:S.length)>2&&l.createElement(o.LinkButton,{label:x(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{X(e=>!e)}})))),"PT"===P&&l.createElement(Wi,{demandData:b,totalDemandTax:D,totalDemandInterest:J,totalDemandPenality:Z,totalCollectionTax:Q,totalCollectionInterest:ee,totalCollectionPenality:te,totalBalanceTax:le,totalBalancePenality:ie,totalBalanceInterest:ne}))}function $i(e){var t,n,i,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S;let{t:h,showToast:b,closeToast:y,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var T;let e="";switch(null==b||null===(T=b.action)||void 0===T?void 0:T.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(t=b.error)||void 0===t?void 0:t.message:h("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:h("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:h("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:h("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:h("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:h("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:h("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:h(`ES_${C}_${null==b||null===(c=b.action)||void 0===c?void 0:c.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(o.Toast,{error:"error"===b.key,label:e,onClose:y}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?h(e[1]):h(e[0]),l};let t="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":t="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":t="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":t="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":t="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":t="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:t="error"===(null==b?void 0:b.key)?null==b||null===(A=b.error)||void 0===A?void 0:A.message:h(`ES_${C}_${null==b||null===(S=b.action)||void 0===S?void 0:S.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(o.Toast,{error:"error"===b.key,label:t,onClose:y}))}{var P,N;const e="error"===(null==b?void 0:b.key)?null==b||null===(P=b.error)||void 0===P?void 0:P.message:`ES_${C}_${null==b||null===(N=b.action)||void 0===N?void 0:N.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(o.Toast,{error:"error"===b.key,label:h(e),onClose:y}))}}function zi(e){var i,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S;let{workflowDetails:h,displayMenu:b,onActionSelect:y,setDisplayMenu:C,businessService:T,forcedActionPrefix:D,ActionBarStyle:P={},MenuStyle:N={}}=e;const{t:I}=n.useTranslation();let L=Digit.UserService.getUser();const B=t.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};L=null==t?void 0:t.value}const O=null===(i=L)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let R=!1,x=!1,w=(null==h||null===(u=h.data)||void 0===u||null===(d=u.actionState)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.filter(e=>(null==O?void 0:O.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles))||(null==h||null===(c=h.data)||void 0===c||null===(p=c.nextActions)||void 0===p?void 0:p.filter(e=>(null==O?void 0:O.some(t=>{var l;return null===(l=e.roles)||void 0===l?void 0:l.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(B,()=>{C(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==w?void 0:w.length)||null!=w&&null!==(v=w[0])&&void 0!==v&&null!==(m=v.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==w?void 0:w.length)?(x=!1,R=!0):(null==w?void 0:w.length)>0&&(x=!0,R=!1),l.createElement(l.Fragment,null,!(null!=h&&h.isLoading)&&x&&!R&&l.createElement(o.ActionBar,{style:{...P}},b&&(null!=h&&null!==(E=h.data)&&void 0!==E&&null!==(f=E.actionState)&&void 0!==f&&f.nextActions||null!=h&&null!==(_=h.data)&&void 0!==_&&_.nextActions)?l.createElement(o.Menu,{localeKeyPrefix:D||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase()),options:w,optionKey:"action",t:I,onSelect:y,style:N}):null,l.createElement(o.SubmitBar,{ref:B,label:I("WF_TAKE_ACTION"),onSubmit:()=>C(!b)})),!(null!=h&&h.isLoading)&&!x&&R&&l.createElement(o.ActionBar,{style:{...P}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==w||null===(g=w[0])||void 0===g?void 0:g.action,value:null==w||null===(A=w[0])||void 0===A?void 0:A.action,onClick:e=>{y((null==w?void 0:w[0])||{})}},I(`${D||"WF_EMPLOYEE_"+(null==T?void 0:T.toUpperCase())}_${null==w||null===(S=w[0])||void 0===S?void 0:S.action}`))))}const Yi=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yi,null));function Ki(e){let{action:t,closeWarningPopup:i}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(o.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Gi,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(o.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==t?void 0:t.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(o.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==t?void 0:t.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(o.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(o.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(`${window.location.origin}${null==t||null===(e=t.redirectionUrl)||void 0===e?void 0:e.pathname}`)},style:{marginLeft:"10px"}})))),")")}const Vi=e=>{var a,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),{data:v}=Digit.Hooks.obps.useMDMS(p,"BPA",["BlockReason"]),{t:m}=n.useTranslation(),E=i.useHistory();let{id:f}=i.useParams();const[_,g]=t.useState(!1),[A,S]=t.useState(null),[h,b]=t.useState(!1),[y,C]=t.useState(!1),[T,D]=t.useState(!1),{data:P}=Digit.Hooks.obps.useMDMS(p,"BPA",["RiskTypeComputation"]),{applicationDetails:N,demandData:I,totalDemandTax:L,totalBalanceTax:B,showToast:O,setShowToast:R,isLoading:x,isDataLoading:w,applicationData:M,mutate:k,nocMutation:F,workflowDetails:U,id:H,businessService:W,closeToast:j,moduleCode:$,timelineStatusPrefix:z,forcedActionPrefix:Y,statusAttribute:G,ActionBarStyle:K,MenuStyle:V,paymentsList:q,showTimeLine:X=!0,oldValue:J,isInfoLabel:Z=!1,clearDataDetails:Q}=e;t.useEffect(()=>{O&&U.revalidate()},[O]);const ee=r.useQueryClient(),te=()=>{S(null),b(!1)};return x||y?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,x?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(ji,{applicationDetails:N,demandData:I,id:H,workflowDetails:U,isDataLoading:w,applicationData:M,totalDemandTax:L,totalBalanceTax:B,businessService:W,timelineStatusPrefix:z,statusAttribute:G,paymentsList:q,showTimeLine:X,oldValue:J,isInfoLabel:Z}),h?l.createElement(_i,{t:m,action:A,tenantId:c,state:p,id:f,applicationDetails:N,applicationData:null==N?void 0:N.applicationData,closeModal:te,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,u,s,c,p,v,f,_,g,S,h,b,y,T,D){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(p=c.additionalDetail)||void 0===p||null===(v=p.validityYears)||void 0===v?void 0:v.length):0==(null==e||null===(f=e.Licenses)||void 0===f||null===(_=f[0])||void 0===_||null===(g=_.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(h=S.comment)||void 0===h?void 0:h.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(y=b.comment)||void 0===y?void 0:y.length)||0==(null==e||null===(T=e.BPA)||void 0===T||null===(D=T.comment)||void 0===D?void 0:D.length)){var P,N;"INITIATE"===(null==e||null===(P=e.Licenses)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.action)?alert(m("Please fill in the validity before submitting")):alert(m("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(u=r.workflow)||void 0===u?void 0:u.action)){function s(t){if(n)return t;k&&(C(!0),k(e,{onError:(e,t)=>{C(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=A,E.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=A,E.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&E.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,p,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:m("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(p=c.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?R({key:"success",label:m("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:m("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(_=t.AmendmentUpdate)&&void 0!==_&&null!==(g=_.workflow)&&void 0!==g&&g.action.includes("REJECT")&&R({key:"success",label:m("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var 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 R({key:"success",action:A}),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:A}),Q&&setTimeout(Q,3e3),setTimeout(j,5e3),ee.clear(),ee.refetchQueries("APPLICATION_SEARCH")}}})),te()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&F){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==F?void 0:F.mutateAsync(e)),i=d(function(){return C(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,s,c,p,v;C(!1);let E=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?m(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===(p=c.Errors)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.message)||e;te(),R({key:"error",error:{message:E}}),setTimeout(j,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(m("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(a=U.data)||void 0===a?void 0:a.timeline,businessService:W,workflowDetails:U,moduleCode:$,blockReason:null==v||null===(u=v.BPA)||void 0===u?void 0:u.BlockReason}):null,T?l.createElement(Ki,{action:A,workflowDetails:U,businessService:W,isWarningPop:T,closeWarningPopup:()=>{D(!1)}}):null,l.createElement($i,{t:m,showToast:O,closeToast:j,businessService:W}),s?l.createElement("div",null,l.createElement(o.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,l,n,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==P||null===(t=P.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==N||null===(l=N.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(i=n.plot)||void 0===i?void 0:i.area,null==N||null===(o=N.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const d=function(e,t,l,n,i,o,a,r,d,s,p,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null==u||null===(n=u.BPA)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(s=u.BPA)||void 0===s||null===(p=s.additionalDetails)||void 0===p||null===(v=p.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(zi,{workflowDetails:U,displayMenu:_,onActionSelect:function(e){var t,l,n;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))E.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:`${null===(u=location)||void 0===u?void 0:u.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var d,s;E.push(""+(null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname),{data:null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.state})}else{var c;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.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))console.log("Got Inside Direct"),b(!0);else{var p,v;E.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:{...null===(v=e.redirectionUrl)||void 0===v?void 0:v.state}})}else b(!0);S(e),g(!1)},setDisplayMenu:g,businessService:W,forcedActionPrefix:Y,ActionBarStyle:K,MenuStyle:V})))},qi=[{head:"",body:[{type:"component",component:"InspectionReport",key:"FieldReports",withoutLabel:!0,hideInCitizen:!0}]}];var Xi=function(e){return"symbol"==typeof e||te(e)&&"[object Symbol]"==I(e)},Ji=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zi=/^\w*$/,Qi=function(e,t){if(re(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Xi(e))||Zi.test(e)||!Ji.test(e)||null!=t&&e in Object(t)};function eo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(eo.Cache||K),l}eo.Cache=K;var to,lo,no=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,io=/\\(\\)?/g,oo=(to=eo(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(no,function(e,l,n,i){t.push(n?i.replace(io,"$1"):l||e)}),t},function(e){return 500===lo.size&&lo.clear(),e}),lo=to.cache,to),ao=function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i},ro=b?b.prototype:void 0,uo=ro?ro.toString:void 0,so=function(e,t){return re(e)?e:Qi(e,t)?[e]:oo(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(re(t))return ao(t,e)+"";if(Xi(t))return uo?uo.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))},co=function(e){if("string"==typeof e||Xi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},po=function(e,t){for(var l=0,n=(t=so(t,e)).length;null!=e&&l<n;)e=e[co(t[l++])];return l&&l==n?e:void 0},vo=function(e,t,l){var n=null==e?void 0:po(e,t);return void 0===n?l:n};function mo(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new K;++t<l;)this.add(e[t])}mo.prototype.add=mo.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},mo.prototype.has=function(e){return this.__data__.has(e)};var Eo=mo,fo=function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1},_o=function(e,t){return e.has(t)},go=function(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,p=!0,v=2&l?new Eo:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var f=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==f){if(f)continue;p=!1;break}if(v){if(!fo(t,function(e,t){if(!_o(v,t)&&(m===e||i(m,e,l,n,o)))return v.push(t)})){p=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){p=!1;break}}return o.delete(e),o.delete(t),p},Ao=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l},So=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l},ho=b?b.prototype:void 0,bo=ho?ho.valueOf:void 0,yo=Object.prototype.hasOwnProperty,Co=Object.prototype.hasOwnProperty,To=function e(t,l,n,i,o){return t===l||(null==t||null==l||!te(t)&&!te(l)?t!=t&&l!=l:function(e,t,l,n,i,o){var a=re(e),r=re(t),u=a?"[object Array]":Xe(e),d=r?"[object Array]":Xe(t),c="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),p="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),v=u==d;if(v&&de(e)){if(!de(t))return!1;a=!0,c=!1}if(v&&!c)return o||(o=new q),a||_e(e)?go(e,t,l,n,i,o):function(e,t,l,n,i,o,a){switch(l){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Ze(e),new Ze(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return s(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var r=Ao;case"[object Set]":if(r||(r=So),e.size!=t.size&&!(1&n))return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var d=go(r(e),r(t),n,i,o,a);return a.delete(e),d;case"[object Symbol]":if(bo)return bo.call(e)==bo.call(t)}return!1}(e,t,u,l,n,i,o);if(!(1&l)){var m=c&&Co.call(e,"__wrapped__"),E=p&&Co.call(t,"__wrapped__");if(m||E){var f=m?e.value():e,_=E?t.value():t;return o||(o=new q),i(f,_,l,n,o)}}return!!v&&(o||(o=new q),function(e,t,l,n,i,o){var a=1&l,r=Fe(e),u=r.length;if(u!=Fe(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:yo.call(t,s)))return!1}var c=o.get(e),p=o.get(t);if(c&&p)return c==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var _=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===_?E===f||i(E,f,l,n,o):_)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var g=e.constructor,A=t.constructor;g==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof A&&A instanceof A||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,o))}(t,l,n,i,e,o))},Do=function(e){return e==e&&!L(e)},Po=function(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in Object(l))}},No=function(e,t){return null!=e&&t in Object(e)},Io=function(e){return e},Lo=function(e){return"function"==typeof e?e:null==e?Io:"object"==typeof e?re(e)?(i=e[1],Qi(n=e[0])&&Do(i)?Po(co(n),i):function(e){var t=vo(e,n);return void 0===t&&t===i?function(e,t){return null!=e&&function(e,t,l){for(var n=-1,i=(t=so(t,e)).length,o=!1;++n<i;){var a=co(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&pe(i)&&ce(a,i)&&(re(e)||ae(e))}(e,t,No)}(e,n):To(i,t,3)}):1==(l=function(e){for(var t=De(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,Do(i)]}return t}(t=e)).length&&l[0][2]?Po(l[0][0],l[0][1]):function(e){return e===t||function(e,t,l,n){var i=l.length,o=i;if(null==e)return!o;for(e=Object(e);i--;){var a=l[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var r=(a=l[i])[0],u=e[r],d=a[1];if(a[2]){if(void 0===u&&!(r in e))return!1}else{var s=new q;if(!To(d,u,3,void 0,s))return!1}}return!0}(e,0,l)}:function(e){return Qi(e)?(t=co(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return po(t,e)}}(e);var t}(e);var t,l,n,i},Bo=function(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Xi(e),a=void 0!==t,r=null===t,u=t==t,d=Xi(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0};const Oo=e=>e.substr(0,1).toUpperCase()+e.substr(1);var Ro=function(e,t){return function(){for(var l=new Array(arguments.length),n=0;n<l.length;n++)l[n]=arguments[n];return e.apply(t,l)}},xo=Object.prototype.toString;function wo(e){return"[object Array]"===xo.call(e)}function Mo(e){return void 0===e}function ko(e){return null!==e&&"object"==typeof e}function Fo(e){if("[object Object]"!==xo.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Uo(e){return"[object Function]"===xo.call(e)}function Ho(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),wo(e))for(var l=0,n=e.length;l<n;l++)t.call(null,e[l],l,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var Wo={isArray:wo,isArrayBuffer:function(e){return"[object ArrayBuffer]"===xo.call(e)},isBuffer:function(e){return null!==e&&!Mo(e)&&null!==e.constructor&&!Mo(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:ko,isPlainObject:Fo,isUndefined:Mo,isDate:function(e){return"[object Date]"===xo.call(e)},isFile:function(e){return"[object File]"===xo.call(e)},isBlob:function(e){return"[object Blob]"===xo.call(e)},isFunction:Uo,isStream:function(e){return ko(e)&&Uo(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:Ho,merge:function e(){var t={};function l(l,n){t[n]=Fo(t[n])&&Fo(l)?e(t[n],l):Fo(l)?e({},l):wo(l)?l.slice():l}for(var n=0,i=arguments.length;n<i;n++)Ho(arguments[n],l);return t},extend:function(e,t,l){return Ho(t,function(t,n){e[n]=l&&"function"==typeof t?Ro(t,l):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function jo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var $o=function(e,t,l){if(!t)return e;var n;if(l)n=l(t);else if(Wo.isURLSearchParams(t))n=t.toString();else{var i=[];Wo.forEach(t,function(e,t){null!=e&&(Wo.isArray(e)?t+="[]":e=[e],Wo.forEach(e,function(e){Wo.isDate(e)?e=e.toISOString():Wo.isObject(e)&&(e=JSON.stringify(e)),i.push(jo(t)+"="+jo(e))}))}),n=i.join("&")}if(n){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function zo(){this.handlers=[]}zo.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},zo.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},zo.prototype.forEach=function(e){Wo.forEach(this.handlers,function(t){null!==t&&e(t)})};var Yo=zo,Go=function(e,t,l){return Wo.forEach(l,function(l){e=l(e,t)}),e},Ko=function(e){return!(!e||!e.__CANCEL__)},Vo=function(e,t){Wo.forEach(e,function(l,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=l,delete e[n])})},qo=function(e,t,l,n,i){return function(e,t,l,n,i){return e.config=t,l&&(e.code=l),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,l,n,i)},Xo=Wo.isStandardBrowserEnv()?{write:function(e,t,l,n,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),Wo.isNumber(l)&&a.push("expires="+new Date(l).toGMTString()),Wo.isString(n)&&a.push("path="+n),Wo.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Jo=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],Zo=Wo.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),l=document.createElement("a");function n(e){var n=e;return t&&(l.setAttribute("href",n),n=l.href),l.setAttribute("href",n),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:"/"===l.pathname.charAt(0)?l.pathname:"/"+l.pathname}}return e=n(window.location.href),function(t){var l=Wo.isString(t)?n(t):t;return l.protocol===e.protocol&&l.host===e.host}}():function(){return!0},Qo={"Content-Type":"application/x-www-form-urlencoded"};function ea(e,t){!Wo.isUndefined(e)&&Wo.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var ta,la={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ta=function(e){return new Promise(function(t,l){var n=e.data,i=e.headers;Wo.isFormData(n)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(a+":"+r)}var u,d,s=(d=e.url,(u=e.baseURL)&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(d)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,d):d);if(o.open(e.method.toUpperCase(),$o(s,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var n,i,a,r,u,d="getAllResponseHeaders"in o?(n=o.getAllResponseHeaders(),u={},n?(Wo.forEach(n.split("\n"),function(e){if(r=e.indexOf(":"),i=Wo.trim(e.substr(0,r)).toLowerCase(),a=Wo.trim(e.substr(r+1)),i){if(u[i]&&Jo.indexOf(i)>=0)return;u[i]="set-cookie"===i?(u[i]?u[i]:[]).concat([a]):u[i]?u[i]+", "+a:a}}),u):u):null;!function(e,t,l){var n=l.config.validateStatus;l.status&&n&&!n(l.status)?t(qo("Request failed with status code "+l.status,l.config,null,l.request,l)):e(l)}(t,l,{data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:d,config:e,request:o}),o=null}},o.onabort=function(){o&&(l(qo("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){l(qo("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),l(qo(t,e,"ECONNABORTED",o)),o=null},Wo.isStandardBrowserEnv()){var c=(e.withCredentials||Zo(s))&&e.xsrfCookieName?Xo.read(e.xsrfCookieName):void 0;c&&(i[e.xsrfHeaderName]=c)}if("setRequestHeader"in o&&Wo.forEach(i,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)}),Wo.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){o&&(o.abort(),l(e),o=null)}),n||(n=null),o.send(n)})}),ta),transformRequest:[function(e,t){return Vo(t,"Accept"),Vo(t,"Content-Type"),Wo.isFormData(e)||Wo.isArrayBuffer(e)||Wo.isBuffer(e)||Wo.isStream(e)||Wo.isFile(e)||Wo.isBlob(e)?e:Wo.isArrayBufferView(e)?e.buffer:Wo.isURLSearchParams(e)?(ea(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Wo.isObject(e)?(ea(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Wo.forEach(["delete","get","head"],function(e){la.headers[e]={}}),Wo.forEach(["post","put","patch"],function(e){la.headers[e]=Wo.merge(Qo)});var na=la;function ia(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var oa=function(e){return ia(e),e.headers=e.headers||{},e.data=Go(e.data,e.headers,e.transformRequest),e.headers=Wo.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Wo.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||na.adapter)(e).then(function(t){return ia(e),t.data=Go(t.data,t.headers,e.transformResponse),t},function(t){return Ko(t)||(ia(e),t&&t.response&&(t.response.data=Go(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},aa=function(e,t){t=t||{};var l={},n=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function r(e,t){return Wo.isPlainObject(e)&&Wo.isPlainObject(t)?Wo.merge(e,t):Wo.isPlainObject(t)?Wo.merge({},t):Wo.isArray(t)?t.slice():t}function u(n){Wo.isUndefined(t[n])?Wo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(e[n],t[n])}Wo.forEach(n,function(e){Wo.isUndefined(t[e])||(l[e]=r(void 0,t[e]))}),Wo.forEach(i,u),Wo.forEach(o,function(n){Wo.isUndefined(t[n])?Wo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(void 0,t[n])}),Wo.forEach(a,function(n){n in t?l[n]=r(e[n],t[n]):n in e&&(l[n]=r(void 0,e[n]))});var d=n.concat(i).concat(o).concat(a),s=Object.keys(e).concat(Object.keys(t)).filter(function(e){return-1===d.indexOf(e)});return Wo.forEach(s,u),l};function ra(e){this.defaults=e,this.interceptors={request:new Yo,response:new Yo}}ra.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=aa(this.defaults,e)).method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var t=[oa,void 0],l=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)l=l.then(t.shift(),t.shift());return l},ra.prototype.getUri=function(e){return e=aa(this.defaults,e),$o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Wo.forEach(["delete","get","head","options"],function(e){ra.prototype[e]=function(t,l){return this.request(aa(l||{},{method:e,url:t,data:(l||{}).data}))}}),Wo.forEach(["post","put","patch"],function(e){ra.prototype[e]=function(t,l,n){return this.request(aa(n||{},{method:e,url:t,data:l}))}});var ua=ra;function da(e){this.message=e}da.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},da.prototype.__CANCEL__=!0;var sa=da;function ca(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var l=this;e(function(e){l.reason||(l.reason=new sa(e),t(l.reason))})}ca.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ca.source=function(){var e;return{token:new ca(function(t){e=t}),cancel:e}};var pa=ca;function va(e){var t=new ua(e),l=Ro(ua.prototype.request,t);return Wo.extend(l,ua.prototype,t),Wo.extend(l,t),l}var ma=va(na);ma.Axios=ua,ma.create=function(e){return va(aa(ma.defaults,e))},ma.Cancel=sa,ma.CancelToken=pa,ma.isCancel=Ko,ma.all=function(e){return Promise.all(e)},ma.spread=function(e){return function(t){return e.apply(null,t)}},ma.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var Ea=ma;Ea.default=ma,Ea.interceptors.response.use(e=>e,e=>{var t,l;const n=window.location.pathname.split("/").includes("employee");if(null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.Errors)for(const t of e.response.data.Errors){var i,o,a,r;t.message.includes("InvalidAccessTokenException")?(localStorage.clear(),sessionStorage.clear(),window.location.href=(n?"/digit-ui/employee/user/login":"/digit-ui/citizen/login")+"?from="+encodeURIComponent(window.location.pathname+window.location.search)):null!=t&&null!==(i=t.message)&&void 0!==i&&null!==(o=i.toLowerCase())&&void 0!==o&&o.includes("internal server error")||null!=t&&null!==(a=t.message)&&void 0!==a&&null!==(r=a.toLowerCase())&&void 0!==r&&r.includes("some error occured")?window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=maintenance&from="+encodeURIComponent(window.location.pathname+window.location.search):t.message.includes("ZuulRuntimeException")&&(window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=notfound&from="+encodeURIComponent(window.location.pathname+window.location.search))}throw e}),window.Digit=window.Digit||{},window.Digit={...window.Digit,RequestCache:window.Digit.RequestCache||{}};const fa=e=>{var t,l,n,i,o,a,r,u;const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA",c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");let p=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var v,m,E,f;return e.isSuccess?"BPA_SUBMIT_APP"==p?window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(m=d.workflow)||void 0===m?void 0:m.action}_${vt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(v=d.workflow)||void 0===v?void 0:v.action}_${vt(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(f=d.workflow)||void 0===f?void 0:f.action}_${vt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${vt(c," ","_").toUpperCase()}`):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},_a=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},ga=e=>{var t;return l.createElement(o.Banner,{message:fa(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?_a(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},Aa=e=>{var t,l,n,i,o,a,r,u;const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA",c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");let p=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var v,m,E,f;return e.isSuccess?"BPA_SUBMIT_APP"==p?window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(m=d.workflow)||void 0===m?void 0:m.action}_${vt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(v=d.workflow)||void 0===v?void 0:v.action}_${vt(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(f=d.workflow)||void 0===f?void 0:f.action}_${vt(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${vt(c," ","_").toUpperCase()}`):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},Sa=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},ha=e=>{var t;return l.createElement(o.Banner,{message:Aa(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?Sa(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},ba=e=>e.substr(0,1).toUpperCase()+e.substr(1),ya=e=>{var t,l,i,o,a,r,u;const d=(null==e||null===(t=e.data)||void 0===t||null===(l=t.Licenses)||void 0===l||null===(i=l[0])||void 0===i||null===(o=i.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0])||"ARCHITECT",{t:s}=n.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS"):`${s("TRADELICENSE_TRADETYPE_"+d)}${s("CS_STAKEHOLDER_APPLICATION_SUCCESS")}`:e.isLoading?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_PENDING"):s("CS_STAKEHOLDER_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_FAILED"):s("CS_STAKEHOLDER_APPLICATION_FAILED")},Ca=e=>{var t,n,i,a,r,u,d,s;const c=(null==e||null===(t=e.data)||void 0===t||null===(n=t.Licenses)||void 0===n||null===(i=n[0])||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a||null===(r=a.tradeUnits)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.tradeType)||void 0===d?void 0:d.split(".")[0])||"ARCHITECT";return l.createElement(o.Banner,{message:ya(e),applicationNumber:null===(s=e.data)||void 0===s?void 0:s.Licenses[0].applicationNumber,info:e.isSuccess?`${e.t("TRADELICENSE_TRADETYPE_"+c)} ${e.t("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL")}`:"",successful:e.isSuccess,style:{padding:"10px"},headerStyles:{fontSize:"32px"}})},Ta={OBPSModule:e=>{let{stateCode:t,userType:n,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:t,moduleCode:["bpa","bpareg","common"],language:u});return Digit.SessionStorage.set("OBPS_TENANTS",a),d?l.createElement(o.Loader,null):l.createElement("citizen"===n?Ml:Sn,{path:r,stateCode:t})},OBPSLinks:e=>{let{matchPath:t}=e;const{t:i}=n.useTranslation(),a=[{link:t+"/my-applications",i18nKey:i("BPA_CITIZEN_HOME_VIEW_APP_BY_CITIZEN_LABEL")},{link:t+"/stakeholder/apply/stakeholder-docs-required",i18nKey:i("BPA_CITIZEN_HOME_STAKEHOLDER_LOGIN_LABEL")},{link:t+"/home",i18nKey:i("BPA_CITIZEN_HOME_ARCHITECT_LOGIN_LABEL")}];return l.createElement(o.CitizenHomeCard,{header:i("ACTION_TEST_BUILDING_PLAN_APPROVAL"),links:a,Icon:()=>l.createElement(o.OBPSIcon,null),Info:()=>l.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:i("CS_FILE_APPLICATION_INFO_LABEL"),text:i("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}),isInfo:!0})},OBPSCard:()=>{const[e,a]=t.useState(0),[r,u]=t.useState(0),{t:d}=n.useTranslation(),s=i.useLocation(),c=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),v=function(e){var t;void 0===e&&(e=[]);let l=sessionStorage.getItem("Digit.citizen.userRequestObject");const n=l?JSON.parse(l):{};let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,l,o;null==n||null===(t=n.value)||void 0===t||null===(l=t.info)||void 0===l||null===(o=l.roles)||void 0===o||o.map(t=>{t.code===e.code&&t.tenantId===e.tenantId&&i.push(t)})}),null==i?void 0:i.length}([{code:"BPAREG_DOC_VERIFIER",tenantId:p},{code:"BPAREG_APPROVER",tenantId:p}]),m=function(e){var t;void 0===e&&(e=[]);const l=Digit.UserService.getUser(),n=Digit.ULBService.getCurrentTenantId();let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,o;null==l||null===(t=l.info)||void 0===t||null===(o=t.roles)||void 0===o||o.map(t=>{t.code==e&&t.tenantId===n&&i.push(t)})}),null==i?void 0:i.length}(["BPA_FIELD_INSPECTOR","BPA_NOC_VERIFIER","BPA_APPROVER","BPA_VERIFIER","CEMP"]),{isLoading:E,data:f}=Digit.Hooks.obps.useBPAInbox({tenantId:c,filters:{filterForm:{moduleName:"BPAREG",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL"},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}},config:{enabled:!!v}}),{isLoading:_,data:g}=Digit.Hooks.obps.useBPAInbox({tenantId:c,filters:{filterForm:{moduleName:"bpa-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}},config:{enabled:!!m}});t.useEffect(()=>{_||E||(a((null!=g&&g.totalCount?null==g?void 0:g.totalCount:0)+(null!=f&&f.totalCount?null==f?void 0:f.totalCount:0)),u((null==g?void 0:g.nearingSlaCount)||0+(null==f?void 0:f.nearingSlaCount)||0))},[g,f]),t.useEffect(()=>{"/digit-ui/employee"===s.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[s.pathname]);const A=t.useMemo(()=>({Icon:l.createElement(o.OBPSIconSolidBg,null),moduleName:d("MODULE_OBPS"),kpis:[{count:_||E?"":e,label:d("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:_||E?"":r,label:d("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:E?"":null==f?void 0:f.totalCount,label:d("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),link:"/digit-ui/employee/obps/stakeholder-inbox",field:"STAKEHOLDER"},{count:_?"":null==g?void 0:g.totalCount,label:d("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/employee/obps/inbox",field:"BPA"},{label:d("ES_COMMON_SEARCH_APPLICATION"),link:"/digit-ui/employee/obps/search/application"}]}),[_,E,f,g,e,r]);return v||(A.links=A.links.filter(e=>"STAKEHOLDER"!==e.field)),m||(A.links=A.links.filter(e=>"BPA"!==e.field)),m||v?l.createElement(o.EmployeeModuleCard,A):null},BPACitizenHomeScreen:e=>{var a,r,u,d;const s=Digit.UserService.getUser(),c=null==s||null===(a=s.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code),p=Digit.ULBService.getStateId(),[v,m]=t.useState(!1),{data:E,isLoading:f}=Digit.Hooks.obps.useMDMS(p,"StakeholderRegistraition","TradeTypetoRoleMapping"),[_,g]=t.useState([]),A=Digit.ULBService.getStateId(),{t:S}=n.useTranslation(),h=i.useLocation(),[b,y,C]=Digit.Hooks.useSessionStorage("BPA_HOME_CREATE",{}),{data:T,isLoading:D}=Digit.Hooks.obps.useMDMS(A,"BPA",["homePageUrlLinks"]),[P,N]=t.useState(null),[I,L]=t.useState("-"),[B,O]=t.useState({applicationStatus:[]});window.Digit.Utils.browser.isMobile();const[R,x]=t.useState(0),[w,M]=t.useState(window.Digit.Utils.browser.isMobile()?50:10),[k,F]=t.useState([{id:"createdTime",sortOrder:"DESC"}]),{isLoading:U,data:H}=Digit.Hooks.obps.useArchitectInbox({tenantId:p,moduleName:"bpa-services",businessService:["BPA_LOW","BPA","BPA_OC"],filters:{searchForm:{...B},tableForm:{sortBy:null==k||null===(u=k[0])||void 0===u?void 0:u.id,limit:w,offset:R,sortOrder:null==k||null===(d=k[0])||void 0===d?void 0:d.sortOrder},filterForm:{moduleName:"bpa-services",businessService:[],applicationStatus:null==B?void 0:B.applicationStatus,locality:[],assignee:"ASSIGNED_TO_ALL"}},config:{},withEDCRData:!1}),{isLoading:W,data:{totalCount:j}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:p,filters:{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0}}});if(t.useEffect(()=>{"/digit-ui/citizen/obps/home"===h.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[h.pathname]),t.useEffect(()=>{U||L((null==H?void 0:H.totalCount)||0)},[H]),t.useEffect(()=>{if(!f){var e,t;let l=[];null==E||null===(e=E.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);let i=!1;null==n||n.map(e=>{null!=c&&c.includes(e)&&!i&&(i=!0)}),i?m(!0):(m(!1),N({key:"true",message:S("BPA_LOGIN_HOME_VALIDATION_MESSAGE_LABEL")}))}},[f]),t.useEffect(()=>{var e,t;if(!D&&(null==T||null===(e=T.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0){var l,n;let e=[];null==T||null===(l=T.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(t=>{var l,n,i;e.push({link:`${null==t||null===(l=t.flow)||void 0===l?void 0:l.toLowerCase()}/${null==t||null===(n=t.applicationType)||void 0===n?void 0:n.toLowerCase()}/${null==t||null===(i=t.serviceType)||void 0===i?void 0:i.toLowerCase()}/docs-required`,i18nKey:S(`BPA_HOME_${null==t?void 0:t.applicationType}_${null==t?void 0:t.serviceType}_LABEL`),state:{linkData:t},linkState:!0})}),g(e)}},[!D]),t.useEffect(()=>{C()},[]),Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK"),P)return l.createElement(o.Toast,{error:!0,label:S(null==P?void 0:P.message),isDleteBtn:!0,onClose:()=>{window.location.replace("/digit-ui/citizen/all-services"),N(null)}});if(f||!v||U)return l.createElement(o.Loader,null);const $=[{Icon:l.createElement(o.BPAHomeIcon,null),moduleName:S("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),name:"employeeCard",isCitizen:!0,kpis:[{count:!U&&!W&&I&&j?I+j:"-",label:S("BPA_PDF_TOTAL"),link:"/digit-ui/citizen/obps/bpa/inbox"}],links:[{count:U?"-":I,label:S("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/citizen/obps/bpa/inbox"},{count:W?"-":j,label:S("ES_COMMON_EDCR_INBOX_LABEL"),link:"/digit-ui/citizen/obps/edcr/inbox"}],className:"CitizenHomeCard",styles:{padding:"0px",minWidth:"90%",minHeight:"90%"}},{title:S("ACTION_TEST_EDCR_SCRUTINY"),Icon:l.createElement(o.EDCRIcon,{className:"fill-path-primary-main"}),links:[{link:"edcrscrutiny/apply",i18nKey:S("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"edcrscrutiny/oc-apply",i18nKey:S("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}],styles:{minWidth:"90%",minHeight:"90%"}},{title:S("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),Icon:l.createElement(o.BPAIcon,{className:"fill-path-primary-main"}),links:_,styles:{minWidth:"90%",minHeight:"90%"}}],z=l.createElement("div",{className:"mainContent"},$.map(e=>l.createElement("div",null,"employeeCard"===e.name?l.createElement(o.EmployeeModuleCard,e):l.createElement(o.CitizenHomeCard,{header:e.title,links:e.links,Icon:()=>e.Icon,styles:null==e?void 0:e.styles}))));return sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!1)),z},EDCRForm:e=>{var n,a,r,d,s,c;let{t:p,config:v,onSelect:m,formData:E,ownerIndex:f=0,isShowToast:_,isSubmitBtnDisable:g,setIsShowToast:A}=e;i.useLocation(),Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),[h,b]=t.useState([]),[y,C]=t.useState(null==E||null===(n=E.Scrutiny)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.applicantName),[T,D]=t.useState(null==E||null===(r=E.Scrutiny)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.tenantIdData),[P,N]=t.useState(()=>{var e,t,l;return(null==E||null===(e=E.Scrutiny)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.proofIdentity)||void 0===l?void 0:l.fileStoreId)||null}),[I,L]=t.useState(null==E||null===(s=E.owners)||void 0===s||null===(c=s.documents)||void 0===c?void 0:c.proofIdentity),[B,O]=t.useState(null),[R,x]=t.useState(""),[w,M]=t.useState(null),k=i.useHistory(),{isLoading:F,data:U}=Digit.Hooks.obps.useMDMS(S,"tenant",["citymodule"]);return t.useEffect(()=>{var e,t,l,n;if((null==U||null===(e=U.tenant)||void 0===e||null===(t=e.citymodule)||void 0===t?void 0:t.length)>0){var i,o,a,r,u,d,s;const e=null==U||null===(i=U.tenant)||void 0===i||null===(o=i.citymodule)||void 0===o?void 0:o.filter(e=>"BPAAPPLY"==e.code);null==e||null===(a=e[0])||void 0===a||null===(r=a.tenants)||void 0===r||r.forEach(e=>{var t;e.i18nKey="TENANT_TENANTS_"+vt(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),".","_")}),Array.isArray(null==e||null===(u=e[0])||void 0===u?void 0:u.tenants)&&(null==e||null===(d=e[0])||void 0===d||d.tenants.reverse());let t=(l=null==e||null===(s=e[0])||void 0===s?void 0:s.tenants,n=p,l.sort((e,t)=>n(e.code).localeCompare(n(t.code))));b(t)}},[U]),t.useEffect(()=>{(R||_)&&(C(""),D(""),N(null),L(""),x("")),_&&k.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null!=_&&_.label?null==_?void 0:_.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[R,_,g]),F||g?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:p,config:v,onSelect:()=>{const e={};e.tenantId=T,e.applicantName=y,e.file=I,m(v.key,e)},onSkip:()=>{x("NEED TO DELETE")},isDisabled:!T||!y||!I||g,onAdd:function(){x("NEED TO DELETE")},isMultipleAllow:!0},l.createElement(o.CardLabel,null,p("EDCR_SCRUTINY_CITY")+" *"),l.createElement(o.Dropdown,{t:p,isMandatory:!1,option:h,selected:T,optionKey:"i18nKey",select:function(e){D(e)},uploadMessage:R}),l.createElement(o.CardLabel,null,p("EDCR_SCRUTINY_NAME_LABEL")+" *"),l.createElement(o.TextInput,u({isMandatory:!1,optionKey:"i18nKey",t:p,name:"applicantName",onChange:function(e){C(e.target.value)},uploadMessage:R,value:y},{isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:p("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,p("BPA_PLAN_DIAGRAM_LABEL")+" *"),l.createElement(o.UploadFile,{id:"edcr-doc",extraStyleName:"propertyCreate",onUpload:function(e){N(e.target.files[0]),L(e.target.files[0])},onDelete:()=>{N(null),L("")},message:P?"1 "+p("PT_ACTION_FILEUPLOADED"):p("ES_NO_FILE_SELECTED_LABEL"),error:B,uploadMessage:R}),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}},p("EDCR_UPLOAD_FILE_LIMITS_LABEL")),_&&l.createElement(o.Toast,{error:_.key,label:p(_.label),onClose:()=>A(null),isDleteBtn:!0}))},BasicDetails:e=>{var i,a,r,u,d,s,c,p,v,m,E,f;let{formData:_,onSelect:g,config:A}=e;const[S,h]=t.useState(null),[b,y]=t.useState((null==_||null===(i=_.data)||void 0===i?void 0:i.edcrDetails)||null),[C,T]=t.useState(null==_||null===(a=_.data)||void 0===a?void 0:a.scrutinyNumber),[D,P]=t.useState(!(null==_||null===(r=_.data)||void 0===r||!r.scrutinyNumber)),{t:N}=n.useTranslation(),I=Digit.ULBService.getStateId(),L=window.Digit.Utils.browser.isMobile(),{data:B}=Digit.Hooks.obps.useMDMS(I,"BPA",["RiskTypeComputation"]),O=Digit.Utils.obps.calculateRiskType(null==B||null===(u=B.BPA)||void 0===u?void 0:u.RiskTypeComputation,null==b||null===(d=b.planDetail)||void 0===d||null===(s=d.plot)||void 0===s?void 0:s.area,null==b||null===(c=b.planDetail)||void 0===c?void 0:c.blocks);let R=sessionStorage.getItem("isEDCRDisable");if(R=JSON.parse(R),R){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&b||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),function(){try{Promise.resolve(Rt(null==C?void 0:C.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}catch(e){return Promise.reject(e)}}())}return l.createElement("div",null,S&&l.createElement(o.Toast,{error:!0,label:N(""+(null==S?void 0:S.message)),onClose:()=>{h(null)},isDleteBtn:!0}),l.createElement(Hl,null),l.createElement("div",{className:L?"obps-search":"",style:L?{}:{margin:"8px"}},l.createElement(o.Label,null,N("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{return Promise.resolve(function(){if("Enter"===e.key){if(null==C||!C.edcrNumber)return;return Promise.resolve(Rt(null==C?void 0:C.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}}())}catch(e){return Promise.reject(e)}},onChange:e=>T({edcrNumber:e.target.value}),value:null==C?void 0:C.edcrNumber,signature:!0,signatureImg:!R&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!R&&null!=C&&C.edcrNumber?()=>function(e){try{return Promise.resolve(Rt(null==C?void 0:C.edcrNumber,I)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}catch(e){return Promise.reject(e)}}():null}),disable:R,style:{marginBottom:"10px"}})),b&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,N("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,N("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=b&&b.applicationDate?Rl(new Date(null==b?void 0:b.applicationDate),"dd/MM/yyyy"):null==b?void 0:b.applicationDate}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:N("WF_BPA_"+(null==b?void 0:b.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:N(null==b?void 0:b.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==b||null===(p=b.planDetail)||void 0===p||null===(v=p.planInformation)||void 0===v?void 0:v.occupancy}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:N("WF_BPA_"+O)}),l.createElement(o.Row,{className:"border-none",label:N("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==b||null===(m=b.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.applicantName})),O?l.createElement(o.SubmitBar,{label:N("CS_COMMON_NEXT"),onSubmit:e=>{var t,l,n,i,o,a,r,u;g(null==A?void 0:A.key,{scrutinyNumber:C,applicantName:null==b||null===(t=b.planDetail)||void 0===t||null===(l=t.planInformation)||void 0===l?void 0:l.applicantName,occupancyType:null==b||null===(n=b.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.occupancy,applicationType:null==b?void 0:b.appliactionType,serviceType:null==b?void 0:b.applicationSubType,applicationDate:null==b?void 0:b.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==B||null===(o=B.BPA)||void 0===o?void 0:o.RiskTypeComputation,null==b||null===(a=b.planDetail)||void 0===a||null===(r=a.plot)||void 0===r?void 0:r.area,null==b||null===(u=b.planDetail)||void 0===u?void 0:u.blocks),edcrDetails:b})},disabled:!(null!=C&&null!==(f=C.edcrNumber)&&void 0!==f&&f.length)}):l.createElement(o.Loader,null)))},DocsRequired:e=>{var a,r;let{onSelect:u}=e;const{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),[p,v]=(i.useHistory(),i.useParams(),t.useState([])),[m,E]=t.useState([]),{data:f,isLoading:_}=Digit.Hooks.obps.useMDMS(c,"BPA","DocumentTypes"),{data:g}=Digit.Hooks.obps.useMDMS(c,"common-masters",["DocumentType"]),A=(Digit.Hooks.obps.useMDMS(c,"BPA",["RiskTypeComputation"]),Digit.UserService.getUser()),S={0:{tenantId:c},1:{id:null==A||null===(a=A.info)||void 0===a?void 0:a.id}},{data:h}=Digit.Hooks.obps.useBPAREGSearch(s,S),b=window.location.href.includes("ocbpa");sessionStorage.removeItem("clickOnBPAApplyAfterEDCR");const{data:y,isLoading:C}=Digit.Hooks.obps.useMDMS(c,"BPA",["homePageUrlLinks"]);return t.useEffect(()=>{let e,t="",l=!0;for(let m=0;m<(null==h||null===(n=h.Licenses)||void 0===n?void 0:n.length);m++){var n,i,o,a,r,u,d,s,c,p,v;"APPROVED"===(null==h||null===(i=h.Licenses)||void 0===i||null===(o=i[m])||void 0===o?void 0:o.status)&&l&&(l=!1,t=(null==h||null===(a=h.Licenses)||void 0===a||null===(r=a[m])||void 0===r||null===(u=r.tradeLicenseDetail)||void 0===u||null===(d=u.tradeUnits)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.tradeType)||void 0===c?void 0:c.split(".")[0])||"ARCHITECT",sessionStorage.setItem("BPA_ARCHITECT_NAME",JSON.stringify(t)),e=null==h||null===(p=h.Licenses)||void 0===p||null===(v=p[m])||void 0===v?void 0:v.tradeLicenseDetail.additionalDetail.isSelfCertificationRequired,sessionStorage.setItem("isSelfCertificationRequired",JSON.stringify(e)))}},[h]),t.useEffect(()=>{if(!C){var e,t;const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];null==y||null===(e=y.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t||t.map(e=>{(null==i?void 0:i.toUpperCase())===(null==e?void 0:e.applicationType)&&(null==n?void 0:n.toUpperCase())===(null==e?void 0:e.serviceType)&&E({flow:null==e?void 0:e.flow,applicationType:null==e?void 0:e.applicationType,serviceType:null==e?void 0:e.serviceType})})}},[!C]),t.useEffect(()=>{if(!_){let e=[],t=[];const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];for(let t=0;t<f.length;t++)e[f[t].applicationType]||e[f[t].ServiceType]||(e[f[t].applicationType]=f[t]);Object.values(e).map(e=>{var l;(null==e?void 0:e.applicationType)==(null==i?void 0:i.toUpperCase())&&(null==e?void 0:e.ServiceType)==(null==n?void 0:n.toUpperCase())&&t.push(null==e?void 0:e.docTypes),null==t||null===(l=t[0])||void 0===l||l.forEach(e=>{var t,l;let n=e.code;e.dropdownData=[],null==g||null===(t=g["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))})}),v(t)})}},[!_]),_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,d(b?"BPA_OOCUPANCY_CERTIFICATE_APP_LABEL":"OBPS_NEW_BUILDING_PERMIT")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},d("OBPS_NEW_BUILDING_PERMIT_DESCRIPTION")),_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==p||null===(r=p[0])||void 0===r?void 0:r.map((e,t)=>{var n;return l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+d(null==e?void 0:e.code.replace(".","_"))))),l.createElement("div",{style:{marginBottom:"16px"}},null==e||null===(n=e.dropdownData)||void 0===n?void 0:n.map((t,n)=>{var i;return(null==e||null===(i=e.dropdownData)||void 0===i?void 0:i.length)!==n+1?l.createElement("span",null,d(null==t?void 0:t.i18nKey)+", "):l.createElement("span",null,""+d(null==t?void 0:t.i18nKey))})))})),l.createElement(o.SubmitBar,{label:d("CS_COMMON_NEXT"),onSubmit:()=>{if(null!==JSON.parse(sessionStorage.getItem("BPAintermediateValue"))){let e=JSON.parse(sessionStorage.getItem("BPAintermediateValue"));sessionStorage.setItem("BPAintermediateValue",null),u("",e)}else u("uiFlow",m)}})),l.createElement(o.CitizenInfoLabel,{info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},PlotDetails:e=>{var i,a,r,u,d,s,c,p,v,m;let{formData:E,onSelect:f,config:_}=e;const{t:g}=n.useTranslation(),[A,S]=t.useState(""),[h,b]=t.useState(""),[y,C]=t.useState(""),T=(Digit.ULBService.getCurrentTenantId(),null==E||null===(i=E.uiFlow)||void 0===i?void 0:i.flow),D=Digit.ULBService.getStateId();let[P,N]=t.useState(!1);t.useEffect(()=>{"BPA"===T&&N(!0)},[T]);const{data:I,isLoading:L}=Digit.Hooks.obps.useScrutinyDetails(D,null==E||null===(a=E.data)||void 0===a?void 0:a.scrutinyNumber);return L?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(Hl,{flow:"OCBPA"===T?"OCBPA":""}),l.createElement(o.FormStep,{config:_,onSelect:e=>{f(null==_?void 0:_.key,{...e})},childrenAtTheBottom:!1,t:g,_defaultValues:null==E?void 0:E.data,onSkip:()=>f(),onChange:function(e){"boundaryWallLength"==e.target.name&&0==isNaN(parseInt(e.target.value))?N(!1):"boundaryWallLength"==e.target.name&&1==isNaN(parseInt(e.target.value))&&N(!0)},isDisabled:P},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:g("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=I&&null!==(r=I.planDetail)&&void 0!==r&&null!==(u=r.planInformation)&&void 0!==u&&u.plotArea?`${null==I||null===(d=I.planDetail)||void 0===d||null===(s=d.planInformation)||void 0===s?void 0:s.plotArea} ${g("BPA_SQ_FT_LABEL")}`:"NA"}),l.createElement(o.Row,{className:"border-none",label:g("BPA_PLOT_NUMBER_LABEL"),text:null==I||null===(c=I.planDetail)||void 0===c||null===(p=c.planInformation)||void 0===p?void 0:p.plotNo}),l.createElement(o.Row,{className:"border-none",label:g("BPA_KHATHA_NUMBER_LABEL"),text:null==I||null===(v=I.planDetail)||void 0===v||null===(m=v.planInformation)||void 0===m?void 0:m.khataNo}))))},ScrutinyDetails:e=>{var a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w;let{onSelect:M,formData:k,config:F}=e;const{t:U}=n.useTranslation(),[H,W]=(i.useHistory(),t.useState([])),[j,$]=t.useState((null==k?void 0:k.subOccupancy)||(null==k||null===(a=k.landInfo)||void 0===a?void 0:a.unit)||{}),[z,Y]=t.useState([]),[G,K]=t.useState([]);let V=Digit.UserService.getUser();const q=(null==V||null===(r=V.info)||void 0===r?void 0:r.permanentCity)||Digit.ULBService.getCurrentTenantId(),X=null==k||null===(u=k.uiFlow)||void 0===u?void 0:u.flow,[J,Z]=t.useState(null),Q=Digit.ULBService.getStateId(),{isMdmsLoading:ee,data:te}=Digit.Hooks.obps.useMDMS(Q,"BPA",["SubOccupancyType"]),{data:le}=Digit.Hooks.obps.useScrutinyDetails(q,null==k||null===(d=k.data)||void 0===d?void 0:d.scrutinyNumber,{enabled:!0});function ne(e){var t,l;let n=[];return null==e||null===(t=e.building)||void 0===t||null===(l=t.floors)||void 0===l||l.map(e=>{var t,l,i,o,a,r,u,d;n.push({Floor:U("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:U(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:U("BPA_FLOOR_NAME_"+e.number)})}),n}function ie(){var e,t;let l=[];return null==te||null===(e=te.BPA)||void 0===e||null===(t=e.SubOccupancyType)||void 0===t||t.map(e=>{var t;l.push({code:e.code,name:e.name,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+vt(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),"-","_")})}),Digit.Utils.locale.sortDropdownNames(l,"i18nKey",U)}const oe=e=>{let{label:t,jumpTo:a}=e;const{t:r}=n.useTranslation();return i.useHistory(),l.createElement(o.LinkButton,{label:r(t),onClick:function(){location.href=a}})},ae=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],re=e=>{const t=e;return(e,l,n)=>e[t]},ue=t.useMemo(()=>null==ae?void 0:ae.map(e=>({Header:U(""+e.name),accessor:re(e.id),id:e.id})));function de(e){var t,l,n,i,o;let a=null==k||null===(t=k.data)||void 0===t||null===(l=t.bpaData)||void 0===l||null===(n=l.bpaApprovalResponse)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.landInfo)||void 0===o?void 0:o.unit,r="";if((null==a?void 0:a.length)>0){var u,d;let t=null===(u=a[e])||void 0===u||null===(d=u.usageCategory)||void 0===d?void 0:d.split(",");null!=t&&t.length&&(r=(null==t?void 0:t.map(e=>e?""+U("BPA_SUBOCCUPANCYTYPE_"+vt(null==e?void 0:e.toUpperCase(),"-","_")):"NA")).join(", "))}return r||"NA"}return ee?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Hl,{currentStep:"OCBPA"===X?2:1,flow:"OCBPA"===X?"OCBPA":""}),l.createElement(o.FormStep,{t:U,config:F,onSelect:()=>{if("OCBPA"===X)if(null!=k&&k.id)M("",k,"",!0);else{var e,t,l,n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C;let T={};T.edcrNumber=null!=k&&null!==(e=k.edcrNumber)&&void 0!==e&&e.edcrNumber?null==k||null===(t=k.edcrNumber)||void 0===t?void 0:t.edcrNumber:null==k||null===(l=k.data)||void 0===l||null===(n=l.scrutinyNumber)||void 0===n?void 0:n.edcrNumber,T.riskType=null==k||null===(i=k.data)||void 0===i?void 0:i.riskType,T.applicationType=null==k||null===(o=k.data)||void 0===o?void 0:o.applicationType,T.serviceType=null==k||null===(a=k.data)||void 0===a?void 0:a.serviceType;const D=Digit.UserService.getUser(),P=null==D||null===(r=D.info)||void 0===r?void 0:r.uuid;T.tenantId=null==k||null===(u=k.data)||void 0===u||null===(d=u.bpaData)||void 0===d||null===(s=d.bpaApprovalResponse)||void 0===s||null===(c=s[0])||void 0===c||null===(p=c.landInfo)||void 0===p?void 0:p.tenantId,T.workflow={action:"INITIATE",assignes:[null==D||null===(v=D.info)||void 0===v?void 0:v.uuid]},T.accountId=P,T.documents=null,T.additionalDetails={},null!=k&&null!==(m=k.data)&&void 0!==m&&m.holdingNumber&&(T.additionalDetails.holdingNo=null==k||null===(E=k.data)||void 0===E?void 0:E.holdingNumber),null!=k&&null!==(f=k.data)&&void 0!==f&&f.registrationDetails&&(T.additionalDetails.registrationDetails=null==k||null===(_=k.data)||void 0===_?void 0:_.registrationDetails),null!=k&&null!==(g=k.data)&&void 0!==g&&g.applicationType&&(T.additionalDetails.applicationType=null==k||null===(A=k.data)||void 0===A?void 0:A.applicationType),null!=k&&null!==(S=k.data)&&void 0!==S&&S.serviceType&&(T.additionalDetails.serviceType=null==k||null===(h=k.data)||void 0===h?void 0:h.serviceType),T.landInfo=(null==k||null===(b=k.data)||void 0===b||null===(y=b.bpaData)||void 0===y||null===(C=y.bpaApprovalResponse)||void 0===C?void 0:C[0].landInfo)||{};let N=sessionStorage.getItem("BPA_ARCHITECT_NAME"),I=N?JSON.parse(N):"ARCHITECT";T.additionalDetails.typeOfArchitect=I,Digit.OBPSService.create({BPA:T},q).then((e,t)=>{var l;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(e.BPA[0].data=k.data,e.BPA[0].uiFlow=null==k?void 0:k.uiFlow,M("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;Z({key:"true",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?void 0:n.message)||null})})}else M(F.key,j)},onSkip:()=>M()},l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",style:{border:"none"},label:U("OCBPA"===X?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_NO_LABEL"),text:null==le?void 0:le.edcrNumber,labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),l.createElement(o.Row,{className:"border-none",label:U("BPA_UPLOADED_PLAN_DIAGRAM"),text:l.createElement(oe,{label:U("BPA_UPLOADED_PLAN_DXF"),jumpTo:null==le?void 0:le.updatedDxfFile})}),l.createElement(o.Row,{className:"border-none",label:U("BPA_SCRUNTINY_REPORT_OUTPUT"),text:l.createElement(oe,{label:U("BPA_SCRUTINY_REPORT_PDF"),jumpTo:null==le?void 0:le.planReport})})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("OCBPA"===X?"BPA_ACTUAL_BUILDING_EXTRACT_HEADER":"BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:U("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=le&&null!==(s=le.planDetail)&&void 0!==s&&null!==(c=s.blocks)&&void 0!==c&&null!==(p=c[0])&&void 0!==p&&null!==(v=p.building)&&void 0!==v&&v.totalBuitUpArea?`${null==le||null===(m=le.planDetail)||void 0===m||null===(E=m.blocks)||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.building)||void 0===_?void 0:_.totalBuitUpArea} ${U("BPA_SQ_MTRS_LABEL")}`:U("NA")}),l.createElement(o.Row,{className:"border-none",label:U("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==le||null===(g=le.planDetail)||void 0===g||null===(A=g.blocks)||void 0===A||null===(S=A[0])||void 0===S||null===(h=S.building)||void 0===h?void 0:h.totalFloors}),l.createElement(o.Row,{className:"border-none",label:U("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:null!=le&&null!==(b=le.planDetail)&&void 0!==b&&null!==(y=b.blocks)&&void 0!==y&&null!==(C=y[0])&&void 0!==C&&null!==(T=C.building)&&void 0!==T&&T.declaredBuildingHeight?`${null==le||null===(D=le.planDetail)||void 0===D||null===(P=D.blocks)||void 0===P||null===(N=P[0])||void 0===N||null===(I=N.building)||void 0===I?void 0:I.declaredBuildingHeight} ${U("BPA_MTRS_LABEL")}`:U("NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_OCC_SUBOCC_HEADER")),null==le||null===(L=le.planDetail)||void 0===L||null===(B=L.blocks)||void 0===B?void 0:B.map((e,t)=>{var n;return l.createElement("div",{key:t,style:{marginTop:"20px"}},l.createElement(o.CardSubHeader,{style:{fontSize:"18px"}},U("BPA_BLOCK_SUBHEADER")," ",t+1),"OCBPA"!==X?l.createElement(o.CardSectionHeader,{style:{fontWeight:"normal"},className:"card-label-smaller"},U("BPA_SUB_OCCUPANCY_LABEL")):null,"OCBPA"!==X?l.createElement(o.MultiSelectDropdown,{BlockNumber:e.number,className:"form-field",isMandatory:!0,defaultUnit:"Selected",selected:j["Block_"+e.number],options:ie(),onSelect:t=>((e,t,l)=>{let n=j,i=[];e&&(null==e||e.map(e=>{i.push(null==e?void 0:e[1])})),n["Block_"+l]=i,W(i),$(n)})(t,0,e.number),isOBPSMultiple:!0,optionsKey:"i18nKey",ServerStyle:{width:"100%",overflowX:"hidden"},t:U}):null,"OCBPA"!==X?l.createElement("div",{className:"tag-container"},j["Block_"+e.number]&&j["Block_"+e.number].length>0&&(null===(n=j["Block_"+e.number])||void 0===n?void 0:n.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:""+U(t.i18nKey),onClick:()=>((e,t,l)=>{let n=j["Block_"+l].filter((t,l)=>l!==e);W(n);let i=j;i["Block_"+l]=n,$(i)})(n,0,e.number)})))):null,"OCBPA"!==X?j["Block_"+e.number]&&j["Block_"+e.number].length>0&&l.createElement(o.LinkButton,{style:{textAlign:"left"},label:"Clear All",onClick:()=>(e=>{let t=[],l=j;l["Block_"+e]=t,W(t),$(l)})(e.number)}):null,l.createElement("div",{style:{marginTop:"20px"}},"OCBPA"===X?l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+U("BPA_SUB_OCCUPANCY_LABEL"),text:de(t)})):null,l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:U,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:ne(e),columns:ue,getCellProps:e=>({style:{}})}))))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{label:U("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=le&&null!==(O=le.planDetail)&&void 0!==O&&null!==(R=O.planInformation)&&void 0!==R&&R.demolitionArea?`${null==le||null===(x=le.planDetail)||void 0===x||null===(w=x.planInformation)||void 0===w?void 0:w.demolitionArea} ${U("BPA_SQ_MTRS_LABEL")}`:U("CS_NA")}))),J&&l.createElement(o.Toast,{error:!0,label:U(null==J?void 0:J.message),isDleteBtn:!0,onClose:()=>{Z(null)}}))},OwnerDetails:e=>{var n,i,a,r,d,s,c,p;let{t:v,config:m,onSelect:E,formData:f}=e,_={};sessionStorage.removeItem("currentPincode");let g=window.location.href.includes("edit-application"),A=window.location.href.includes("renew-trade");Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),[h,b]=t.useState(!g&&!A),[y,C]=t.useState([]),[T,D]=t.useState([]),[P,N]=t.useState(null==f||null===(n=f.owners)||void 0===n?void 0:n.ownershipCategory),[I,L]=t.useState((null==f||null===(i=f.owners)||void 0===i?void 0:i.name)||""),[B,O]=t.useState(!1),[R,x]=t.useState(null==f||null===(a=f.owners)||void 0===a?void 0:a.gender),[w,M]=t.useState((null==f||null===(r=f.owners)||void 0===r?void 0:r.mobileNumber)||""),[k,F]=t.useState((null==f||null===(d=f.owners)||void 0===d?void 0:d.emailId)||""),[U,H]=t.useState(null),[W,j]=t.useState(!1);Digit.Utils.browser.isMobile();const $=!(null==P||!P.code.includes("MULTIPLEOWNERS"));null==f||null===(s=f.owners)||void 0===s||null===(c=s.owners)||void 0===c||c.forEach(e=>{"false"==e.isPrimaryOwner&&(e.isPrimaryOwner=!1)});const[z,Y]=t.useState((null==f?void 0:f.owners)&&(null==f||null===(p=f.owners)||void 0===p?void 0:p.owners)||[{name:"",gender:"",mobileNumber:null,isPrimaryOwner:!0}]);t.useEffect(()=>{var e=0;z.map(t=>{null!=t&&t.isPrimaryOwner&&(e=1),b(!(null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&t.gender))}),h||!P||null!=P&&P.code.includes("SINGLEOWNER")||b(1!=e)},[z]),t.useEffect(()=>{const e=ct(z);P&&!$&&(null==e?void 0:e.length)>1&&Y([{...e[0],isPrimaryOwner:!0}])},[P]);const{isLoading:G,data:K}=Digit.Hooks.obps.useMDMS(S,"common-masters",["OwnerShipCategory"]),{data:V}=Digit.Hooks.obps.useMDMS(S,"common-masters",["GenderType"]);t.useEffect(()=>{var e;const t=null==K||null===(e=K["common-masters"])||void 0===e?void 0:e.OwnerShipCategory;if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>{var t;return null==e||null===(t=e.code)||void 0===t?void 0:t.includes("INDIVIDUAL")});e.forEach(e=>{e.i18nKey="COMMON_MASTERS_OWNERSHIPCATEGORY_"+vt(null==e?void 0:e.code,".","_")}),C(e)}},[K]),t.useEffect(()=>{var e;const t=(null==V||null===(e=V["common-masters"])||void 0===e?void 0:e.GenderType)||[];if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>e.active);e.forEach(e=>{e.i18nKey="COMMON_GENDER_"+e.code}),D(e)}},[V]);const[q,X]=t.useState(null);return l.createElement("div",null,l.createElement(Hl,{currentStep:2}),l.createElement(o.FormStep,{config:m,onSelect:function(){try{return X(null),Promise.resolve(function(e,t){try{let e=!1,t=[];return t=null==z?void 0:z.map((e,t)=>{var l;return Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==z||null===(l=z[t])||void 0===l?void 0:l.mobileNumber},{}).then(e=>e)}),Promise.resolve(Promise.all(t)).then(function(l){var n;t=l;let i=[],o=!1;return t&&(null===(n=t)||void 0===n?void 0:n.length)>0&&t.map(t=>{var l,n,a,r,u,d;o=null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n||null===(a=n.roles)||void 0===a||null===(r=a.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===r?void 0:r[0],z.find(e=>{var l,n,i,a,r,u;return!(null!=e&&e.uuid&&!o)&&((null==e?void 0:e.name)===(null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.name)&&(null==e?void 0:e.mobileNumber)===(null==t||null===(i=t.user)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.mobileNumber)||(null==e?void 0:e.mobileNumber)===(null==t||null===(r=t.user)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.mobileNumber)&&o)})&&(e=!0,i.push(null==t||null===(u=t.user)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.mobileNumber))}),(null==i?void 0:i.length)>0&&H({key:"true",error:!0,message:`${v("BPA_OWNER_VALIDATION_1")} ${null==i?void 0:i.join(", ")} ${v("BPA_OWNER_VALIDATION_2")}`}),1!=e})}catch(e){return Promise.reject(e)}}()).then(function(e){if(e)if(1==$&&1==z.length)window.scrollTo(0,0),X("BPA_ERROR_MULTIPLE_OWNER");else{let e;e={...f.owners,owners:z,ownershipCategory:P},E(m.key,e)}})}catch(e){return Promise.reject(e)}},onSkip:()=>E(),t:v,isDisabled:h||function(){let e=0;return z&&(null==z||z.map(t=>{var l;1===e||null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&null!==(l=t.gender)&&void 0!==l&&l.code||(e=1)})),0!=e}()||!P||W,forcedError:v(q)},G?l.createElement(o.Loader,null):l.createElement("div",{style:{marginBottom:"10px"}},l.createElement("div",null,l.createElement(o.CardLabel,null,v("BPA_TYPE_OF_OWNER_LABEL")+" *"),l.createElement(o.RadioButtons,{isMandatory:m.isMandatory,options:y,selectedOption:P,optionsKey:"i18nKey",onSelect:function(e){N(e)},value:P,labelKey:"PT_OWNERSHIP",isDependent:!0})),z.map((e,t)=>l.createElement("div",{key:`${e}-${t}`},l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA"}},l.createElement(o.CardLabel,{style:{marginBottom:"-15px"}},v("CORE_COMMON_MOBILE_NUMBER")+" *"),$&&l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"5px"},fill:1!=z.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>function(e){const t=[...z];1!=t.length&&(t.splice(e,1),1==t.length&&(t[0]={...t[0],isPrimaryOwner:!0}),Y(t))}(t)}),l.createElement("div",{style:{marginTop:"30px"}},l.createElement("div",{className:"field-container"},l.createElement("div",{style:{position:"relative",zIndex:"100",left:"35px",marginTop:"-24.5px",marginLeft:"-25px"}},"+91"),l.createElement(o.TextInput,u({style:{background:"#FAFAFA",padding:"0px 35px"},type:"text",t:v,isMandatory:!1,optionKey:"i18nKey",name:"mobileNumber",value:e.mobileNumber,onChange:e=>function(e,t){let l=[...z];l[e].mobileNumber=t.target.value,M(t.target.value),Y(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e)},_={isRequired:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:v("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"35px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>function(e,t){try{var l,n,i,o;const t=ct(z),a=(null==t||null===(l=t[e])||void 0===l?void 0:l.mobileNumber)||"";if(H(null),!a.match(pt("MobileNo")))return H({key:"true",error:!0,message:"ERR_MOBILE_NUMBER_INCORRECT"}),Promise.resolve();if(a===(null==t||null===(n=t[e])||void 0===n?void 0:n.userName)&&"BPA_ARCHITECT"!==(null===(i=ownerRoleCheck)||void 0===i?void 0:i.code)&&"BPA_SUPERVISOR"!==(null===(o=ownerRoleCheck)||void 0===o?void 0:o.code))return H({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED_TOGGLE_MSG"}),Promise.resolve();const r=t.findIndex(e=>e.userName===a);return Promise.resolve(function(l,n){var i;if(!(r>-1&&"BPA_ARCHITECT"!==(null===(l=ownerRoleCheck)||void 0===l?void 0:l.code)&&"BPA_SUPERVISOR"!==(null===(n=ownerRoleCheck)||void 0===n?void 0:n.code)))return Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==z||null===(i=z[e])||void 0===i?void 0:i.mobileNumber},{})).then(function(l){var n,i,o,a,r;let u=null==l||null===(n=l.user)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.roles)||void 0===o||null===(a=o.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===a?void 0:a[0];if(0===(null==l||null===(r=l.user)||void 0===r?void 0:r.length))H({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"});else{var d,s,c,p,v;const n=null==l||null===(d=l.user)||void 0===d?void 0:d[0];n.gender=n.gender?{code:n.gender,active:!0,i18nKey:"COMMON_GENDER_"+n.gender}:"",null!=n&&n.dob&&(n.dob=Ct(null==n?void 0:n.dob)),null!=n&&n.createdDate&&(n.createdDate=Nt(null==n?void 0:n.createdDate),n.lastModifiedDate=Nt(null==n?void 0:n.lastModifiedDate),n.pwdExpiryDate=Nt(null==n?void 0:n.pwdExpiryDate));let i=[...t];var m;i[e]&&(i[e]=n,i[e].isPrimaryOwner=(null===(m=z[e])||void 0===m?void 0:m.isPrimaryOwner)||!1),Y(i),null!==(s=i[e])&&void 0!==s&&s.mobileNumber&&null!==(c=i[e])&&void 0!==c&&c.name&&null!==(p=i[e])&&void 0!==p&&null!==(v=p.gender)&&void 0!==v&&v.code?b(!0):b(!1),u&&(b(!1),setownerRoleCheck(u),H({key:"true",error:!0,message:"BPA_OWNER_VALIDATION_"+(null==u?void 0:u.code)}))}});H({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED"})}())}catch(e){return Promise.reject(e)}}(t)}," ",l.createElement(o.SearchIcon,null)," "))),l.createElement(o.CardLabel,null,v("CORE_COMMON_NAME")+" *"),l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:v,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:e.name,onChange:e=>function(e,t){let l=[...z];l[e].name=t.target.value,L(t.target.value),Y(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e)},_={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:v("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,v("BPA_APPLICANT_GENDER_LABEL")+" *"),l.createElement(o.RadioOrSelect,{name:"gender",options:T,selectedOption:e.gender,optionKey:"i18nKey",onSelect:e=>function(e,t){let l=[...z];l[e].gender=t,x(t),Y(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e),t:v}),l.createElement(o.CardLabel,null,""+v("CORE_EMAIL_ID")),l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:v,type:"emailId",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:e.emailId,onChange:e=>function(e,t){let l=[...z];l[e].emailId=t.target.value,F(t.target.value),Y(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e)},_={pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"emailId",title:v("TL_EMAIL_ID_ERROR_MESSAGE")})),$&&l.createElement(o.CheckBox,{label:v("BPA_IS_PRIMARY_OWNER_LABEL"),onChange:e=>function(e,t){let l=[...z];l.map(e=>{e.isPrimaryOwner=!1}),l[e].isPrimaryOwner=!$||t.target.checked,O(t.target.checked),Y(l)}(t,e),value:e.isPrimaryOwner,checked:e.isPrimaryOwner,style:{paddingTop:"10px"}})))),$?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>function(){const e=[...z];e.push({name:"",gender:"",mobileNumber:null,isPrimaryOwner:!1}),Y(e),b(!0)}()},v("BPA_ADD_OWNER")))):null)),U&&l.createElement(o.Toast,{error:null==U?void 0:U.error,warning:null==U?void 0:U.warning,label:v(null==U?void 0:U.message),isDleteBtn:!0,onClose:()=>{H(null)}}))},DocumentDetails:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const s=Digit.ULBService.getStateId(),[c,p]=t.useState((null==d||null===(n=d.documents)||void 0===n?void 0:n.documents)||[]),[v,m]=t.useState(null),[E,f]=t.useState(!0),[_,g]=t.useState(!1),A=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,S=ct((null==d?void 0:d.PrevStateDocuments)||[]),{data:h,isLoading:b}=Digit.Hooks.obps.useBPATaxDocuments(s,d,S||[]);return t.useEffect(()=>{const e=h.filter(e=>e.required).map(e=>e.code),t=e.filter(e=>c.reduce((t,l)=>{var n,i,o,a;return e==`${null==l||null===(n=l.documentType)||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i[0]}.${null==l||null===(o=l.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1]}`||t},!1));f(!(t.length==e.length&&c.length>0))},[c,_]),l.createElement("div",null,l.createElement(Hl,{currentStep:"OCBPA"===A?3:2,flow:"OCBPA"===A?"OCBPA":""}),b?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e,t=d.documents,l=[];h&&h.map(e=>{c&&c.filter(t=>e.code===vt(null==t?void 0:t.additionalDetails.category,"_",".")).map(e=>{l.push(e)})}),e={...t,documents:l},u(r.key,e)},onSkip:()=>u(),isDisabled:!window.location.href.includes("editApplication")&&!window.location.href.includes("sendbacktocitizen")&&E,onAdd:function(){}},null==h?void 0:h.map((e,t)=>l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},l.createElement(jl,{key:t,document:e,t:a,error:v,setError:m,setDocuments:p,documents:c,setCheckRequiredFields:g,formData:d,beforeUploadDocuments:S||[]}))),v&&l.createElement(o.Toast,{label:v,onClose:()=>m(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!=d&&d.applicationNo?l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:`${a("BPA_APPLICATION_NUMBER_LABEL")} ${null==d?void 0:d.applicationNo} ${a("BPA_DOCS_INFORMATION")}`,className:"info-banner-wrap-citizen-override"}):"")},NOCDetails:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;Digit.ULBService.getCurrentTenantId();const s=Digit.ULBService.getStateId(),[c,p]=t.useState((null==d||null===(n=d.nocDocuments)||void 0===n?void 0:n.nocDocuments)||[]),[v,m]=t.useState(null),[E,f]=t.useState([]),[_,g]=t.useState(!0),[A,S]=t.useState(!1);let[h,b]=t.useState(null!=d&&d.PrevStateNocDocuments?ct(null==d?void 0:d.PrevStateNocDocuments):[]);const y=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,[C,T]=t.useState(null==d?void 0:d.applicationNo),[D,P]=t.useState([]),[N,I]=t.useState([]),[L,B]=t.useState([]),{data:O}=Digit.Hooks.obps.useNocDetails(null==d?void 0:d.tenantId,{sourceRefId:C}),{isLoading:R,data:x}=Digit.Hooks.obps.useMDMS(s,"NOC",["DocumentTypeMapping"]),{data:w}=Digit.Hooks.obps.useMDMS(s,"common-masters",["DocumentType"]),{data:M,isLoading:k}=Digit.Hooks.useDocumentSearch(h,{enabled:(null==h?void 0:h.length)>0});return t.useEffect(()=>{var e,t;(null==M||null===(e=M.pdfFiles)||void 0===e?void 0:e.length)>0&&(null==M||null===(t=M.pdfFiles)||void 0===t||t.forEach(e=>e.title=null==e?void 0:e.documentType),b(null==M?void 0:M.pdfFiles))},[null==M?void 0:M.pdfFiles]),t.useEffect(()=>{P(O)},[O]),t.useEffect(()=>{var e;I(null==x||null===(e=x.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[x]),t.useEffect(()=>{var e;B(null==w||null===(e=w["common-masters"])||void 0===e?void 0:e.DocumentType)},[w]),t.useEffect(()=>{if(null!=D&&D.length&&null!=N&&N.length){let e=[];D.map(t=>{var l,n;const i=N.filter(e=>e.applicationType===t.applicationType&&e.nocType===t.nocType);null!=i&&null!==(l=i[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let l=e.documentType;e.dropdownData=[],e.uploadedDocuments=[],L&&L.forEach(t=>{let n=t.code.slice(0,l.length);l===n&&(e.hasDropdown=!0,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],h.map(t=>{var n,i;l===`${null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0]}.${null==t||null===(i=t.documentType)||void 0===i?void 0:i.split(".")[1]}`&&e.uploadedDocuments[0].values.push(t)}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),f(t)}},[D,N,L,h]),l.createElement("div",null,l.createElement(Hl,{currentStep:3,flow:"OCBPA"===y?"OCBPA":""}),R?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e;e={...d.nocDocuments,nocDocuments:c,NocDetails:D,nocTaxDocuments:E},u(r.key,e)},onSkip:()=>{let e;e={...d.nocDocuments,nocDocuments:c,NocDetails:D,nocTaxDocuments:E},u(r.key,e)},onAdd:function(){}},null==E?void 0:E.map((e,t)=>l.createElement(zl,{key:t,document:e,t:a,error:v,setError:m,setNocDocuments:p,nocDocuments:c,setCheckRequiredFields:S,formData:d,beforeUploadNocDocuments:h,pdfLoading:k})),v&&l.createElement(o.Toast,{label:v,onClose:()=>m(null),error:!0})))},NOCNumber:e=>{let{t:n,config:i,onSelect:a,formData:r}=e;const[u,d]=t.useState(null),s=Digit.ULBService.getCurrentTenantId();function c(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}function p(e){let t={};return e.map((e,l)=>{t["Block_"+e.floorNo]=e.id}),t}return l.createElement("div",null,l.createElement(Hl,{currentStep:3}),l.createElement(o.FormStep,{t:n,config:i,onSelect:()=>{let e,t=r.owners;if(e={...t},null!=r&&r.id)a(i.key,e);else{var l,n,o,d,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W,j,$,z,Y,G,K,V,q,X;let i=null==r||null===(l=r.owners)||void 0===l?void 0:l.ownershipCategory,J=[];null===(n=e)||void 0===n||null===(o=n.owners)||void 0===o||o.map(e=>{J.push({...e,active:!0,name:e.name,emailId:e.emailId,mobileNumber:e.mobileNumber,isPrimaryOwner:e.isPrimaryOwner,gender:e.gender.code,fatherOrHusbandName:"NAME"})});let Z={};Z.edcrNumber=null!=r&&null!==(d=r.edcrNumber)&&void 0!==d&&d.edcrNumber?null==r||null===(v=r.edcrNumber)||void 0===v?void 0:v.edcrNumber:null==r||null===(m=r.data)||void 0===m||null===(E=m.scrutinyNumber)||void 0===E?void 0:E.edcrNumber,Z.riskType=null==r||null===(f=r.data)||void 0===f?void 0:f.riskType,Z.applicationType=null==r||null===(_=r.data)||void 0===_?void 0:_.applicationType,Z.serviceType=null==r||null===(g=r.data)||void 0===g?void 0:g.serviceType;const Q=Digit.UserService.getUser(),ee=null==Q||null===(A=Q.info)||void 0===A?void 0:A.uuid;Z.tenantId=null==r||null===(S=r.address)||void 0===S||null===(h=S.city)||void 0===h?void 0:h.code,Z.workflow={action:"INITIATE",assignes:[null==Q||null===(b=Q.info)||void 0===b?void 0:b.uuid]},Z.accountId=ee,Z.documents=null,Z.additionalDetails={GISPlaceName:null==r||null===(y=r.address)||void 0===y?void 0:y.placeName},Z.additionalDetails.boundaryWallLength=(null==r||null===(C=r.data)||void 0===C?void 0:C.boundaryWallLength)||"NA",Z.additionalDetails.area=(null==r?void 0:r.data.edcrDetails.planDetail.planInformation.plotArea).toString()||"NA",Z.additionalDetails.height=(null==r?void 0:r.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString()||"NA",Z.additionalDetails.usage=(null==r?void 0:r.data.occupancyType)||"NA",Z.additionalDetails.builtUpArea=(null==r?void 0:r.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(),Z.additionalDetails.nocNumber=u,null!=r&&null!==(T=r.data)&&void 0!==T&&T.holdingNumber&&(Z.additionalDetails.holdingNo=null==r||null===(D=r.data)||void 0===D?void 0:D.holdingNumber),null!=r&&null!==(P=r.data)&&void 0!==P&&P.registrationDetails&&(Z.additionalDetails.registrationDetails=null==r||null===(N=r.data)||void 0===N?void 0:N.registrationDetails),null!=r&&null!==(I=r.data)&&void 0!==I&&I.applicationType&&(Z.additionalDetails.applicationType=null==r||null===(L=r.data)||void 0===L?void 0:L.applicationType),null!=r&&null!==(B=r.data)&&void 0!==B&&B.serviceType&&(Z.additionalDetails.serviceType=null==r||null===(O=r.data)||void 0===O?void 0:O.serviceType),Z.landInfo={},Z.landInfo.address={},null!=r&&null!==(R=r.address)&&void 0!==R&&null!==(x=R.city)&&void 0!==x&&x.code&&(Z.landInfo.address.city=null==r||null===(w=r.address)||void 0===w||null===(M=w.city)||void 0===M?void 0:M.code),null!=r&&null!==(k=r.address)&&void 0!==k&&null!==(F=k.locality)&&void 0!==F&&F.code&&(Z.landInfo.address.locality={code:null==r||null===(U=r.address)||void 0===U||null===(H=U.locality)||void 0===H?void 0:H.code}),null!=r&&null!==(W=r.address)&&void 0!==W&&W.pincode&&(Z.landInfo.address.pincode=null==r||null===(j=r.address)||void 0===j?void 0:j.pincode),null!=r&&null!==($=r.address)&&void 0!==$&&$.landmark&&(Z.landInfo.address.landmark=null==r||null===(z=r.address)||void 0===z?void 0:z.landmark),null!=r&&null!==(Y=r.address)&&void 0!==Y&&Y.street&&(Z.landInfo.address.street=null==r||null===(G=r.address)||void 0===G?void 0:G.street),null!=r&&null!==(K=r.address)&&void 0!==K&&K.geoLocation&&(Z.landInfo.address.geoLocation=null==r||null===(V=r.address)||void 0===V?void 0:V.geoLocation),Z.landInfo.owners=J,Z.landInfo.ownershipCategory=i.code,Z.landInfo.tenantId=null==r||null===(q=r.address)||void 0===q||null===(X=q.city)||void 0===X?void 0:X.code,Z.landInfo.unit=function(e){var t,l,n;const i=null==e?void 0:e.subOccupancy,o=(null==e||null===(t=e.data)||void 0===t||null===(l=t.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n?void 0:n.blocks)||[];let a=[];return i&&Object.entries(i).map((e,t)=>{var l,n,i,r,u,d;a.push({blockIndex:t,floorNo:e[0].split("_")[1],unitType:"Block",occupancyType:(null==o||null===(l=o[t])||void 0===l||null===(n=l.building)||void 0===n||null===(i=n.occupancies)||void 0===i||null===(r=i[0])||void 0===r||null===(u=r.typeHelper)||void 0===u||null===(d=u.type)||void 0===d?void 0:d.code)||"A",usageCategory:c(e[1])})}),a}(r);let te=sessionStorage.getItem("BPA_ARCHITECT_NAME"),le=te?JSON.parse(te):"ARCHITECT";Z.additionalDetails.typeOfArchitect=le;let ne=sessionStorage.getItem("isSelfCertificationRequired");"undefined"===ne&&(ne="false"),Z.additionalDetails.isSelfCertificationRequired=ne.toString(),!0!==ne||"Residential"!==(null==r?void 0:r.data.occupancyType)||"ARCHITECT"!=le&&"ENGINEER"!=le&&"DESIGNER"!=le&&"SUPERVISOR"!=le?Digit.OBPSService.create({BPA:Z},s).then((e,l)=>{var n,o,u,d,s,c,v,m,E,f,_,g;(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&(null==e||null===(o=e.BPA)||void 0===o||null===(u=o[0])||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.owners)||void 0===s||s.forEach(e=>{e.gender={code:e.gender,active:!0,i18nKey:"COMMON_GENDER_"+e.gender}}),e.BPA[0].owners={...t,owners:null==e||null===(c=e.BPA)||void 0===c||null===(v=c[0])||void 0===v||null===(m=v.landInfo)||void 0===m?void 0:m.owners,ownershipCategory:i},e.BPA[0].address=null==e||null===(E=e.BPA)||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.landInfo)||void 0===_?void 0:_.address,e.BPA[0].address.city=r.address.city,e.BPA[0].address.locality=r.address.locality,e.BPA[0].placeName=null==r||null===(g=r.address)||void 0===g?void 0:g.placeName,e.BPA[0].data=r.data,e.BPA[0].BlockIds=p(e.BPA[0].landInfo.unit),e.BPA[0].subOccupancy=null==r?void 0:r.subOccupancy,e.BPA[0].uiFlow=null==r?void 0:r.uiFlow,a("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;setShowToast({key:"true",error:!0,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?void 0:n.message})}):(null==r?void 0:r.data.edcrDetails.planDetail.blocks[0].building.buildingHeight)>15?alert("Height should not be more than 15 metres"):("ARCHITECT"==le||"ENGINEER"==le)&&(null==r?void 0:r.data.edcrDetails.planDetail.planInformation.plotArea)>500?alert("Architect/Engineer can apply for area less then 500 sq. yards. in self declaration"):("DESIGNER"==le||"SUPERVISOR"==le)&&(null==r?void 0:r.data.edcrDetails.planDetail.planInformation.plotArea)>250?alert("Designer/Supervisor can apply for area less then 500 sq. yards. in self declaration"):Digit.OBPSService.create({BPA:Z},s).then((e,l)=>{var n,o,u,d,s,c,v,m,E,f,_,g;(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&(null==e||null===(o=e.BPA)||void 0===o||null===(u=o[0])||void 0===u||null===(d=u.landInfo)||void 0===d||null===(s=d.owners)||void 0===s||s.forEach(e=>{e.gender={code:e.gender,active:!0,i18nKey:"COMMON_GENDER_"+e.gender}}),e.BPA[0].owners={...t,owners:null==e||null===(c=e.BPA)||void 0===c||null===(v=c[0])||void 0===v||null===(m=v.landInfo)||void 0===m?void 0:m.owners,ownershipCategory:i},e.BPA[0].address=null==e||null===(E=e.BPA)||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.landInfo)||void 0===_?void 0:_.address,e.BPA[0].address.city=r.address.city,e.BPA[0].address.locality=r.address.locality,e.BPA[0].placeName=null==r||null===(g=r.address)||void 0===g?void 0:g.placeName,e.BPA[0].data=r.data,e.BPA[0].BlockIds=p(e.BPA[0].landInfo.unit),e.BPA[0].subOccupancy=null==r?void 0:r.subOccupancy,e.BPA[0].uiFlow=null==r?void 0:r.uiFlow,a("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;setShowToast({key:"true",error:!0,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?void 0:n.message})})}},isDisabled:!u,onChange:function(e){d(e.target.value)}},l.createElement("span",{onClick:function(){console.log("inside_search")},style:{alignSelf:"flex-start",marginBottom:"5px",backgroundColor:"maroon",border:"1px solid marron",color:"white",padding:"5px 10px",borderRadius:"3px",cursor:"pointer"}},"SEARCH NOC")))},LocationDetails:e=>{var n,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x;let{t:w,config:M,onSelect:k,userType:F,formData:U,ownerIndex:H=0}=e,W=JSON.parse(sessionStorage.getItem("Digit_OBPS_PT")),j=JSON.parse(sessionStorage.getItem("currentCity"))||{},$=sessionStorage.getItem("currentPincode");JSON.parse(sessionStorage.getItem("currentLocality"));const z=Digit.Hooks.obps.useTenants(),Y=(i.useLocation(),Digit.ULBService.getCurrentTenantId()),[G,K]=(Digit.ULBService.getStateId(),t.useState(null)),[V,q]=t.useState(!1),[X,J]=t.useState($||(null===(n=U)||void 0===n||null===(a=n.address)||void 0===a?void 0:a.pincode)||(null==W||null===(r=W.address)||void 0===r?void 0:r.pincode)||""),[Z,Q]=t.useState((null===(u=U)||void 0===u||null===(d=u.address)||void 0===d?void 0:d.geoLocation)||""),[ee,te]=t.useState(null===(s=U)||void 0===s||null===(c=s.Scrutiny)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.tenantIdData),[le,ne]=t.useState(()=>{var e,t,l;return(null===(e=U)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.city)||j||(null==W||null===(l=W.address)||void 0===l?void 0:l.pincode)||null}),[ie,oe]=t.useState((null===(v=U)||void 0===v||null===(m=v.address)||void 0===m?void 0:m.street)||(null==W||null===(E=W.address)||void 0===E?void 0:E.street)||""),[ae,re]=t.useState((null===(f=U)||void 0===f||null===(_=f.address)||void 0===_?void 0:_.landmark)||(null===(g=U)||void 0===g||null===(A=g.address)||void 0===A?void 0:A.Landmark)||(null==W||null===(S=W.address)||void 0===S?void 0:S.landmark)||""),[ue,de]=t.useState((null===(h=U)||void 0===h||null===(b=h.address)||void 0===b?void 0:b.placeName)||(null===(y=U)||void 0===y?void 0:y.placeName)||""),[se,ce]=t.useState(),[pe,ve]=t.useState((null==W||null===(C=W.address)||void 0===C?void 0:C.locality)||(null===(T=U)||void 0===T||null===(D=T.address)||void 0===D?void 0:D.locality)||null);let[me,Ee]=t.useState(z),fe=null===(P=U)||void 0===P||null===(N=P.data)||void 0===N||null===(I=N.edcrDetails)||void 0===I?void 0:I.tenantId;U={address:{...null===(L=U)||void 0===L?void 0:L.address}};const _e=window.Digit.Utils.browser.isMobile();t.useEffect(()=>{var e;if(!le||!se)if(me=F&&"employee"===F?z.filter(e=>e.code===Y):X?z.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==Number(X))}):z,Ee(me),0==(null===(e=me)||void 0===e?void 0:e.length))K("BPA_PIN_NOT_VALID_ERROR");else if(1==me.length){var t;(null===(t=me)||void 0===t?void 0:t[0].code)!=(null!=le&&le.code?null==le?void 0:le.code:le||"")&&K("BPA_PIN_NOT_VALID_ERROR")}},[X]),t.useEffect(()=>{me.map((e,t)=>{e.code===fe&&(ne(e),sessionStorage.setItem("currentCity",JSON.stringify(e)))})},[me,null===(B=U)||void 0===B?void 0:B.data]),t.useEffect(()=>{var e;me&&1===me.length&&(null===(e=me)||void 0===e?void 0:e[0].code)===(null==le?void 0:le.code)&&(ne(me[0]),sessionStorage.setItem("currentCity",JSON.stringify(me[0])))},[me]);const{data:ge}=Digit.Hooks.useBoundaryLocalities(null==le?void 0:le.code,"revenue",{enabled:!!le},w);let Ae=window.location.href.includes("editApplication"),Se=window.location.href.includes("sendbacktocitizen");function he(e){K(null),""!==("object"==typeof e&&null!==e?e.target.value:e)&&(("object"==typeof e&&null!==e?e.target.value:e).match(/^[1-9][0-9]{5}$/)||K("BPA_PIN_NOT_VALID_ERROR")),U.address.pincode="object"==typeof e&&null!==e?e.target.value:e,J("object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentPincode","object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),ve(null),ce(null)}return t.useEffect(()=>{var e,t;if(null!=W&&null!==(e=W.address)&&void 0!==e&&e.locality)ve(null==W||null===(t=W.address)||void 0===t?void 0:t.locality);else if(le&&ge&&!G){var l,n,i,o,a,r,u,d;let e=ge,t=[];var s,c;console.log("fetchedLocalities",ge),null!==(l=U)&&void 0!==l&&null!==(n=l.address)&&void 0!==n&&n.locality&&(null===(i=U)||void 0===i||null===(o=i.address)||void 0===o||null===(a=o.locality)||void 0===a?void 0:a.code)===(null==pe?void 0:pe.code)&&ve(U.address.locality),(null!==(r=U)&&void 0!==r&&null!==(u=r.address)&&void 0!==u&&u.pincode||X)&&!G&&(t=e.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==X)}),(null===(s=U)||void 0===s||null===(c=s.address)||void 0===c||!c.locality)&&t.length<=0&&ve()),(!se||t.length>0&&se.length!==t.length||t.length<=0&&se&&se.length!==e.length)&&(console.log("filteredLocalityList",t),ce(()=>t.length>0?t:e)),1===t.length&&(null==pe||pe&&(null===(d=t[0])||void 0===d?void 0:d.code)!==(null==pe?void 0:pe.code))&&(ve(t[0]),sessionStorage.setItem("currLocality",JSON.stringify(t[0])))}},[le,null===(O=U)||void 0===O?void 0:O.pincode,ge,X,Z]),l.createElement("div",null,!V&&l.createElement(Hl,null),V&&l.createElement(Yl,{t:w,onSelect:k,formData:U,handleRemove:()=>{q(!V)},onSave:function(e,t,l){he(t),sessionStorage.setItem("currentPincode",t),Q(e),de(l),q(!1),K(null)}}),!V&&l.createElement(o.FormStep,{t:w,config:M,onSelect:()=>{const e={};e.pincode=X,e.city=le,e.locality=pe,e.street=ie,e.landmark=ae,e.geoLocation=Z,e.placeName=ue,k(M.key,e)},isDisabled:!le||!pe||G,isMultipleAllow:!0,forcedError:w(G)},l.createElement(o.CardLabel,null,""+w("BPA_GIS_LABEL")),l.createElement("div",{style:{}},l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:w,name:"gis",value:Ae||Se?null!==Z.latitude?`${Z.latitude}, ${Z.longitude}`:"":ue,onChange:function(e){U.address.geoLocation="object"==typeof e&&null!==e?e.target.value:e,Q("object"==typeof e&&null!==e?e.target.value:e),de("object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentPincode",""),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),J(""),ve(null)}}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:_e?{float:"right",position:"relative",bottom:"35px",marginTop:"-20px",marginRight:"5px"}:{position:"relative",left:"515px",bottom:"35px",marginTop:"-20px"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 7C8.79 7 7 8.79 7 11C7 13.21 8.79 15 11 15C13.21 15 15 13.21 15 11C15 8.79 13.21 7 11 7ZM19.94 10C19.48 5.83 16.17 2.52 12 2.06V0H10V2.06C5.83 2.52 2.52 5.83 2.06 10H0V12H2.06C2.52 16.17 5.83 19.48 10 19.94V22H12V19.94C16.17 19.48 19.48 16.17 19.94 12H22V10H19.94ZM11 18C7.13 18 4 14.87 4 11C4 7.13 7.13 4 11 4C14.87 4 18 7.13 18 11C18 14.87 14.87 18 11 18Z",fill:"#505A5F"})))),style:{},onClick:e=>{q(!V)}})),l.createElement(o.CardLabel,null,""+w("BPA_DETAILS_PIN_LABEL")),!V&&l.createElement(o.TextInput,{isMandatory:!1,optionKey:"i18nKey",type:"text",t:w,name:"pincode",onChange:he,value:X,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,w("BPA_CITY_LABEL")+"*"),!V&&l.createElement(o.RadioOrSelect,{options:me.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:le,optionKey:"code",onSelect:function(e){ve(null),ce(null),ne(e),sessionStorage.setItem("currentCity",JSON.stringify(e)),U.address.city=e},t:w,isDependent:!0,disabled:!(null==W||!W.address)}),l.createElement("span",{className:"form-pt-dropdown-only"},l.createElement(o.CardLabel,null,w("BPA_LOC_MOHALLA_LABEL")+"*"),V||!le||!se||null!=W&&W.address?l.createElement(o.TextInput,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:M.isMandatory,value:null==W||null===(R=W.address)||void 0===R||null===(x=R.locality)||void 0===x?void 0:x.name,optionKey:"i18nkey",t:w,isDependent:!0,labelKey:vt(null==le?void 0:le.code,".","_").toUpperCase()+"_REVENUE",disabled:!(null==W||!W.address)}):l.createElement(o.RadioOrSelect,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:M.isMandatory,options:se.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:pe,optionKey:"i18nkey",onSelect:function(e){var t,l;null!==(t=U)&&void 0!==t&&null!==(l=t.address)&&void 0!==l&&l.locality&&(U.address.locality=e),ve(e),sessionStorage.setItem("currLocality",JSON.stringify(e))},t:w,isDependent:!0,labelKey:vt(null==le?void 0:le.code,".","_").toUpperCase()+"_REVENUE"})),l.createElement(o.CardLabel,null,""+w("BPA_DETAILS_SRT_NAME_LABEL")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:w,name:"street",onChange:function(e){oe(e.target.value)},value:ie,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,""+w("ES_NEW_APPLICATION_LOCATION_LANDMARK")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:w,name:"landmark",onChange:function(e){re(e.target.value)},value:ae,disabled:!(null==W||!W.address)})))},GIS:Yl,OCEDCRDocsRequired:e=>{let{onSelect:i}=e;const{t:a}=n.useTranslation(),r=[{code:"BPA_PERMIT_NUMBER_OC_SCRUTINY_LABEL"},{code:"BPA_PERMIT_DATE_LABEL"},{code:"BPA_OC_PLAN_DXF_FILE"}];return l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,a("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},a("OBPS_OCEDCR_BUILDING_PERMIT_DESCRIPTION")),l.createElement(t.Fragment,null,null==r?void 0:r.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:700},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+a(null==e?void 0:e.code.replace(".","_"))))))),l.createElement(o.SubmitBar,{label:a("CS_COMMON_NEXT"),onSubmit:()=>{i()}})),l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:a("OBPS_OC_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},OCeDCRScrutiny:e=>{var n,i,a,r,d,s,c;let{t:p,config:v,onSelect:m,formData:E,ownerIndex:f=0}=e;const _=Digit.ULBService.getCurrentTenantId(),[g,A]=(Digit.ULBService.getStateId(),t.useState(null==E||null===(n=E.ScrutinyDetails)||void 0===n?void 0:n.ocPermitNumber)),[S,h]=t.useState(null==E||null===(i=E.ScrutinyDetails)||void 0===i?void 0:i.ocPermitdate),[b,y]=t.useState(null==E?void 0:E.ScrutinyDetails),[C,T]=t.useState(null);let D={};function P(){}const N=()=>{},I=()=>{const e={};e.file=file,m(v.key,e)};return l.createElement("div",null,l.createElement(o.FormStep,{t:p,config:v,onSelect:I,onSkip:N,isDisabled:!g,onAdd:P,isMultipleAllow:!0},l.createElement(o.CardCaption,null,""+p("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardHeader,null,""+p("BPA_OC_EDCR_SCRUTINY_LABEL")),l.createElement(o.CardText,null,""+p("BPA_PROVIDE_BPN_AND_BPD_APP_LABEL")),l.createElement(o.CardLabel,null,p("EDCR_BUILDING_PERMIT_NUM_LABEL")+" *"),l.createElement(o.TextInput,u({isMandatory:!1,optionKey:"i18nKey",t:p,name:"permitNumber",onChange:function(e){A(e.target.value)},value:g},D={isRequired:!0,pattern:pt("Name"),title:p("BPA_INVALID_NAME")})),l.createElement(o.CardLabel,null,p("EDCR_BUILDING_PERMIT_DATE_LABEL")+" *"),l.createElement(o.DatePicker,{date:S,name:"permitDate",onChange:function(e){h(e)}}),l.createElement("div",{onClick:function(){try{y({}),T(null);let e={permitDate:Ct(S),approvalNo:g};return Digit.OBPSService.BPASearch(_,e).then((e,t)=>{var l,n;if((null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0){var i,o,a,r,u,d;const t=null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber,l=null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId;S===(e=>{if(e){const t=new Date(e);let l=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,`${i}-${l}-${n}`}return null})(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.approvalDate)?Digit.OBPSService.scrutinyDetails(l,{edcrNumber:t}).then(t=>{var n,i;Digit.WorkflowService.getAllApplication(l,{businessIds:null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.applicationNo,history:!0}).then((l,n)=>{var i,o,a,r,u;const d=null==l||null===(i=l.ProcessInstances)||void 0===i?void 0:i[(null==l||null===(o=l.ProcessInstances)||void 0===o?void 0:o.length)-1],s=(null==d||null===(a=d.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name)||"";if((null==t||null===(u=t.edcrDetail)||void 0===u?void 0:u.length)>0){var c,p,v,m,E,f;const l=null==e||null===(c=e.BPA)||void 0===c||null===(p=c[0])||void 0===p||null===(v=p.landInfo)||void 0===v||null===(m=v.owners)||void 0===m?void 0:m.filter(e=>e.isPrimaryOwner&&"false"!=e.isPrimaryOwner);t.edcrDetail[0].applicantName=null==l||null===(E=l[0])||void 0===E?void 0:E.name,t.edcrDetail[0].ocPermitNumber=g,t.edcrDetail[0].ocPermitdate=S,t.edcrDetail[0].appliedBy=s,y(null==t||null===(f=t.edcrDetail)||void 0===f?void 0:f[0])}}).catch(e=>{var t,l,n;T({key:"error",error:!0,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?void 0:n.message)||null})})}).catch(e=>{var t,l,n;T({key:"error",error:!0,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?void 0:n.message)||null})}):T({key:"error",warning:!0,message:p("ERR_FILL_EDCR_PERMIT_INCORRECT_DATE")})}else 0==(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)&&T({key:"error",error:!0,message:p("BPA_NO_REC_FOUND_LABEL")})}).catch(e=>{var t,l,n;T({key:"error",error:!0,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?void 0:n.message)||null})}),Promise.resolve()}catch(e){return Promise.reject(e)}}},l.createElement(o.SubmitBar,{label:p("ACTION_TEST_BPA_STAKE_HOLDER_SEARCH"),disabled:!g||!S})),C&&l.createElement(o.Toast,{error:null==C?void 0:C.error,warning:null==C?void 0:C.warning,label:p(null==C?void 0:C.message),isDleteBtn:!0,onClose:()=>{T(null)}})),null!=b&&b.edcrNumber?l.createElement(o.FormStep,{t:p,config:v,onSelect:I,onSkip:N,isDisabled:!g,onAdd:P,isMultipleAllow:!0},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+p("REPORT_FSM_RESULT_APPLICANTNAME"),text:p(null==b?void 0:b.applicantName),className:"border-none"}),l.createElement(o.Row,{label:""+p("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:p(null==b?void 0:b.applicationSubType),className:"border-none"}),l.createElement(o.Row,{label:""+p("EDCR_TOTAL_BUILD_UP_AREA_LABEL"),text:p(null==b||null===(a=b.planDetail)||void 0===a||null===(r=a.virtualBuilding)||void 0===r?void 0:r.totalBuitUpArea),className:"border-none"}),l.createElement(o.Row,{label:""+p("EDCR_BUILDING_HEIGHT_LABEL"),text:p(null==b||null===(d=b.planDetail)||void 0===d||null===(s=d.blocks[0])||void 0===s||null===(c=s.building)||void 0===c?void 0:c.buildingHeight),className:"border-none"}),l.createElement(o.Row,{label:""+p("BPA_ARCHITECT_NAME_LABEL"),text:p(null==b?void 0:b.appliedBy),className:"border-none"})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+p("BPA_PERMIT_EDCR_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+p("BPA_EDCR_NO_LABEL"),text:p(null==b?void 0:b.edcrNumber),className:"border-none"})),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+p("BPA_UPLOADED_PLAN_DIAGRAM_LABEL")),l.createElement("a",{target:"_",href:null==b?void 0:b.updatedDxfFile,style:{minWidth:"160px",marginRight:"20px"},key:null==b?void 0:b.updatedDxfFile},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},p("BPA_UPLOADED_PLAN_DXF"))),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+p("BPA_SCRUTINY_REPORT_OUTPUT_LABEL")),l.createElement("a",{target:"_",href:null==b?void 0:b.planReport,style:{minWidth:"160px",marginRight:"20px"},key:null==b?void 0:b.planReport},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},p("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("div",{onClick:()=>{m(v.key,b)}},l.createElement(o.SubmitBar,{label:p("BPA_PROCEED_OC_SCRUTINY_LABEL")}))):null)},OCUploadPlanDiagram:e=>{var n;let{t:a,config:r,onSelect:u,formData:d,ownerIndex:s=0,isShowToast:c,isSubmitBtnDisable:p,setIsShowToast:v}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const[m,E]=t.useState(()=>{var e;return(null==d||null===(e=d.uploadData)||void 0===e?void 0:e.file)||null}),[f,_]=t.useState(null==d||null===(n=d.uploadData)||void 0===n?void 0:n.file),[g,A]=t.useState(""),S=i.useHistory();return t.useEffect(()=>{(g||c)&&(E(null),_(""),A("")),c&&S.push("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null!=c&&c.label?null==c?void 0:c.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[g,c,p]),p?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{const e={};e.file=f,u(r.key,e,!0,!0)},onSkip:()=>{},isDisabled:!f||p,onAdd:function(){},isMultipleAllow:!0},l.createElement(o.CardLabel,null,a("BPA_OC_PLAN_DIAGRAM_DXF")+" *"),l.createElement(o.UploadFile,{id:"oc-doc",extraStyleName:"propertyCreate",onUpload:function(e){E(e.target.files[0]),_(e.target.files[0])},onDelete:()=>{E(null),_("")},message:m?"1 "+a("PT_ACTION_FILEUPLOADED"):a("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:g}),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),c&&l.createElement(o.Toast,{error:c.key,label:a(c.label),onClose:()=>v(null),isDleteBtn:!0}))},StakeholderDocsRequired:e=>{var a,r,u,d;let{onSelect:s}=e;const{t:c}=n.useTranslation(),p=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:m,isLoading:E}=(i.useHistory(),Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping"));let f=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),t.useEffect(()=>{p&&Digit.LocalizationService.getLocale({modules:["rainmaker-bpareg"],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+p})},[p]),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:f?"OpenlinkContainer":""},l.createElement(o.Card,null,l.createElement(o.CardHeader,null,c("BPA_NEW_BUILDING_HEADER")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},c("BPA_NEW_BUILDING_PERMIT_DESCRIPTION")),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==m||null===(a=m.StakeholderRegistraition)||void 0===a||null===(r=a.TradeTypetoRoleMapping)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.docTypes)||void 0===d?void 0:d.map((e,t)=>l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}},t+1+"."," "),l.createElement("div",null," "+c("BPAREG_HEADER_"+(null==e?void 0:e.code.replace(".","_")))))),l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}}),null!=e&&e.info?l.createElement("div",{style:{color:"#505A5F",fontSize:"16px"}},""+c(null==e?void 0:e.info.replace(".","_"))):null))))),l.createElement(o.SubmitBar,{label:c("CS_COMMON_NEXT"),onSubmit:s})),l.createElement(o.CitizenInfoLabel,{info:c("CS_FILE_APPLICATION_INFO_LABEL"),text:c("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"})))},LicenseType:e=>{var n,i,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h;let{t:b,config:y,onSelect:C,formData:T}=e;null!==JSON.parse(sessionStorage.getItem("BPAREGintermediateValue"))?(T=JSON.parse(sessionStorage.getItem("BPAREGintermediateValue")),sessionStorage.setItem("BPAREGintermediateValue",null)):T=T,null===(n=window.location.href)||void 0===n||n.split("/").pop(),Digit.ULBService.getCurrentTenantId();const D=Digit.ULBService.getStateId(),[P,N]=t.useState(null),[I,L]=t.useState((null===(i=T)||void 0===i||null===(a=i.LicneseType)||void 0===a?void 0:a.LicenseType)||(null===(r=T)||void 0===r||null===(u=r.formData)||void 0===u||null===(d=u.LicneseType)||void 0===d?void 0:d.LicenseType)||""),[B,O]=t.useState((null===(s=T)||void 0===s||null===(c=s.LicneseType)||void 0===c?void 0:c.ArchitectNo)||(null===(p=T)||void 0===p||null===(v=p.formData)||void 0===v||null===(m=v.LicneseType)||void 0===m?void 0:m.ArchitectNo)||null),{data:R}=Digit.Hooks.obps.useQualificationTypes(D),{data:x}=Digit.Hooks.obps.useMDMS(D,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:w}=Digit.Hooks.useCustomMDMS(D,"StakeholderRegistraition",[{name:"TradeTypetoRoleMapping"}]),M=null==w||null===(E=w.StakeholderRegistraition)||void 0===E?void 0:E.TradeTypetoRoleMapping;let k=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[F,U]=t.useState((null===(f=T)||void 0===f?void 0:f.selfCertification)||(null===(_=T)||void 0===_||null===(g=_.formData)||void 0===g?void 0:g.selfCertification)||null);console.log("OBPS_Formdata",T);const[H,W]=t.useState("");function j(){let e=[];return null==M||M.forEach(t=>{if("true"===(null==t?void 0:t.isActive)){var l;console.log("item=====",t);const n="TRADELICENSE_TRADETYPE_"+(null==t||null===(l=t.tradeType)||void 0===l?void 0:l.split(".")[0]);e.some(e=>e.i18nKey===n)||e.push({role:t.role,i18nKey:n,tradeType:t.tradeType,code:null==t?void 0:t.code})}}),console.log("list",e),e}function $(e){let t=null;console.log("qualification",e),"B-Arch"==e.name?t=j().find(e=>e.i18nKey.includes("ARCHITECT")):"BE/B-Tech"==e.name?t=j().find(e=>e.i18nKey.includes("ENGINEER")):"Diploma in Civil Engineering/Architect"==e.name?t=j().find(e=>e.i18nKey.includes("SUPERVISOR")):"Town and Country Planning"==e.name&&(t=j().find(e=>e.i18nKey.includes("TOWNPLANNER"))),t&&L(t)}function z(e){const t=e.target.value.trim();O(t),/^CA(19[7-9][2-9]|20[0-9][0-9]|202[0-5])\d{5}$/.test(t)||""===t?W(""):W("Invalid Council Number format! Format should be: CA<YEAR><5 DIGITS> (Year between 1972-2025) Example: CA20230012345")}return k&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{P&&$(P)},[P]),console.log("qualificationTypeFinfing",P),t.useEffect(()=>{var e,t,l,n;if(console.log("selectedQualificationType 1",R,null===(e=T)||void 0===e||null===(t=e.LicneseType)||void 0===t?void 0:t.qualificationType,R),null!==(l=T)&&void 0!==l&&null!==(n=l.LicneseType)&&void 0!==n&&n.qualificationType&&R&&!P){var i,o;const e=R.find(e=>{var t,l;return e.name===(null===(t=T)||void 0===t||null===(l=t.LicneseType)||void 0===l?void 0:l.qualificationType)});N(e),console.log("selectedQualificationType",e,null===(i=T)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.qualificationType,R)}},[]),l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},l.createElement("div",{style:{flex:1,marginRight:"20px"}},l.createElement("div",{className:k?"OpenlinkContainer":""},k&&l.createElement(o.BackButton,{style:{border:"none"}},b("CS_COMMON_BACK")),l.createElement(Hl,{currentStep:1,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{t:b,config:y,onSelect:function(){var e,t,l,n;if(null!==(e=T)&&void 0!==e&&e.result&&null!==(t=T)&&void 0!==t&&null!==(l=t.result)&&void 0!==l&&null!==(n=l.Licenses[0])&&void 0!==n&&n.id){var i;let e=null===(i=T)||void 0===i?void 0:i.formData;e.LicneseType.LicenseType=I,e.LicneseType.ArchitectNo=B,e.LicneseType.selfCertification=F||!1,e.qualificationType=null==P?void 0:P.name,C("",T)}else C(y.key,{LicenseType:I,ArchitectNo:B,selfCertification:F,qualificationType:null==P?void 0:P.name})},onSkip:()=>C(),isDisabled:I&&null!=I&&I.i18nKey.includes("ARCHITECT")?!I||!B:!I},l.createElement(o.CardLabel,null,"Qualification*"),l.createElement("div",{className:"form-pt-dropdown-only"},l.createElement(o.Dropdown,{t:b,optionKey:"name",isMandatory:y.isMandatory,option:R||[],selected:P,select:e=>{!function(e){N(e),$(e),L(null),O(null)}(e)}})),l.createElement(o.CardLabel,null,b("BPA_LICENSE_TYPE"),"*"),l.createElement("div",{className:"form-pt-dropdown-only"},x&&l.createElement(o.Dropdown,{t:b,optionKey:"code",isMandatory:y.isMandatory,option:j()||{},selected:I,select:function(e){L(e)},disable:!0})),I&&(null==I?void 0:I.i18nKey.includes("ARCHITECT"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,b("BPA_COUNCIL_NUMBER")+"*"),l.createElement(o.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:B,onChange:z,onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),H&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},H)),I&&(null==I?void 0:I.i18nKey.includes("TOWNPLANNER"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,b("BPA_COUNCIL_NUMBER")+"*"),l.createElement(o.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:B,onChange:z,onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),H&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},H)),I&&((null==I?void 0:I.i18nKey.includes("ARCHITECT"))||(null==I?void 0:I.i18nKey.includes("_ENGINEER"))||(null==I?void 0:I.i18nKey.includes("SUPERVISOR")))&&l.createElement("div",null,l.createElement(o.CheckBox,{label:null!=I&&I.i18nKey.includes("ARCHITECT")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ARCHITECT)]":null!=I&&I.i18nKey.includes("_ENGINEER")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ENGINEER)]":null!=I&&I.i18nKey.includes("SUPERVISOR")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY DESIGNER)]":"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY SUPERVISOR)]",onChange:function(e){U(e.target.checked)},value:F,checked:F||!1,style:{marginBottom:"40px"}}))),l.createElement("div",{style:{flex:"0 0 30%",border:"1px solid #dcdcdc",backgroundColor:"#f9f9f9",borderRadius:"8px",padding:"20px",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",marginTop:"20px"}},l.createElement("h1",{style:{fontSize:"22px",fontWeight:"600",color:"#333",marginBottom:"10px",textAlign:"center",textTransform:"uppercase",letterSpacing:"1px"}},"Competencies"),l.createElement("ul",{style:{fontSize:"16px",color:"#555",lineHeight:"1.6",textAlign:"justify",margin:"0",paddingLeft:"20px"}},I&&(null===(A=fn[null==I||null===(h=I.i18nKey)||void 0===h?void 0:h.split("_").pop()])||void 0===A||null===(S=A.split("\n"))||void 0===S?void 0:S.map((e,t)=>l.createElement("li",{key:t,style:{marginBottom:"8px"}},e.trim()))))))))},LicenseDetails:e=>{var n,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O;let{t:R,config:x,onSelect:w,formData:M}=e;i.useLocation();const k=Digit.UserService.getUser();let F={};const U=Digit.ULBService.getCurrentTenantId();let H=window.location.href.includes("openlink");const W=null==k||null===(n=k.info)||void 0===n?void 0:n.uuid,{data:j,isLoading:$}=Digit.Hooks.useUserSearch(U,{uuid:[W]},{},{enabled:!!W}),[z,Y]=t.useState((H?"":null==k||null===(a=k.info)||void 0===a?void 0:a.name)||(null==M||null===(r=M.LicneseDetails)||void 0===r?void 0:r.name)||(null==M||null===(d=M.formData)||void 0===d||null===(s=d.LicneseDetails)||void 0===s?void 0:s.name)||""),[G,K]=t.useState(()=>{var e,t,l;const n=((null==M||null===(e=M.LicneseDetails)||void 0===e?void 0:e.name)||(null==M||null===(t=M.formData)||void 0===t||null===(l=t.LicneseDetails)||void 0===l?void 0:l.name)||"").trim().split(" ");return n.length>1?n[n.length-1]:""}),[V,q]=t.useState(""),[X,J]=t.useState(""),[Z,Q]=t.useState(""),[ee,te]=t.useState(!0),[le,ne]=t.useState((null==M||null===(c=M.LicneseDetails)||void 0===c?void 0:c.dateOfBirth)||""),[ie,oe]=t.useState((H?"":null==k||null===(p=k.info)||void 0===p?void 0:p.emailId)||(null==M||null===(v=M.LicneseDetails)||void 0===v?void 0:v.email)||(null==M||null===(m=M.formData)||void 0===m||null===(E=m.LicneseDetails)||void 0===E?void 0:E.email)||""),[ae,re]=t.useState((!H&&j?{i18nKey:"COMMON_GENDER_"+(null==j||null===(f=j.user)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.gender),code:null==j||null===(g=j.user)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.gender,value:null==j||null===(S=j.user)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.gender}:"")||(null==M||null===(b=M.LicneseDetails)||void 0===b?void 0:b.gender)||(null==M||null===(y=M.formData)||void 0===y||null===(C=y.LicneseDetails)||void 0===C?void 0:C.gender)),[ue,de]=t.useState((H?"":null==k||null===(T=k.info)||void 0===T?void 0:T.mobileNumber)||(null==M||null===(D=M.LicneseDetails)||void 0===D?void 0:D.mobileNumber)||(null==M||null===(P=M.formData)||void 0===P||null===(N=P.LicneseDetails)||void 0===N?void 0:N.mobileNumber)||""),[se,ce]=t.useState((null==M||null===(I=M.LicneseDetails)||void 0===I?void 0:I.PanNumber)||(null==M||null===(L=M.formData)||void 0===L||null===(B=L.LicneseDetails)||void 0===B?void 0:B.PanNumber)||"");t.useEffect(()=>{var e,t,l,n,i,o,a,r;null!=ae&&ae.code||null==j||null===(e=j.user)||void 0===e||null===(t=e[0])||void 0===t||!t.gender||H||re({i18nKey:"COMMON_GENDER_"+(null==j||null===(l=j.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.gender),code:null==j||null===(i=j.user)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.gender,value:null==j||null===(a=j.user)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.gender})},[j]);const pe=Digit.ULBService.getStateId();Digit.Utils.browser.isMobile(),H&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{isLoading:ve,data:me}=Digit.Hooks.obps.useMDMS(pe,"common-masters",["GenderType"]);let Ee=[];return me&&me["common-masters"].GenderType.filter(e=>e.active).map(e=>{Ee.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),$?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:H?"OpenlinkContainer":""},H&&l.createElement(o.BackButton,{style:{border:"none"}},R("CS_COMMON_BACK")),l.createElement(Hl,{currentStep:1,flow:"STAKEHOLDER"}),ve&&$?l.createElement(o.Loader,null):l.createElement(o.FormStep,{config:x,onSelect:()=>{var e,t;const l=new Date,n=new Date(le);let i=l.getFullYear()-n.getFullYear();const o=l.getMonth()-n.getMonth();if((o<0||0===o&&l.getDate()<n.getDate())&&i--,null!=M&&M.result&&null!=M&&null!==(e=M.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==M?void 0:M.formData;e.LicneseDetails.name=z,e.LicneseDetails.mobileNumber=ue,e.LicneseDetails.gender=ae,e.LicneseDetails.email=ie,e.LicneseDetails.PanNumber=se,w("",M)}else w(x.key,{name:z,mobileNumber:ue,gender:ae,email:ie,PanNumber:se,dateOfBirth:le});i<18&&alert(R("You must be at least 18 years old to proceed"))},onSkip:()=>w(),t:R,isDisabled:!(z&&ue&&ae&&le)},l.createElement("div",null,l.createElement(o.CardLabel,null,"Firstname*"),l.createElement(o.TextInput,u({t:R,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:z,onChange:function(e){Y(e.target.value)},disable:!(!z||H)},F={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:R("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,"Middle name"),l.createElement(o.TextInput,u({t:R,type:"text",isMandatory:!1,name:"Mname",value:V,onChange:function(e){q(e.target.value)}},F={isRequired:!1,pattern:"^[a-zA-Z ]*$",type:"text",title:R("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,"Lastname*"),l.createElement(o.TextInput,u({t:R,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Lname",value:G,onChange:function(e){K(e.target.value)}},F={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:R("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,"Date of Birth"),l.createElement(o.DatePicker,{date:le,onChange:function(e){const t=new Date,l=new Date(e);let n=t.getFullYear()-l.getFullYear();const i=t.getMonth()-l.getMonth();(i<0||0===i&&t.getDate()<l.getDate())&&n--,n<18?alert(R("You must be at least 18 years old. Please enter a valid date of birth.")):ne(e)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],isRequired:!0}),l.createElement(o.CardLabel,null,R("BPA_APPLICANT_GENDER_LABEL")+"*"),l.createElement(o.RadioButtons,{t:R,options:Ee,optionsKey:"code",name:"gender",value:ae,selectedOption:ae,onSelect:function(e){re(e)},isDependent:!0,labelKey:"COMMON_GENDER",disable:!(!ae||H)}),l.createElement(o.CardLabel,null,R("BPA_OWNER_MOBILE_NO_LABEL")+"*"),l.createElement(o.MobileNumber,{value:ue,name:"mobileNumber",onChange:e=>{de({value:e}.value)},disable:!(!ue||H),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:R("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.CardLabel,null,R("BPA_APPLICANT_EMAIL_LABEL")),l.createElement(o.TextInput,{t:R,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:ie,onChange:function(e){oe(e.target.value)},disable:!(null==k||null===(O=k.info)||void 0===O||!O.emailId||H),required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:R("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})))))},CorrospondenceAddress:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const[s,c]=t.useState((null==d?void 0:d.Correspondenceaddress)||(null==d||null===(n=d.formData)||void 0===n?void 0:n.Correspondenceaddress)||""),[p,v]=t.useState((null==d?void 0:d.isAddressSame)||(null==d||null===(i=d.formData)||void 0===i?void 0:i.isAddressSame)||!1),[m,E]=t.useState(null),[f,_]=t.useState(null),[g,A]=t.useState(!1),S=Digit.ULBService.getCurrentTenantId(),h=Digit.ULBService.getStateId();let b=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),b&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),l.createElement(l.Fragment,null,l.createElement("div",{className:b?"OpenlinkContainer":""},b&&l.createElement(o.BackButton,{style:{border:"none"}},a("CS_COMMON_BACK")),l.createElement(Hl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:r,onSelect:()=>{var e,t;if(null!=d&&d.result&&null!=d&&null!==(e=d.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id)d.Correspondenceaddress=s,d.isAddressSame=p,u("",d,"",!0);else{var l,n,i,o,a,r,c,v,m,f,g,b;A(!0);let e={Licenses:[{tradeLicenseDetail:{owners:[{gender:null==d||null===(l=d.LicneseDetails)||void 0===l||null===(n=l.gender)||void 0===n?void 0:n.code,mobileNumber:null==d||null===(i=d.LicneseDetails)||void 0===i?void 0:i.mobileNumber,name:null==d||null===(o=d.LicneseDetails)||void 0===o?void 0:o.name,dob:null,emailId:null==d||null===(a=d.LicneseDetails)||void 0===a?void 0:a.email,permanentAddress:null==d||null===(r=d.LicneseDetails)||void 0===r?void 0:r.PermanentAddress,correspondenceAddress:s,pan:null==d||null===(c=d.LicneseDetails)||void 0===c?void 0:c.PanNumber}],subOwnerShipCategory:"INDIVIDUAL",tradeUnits:[{tradeType:null==d||null===(v=d.LicneseType)||void 0===v||null===(m=v.LicenseType)||void 0===m?void 0:m.tradeType}],additionalDetail:{counsilForArchNo:null==d||null===(f=d.LicneseType)||void 0===f?void 0:f.ArchitectNo,isSelfCertificationRequired:null!=d&&null!==(g=d.LicneseType)&&void 0!==g&&g.selfCertification?null==d||null===(b=d.LicneseType)||void 0===b?void 0:b.selfCertification:null},address:{city:"",landmark:"",pincode:""},institution:null,applicationDocuments:null},licenseType:"PERMANENT",businessService:"BPAREG",tenantId:h,action:"NOWORKFLOW"}]};Digit.OBPSService.BPAREGCreate(e,S).then((e,t)=>{A(!1),u("",{result:e,formData:d,Correspondenceaddress:s,isAddressSame:p},"",!0)}).catch(e=>{var t,l,n;A(!1),_({key:"error"}),E((null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null)})}},onSkip:()=>u(),t:a,isDisabled:g},l.createElement(o.CheckBox,{label:a("BPA_SAME_AS_PERMANENT_ADDRESS"),onChange:e=>{var t,l,n,i;0==p?(v(!0),c(null!=d&&null!==(t=d.LicneseDetails)&&void 0!==t&&t.PermanentAddress?null==d||null===(l=d.LicneseDetails)||void 0===l?void 0:l.PermanentAddress:null==d||null===(n=d.formData)||void 0===n||null===(i=n.LicneseDetails)||void 0===i?void 0:i.PermanentAddress)):(Array.from(document.querySelectorAll("input")).forEach(e=>e.value=""),v(!1),c(""))},checked:p,style:{paddingBottom:"10px",paddingTop:"10px"}}),l.createElement(o.CardLabel,null,""+a("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL")),l.createElement(o.TextArea,{t:a,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"Correspondenceaddress",onChange:function(e){c(e.target.value)},value:s,disable:p}))),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),f&&l.createElement(o.Toast,{error:"error"===(null==f?void 0:f.key),label:m,isDleteBtn:!0,onClose:()=>{_(null),E(null)}}))},PermanentAddress:e=>{var n,i,a,r,d,s,c,p,v,m,E;let{t:f,config:_,onSelect:g,formData:A}=e,S={};const[h,b]=t.useState((null==A||null===(n=A.LicneseDetails)||void 0===n?void 0:n.PermanentAddress)||(null==A||null===(i=A.formData)||void 0===i||null===(a=i.LicneseDetails)||void 0===a?void 0:a.PermanentAddress)),y=Digit.ULBService.getCurrentTenantId();console.log("tenantId",y),Digit.ULBService.getStateId();let C=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[T,D]=t.useState((null==A||null===(r=A.LicneseDetails)||void 0===r?void 0:r.Pincode)||(null==A||null===(d=A.formData)||void 0===d||null===(s=d.LicneseDetails)||void 0===s?void 0:s.Pincode)||""),[P,N]=t.useState(""),[I,L]=t.useState((null==A||null===(c=A.LicneseDetails)||void 0===c?void 0:c.Ulb)||(null==A||null===(p=A.formData)||void 0===p||null===(v=p.LicneseDetails)||void 0===v?void 0:v.Ulb)||[]);console.log("formData",A);const B=Digit.SessionStorage.get("OBPS_TENANTS").map(e=>e.name);return t.useEffect(()=>{var e,t;if("BPA_ARCHITECT"==(null==A||null===(e=A.LicneseType)||void 0===e||null===(t=e.LicenseType)||void 0===t?void 0:t.role)){const e=B.map(e=>({ulbname:e}));L(e),console.log("Initial ULBs for BPA_ARCHITECT:",e)}},[null==A||null===(m=A.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.role]),C&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{},[I]),l.createElement(l.Fragment,null,l.createElement("div",{className:C?"OpenlinkContainer":""},C&&l.createElement(o.BackButton,{style:{border:"none"}},f("CS_COMMON_BACK")),l.createElement(Hl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:_,onSelect:()=>{var e,t;if(null!=A&&A.result&&null!=A&&null!==(e=A.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==A?void 0:A.formData;console.log("data",e),e.LicneseDetails.PermanentAddress=h,e.LicneseDetails.Ulb=I,e.LicneseDetails.Pincode=T,g("",A)}else g(_.key,{PermanentAddress:h,Pincode:T,Ulb:I})},onSkip:()=>g(),t:f,isDisabled:!h},l.createElement(o.CardLabel,null,f("BPA_PERMANANT_ADDRESS_LABEL")+"*"),l.createElement(o.TextArea,{t:f,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"PermanentAddress",onChange:function(e){b(e.target.value)},value:h}),l.createElement(o.CardLabel,null,"Pincode*"),l.createElement(o.TextInput,u({t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Pcode",minLength:"6",value:T,onChange:function(e){const t=e.target.value;/^[0-9]*$/.test(t)&&t.length<=6&&D(t)}},S={isRequired:!0,pattern:"^[0-9]{6}$",type:"number",title:f("Please enter a valid 6-digit pincode.")})),l.createElement(o.CardLabel,null,"ULB*"),l.createElement(o.MultiSelectDropdown,{options:B.map(e=>({ulbname:e})),optionsKey:"ulbname",onSelect:e=>function(e){var t,l;const n=e.map(e=>e[1]);if("BPA_ARCHITECT"==(null==A||null===(t=A.LicneseType)||void 0===t||null===(l=t.LicenseType)||void 0===l?void 0:l.role)){const e=B.map(e=>({ulbname:e}));n.length<e.length?(L(n),console.log("Updated ULBs for BPA_ARCHITECT after deselection:",n)):(L(e),console.log("All ULBs selected for BPA_ARCHITECT:",e))}else L(n),console.log("Selected ULB Types:",n)}(e),defaultLabel:f("Select ULBs"),defaultUnit:f("ULBs"),selected:I}))))},StakeholderDocuments:e=>{var n,i,a,r;let{t:u,config:d,onSelect:s,formData:c}=e;Digit.ULBService.getCurrentTenantId();const p=Digit.ULBService.getStateId(),[v,m]=t.useState((null==c||null===(n=c.documents)||void 0===n?void 0:n.documents)||[]),[E,f]=t.useState(null),[_,g]=t.useState([]),[A,S]=t.useState(!0),[h,b]=t.useState(!1),y=!!Digit.Utils.browser.isMobile();let C=window.location.href.includes("/openlink/");C&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{data:T,isLoading:D}=Digit.Hooks.obps.useMDMS(p,"StakeholderRegistraition","TradeTypetoRoleMapping");return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=T&&null!==(e=T.StakeholderRegistraition)&&void 0!==e&&e.TradeTypetoRoleMapping&&(i=null==T||null===(o=T.StakeholderRegistraition)||void 0===o||null===(a=o.TradeTypetoRoleMapping)||void 0===a?void 0:a.filter(e=>{var t,l,n;return e.tradeType===(null==c||null===(t=c.formData)||void 0===t||null===(l=t.LicneseType)||void 0===l||null===(n=l.LicenseType)||void 0===n?void 0:n.tradeType)}));let r=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{r.push(e)}),g(r)},[!D]),t.useEffect(()=>{let e=0;_.map(t=>{let l=!1;v.map(e=>{t.required&&null!==e&&e&&t.code==`${e.documentType.split(".")[0]}.${e.documentType.split(".")[1]}`&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,h]),l.createElement("div",null,l.createElement("div",{className:C?"OpenlinkContainer":""},C&&l.createElement(o.BackButton,{style:{border:"none"}},u("CS_COMMON_BACK")),l.createElement(Hl,{currentStep:3,flow:"STAKEHOLDER"}),D?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:u,config:d,onSelect:()=>{let e,t=c.documents,l=[];_&&v&&null!==v&&_.map((e,t)=>{let n=v.find(t=>t&&null!==t&&t.documentType===e.code);n&&l.push(n)}),e={...t,documents:l},s(d.key,e)},onSkip:()=>s(),isDisabled:A,onAdd:function(){},cardStyle:{paddingRight:"16px"}},null==_?void 0:_.map((e,t)=>l.createElement(_n,{key:t,document:e,t:u,error:E,setError:f,setDocuments:m,documents:v,setCheckRequiredFields:b,isCitizenUrl:y})),E&&l.createElement(o.Toast,{label:E,isDleteBtn:!0,onClose:()=>f(null),error:!0})),!(null!=c&&c.initiationFlow)&&l.createElement(o.CitizenInfoLabel,{info:u("CS_FILE_APPLICATION_INFO_LABEL"),text:`${u("BPA_APPLICATION_NUMBER_LABEL")} ${null==c||null===(i=c.result)||void 0===i||null===(a=i.Licenses)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.applicationNumber} ${u("BPA_DOCS_INFORMATION")}`,className:"info-banner-wrap-citizen-override"})))},OCBasicDetails:e=>{var i,a,r,u,s,c,p,v,m,E,f,_,g,A,S,h;let{formData:b,onSelect:y,config:C}=e;const[T,D]=t.useState(null),[P,N]=t.useState(null==b||null===(i=b.data)||void 0===i?void 0:i.scrutinyNumber),I=window.Digit.Utils.browser.isMobile(),[L,B]=t.useState(!(null==b||null===(a=b.data)||void 0===a||!a.scrutinyNumber)),{t:O}=n.useTranslation(),R=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[x,w]=t.useState((null==b||null===(r=b.data)||void 0===r?void 0:r.bpaData)||{}),[M,k]=t.useState((null==b||null===(u=b.data)||void 0===u?void 0:u.edcrDetails)||null),[F,U]=t.useState(!1),{isMdmsLoading:H,data:W}=Digit.Hooks.obps.useMDMS(R,"BPA",["RiskTypeComputation"]);Digit.Utils.obps.calculateRiskType(null==W||null===(s=W.BPA)||void 0===s?void 0:s.RiskTypeComputation,null==M||null===(c=M.planDetail)||void 0===c||null===(p=c.plot)||void 0===p?void 0:p.area,null==M||null===(v=M.planDetail)||void 0===v?void 0:v.blocks),t.useEffect(()=>{},T);const j=function(){try{return k(null),w(null),U(!0),Promise.resolve(function(e,t){return Promise.resolve(function(e,t){try{return Promise.resolve(d(function(){return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e}))},function(e){var t,l;return null!=e&&null!==(t=e.response)&&void 0!==t&&t.statusText?null==e||null===(l=e.response)||void 0===l?void 0:l.statusText:"BPA_INTERNAL_SERVER_ERROR"}))}catch(e){return Promise.reject(e)}}(e,t)).then(function(l){var n,i,o,a;return null!=l&&null!==(n=l.edcrDetail)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.edcrNumber?Promise.resolve(Digit.OBPSService.BPASearch(t,{approvalNo:null==l||null===(o=l.edcrDetail)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.permitNumber})).then(function(n){var i,o,a,r;const u=null==n||null===(i=n.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber;return t=null==n||null===(a=n.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId,Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:u})).then(function(i){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,o,a,r,u;return null!=l&&null!==(t=l.edcrDetail)&&void 0!==t&&null!==(o=t[0])&&void 0!==o&&o.edcrNumber?null!=l&&null!==(a=l.edcrDetail)&&void 0!==a&&null!==(r=a[0])&&void 0!==r&&r.edcrNumber?{ocEdcrDetails:null==l||null===(u=l.edcrDetail)||void 0===u?void 0:u[0],otherDetails:{bpaApprovalResponse:null==n?void 0:n.BPA,edcrDetails:null==i?void 0:i.edcrDetail,bpaResponse:null==e?void 0:e.BPA}}:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}})})}):{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}})}(null==P?void 0:P.edcrNumber,R)).then(function(e){var t,l,n;U(!1),"ERROR"==(null==e?void 0:e.type)&&(D({key:"true",message:null==e?void 0:e.message}),k(null),w(null));let i=null==e?void 0:e.otherDetails,o=null==e?void 0:e.ocEdcrDetails;if(i&&o&&null!=o&&o.tenantId&&null!=i&&null!==(t=i.edcrDetails)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.tenantId){var a,r,u,d,s,c,p,v,m,E;if((null==i||null===(a=i.edcrDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId)!=(null==o?void 0:o.tenantId))return void D({key:"true",message:"BPA_INVALID_PERMIT_CITY"});if((null==i||null===(u=i.bpaApprovalResponse)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.edcrNumber)===(null==o?void 0:o.edcrNumber)&&("REJECTED"!=(null==i||null===(s=i.bpaResponse)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.status)&&"PERMIT REVOCATION"!=(null==i||null===(p=i.bpaResponse)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.status)||"INITIATED"!=(null==i||null===(m=i.bpaResponse)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.status)))return void D({key:"true",message:"APPLICATION_NUMBER_ALREADY_EXISTS"});sessionStorage.setItem("checkForProcced",JSON.stringify(!1)),D(null),k(M)}null!=e&&null!==(n=e.ocEdcrDetails)&&void 0!==n&&n.edcrNumber&&(k(null==e?void 0:e.ocEdcrDetails),w(null==e?void 0:e.otherDetails),D(null))})}catch(e){return Promise.reject(e)}};let $=sessionStorage.getItem("isEDCRDisable");$=JSON.parse($),t.useEffect(()=>{if($){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&M||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),Promise.resolve(j()).then(function(){}))}},[]);const z=e=>{let t=!1;if(x&&M){var l,n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g;const e=(null==x||null===(l=x.edcrDetails)||void 0===l?void 0:l[0])||{},A=M||{},S=null==A||null===(n=A.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.khataNo,h=null==e||null===(o=e.planDetail)||void 0===o||null===(a=o.planInformation)||void 0===a?void 0:a.khataNo,b=null==A||null===(r=A.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.plotNo,y=null==e||null===(d=e.planDetail)||void 0===d||null===(s=d.planInformation)||void 0===s?void 0:s.plotNo,C={LOW:0,MEDIUM:1,HIGH:2},T=Digit.Utils.obps.calculateRiskType(null==W||null===(c=W.BPA)||void 0===c?void 0:c.RiskTypeComputation,null==A||null===(p=A.planDetail)||void 0===p||null===(v=p.plot)||void 0===v?void 0:v.area,null==M||null===(m=M.planDetail)||void 0===m?void 0:m.blocks),P=Digit.Utils.obps.calculateRiskType(null==W||null===(E=W.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==e||null===(f=e.planDetail)||void 0===f||null===(_=f.plot)||void 0===_?void 0:_.area,null==M||null===(g=M.planDetail)||void 0===g?void 0:g.blocks);if(S&&h&&b&&y){if(b!=y||S!=h)return S!=h&&b==y?(t=!1,D({key:"true",message:"Khata number from permit order XXXX(permit order number) is not matching with the khata number from occupancy certificate. You cannot proceed with the application"})):b!=y&&S==h?(t=!1,D({key:"true",message:"Plot number from permit order XXXX(permit order number) is not matching with the Plot number from occupancy certificate. You cannot proceed with the application"})):b!=y&&S!=h&&(t=!1,D({key:"true",message:"Khata No and plot No from permit order XXXX(permit order number) is not matching with the Khata No and plot No from occupancy certificate. You cannot proceed with the application"})),!1;t=!0}C[P]<C[T]?(t=!1,D({key:"true",message:O("BPA_RISK_TYPE_VALIDATION_ERROR"),labelName:"The Risk type from permit order XXXX(permit order number) to occupancy certificate application is changed from Low to high .You cannot proceed with the application."})):C[P]>C[T]?(t=JSON.parse(sessionStorage.getItem("checkForProcced")),D({warning:"true",message:O("BPA_RISK_TYPE_VALIDATION_WARNING"),labelName:"The Risk type in permit order XXXX is high where as the risk type in occupancy is Low , do you want to continue"})):t=!0}var A,S,h,b,T,N,I,L;t&&y(null==C?void 0:C.key,{scrutinyNumber:P,applicantName:null==M||null===(A=M.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.applicantName,occupancyType:null==M||null===(h=M.planDetail)||void 0===h||null===(b=h.planInformation)||void 0===b?void 0:b.occupancy,applicationType:null==M?void 0:M.appliactionType,serviceType:null==M?void 0:M.applicationSubType,applicationDate:null==M?void 0:M.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==W||null===(T=W.BPA)||void 0===T?void 0:T.RiskTypeComputation,null==M||null===(N=M.planDetail)||void 0===N||null===(I=N.plot)||void 0===I?void 0:I.area,null==M||null===(L=M.planDetail)||void 0===L?void 0:L.blocks),bpaData:x,edcrDetails:M})};return H?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(Hl,{currentStep:1,flow:"OCBPA"}),l.createElement("div",{className:I?"obps-search":"",style:I?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},l.createElement(o.Label,null,O("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{const t=function(t){if(null!=P&&null!==(t=P.edcrNumber)&&void 0!==t&&t.startsWith("OC")){const t=function(){if("Enter"===e.key)return Promise.resolve(j()).then(function(){})}();if(t&&t.then)return t.then(function(){})}else D({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onChange:e=>N({edcrNumber:e.target.value}),value:null==P?void 0:P.edcrNumber,signature:!0,signatureImg:!$&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!$&&null!=P&&P.edcrNumber?()=>function(e){try{const e=function(e){if(null!=P&&null!==(e=P.edcrNumber)&&void 0!==e&&e.startsWith("OC"))return Promise.resolve(j()).then(function(){});D({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():null}),disable:L,style:{marginBottom:"10px"}})),F?l.createElement(o.Loader,null):null,M&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,O("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,O("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=M&&M.applicationDate?Rl(new Date(null==M?void 0:M.applicationDate),"dd/MM/yyyy"):null==M?void 0:M.applicationDate}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:O("WF_BPA_"+(null==M?void 0:M.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:O(null==M?void 0:M.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==M||null===(m=M.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.occupancy}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:O("WF_BPA_"+Digit.Utils.obps.calculateRiskType(null==W||null===(f=W.BPA)||void 0===f?void 0:f.RiskTypeComputation,null==M||null===(_=M.planDetail)||void 0===_||null===(g=_.plot)||void 0===g?void 0:g.area,null==M||null===(A=M.planDetail)||void 0===A?void 0:A.blocks))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==M||null===(S=M.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.applicantName})),l.createElement(o.SubmitBar,{label:O("CS_COMMON_NEXT"),onSubmit:z})),T&&l.createElement(o.Toast,{error:!(null==T||!T.key),warning:!(null==T||!T.warning),label:O(null==T?void 0:T.message),isDleteBtn:!0,onClose:()=>{D(null)},onNo:()=>{D(null)},onYes:()=>{sessionStorage.setItem("checkForProcced",JSON.stringify(!0)),z()},isWarningButtons:!0}))},OBPSSearchApplication:e=>{var n,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y;let{t:C,onSubmit:T,data:D,error:P,searchData:N,isLoading:I,Count:L,setparamerror:B}=e;const[O,R]=t.useState(null),x=sessionStorage.getItem("Digit.citizen.userRequestObject"),w=x?JSON.parse(x):{},M=null==w||null===(n=w.value)||void 0===n?void 0:n.info,k=null==w||null===(r=w.value)||void 0===r||null===(d=r.info)||void 0===d?void 0:d.mobileNumber,{register:F,control:U,handleSubmit:H,setValue:W,getValues:j,reset:$,formState:z}=a.useForm({defaultValues:{applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?k:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==M||null===(s=M.roles)||void 0===s||null===(c=s.filter(e=>e.code.includes("BPAREG_")))||void 0===c?void 0:c.length)<=0&&(null==M||null===(p=M.roles)||void 0===p?void 0:p.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==M||null===(v=M.roles)||void 0===v||null===(m=v.filter(e=>e.code.includes("BPAREG_")))||void 0===m?void 0:m.length)>0&&(null==M||null===(E=M.roles)||void 0===E?void 0:E.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==M||null===(f=M.roles)||void 0===f||null===(_=f.filter(e=>e.code.includes("BPAREG_")))||void 0===_?void 0:_.length)<=0&&(null==M||null===(g=M.roles)||void 0===g?void 0:g.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==M||null===(A=M.roles)||void 0===A||null===(S=A.filter(e=>e.code.includes("BPAREG_")))||void 0===S?void 0:S.length)>0&&(null==M||null===(h=M.roles)||void 0===h?void 0:h.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},...N}});t.useEffect(()=>{F("offset",0),F("limit",10),F("sortBy","commencementDate"),F("sortOrder","DESC")},[F]),l.useEffect(()=>{var e,t,l,n,i,o,a,r,u,d,s,c,p,v;z.isSubmitSuccessful&&$({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==M||null===(l=M.roles)||void 0===l||null===(n=l.filter(e=>e.code.includes("BPAREG_")))||void 0===n?void 0:n.length)<=0&&(null==M||null===(i=M.roles)||void 0===i?void 0:i.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==M||null===(o=M.roles)||void 0===o||null===(a=o.filter(e=>e.code.includes("BPAREG_")))||void 0===a?void 0:a.length)>0&&(null==M||null===(r=M.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==M||null===(u=M.roles)||void 0===u||null===(d=u.filter(e=>e.code.includes("BPAREG_")))||void 0===d?void 0:d.length)<=0&&(null==M||null===(s=M.roles)||void 0===s?void 0:s.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==M||null===(c=M.roles)||void 0===c||null===(p=c.filter(e=>e.code.includes("BPAREG_")))||void 0===p?void 0:p.length)>0&&(null==M||null===(v=M.roles)||void 0===v?void 0:v.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},...N,isSubmitSuccessful:!1})},[z]);const Y=(e=>{let{t:n}=e;const o=e=>{let t="BPAREG"===e?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(t="BPAREG"===e?"stakeholder":"bpa"),t},a=e=>l.createElement("span",{className:"cell-text"},e);return t.useMemo(()=>[{Header:n("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?`/digit-ui/citizen/obps/${o(t.original.businessService)||"--"}/${t.original.applicationNo||t.original.applicationNumber}`:`/digit-ui/employee/obps/${o(t.original.businessService)||"--"}/${t.original.applicationNo||t.original.applicationNumber}`},t.original.applicationNo||t.original.applicationNumber)))}},{Header:n("BPA_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l;return a(null!=e&&null!==(t=e.auditDetails)&&void 0!==t&&t.createdTime?Tt(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"")}},{Header:n("BPA_SEARCH_APPLICATION_TYPE_LABEL"),disableSortBy:!0,accessor:"applicationType",Cell:e=>{var t,i,o,a,r,u;let{row:d}=e;return l.createElement("div",null,l.createElement("span",{className:"cell-text"},null!==(t=d.original)&&void 0!==t&&null!==(i=t.additionalDetails)&&void 0!==i&&i.applicationType?n("WF_BPA_"+(null===(o=d.original)||void 0===o||null===(a=o.additionalDetails)||void 0===a?void 0:a.applicationType)):null!==(r=d.original)&&void 0!==r&&r.businessService?n("BPA_APPLICATIONTYPE_"+(null==d||null===(u=d.original)||void 0===u?void 0:u.businessService)):"-"))}},{Header:n("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l,i,o,r;return a(n((null===(t=e.additionalDetails)||void 0===t?void 0:t.serviceType)||n("TRADELICENSE_TRADETYPE_"+(null==e||null===(l=e.tradeLicenseDetail)||void 0===l||null===(i=l.tradeUnits)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.tradeType)||void 0===r?void 0:r.split(".")[0]))||"-"))}},{Header:n("BPA_CURRENT_OWNER_HEAD"),accessor:e=>a((null==e?void 0:e.assignee)||"-"),disableSortBy:!0},{Header:n("BPA_STATUS_LABEL"),accessor:e=>a(n((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||"NA")),disableSortBy:!0}],[])})({t:C}),[G,K]=t.useState(j("offset")/j("limit"));t.useEffect(()=>{""!==P&&(B(""),R({key:!0,label:P}))},[P]);const V=t.useCallback(e=>{0!==e.length&&(W("sortBy",e.id),W("sortOrder",e.desc?"DESC":"ASC"))},[]);function q(){W("offset",j("offset")-j("limit")),H(T)()}t.useEffect(()=>{null!=j("offset")&&null!=j("limit")&&K(j("offset")/j("limit"))},[j("offset"),j("limit")]);const X=window.Digit.Utils.browser.isMobile(),J={formState:z,Controller:a.Controller,register:F,control:U,t:C,reset:$,previousPage:q},Z=e=>{var t;const l="BPAREG"==(null==D||null===(t=D[0])||void 0===t?void 0:t.businessService)?"BPAREG":e;let n="BPAREG"===l?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(n="BPAREG"===l?"stakeholder":"bpa"),n},Q=t.useMemo(()=>null==D?void 0:D.map(e=>{var t,l,n,i,o,a,r,u;return{[C("BPA_APPLICATION_NUMBER_LABEL")]:e.applicationNo||e.applicationNumber,[C("BPA_COMMON_TABLE_COL_APP_DATE_LABEL")]:Tt(null===(t=e.auditDetails)||void 0===t?void 0:t.createdTime)||"",[C("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:null!=e&&null!==(l=e.additionalDetails)&&void 0!==l&&l.applicationType?C("WF_BPA_"+(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.applicationType)):C(null!=e&&e.businessService?"BPA_APPLICATIONTYPE_"+(null==e?void 0:e.businessService):"CS_NA"),[C("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")]:C((null===(i=e.additionalDetails)||void 0===i?void 0:i.serviceType)||C("TRADELICENSE_TRADETYPE_"+(null==e||null===(o=e.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0]))||C("CS_NA")),[C("BPA_CURRENT_OWNER_HEAD")]:(null==e?void 0:e.assignee)||C("CS_NA"),[C("BPA_STATUS_LABEL")]:C((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||C("CS_NA"))}}),[D]);if(X){var ee,te;const[e,n]=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),i=()=>{n({type:"remove"})},a=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:i},l.createElement(o.CloseSvg,null)),r=e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:i,...r}=e;const{closeMobilePopupModal:d}=r;switch(n){case"SearchFormComponent":return l.createElement(t.Fragment,null,l.createElement(o.SearchForm,r,l.createElement(a,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,C("ES_COMMON_SEARCH_APPLICATION"),":")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",padding:"20px 0px",color:"#00000099"}},l.createElement("label",null,C("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(wt,u({},i,{closeMobilePopupModal:d}))));default:return l.createElement("span",null)}},d=t.useCallback(e=>{let{currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l,...n}=e;return r({currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l,...n})},[e]);return I?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(o.SearchAction,{text:C("ES_COMMON_SEARCH_APPLICATION"),handleActionClick:()=>n({type:"set",payload:"SearchFormComponent"})})),e?l.createElement(o.PopUp,null,l.createElement(d,{onSubmit:e=>{n({type:"remove"}),T(e)},handleSubmit:H,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:J,currentlyActiveMobileModal:e,closeMobilePopupModal:i})):null,null!=D&&null!==(ee=D[0])&&void 0!==ee&&ee.display?l.createElement(o.Card,{style:{marginTop:20}},C(null==D||null===(te=D[0])||void 0===te?void 0:te.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(o.DetailsCard,{data:Q,isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:Z,serviceRequestIdKey:"applicationNo"}))}return l.createElement(l.Fragment,null,l.createElement(o.Header,null,C("ES_COMMON_SEARCH_APPLICATION")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",paddingLeft:"25px",paddingTop:"10px",color:"#00000099"}},l.createElement("label",null,C("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(o.SearchForm,{onSubmit:T,handleSubmit:H},l.createElement(wt,J)),!I&&null!=D&&null!==(b=D[0])&&void 0!==b&&b.display?l.createElement(o.Card,{style:{marginTop:20}},C(null==D||null===(y=D[0])||void 0===y?void 0:y.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):O?"":I?l.createElement(o.Loader,null):l.createElement(o.Table,{t:C,data:D,columns:Y,getCellProps:e=>({style:{minWidth:e.column.Header===C("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){W("limit",Number(e.target.value)),H(T)()},currentPage:G,onNextPage:function(){W("offset",j("offset")+j("limit")),H(T)()},onPrevPage:q,pageSizeLimit:j("limit"),onSort:V,totalRecords:L,disableSort:!1,onLastPage:()=>{W("offset",L&&10*Math.ceil(L/10)-j("limit")),H(T)()},onFirstPage:()=>{W("offset",0),H(T)()},sortParams:[{id:j("sortBy"),desc:"DESC"===j("sortOrder")}]}),O&&l.createElement(o.Toast,{warning:"BPA_ADD_MORE_PARAM_STAKEHOLDER"==O.label,error:"BPA_ADD_MORE_PARAM_STAKEHOLDER"!=O.label&&O.key,label:C(O.label),isDleteBtn:!0,onClose:()=>{R(null)}}))},InspectionReport:e=>{let{config:a,onSelect:r,userType:d,formData:s,setError:c,formState:p,clearErrors:v}=e;const{t:m}=n.useTranslation(),{pathname:E}=i.useLocation(),f=E.includes("/modify-application/"),[_,g]=t.useState((null==s?void 0:s.FieldReports)||[Cn()]),[A,S]=t.useState({index:-1,type:""}),h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[b,y]=t.useState([]),[C,T]=t.useState([]),[D,P]=t.useState([]),[N,I]=t.useState([]),[L,B]=t.useState([]),[O,R]=t.useState([]),[x,w]=t.useState(!1),[M,k]=t.useState((null==s?void 0:s.tradedetils1)||[]);let F=window.location.href.includes("tl/renew-application-details");window.location.href.includes("tl/renew-application-details")&&(F=!0);const{data:U,isLoading:H}=Digit.Hooks.tl.useTradeLicenseMDMS(h,"TradeLicense","TradeUnits","[?(@.type=='TL')]"),{data:W}=Digit.Hooks.obps.useMDMS(h,"BPA",["CheckList"]);t.useEffect(()=>{const e=_.map(e=>e);r(null==a?void 0:a.key,e),sessionStorage.setItem("INSPECTION_DATA",JSON.stringify(e))},[_]),t.useEffect(()=>{r("tradedetils1",M)},[M]),t.useEffect(()=>{let e=[],t=[];W&&W.BPA.CheckList.map(l=>{"LOW"===(null==l?void 0:l.RiskType)&&"FIELDINSPECTION_PENDING"===(null==l?void 0:l.WFState)&&(e=[...l.questions],t=[...l.docTypes])}),B(t),I(e)},[W]);const j={focusIndex:A,allFieldReport:_,setFocusIndex:S,removeUnit:e=>{g(t=>t.filter(t=>t.key!=e.key))},formData:s,formState:p,setFieldReports:g,t:m,setError:c,clearErrors:v,config:a,onSelect:r,userType:d,tradeCategoryValues:C,tradeTypeOptionsList:D,setTradeTypeOptionsList:P,tradeTypeMdmsData:b,tradeSubTypeOptionsList:O,setTradeSubTypeOptionsList:R,setTradeTypeMdmsData:y,setTradeCategoryValues:T,tradeMdmsData:U,isErrors:x,setIsErrors:w,previousLicenseDetails:M,setPreviousLicenseDetails:k,isLoading:H,bpaDocs:W,type:"LOW",questionList:N,setquestionList:I,documentList:L};return f?l.createElement(l.Fragment,null):l.createElement("div",null,l.createElement(l.Fragment,null,_&&_.map((e,t)=>l.createElement(Tn,u({key:e.key,index:t,unit:e},j)))),l.createElement(o.LinkButton,{label:m("BPA_ADD_FIELD_INSPECTION"),onClick:()=>{const e=Cn();g(t=>[...t,e])},style:{color:"#a82227",width:"fit-content"}}))},BPAInbox:wl,StakeholderInbox:e=>{let{parentRoute:r}=e;const{t:d}=n.useTranslation(),s=Digit.ULBService.getStateId(),c={},p={moduleName:"BPAREG",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL"},v={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("STAKEHOLDER.INBOX"),E=t.useMemo(()=>m||{filterForm:p,searchForm:c,tableForm:v},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[f,_]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},E),{data:g,isLoading:A}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},d),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:s,filters:{...f}}),C={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:d("BPA_SEARCH_PAGE_TITLE"),link:"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},T=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Fl,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),D=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(kl,{statuses:b,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==f?void 0:f.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),P={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==f?void 0:f.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:c})}},N={FilterFormFields:D,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==f?void 0:f.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","BPAREG"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),_({action:"mutateFilterForm",data:p})}},I=(e=>{var o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:p,table:v,dispatch:m,onSortingByData:E}=e;const{t:f}=n.useTranslation(),_=t.useMemo(()=>[{Header:f("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:`${d}/stakeholder-inbox/stakeholder/${t.original.applicationId}`},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:f("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Rl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:f("EVENTS_STATUS_LABEL"),accessor:e=>f(`WF_${null==e?void 0:e.businessService}_${null==e?void 0:e.status}`)},{Header:f("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>null==e?void 0:e.owner},{Header:f("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortI:"applicationDate",onPageSizeChange:s,currentPage:(null===(o=c.tableForm)||void 0===o?void 0:o.offset)/(null===(a=c.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return m({action:"mutateTableForm",data:{...c.tableForm,offset:parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=c.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(r=c.tableForm)||void 0===r?void 0:r.limit,onSort:E,totalRecords:p,onSearch:null==c||null===(u=c.searchForm)||void 0===u?void 0:u.message,onLastPage:()=>{var e;return m({action:"mutateTableForm",data:{...c.tableForm,offset:10*Math.ceil(p/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:v,columns:_}})({parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:{...f.tableForm,limit:e.target.value}})},formState:f,totalCount:y,table:h,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";f.tableForm.sortBy===t&&f.tableForm.sortOrder===n||_({action:"mutateTableForm",data:{...f.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),L=(e=>{let{parentRoute:t,table:i}=e;const{t:r}=n.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:l,businessService:n,status:i,owner:o,sla:a}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Rl(new Date(l),"dd/MM/yyyy"),[r("EVENTS_STATUS_LABEL")]:r(`WF_${n}_${i}`),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:o,[r("ES_INBOX_SLA_DAYS_REMAINING")]:a}}),linkPrefix:t+"/stakeholder-inbox/stakeholder/",serviceRequestIdKey:r("BPA_APPLICATION_NUMBER_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:{...f.tableForm,sortOrder:t}})},sortFormDefaultValues:null==f?void 0:f.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:v})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,d("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},d("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,u({isInboxLoading:S,PropsForInboxLinks:C},P,N,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:f})))},StakeholderCheckPage:e=>{var t,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k;let{onSubmit:F,value:U}=e;const{t:H}=n.useTranslation(),W=i.useHistory();i.useRouteMatch();let j=Digit.UserService.getUser();const $=j&&null!=j&&j.info&&null!=j&&null!==(t=j.info)&&void 0!==t&&t.permanentCity?null==j||null===(a=j.info)||void 0===a?void 0:a.permanentCity:Digit.ULBService.getCurrentTenantId(),z=Digit.ULBService.getStateId();let Y=window.location.href.includes("/openlink/");const G=window.Digit.Utils.browser.isMobile();Digit.Utils.browser.isMobile(),Y&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{result:K,formData:V,documents:q}=U;let X=null==U||null===(r=U.result)||void 0===r?void 0:r.Licenses[0].applicationNumber;const J={consumerCode:X},{data:Z}=Digit.Hooks.obps.useBPAREGgetbill({businessService:"BPAREG",...J,tenantId:z||$.split(".")[0]},{enabled:!!X,retry:!1});let Q=Y?"/digit-ui/citizen/obps/openlink/stakeholder/apply":"/digit-ui/citizen/obps/stakeholder/apply";function ee(e){W.push(e)}return l.createElement(l.Fragment,null,l.createElement("div",{className:Y?"OpenlinkContainer":""},l.createElement("div",null,Y&&l.createElement(o.BackButton,{style:{border:"none"}},H("CS_COMMON_BACK")),l.createElement(Hl,{currentStep:4,flow:"STAKEHOLDER"}),l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},H("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:H("BPA_APPLICATION_NUMBER_LABEL"),text:null!=K&&null!==(u=K.Licenses)&&void 0!==u&&null!==(d=u[0])&&void 0!==d&&d.applicationNumber?null==K||null===(s=K.Licenses)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.applicationNumber:""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},H("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ee(Q+"/provide-license-type")}),l.createElement(o.Row,{className:"border-none",label:H("BPA_LICENSE_TYPE"),textStyle:{paddingLeft:"12px"},text:H(null==V||null===(p=V.LicneseType)||void 0===p||null===(v=p.LicenseType)||void 0===v?void 0:v.i18nKey)}),(null==V||null===(m=V.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.i18nKey.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:H("BPA_COUNCIL_NUMBER"),text:null==V||null===(f=V.LicneseType)||void 0===f?void 0:f.ArchitectNo}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},H("BPA_LICENSE_DET_CAPTION")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ee(Q+"/license-details")}),l.createElement(o.Row,{className:"border-none",label:H("BPA_APPLICANT_NAME_LABEL"),textStyle:{paddingLeft:"12px"},text:H(null==V||null===(_=V.LicneseDetails)||void 0===_?void 0:_.name)}),l.createElement(o.Row,{className:"border-none",label:H("BPA_APPLICANT_GENDER_LABEL"),text:H(null==V||null===(g=V.LicneseDetails)||void 0===g?void 0:g.gender.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:H("BPA_OWNER_MOBILE_NO_LABEL"),text:null==V||null===(A=V.LicneseDetails)||void 0===A?void 0:A.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:H("BPA_APPLICANT_EMAIL_LABEL"),text:(null==V||null===(S=V.LicneseDetails)||void 0===S?void 0:S.email)||H("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:H("BPA_APPLICANT_PAN_NO"),text:(null==V||null===(h=V.LicneseDetails)||void 0===h?void 0:h.PanNumber)||H("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},H("BPA_LICENSEE_PERMANENT_LABEL"))),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ee(Q+"/Permanent-address")}),l.createElement(o.CardText,{style:G?{color:"black"}:{color:"black",fontSize:"16px"}},H(null==V||null===(b=V.LicneseDetails)||void 0===b?void 0:b.PermanentAddress)))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},H("BPA_COMMUNICATION_ADDRESS_HEADER_DETAILS"))),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ee(Q+"/correspondence-address")}),l.createElement(o.CardText,{style:G?{color:"black"}:{color:"black",fontSize:"16px"}},H(null==U?void 0:U.Correspondenceaddress)))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},H("BPA_DOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ee(Q+"/stakeholder-document-details")}),null==q?void 0:q.documents.map((e,t)=>{var n,i;return l.createElement("div",{key:t},l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},H("BPAREG_HEADER_"+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.replace(".","_")))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px"}},""+H(null==e?void 0:e.info)):null,l.createElement(o.StatusTable,null,l.createElement(rn,{value:U,Code:null==e?void 0:e.documentType,index:t,isNOC:!1,svgStyles:{},isStakeHolder:!0}),(null==q||null===(i=q.documents)||void 0===i?void 0:i.length)!=t+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},H("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==Z||null===(y=Z.billResponse)||void 0===y||null===(C=y.Bill[0])||void 0===C||null===(T=C.billDetails[0])||void 0===T?void 0:T.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:H(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)||H("CS_NA")}))),l.createElement(o.Row,{className:"border-none",label:H("BPA_COMMON_TOTAL_AMT"),text:"₹ "+(null==Z||null===(D=Z.billResponse)||void 0===D||null===(P=D.Bill)||void 0===P||null===(N=P[0])||void 0===N||null===(I=N.billDetails[0])||void 0===I?void 0:I.amount)||H("CS_NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},H("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",null==Z||null===(L=Z.billResponse)||void 0===L||null===(B=L.Bill)||void 0===B||null===(O=B[0])||void 0===O||null===(R=O.billDetails[0])||void 0===R?void 0:R.amount),l.createElement(o.SubmitBar,{label:H("CS_COMMON_SUBMIT"),onSubmit:F,disabled:null==Z||null===(x=Z.billResponse)||void 0===x||null===(w=x.Bill)||void 0===w||null===(M=w[0])||void 0===M||null===(k=M.billDetails[0])||void 0===k||!k.amount})))))},BPACheckPage:e=>{var a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H;let{onSubmit:W,value:j}=e;const[$,z]=t.useState(),[Y,G]=t.useState(),[K,V]=t.useState(),[q,X]=t.useState(),[J,Z]=t.useState(),[Q,ee]=t.useState(),[te,le]=t.useState(),{t:ne}=n.useTranslation();i.useHistory(),i.useRouteMatch();let ie=Digit.UserService.getUser();const oe=Digit.ULBService.getStateId(),ae=(null==ie||null===(a=ie.info)||void 0===a?void 0:a.permanentCity)||(null==j?void 0:j.tenantId)||Digit.ULBService.getCurrentTenantId(),{data:re}=Digit.Hooks.obps.useMDMS(oe,"BPA",["GaushalaFees","MalbaCharges","LabourCess"]);let ue;"BPA_LOW"===j.businessService?ue="BPA.LOW_RISK_PERMIT_FEE":"BPA"===j.businessService&&(ue="BPA.NC_APP_FEE");const{data:de,address:se,owners:ce,nocDocuments:pe,documents:ve,additionalDetails:me,subOccupancy:Ee,PrevStateDocuments:fe,PrevStateNocDocuments:_e,applicationNo:ge}=j,Ae=window.location.href.includes("editApplication");t.useEffect(()=>{var e,t,l,n,i,o,a;console.log("mdmsData",re,sessionStorage.getItem("plotArea"),typeof sessionStorage.getItem("plotArea"));let r=parseInt(sessionStorage.getItem("plotArea"));const u=r>909?(null==re||null===(e=re.BPA)||void 0===e?void 0:e.LabourCess[1].rate)*r:0,d=null==re||null===(t=re.BPA)||void 0===t?void 0:t.GaushalaFees[0].rate,s=r<=500?null==re||null===(l=re.BPA)||void 0===l?void 0:l.MalbaCharges[0].rate:r>500&&r<=1e3?null==re||null===(n=re.BPA)||void 0===n||null===(i=n.MalbaCharges)||void 0===i?void 0:i[1].rate:(null==re||null===(o=re.BPA)||void 0===o?void 0:o.MalbaCharges[2].rate)||500;sessionStorage.setItem("Malbafees",s),sessionStorage.setItem("WaterCharges",s/2),sessionStorage.setItem("GaushalaFees",d),sessionStorage.setItem("LabourCess",u),Z(d),X(u),ee(s),le(s/2),console.log("mdmsData",re,null==re||null===(a=re.MalbaCharges)||void 0===a?void 0:a.BPA[1].rate,r)},[re]);let Se=[];null==fe||fe.map(e=>{Se.push({...e,module:"OBPS"})}),null==ve||null===(r=ve.documents)||void 0===r||r.map(e=>{Se.push({...e,module:"OBPS"})}),null==_e||_e.map(e=>{Se.push({...e,module:"NOC"})}),null==pe||null===(u=pe.nocDocuments)||void 0===u||u.map(e=>{Se.push({...e,module:"NOC"})});const{data:he,isLoading:be}=Digit.Hooks.useDocumentSearch(Se,{enabled:(null==Se?void 0:Se.length)>0});let ye=[],Ce=[];var Te;(null==he||null===(d=he.pdfFiles)||void 0===d?void 0:d.length)>0&&(null==he||null===(Te=he.pdfFiles)||void 0===Te||Te.map(e=>{"OBPS"==(null==e?void 0:e.module)&&ye.push(e),"NOC"==(null==e?void 0:e.module)&&Ce.push(e)}));const{data:De,isLoading:Pe}=Digit.Hooks.obps.useScrutinyDetails(ae,null==j||null===(s=j.data)||void 0===s?void 0:s.scrutinyNumber,{enabled:!(null==j||null===(c=j.data)||void 0===c||!c.scrutinyNumber)});let Ne=null==j?void 0:j.applicationNo;const Ie={consumerCode:Ne},{data:Le}=Digit.Hooks.useFetchBillsForBuissnessService({businessService:ue,...Ie,tenantId:ae},{enabled:!!Ne,retry:!1});j.additionalDetails.P1charges=null==Le?void 0:Le.Bill[0].billDetails[0].amount;const Be=window.location.href.includes("sendbacktocitizen");let Oe=`/digit-ui/citizen/obps/bpa/${null==me?void 0:me.applicationType.toLowerCase()}/${null==me?void 0:me.serviceType.toLowerCase()}`;Ae&&(Oe=`/digit-ui/citizen/obps/editApplication/bpa/${null==j?void 0:j.tenantId}/${null==j?void 0:j.applicationNo}`),Be&&(Oe=`/digit-ui/citizen/obps/sendbacktocitizen/bpa/${null==j?void 0:j.tenantId}/${null==j?void 0:j.applicationNo}`);const Re=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],xe=e=>{const t=e;return(e,l,n)=>e[t]},we=t.useMemo(()=>Re.map(e=>({Header:ne(""+e.name),accessor:xe(e.id),id:e.id})));function Me(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:ne("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:ne(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:ne("BPA_FLOOR_NAME_"+e.number)})}),l}function ke(e){location.href=e}function Fe(e){let t=[];return Ee&&Ee["Block_"+(e+1)]&&Ee["Block_"+(e+1)].map(e=>{var l;t.push(""+ne(vt(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_")))}),null!=t&&t.length?t.join(", "):"NA"}return be||Pe?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Hl,{currentStep:4}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},ne("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ne("BPA_APPLICATION_NUMBER_LABEL"),text:ge||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ne("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ne("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Tt(Number(null==de?void 0:de.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:ne("WF_BPA_"+(null==de?void 0:de.applicationType))}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:ne(null==de?void 0:de.serviceType)}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==de?void 0:de.occupancyType}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:ne("WF_BPA_"+(null==de?void 0:de.riskType))}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==de?void 0:de.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ne("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ke(Oe+"/plot-details")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:ne("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=De&&null!==(p=De.planDetail)&&void 0!==p&&null!==(v=p.planInformation)&&void 0!==v&&v.plotArea?`${null==De||null===(m=De.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.plotArea} ${ne("BPA_SQ_FT_LABEL")}`:ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_PLOT_NUMBER_LABEL"),text:(null==De||null===(f=De.planDetail)||void 0===f||null===(_=f.planInformation)||void 0===_?void 0:_.plotNo)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_KHATHA_NUMBER_LABEL"),text:(null==De||null===(g=De.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.khataNo)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_HOLDING_NUMBER_LABEL"),text:(null==de?void 0:de.holdingNumber)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==de?void 0:de.registrationDetails)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_BOUNDARY_WALL_LENGTH_LABEL"),text:(null==de?void 0:de.boundaryWallLength)||ne("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ne("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ne("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ne("BPA_EDCR_NO_LABEL"),text:null==de||null===(S=de.scrutinyNumber)||void 0===S?void 0:S.edcrNumber}),l.createElement(o.CardSubHeader,null,ne("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>ke(null==De?void 0:De.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ne("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,ne("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>ke(null==De?void 0:De.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ne("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ne("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ne("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:`${null==De||null===(h=De.planDetail)||void 0===h||null===(b=h.blocks)||void 0===b||null===(y=b[0])||void 0===y||null===(C=y.building)||void 0===C?void 0:C.totalBuitUpArea} ${ne("BPA_SQ_MTRS_LABEL")}`}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==De||null===(T=De.planDetail)||void 0===T||null===(D=T.blocks)||void 0===D||null===(P=D[0])||void 0===P||null===(N=P.building)||void 0===N?void 0:N.totalFloors}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==De||null===(I=De.planDetail)||void 0===I||null===(L=I.blocks)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.building)||void 0===O?void 0:O.declaredBuildingHeight} ${ne("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ne("BPA_OCC_SUBOCC_HEADER")),null==De||null===(R=De.planDetail)||void 0===R?void 0:R.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==De||null===(n=De.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px",fontSize:"18px"}},ne("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:ne("BPA_SUB_OCCUPANCY_LABEL"),text:""===Fe(t)?ne("CS_NA"):Fe(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:ne,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:Me(e),columns:we,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ne("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ne("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=De&&null!==(x=De.planDetail)&&void 0!==x&&null!==(w=x.planInformation)&&void 0!==w&&w.demolitionArea?`${null==De||null===(M=De.planDetail)||void 0===M||null===(k=M.planInformation)||void 0===k?void 0:k.demolitionArea} ${ne("BPA_SQ_MTRS_LABEL")}`:ne("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ne("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ke(Oe+"/location")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:ne("BPA_DETAILS_PIN_LABEL"),text:(null==se?void 0:se.pincode)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_CITY_LABEL"),text:(null==se||null===(F=se.city)||void 0===F?void 0:F.name)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_LOC_MOHALLA_LABEL"),text:(null==se||null===(U=se.locality)||void 0===U?void 0:U.name)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==se?void 0:se.street)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==se?void 0:se.landmark)||ne("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ne("BPA_APPLICANT_DETAILS_HEADER")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ke(Oe+"/owner-details")}),(null==ce?void 0:ce.owners)&&(null==ce?void 0:ce.owners.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==ce||null===(n=ce.owners)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},ce.owners.length>1&&l.createElement(o.CardSubHeader,null,ne("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:0==t&&1==ce.owners.length?{paddingLeft:"12px"}:{},label:ne("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_APPLICANT_GENDER_LABEL"),text:ne(null==e||null===(i=e.gender)||void 0===i?void 0:i.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:ne("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:ne("CORE_COMMON_EMAIL_ID"),text:(null==e?void 0:e.emailId)||ne("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+(null==e?void 0:e.isPrimaryOwner)})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ne("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ke(Oe+"/document-details")}),l.createElement(Wl,{documents:xt(ye),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ne("BPA_NOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>ke(Oe+"/noc-details")}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_NOC_NUMBER"),text:null==j||null===(H=j.additionalDetails)||void 0===H?void 0:H.nocNumber}),pe&&(null==pe?void 0:pe.NocDetails.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:"noc-"+t,style:(null==pe||null===(n=pe.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+ne(`BPA_${null==e?void 0:e.nocType}_HEADER`)),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ne(`BPA_${null==e?void 0:e.nocType}_LABEL`),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_NOC_STATUS"),text:ne(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),null!=e&&null!==(i=e.additionalDetails)&&void 0!==i&&i.SubmittedOn?l.createElement(o.Row,{className:"border-none",label:""+ne("BPA_NOC_SUBMISSION_DATE"),text:null!=e&&null!==(a=e.additionalDetails)&&void 0!==a&&a.SubmittedOn?Tt(Number(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.SubmittedOn)):"NA"}):null,null!=e&&e.nocNo?l.createElement(o.Row,{className:"border-none",label:""+ne("BPA_APPROVAL_NUMBER_LABEL"),text:(null==e?void 0:e.nocNo)||"NA"}):null,"APPROVED"===(null==e?void 0:e.applicationStatus)||"REJECTED"===(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"===(null==e?void 0:e.applicationStatus)||"AUTO_REJECTED"===(null==e?void 0:e.applicationStatus)?l.createElement(o.Row,{className:"border-none",label:""+ne("BPA_APPROVED_REJECTED_ON_LABEL"),text:Tt(Number(null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModifiedTime))}):null,l.createElement(o.Row,{className:"border-none",label:ne("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Wl,{documents:xt(null==Ce?void 0:Ce.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,ne("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,null,ne("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ne("BPA_COMMON_P1_AMT"),text:"₹ "+(null==Le?void 0:Le.Bill[0].billDetails[0].amount)}),l.createElement(o.CardSubHeader,null,ne("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ne("BPA_COMMON_MALBA_AMT"),text:"₹ "+Q}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_COMMON_LABOUR_AMT"),text:"₹ "+q}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_COMMON_WATER_AMT"),text:"₹ "+te}),l.createElement(o.Row,{className:"border-none",label:ne("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+J}),l.createElement(o.CardSubHeader,null,ne("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,ne("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:ne,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:$,onChange:e=>{z(e.target.value),sessionStorage.setItem("development",e.target.value)}}),l.createElement(o.CardLabel,null,ne("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:ne,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:Y,onChange:e=>{G(e.target.value),sessionStorage.setItem("otherCharges",e.target.value)}}),l.createElement(o.CardLabel,null,ne("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:ne,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:K,onChange:e=>{V(e.target.value),sessionStorage.setItem("lessAdjusment",e.target.value)}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.SubmitBar,{label:ne("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:W,disabled:!$||!Y||!K,id:!0})))},OCBPACheckPage:e=>{var a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W,j,$,z,Y,G,K,V,q;let{onSubmit:X,value:J}=e;const{t:Z}=n.useTranslation();i.useHistory(),i.useRouteMatch();let Q,ee=Digit.UserService.getUser();"BPA_LOW"===J.businessService?Q="BPA.LOW_RISK_PERMIT_FEE":"BPA"===J.businessService?Q="BPA.NC_APP_FEE":"BPA_OC"===J.businessService&&(Q="BPA.NC_OC_APP_FEE");const{data:te,nocDocuments:le,documents:ne,additionalDetails:ie,PrevStateDocuments:oe,PrevStateNocDocuments:ae,applicationNo:re,uiFlow:ue}=J,de=(null==ee||null===(a=ee.info)||void 0===a?void 0:a.permanentCity)||(null==J?void 0:J.tenantId)||Digit.ULBService.getCurrentTenantId();let se=window.location.href.includes("editApplication"),ce=[];null==oe||oe.map(e=>{ce.push({...e,module:"OBPS"})}),null==ne||null===(r=ne.documents)||void 0===r||r.map(e=>{ce.push({...e,module:"OBPS"})}),null==ae||ae.map(e=>{ce.push({...e,module:"NOC"})}),null==le||null===(u=le.nocDocuments)||void 0===u||u.map(e=>{ce.push({...e,module:"NOC"})});const{data:pe,isLoading:ve}=Digit.Hooks.useDocumentSearch(ce,{enabled:(null==ce?void 0:ce.length)>0});let me=[],Ee=[];var fe;(null==pe||null===(d=pe.pdfFiles)||void 0===d?void 0:d.length)>0&&(null==pe||null===(fe=pe.pdfFiles)||void 0===fe||fe.map(e=>{"OBPS"==(null==e?void 0:e.module)&&me.push(e),"NOC"==(null==e?void 0:e.module)&&Ee.push(e)}));const{data:_e,isLoading:ge}=Digit.Hooks.obps.useScrutinyDetails(de,null==J||null===(s=J.data)||void 0===s?void 0:s.scrutinyNumber,{enabled:!(null==J||null===(c=J.data)||void 0===c||!c.scrutinyNumber)});let Ae=null==J?void 0:J.applicationNo;const Se={consumerCode:Ae},{data:he}=Digit.Hooks.useFetchBillsForBuissnessService({businessService:Q,...Se,tenantId:de||(null==J?void 0:J.tenantId)},{enabled:!!Ae,retry:!1});let be=se?`/digit-ui/citizen/obps/editApplication/ocbpa/${null==J?void 0:J.tenantId}/${null==J?void 0:J.applicationNo}`:`/digit-ui/citizen/obps/ocbpa/${null==ie?void 0:ie.applicationType.toLowerCase()}/${null==ie?void 0:ie.serviceType.toLowerCase()}`;const ye=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],Ce=e=>{const t=e;return(e,l,n)=>e[t]},Te=t.useMemo(()=>ye.map(e=>({Header:Z(""+e.name),accessor:Ce(e.id),id:e.id})));function De(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:Z("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:Z(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:Z("BPA_FLOOR_NAME_"+e.number)})}),l}function Pe(e){var t,l,n,i;let o=null==te||null===(t=te.bpaData)||void 0===t||null===(l=t.bpaApprovalResponse)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.landInfo)||void 0===i?void 0:i.unit,a="";if((null==o?void 0:o.length)>0){var r,u;let t=null===(r=o[e])||void 0===r||null===(u=r.usageCategory)||void 0===u?void 0:u.split(",");null!=t&&t.length&&(a=t.map(e=>e?""+Z("BPA_SUBOCCUPANCYTYPE_"+vt(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return a||"NA"}function Ne(e){location.href=e}return ve||ge?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Hl,{currentStep:4,flow:"OCBPA"===(null==ue?void 0:ue.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},Z("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Z("BPA_APPLICATION_NUMBER_LABEL"),text:re||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Z("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Tt(Number(null==te?void 0:te.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:Z("WF_BPA_"+(null==te?void 0:te.applicationType))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:Z(null==te?void 0:te.serviceType)}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==te?void 0:te.occupancyType}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:Z("WF_BPA_"+(null==te?void 0:te.riskType))}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==te?void 0:te.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(be+"/plot-details")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=_e&&null!==(p=_e.planDetail)&&void 0!==p&&null!==(v=p.planInformation)&&void 0!==v&&v.plotArea?`${null==_e||null===(m=_e.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.plotArea} ${Z("BPA_SQ_FT_LABEL")}`:Z("CS_NA"),textStyle:{paddingLeft:"12px"}}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_PLOT_NUMBER_LABEL"),text:(null==_e||null===(f=_e.planDetail)||void 0===f||null===(_=f.planInformation)||void 0===_?void 0:_.plotNo)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_KHATHA_NUMBER_LABEL"),text:(null==_e||null===(g=_e.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.khataNo)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_HOLDING_NUMBER_LABEL"),text:(null==te?void 0:te.holdingNumber)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==te?void 0:te.registrationDetails)||Z("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,""+Z("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,""+Z("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_OC_EDCR_NO_LABEL"),text:null==te||null===(S=te.scrutinyNumber)||void 0===S?void 0:S.edcrNumber}),l.createElement(o.CardSubHeader,null,Z("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Ne(null==_e?void 0:_e.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Z("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,Z("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Ne(null==_e?void 0:_e.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Z("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_ACTUAL_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=_e&&null!==(h=_e.planDetail)&&void 0!==h&&null!==(b=h.blocks)&&void 0!==b&&null!==(y=b[0])&&void 0!==y&&null!==(C=y.building)&&void 0!==C&&C.totalBuitUpArea?`${null==_e||null===(T=_e.planDetail)||void 0===T||null===(D=T.blocks)||void 0===D||null===(P=D[0])||void 0===P||null===(N=P.building)||void 0===N?void 0:N.totalBuitUpArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==_e||null===(I=_e.planDetail)||void 0===I||null===(L=I.blocks)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.building)||void 0===O?void 0:O.totalFloors}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==_e||null===(R=_e.planDetail)||void 0===R||null===(x=R.blocks)||void 0===x||null===(w=x[0])||void 0===w||null===(M=w.building)||void 0===M?void 0:M.declaredBuildingHeight} ${Z("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_OCC_SUBOCC_HEADER")),null==_e||null===(k=_e.planDetail)||void 0===k?void 0:k.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==_e||null===(n=_e.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},""+Z("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+Z("BPA_SUB_OCCUPANCY_LABEL"),text:Pe(t)})),l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:Z,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:De(e),columns:Te,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Z("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=_e&&null!==(F=_e.planDetail)&&void 0!==F&&null!==(U=F.planInformation)&&void 0!==U&&U.demolitionArea?`${null==_e||null===(H=_e.planDetail)||void 0===H||null===(W=H.planInformation)||void 0===W?void 0:W.demolitionArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(be+"/document-details")}),l.createElement(Wl,{documents:xt(me),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Z("BPA_NOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(be+"/noc-details")}),le&&(null==le?void 0:le.NocDetails.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==le||null===(n=le.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+Z(`BPA_${null==e?void 0:e.nocType}_HEADER`)),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Z(`BPA_${null==e?void 0:e.nocType}_LABEL`),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:Z("BPA_NOC_STATUS"),text:Z(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),null!=e&&null!==(i=e.additionalDetails)&&void 0!==i&&i.SubmittedOn?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_NOC_SUBMISSION_DATE"),text:null!=e&&null!==(a=e.additionalDetails)&&void 0!==a&&a.SubmittedOn?Tt(Number(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.SubmittedOn)):"NA"}):null,null!=e&&e.nocNo?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPROVAL_NUMBER_LABEL"),text:(null==e?void 0:e.nocNo)||"NA"}):null,"APPROVED"===(null==e?void 0:e.applicationStatus)||"REJECTED"===(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"===(null==e?void 0:e.applicationStatus)||"AUTO_REJECTED"===(null==e?void 0:e.applicationStatus)?l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_APPROVED_REJECTED_ON_LABEL"),text:Tt(Number(null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModifiedTime))}):null,l.createElement(o.Row,{className:"border-none",label:Z("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Wl,{documents:xt(null==Ee?void 0:Ee.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,""+Z("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==he||null===(j=he.Bill[0])||void 0===j||null===($=j.billDetails[0])||void 0===$?void 0:$.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:""+Z(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:Z("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==he||null===(z=he.Bill)||void 0===z||null===(Y=z[0])||void 0===Y||null===(G=Y.billDetails[0])||void 0===G?void 0:G.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,Z("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==he||null===(K=he.Bill)||void 0===K||null===(V=K[0])||void 0===V||null===(q=V.billDetails[0])||void 0===q?void 0:q.amount)||"0"),l.createElement(o.SubmitBar,{label:Z("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:X})))},OCBPASendBackCheckPage:e=>{var a,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W,j,$,z,Y,G,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,pe,ve,me,Ee,fe;let{value:_e}=e;const{t:ge}=n.useTranslation(),Ae=i.useHistory();i.useRouteMatch();let Se,he=Digit.UserService.getUser();const be=null==he||null===(a=he.info)||void 0===a?void 0:a.permanentCity,[ye,Ce]=t.useState(null),[Te,De]=t.useState(!1),[Pe,Ne]=t.useState(null),Ie=null==_e||null===(u=_e.data)||void 0===u?void 0:u.edcrDetails,Le=r.useQueryClient(),{data:Be,address:Oe,owners:Re,nocDocuments:xe,documents:we,subOccupancy:Me,PrevStateDocuments:ke,PrevStateNocDocuments:Fe,applicationNo:Ue}=_e;let He=`/digit-ui/citizen/obps/sendbacktocitizen/${"BPA_OC"==_e.businessService?"ocbpa":"bpa"}/${null==_e?void 0:_e.tenantId}/${null==_e?void 0:_e.applicationNo}`;"OCBPA"===(null==_e||null===(d=_e.uiFlow)||void 0===d?void 0:d.flow)&&(He=`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==_e?void 0:_e.tenantId}/${null==_e?void 0:_e.applicationNo}`),Se="BPA_LOW"===_e.businessService?"BPA.LOW_RISK_PERMIT_FEE":"BPA"===_e.businessService?"BPA.NC_APP_FEE":"BPA.NC_OC_APP_FEE";let We=[];null==ke||ke.map(e=>{We.push({...e,module:"OBPS"})}),null==we||null===(s=we.documents)||void 0===s||s.map(e=>{We.push({...e,module:"OBPS"})}),null==Fe||Fe.map(e=>{We.push({...e,module:"NOC"})}),null==xe||null===(c=xe.nocDocuments)||void 0===c||c.map(e=>{We.push({...e,module:"NOC"})});const{data:je,isLoading:$e}=Digit.Hooks.useDocumentSearch(We,{enabled:(null==We?void 0:We.length)>0});let ze=[],Ye=[];var Ge;(null==je||null===(p=je.pdfFiles)||void 0===p?void 0:p.length)>0&&(null==je||null===(Ge=je.pdfFiles)||void 0===Ge||Ge.map(e=>{"OBPS"==(null==e?void 0:e.module)&&ze.push(e),"NOC"==(null==e?void 0:e.module)&&Ye.push(e)}));const{data:Ke,isLoading:Ve}=Digit.Hooks.useRecieptSearch({tenantId:null==_e?void 0:_e.tenantId,businessService:Se,consumerCodes:null==_e?void 0:_e.applicationNo},{enabled:!!(null!=_e&&_e.applicationNo&&Se&&null!=_e&&_e.tenantId)}),qe=Digit.Hooks.obps.useObpsAPI(null==_e?void 0:_e.tenantId,!1),Xe=Digit.Hooks.useWorkflowDetails({tenantId:null==_e?void 0:_e.tenantId,id:null==_e?void 0:_e.applicationNo,moduleCode:"OBPS",config:{enabled:!(null==_e||!_e.applicationNo||null==_e||!_e.tenantId)}}),Je=()=>{Ne(null)},Ze=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],Qe=e=>{const t=e;return(e,l,n)=>e[t]},et=t.useMemo(()=>Ze.map(e=>({Header:ge(""+e.name),accessor:Qe(e.id),id:e.id})));function tt(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:ge("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:ge(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:ge("BPA_FLOOR_NAME_"+e.number)})}),l}function lt(e){location.href=e}function nt(e){let t="";return Me["Block_"+(e+1)]&&Me["Block_"+(e+1)].map(e=>{var l;t+=ge(vt(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_"))+", "}),t}return t.useEffect(()=>{switch(ye){case"FORWARD":De(!0)}},[ye]),$e||Ve?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Hl,{currentStep:4,flow:"OCBPA"===(null==_e||null===(v=_e.uiFlow)||void 0===v?void 0:v.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},ge("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_APPLICATION_NUMBER_LABEL"),text:Ue||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Tt(Number(null==Be?void 0:Be.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:ge("WF_BPA_"+(null==Be?void 0:Be.applicationType))}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:ge(null==Be?void 0:Be.serviceType)}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==Be?void 0:Be.occupancyType}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:ge("WF_BPA_"+(null==Be?void 0:Be.riskType))}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==Be?void 0:Be.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=Ie&&null!==(m=Ie.planDetail)&&void 0!==m&&null!==(E=m.planInformation)&&void 0!==E&&E.plotArea?`${null==Ie||null===(f=Ie.planDetail)||void 0===f||null===(_=f.planInformation)||void 0===_?void 0:_.plotArea} ${ge("BPA_SQ_FT_LABEL")}`:ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_PLOT_NUMBER_LABEL"),text:(null==Ie||null===(g=Ie.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.plotNo)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_KHATHA_NUMBER_LABEL"),text:(null==Ie||null===(S=Ie.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.khataNo)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_HOLDING_NUMBER_LABEL"),text:(null==Be?void 0:Be.holdingNumber)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==Be?void 0:Be.registrationDetails)||ge("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,ge("OCBPA"===(null==_e||null===(b=_e.uiFlow)||void 0===b?void 0:b.flow)?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ge("BPA_EDCR_NO_LABEL"),text:(null==Be||null===(y=Be.scrutinyNumber)||void 0===y?void 0:y.edcrNumber)||ge("CS_NA")}),l.createElement(o.CardSubHeader,null,ge("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>lt(null==Ie?void 0:Ie.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ge("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,ge("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>lt(null==Ie?void 0:Ie.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ge("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,"OCBPA"===(null==_e||null===(C=_e.uiFlow)||void 0===C?void 0:C.flow)?ge("BPA_ACTUAL_BUILDING_EXTRACT_HEADER"):ge("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=Ie&&null!==(T=Ie.planDetail)&&void 0!==T&&null!==(D=T.blocks)&&void 0!==D&&null!==(P=D[0])&&void 0!==P&&null!==(N=P.building)&&void 0!==N&&N.totalBuitUpArea?`${null==Ie||null===(I=Ie.planDetail)||void 0===I||null===(L=I.blocks)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.building)||void 0===O?void 0:O.totalBuitUpArea} ${ge("BPA_SQ_MTRS_LABEL")}`:ge("NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==Ie||null===(R=Ie.planDetail)||void 0===R||null===(x=R.blocks)||void 0===x||null===(w=x[0])||void 0===w||null===(M=w.building)||void 0===M?void 0:M.totalFloors}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==Ie||null===(k=Ie.planDetail)||void 0===k||null===(F=k.blocks)||void 0===F||null===(U=F[0])||void 0===U||null===(H=U.building)||void 0===H?void 0:H.declaredBuildingHeight} ${ge("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,ge("BPA_OCC_SUBOCC_HEADER")),null==Ie||null===(W=Ie.planDetail)||void 0===W?void 0:W.blocks.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},ge("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:ge("BPA_SUB_OCCUPANCY_LABEL"),text:""===nt(t)?ge("CS_NA"):nt(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:ge,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:tt(e),columns:et,getCellProps:e=>({style:{}})})))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,ge("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ge("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=Ie&&null!==(j=Ie.planDetail)&&void 0!==j&&null!==($=j.planInformation)&&void 0!==$&&$.demolitionArea?`${null==Ie||null===(z=Ie.planDetail)||void 0===z||null===(Y=z.planInformation)||void 0===Y?void 0:Y.demolitionArea} ${ge("BPA_SQ_MTRS_LABEL")} `:ge("CS_NA")}))),"OCBPA"!==(null==_e||null===(G=_e.uiFlow)||void 0===G?void 0:G.flow)?l.createElement("div",null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("BPA_DETAILS_PIN_LABEL"),text:(null==Oe?void 0:Oe.pincode)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_CITY_LABEL"),text:(null==Oe||null===(K=Oe.city)||void 0===K?void 0:K.name)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_LOC_MOHALLA_LABEL"),text:(null==Oe||null===(V=Oe.locality)||void 0===V?void 0:V.name)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==Oe?void 0:Oe.street)||ge("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ge("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==Oe?void 0:Oe.landmark)||ge("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_APPLICANT_DETAILS_HEADER")),(null==Re?void 0:Re.owners)&&(null==Re?void 0:Re.owners.map((e,t)=>{var n;return l.createElement("div",{key:t},Re.owners.length>1&&l.createElement(o.CardSubHeader,null,ge("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_APPLICANT_GENDER_LABEL"),text:ge(null==e||null===(n=e.gender)||void 0===n?void 0:n.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:ge("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+(null==e?void 0:e.isPrimaryOwner)})))})))):null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ge("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>lt(He+"/document-details")}),l.createElement(Wl,{documents:xt(ze),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ge("BPA_NOC_DETAILS_SUMMARY")),xe&&(null==xe?void 0:xe.NocDetails.map((e,t)=>{var n;return l.createElement("div",{key:t,style:(null==xe||null===(n=xe.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+ge(`BPA_${null==e?void 0:e.nocType}_HEADER`)),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ge(`BPA_${null==e?void 0:e.nocType}_LABEL`),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_NOC_STATUS"),text:ge(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.Row,{className:"border-none",label:ge("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Wl,{documents:xt(null==Ye?void 0:Ye.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,ge("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==Ke||null===(q=Ke.Payments)||void 0===q||null===(X=q[0])||void 0===X||null===(J=X.paymentDetails)||void 0===J||null===(Z=J[0])||void 0===Z||null===(Q=Z.bill)||void 0===Q||null===(ee=Q.billDetails)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:ge(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:ge("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==Ke||null===(le=Ke.Payments)||void 0===le||null===(ne=le[0])||void 0===ne||null===(ie=ne.paymentDetails)||void 0===ie||null===(oe=ie[0])||void 0===oe||null===(ae=oe.bill)||void 0===ae||null===(re=ae.billDetails)||void 0===re||null===(ue=re[0])||void 0===ue?void 0:ue.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,ge("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==Ke||null===(de=Ke.Payments)||void 0===de||null===(se=de[0])||void 0===se||null===(ce=se.paymentDetails)||void 0===ce||null===(pe=ce[0])||void 0===pe||null===(ve=pe.bill)||void 0===ve||null===(me=ve.billDetails)||void 0===me||null===(Ee=me[0])||void 0===Ee?void 0:Ee.amount)||"0"),l.createElement(o.SubmitBar,{label:ge("BPA_COMMON_BUTTON_SUBMIT"),onSubmit:function(e){Ce("FORWARD"),De(!0)}})),Te?l.createElement(an,{t:ge,action:ye,tenantId:be,id:null==_e?void 0:_e.applicationNo,closeModal:()=>{Ce(null),De(!1)},submitAction:e=>{var t;let l=ct(_e);l.assignee=[];const n="OCBPA"===(null==_e||null===(t=_e.uiFlow)||void 0===t?void 0:t.flow),i=bt(l,n,!0);qe.mutate({BPA:{...null==i?void 0:i.BPA,workflow:e}},{onError:(e,t)=>{var l,n,i;De(!1),Ne({key:"error",action:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors[0])||void 0===i?void 0:i.message)||e}),setTimeout(Je,5e3)},onSuccess:(e,t)=>{De(!1),Ne({key:"success",action:ye}),setTimeout(Je,5e3),Le.invalidateQueries("BPA_DETAILS_PAGE"),Le.invalidateQueries("workFlowDetails"),Ae.replace(`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==_e?void 0:_e.tenantId}/${null==_e?void 0:_e.applicationNo}/acknowledgement`,{data:null==_e?void 0:_e.applicationNo})}})},actionData:null==Xe||null===(fe=Xe.data)||void 0===fe?void 0:fe.timeline}):null,Pe&&l.createElement(o.Toast,{error:"error"===Pe.key,label:ge("success"===Pe.key?`ES_OBPS_${Pe.action}_UPDATE_SUCCESS`:Pe.action),onClose:Je}))},EDCRAcknowledgement:e=>{var a,r,u,d,s,c,p;const{t:v}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var f;if(t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:v(null==e||null===(f=e.data)||void 0===f?void 0:f.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0));const _=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[g,A]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:b}=(window.Digit.Utils.browser.isMobile(),Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]));Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!b&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==_?void 0:_.appliactionType)&&(null==e?void 0:e.serviceType)===(null==_?void 0:_.applicationSubType)&&A({linkData:e,edcrNumber:null==_?void 0:_.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(_.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==_.status?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==_?void 0:_.edcrNumber,info:v("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/obps/${null==g||null===(d=g.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase()}/${null==_||null===(c=_.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==_||null===(p=_.applicationSubType)||void 0===p?void 0:p.toLowerCase()}/docs-required`,state:g},replace:!0},l.createElement(o.SubmitBar,{label:v("BPA_APPLY_FOR_BPA_LABEL"),onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}),l.createElement(o.CardText,{className:"button-sub-text",style:{fontSize:"14px",lineHeight:"16px",textAlign:"center",margin:"0px",marginTop:"4px",fontWeight:"400",color:"#0B0C0C"}},v("BPA_FOR_NEW_CONSTRUCTION_LABEL"))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:v("CORE_COMMON_GO_TO_HOME")}))))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")})))))},OCEDCRAcknowledgement:e=>{var a,r,u,d,s,c,p;const{t:v}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var f;if(t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:v(null==e||null===(f=e.data)||void 0===f?void 0:f.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("isPermitApplication",!0);const _=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[g,A]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:b}=Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]);Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!b&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==_?void 0:_.appliactionType)&&(null==e?void 0:e.serviceType)===(null==_?void 0:_.applicationSubType)&&A({linkData:e,edcrNumber:null==_?void 0:_.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(_.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==(null==_?void 0:_.status)?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("BPA_OC_EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==_?void 0:_.edcrNumber,info:v("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/obps/${null==g||null===(d=g.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase()}/${null==_||null===(c=_.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==_||null===(p=_.applicationSubType)||void 0===p?void 0:p.toLowerCase()}/docs-required`,state:g},replace:!0},l.createElement(o.SubmitBar,{label:v("BPA_APPLY_OC_FOR_BPA_LABEL"),className:"oc-aknowledgement-screen",onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:v("CORE_COMMON_GO_TO_HOME")})))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("BPA_OC_EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==_?void 0:_.applicationNumber}`),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")})))))},BPAAcknowledgement:e=>{var a,r,u,d,s,c;let{data:p,onSuccess:v}=e;const{t:m}=n.useTranslation(),E=Digit.ULBService.getCurrentTenantId(),f=Digit.Hooks.obps.useObpsAPI(null!=p&&null!==(a=p.address)&&void 0!==a&&a.city?null===(r=p.address)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.code:E,!0),_=Digit.Hooks.obps.useObpsAPI(null!=p&&null!==(d=p.address)&&void 0!==d&&d.city?null===(s=p.address)||void 0===s||null===(c=s.city)||void 0===c?void 0:c.code:E,!1),{data:g}=Digit.Hooks.useStore.getInitData(),{tenants:A}=g||{};return t.useEffect(()=>{try{var e,t,l,n;let i=null!=p&&null!==(e=p.address)&&void 0!==e&&e.city?null===(t=p.address)||void 0===t||null===(l=t.city)||void 0===l?void 0:l.code:E;p.tenantId=i;let o={};null==p||null===(n=p.nocDocuments)||void 0===n||n.NocDetails.map(e=>{o=Et(e,p),f.mutate(o,{onSuccess:v})}),o=bt(p),_.mutate(o,{onSuccess:v}),sessionStorage.removeItem("Malbafees"),sessionStorage.removeItem("WaterCharges"),sessionStorage.removeItem("GaushalaFees"),sessionStorage.removeItem("LabourCess"),sessionStorage.removeItem("otherCharges"),sessionStorage.removeItem("lessAdjusment"),sessionStorage.removeItem("development")}catch(e){}},[]),_.isLoading||_.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(ga,{t:m,data:_.data,isSuccess:_.isSuccess,isLoading:_.isIdle||_.isLoading}),_.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,p;const v=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA",E=null==v?void 0:v.status;return"BPA_LOW"==m&&(m="BPA"),e("BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)?`BPA_SUBMIT_SUB_HEADER_${m}_${null==v||null===(r=v.workflow)||void 0===r?void 0:r.action}_${null!=v&&null!==(u=v.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==v||null===(d=v.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${vt(E," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${m}_${null==v||null===(s=v.workflow)||void 0===s?void 0:s.action}_${null!=v&&null!==(c=v.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==v||null===(p=v.additionalDetails)||void 0===p?void 0:p.typeOfArchitect:"ARCHITECT"}_${vt(E," ","_").toUpperCase()}`)})(m,_.data)),!_.isSuccess&&l.createElement(o.CardText,null,m("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:m("CORE_COMMON_GO_TO_HOME")})),_.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:m("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=p,t=A.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W,j,$,z,Y,G,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${se=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),se.toLowerCase().split(" ").map(Oo).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_BUILD_PERMIT_APPLICATION"),applicationNumber:(null==e?void 0:e.applicationNo)||"NA",details:[{title:l("BPA_BASIC_DETAILS_TITLE"),values:[{title:(null==e?void 0:e.businessService)!==l("BPA_OC")?l("BPA_EDCR_NO_LABEL"):l("BPA_OC_EDCR_NO_LABEL"),value:(null==e?void 0:e.edcrNumber)||"NA"},{title:l("BPA_BASIC_DETAILS_APP_DATE_LABEL"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime,"dd/MM/yyyy")||"NA"},{title:l("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),value:l("WF_BPA_"+(null==e||null===(o=e.data)||void 0===o||null===(a=o.edcrDetails)||void 0===a?void 0:a.appliactionType))||"NA"},{title:l("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),value:l(""+(null==e||null===(r=e.data)||void 0===r||null===(u=r.edcrDetails)||void 0===u?void 0:u.applicationSubType))||"NA"},{title:l("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),value:null==e||null===(d=e.data)||void 0===d||null===(s=d.edcrDetails)||void 0===s||null===(c=s.planDetail)||void 0===c||null===(p=c.planInformation)||void 0===p?void 0:p.occupancy},{title:l("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),value:l("WF_BPA_"+(null==e?void 0:e.riskType))||"NA"},{title:l("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),value:(null==e||null===(v=e.data)||void 0===v||null===(m=v.edcrDetails)||void 0===m||null===(E=m.planDetail)||void 0===E||null===(f=E.planInformation)||void 0===f?void 0:f.applicantName)||"NA"}]},{title:l("BPA_PLOT_DETAILS_TITLE"),values:[{title:l("BPA_BOUNDARY_PLOT_AREA_LABEL"),value:(null==e||null===(_=e.data)||void 0===_||null===(g=_.edcrDetails)||void 0===g||null===(A=g.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.plotArea)+" sq.ft"||"NA"},{title:l("BPA_PLOT_NUMBER_LABEL"),value:(null==e||null===(h=e.data)||void 0===h||null===(b=h.edcrDetails)||void 0===b||null===(y=b.planDetail)||void 0===y||null===(C=y.planInformation)||void 0===C?void 0:C.plotNo)||"NA"},{title:l("BPA_KHATHA_NUMBER_LABEL"),value:(null==e||null===(T=e.data)||void 0===T||null===(D=T.edcrDetails)||void 0===D||null===(P=D.planDetail)||void 0===P||null===(N=P.planInformation)||void 0===N?void 0:N.khataNo)||"NA"},{title:l("BPA_HOLDING_NUMBER_LABEL"),value:(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.holdingNo)||"NA"},{title:l("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),value:(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.registrationDetails)||"NA"},{title:l("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),value:l((null==e||null===(B=e.data)||void 0===B||null===(O=B.edcrDetails)||void 0===O||null===(R=O.planDetail)||void 0===R||null===(x=R.planInformation)||void 0===x?void 0:x.demolitionArea)+" sq.mtrs")||"NA"}]},{title:l("BPA_NOC_DETAILS_SUMMARY"),values:[{title:l(`BPA_${null==e||null===(w=e.nocDocuments)||void 0===w||null===(M=w.NocDetails[0])||void 0===M?void 0:M.nocType}_LABEL`),value:(null==e||null===(k=e.nocDocuments)||void 0===k||null===(F=k.NocDetails[0])||void 0===F?void 0:F.applicationNo)||"NA"},{title:l(`BPA_${null==e||null===(U=e.nocDocuments)||void 0===U||null===(H=U.NocDetails[1])||void 0===H?void 0:H.nocType}_LABEL`),value:(null==e||null===(W=e.nocDocuments)||void 0===W||null===(j=W.NocDetails[1])||void 0===j?void 0:j.applicationNo)||"NA"}]},{title:l("BPA_APPLICANT_DETAILS_HEADER"),values:[{title:l("CORE_COMMON_NAME"),value:(null==e||null===($=e.landInfo)||void 0===$||null===(z=$.owners[0])||void 0===z?void 0:z.name)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(Y=e.landInfo)||void 0===Y||null===(G=Y.owners[0])||void 0===G?void 0:G.gender)||"NA"},{title:l("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(K=e.landInfo)||void 0===K||null===(V=K.owners[0])||void 0===V?void 0:V.mobileNumber)||"NA"},{title:l("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(q=e.landInfo)||void 0===q||null===(X=q.owners[0])||void 0===X?void 0:X.emailId)||"NA"},{title:l("BPA_IS_PRIMARY_OWNER_LABEL"),value:(null==e||null===(J=e.landInfo)||void 0===J||null===(Z=J.owners[0])||void 0===Z?void 0:Z.isPrimaryOwner)||"NA"}]},{title:l("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS"),values:[{title:l("BPA_DETAILS_PIN_LABEL"),value:(null==e||null===(Q=e.landInfo)||void 0===Q||null===(ee=Q.address)||void 0===ee?void 0:ee.pincode)||"NA"},{title:l("BPA_CITY_LABEL"),value:(null==e||null===(te=e.landInfo)||void 0===te||null===(le=te.address)||void 0===le?void 0:le.city)||"NA"},{title:l("BPA_LOC_MOHALLA_LABEL"),value:(null==e||null===(ne=e.landInfo)||void 0===ne||null===(ie=ne.address)||void 0===ie||null===(oe=ie.locality)||void 0===oe?void 0:oe.name)||"NA"},{title:l("BPA_DETAILS_SRT_NAME_LABEL"),value:(null==e||null===(ae=e.landInfo)||void 0===ae||null===(re=ae.address)||void 0===re?void 0:re.street)||"NA"},{title:l("ES_NEW_APPLICATION_LOCATION_LANDMARK"),value:(null==e||null===(ue=e.landInfo)||void 0===ue||null===(de=ue.address)||void 0===de?void 0:de.landmark)||"NA"}]}]})}catch(e){return Promise.reject(e)}var se}(e,t,m)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})))},OCBPAAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:u}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!0),c=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!1);return Digit.Hooks.useStore.getInitData(),t.useEffect(()=>{try{var e;a.tenantId=null==a?void 0:a.tenantId;let t={};null==a||null===(e=a.nocDocuments)||void 0===e||e.NocDetails.map(e=>{t=Et(e,a),s.mutate(t,{onSuccess:r})}),t=bt(a,!0),c.mutate(t,{onSuccess:r})}catch(e){}},[]),c.isLoading||c.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(ha,{t:u,data:c.data,isSuccess:c.isSuccess,isLoading:c.isIdle||c.isLoading}),c.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,p;const v=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA",E=null==v?void 0:v.status;return"BPA_LOW"==m&&(m="BPA"),"BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)&&e(`BPA_SUBMIT_SUB_HEADER_${m}_${null==v||null===(r=v.workflow)||void 0===r?void 0:r.action}_${null!=v&&null!==(u=v.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==v||null===(d=v.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${vt(E," ","_").toUpperCase()}`),e(`BPA_SUB_HEADER_${m}_${null==v||null===(s=v.workflow)||void 0===s?void 0:s.action}_${null!=v&&null!==(c=v.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==v||null===(p=v.additionalDetails)||void 0===p?void 0:p.typeOfArchitect:"ARCHITECT"}_${vt(E," ","_").toUpperCase()}`)})(u,c.data)),!c.isSuccess&&l.createElement(o.CardText,null,u(Digit.Utils.locale.getTransformedLocale(c.error.message))),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME")})))},OCSendBackAcknowledgement:e=>{var t,a,r;const u=null==e?void 0:e.data,{t:d}=n.useTranslation();let s=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null,c=null!=u&&u.businessService?null==u?void 0:u.businessService:"BPA",p=null==u?void 0:u.status,v=null!=u&&null!==(t=u.workflow)&&void 0!==t&&t.action?null==u||null===(a=u.workflow)||void 0===a?void 0:a.action:"VERIFY_FORWARD",m=null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.typeOfArchitect;return"BPA_LOW"==c&&(c="BPA"),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:d("BPA_SUBMIT_APP"==s?`BPA_SUBMIT_HEADER_${c}_${v}_${vt(p," ","_").toUpperCase()}`:`BPA_HEADER_${c}_${v}_${vt(p," ","_").toUpperCase()}`),applicationNumber:null==u?void 0:u.applicationNo,info:d("BPA"==c?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:!0,style:{padding:"10px"},headerStyles:{fontSize:"32px"}}),l.createElement(o.CardText,null,d("BPA_SUBMIT_APP"==s?`BPA_SUBMIT_SUB_HEADER_${c}_${v}_${m||"ARCHITECT"}_${vt(p," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${c}_${v}_${m||"ARCHITECT"}_${vt(p," ","_").toUpperCase()}`)),l.createElement("div",{style:{marginTop:"12px",padding:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})))))},StakeholderAcknowledgement:e=>{var a,r,u,d,s,c,p,v,m,E;let{data:f,onSuccess:_}=e;const{t:g}=n.useTranslation(),{id:A}=i.useParams(),S=Digit.ULBService.getCurrentTenantId(),h=Digit.Hooks.obps.useStakeholderAPI(null!=f&&null!==(a=f.address)&&void 0!==a&&a.city?null===(r=f.address)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.code:S,!0),{data:b}=Digit.Hooks.useStore.getInitData(),{tenants:y}=b||{};let C=window.location.href.includes("openlink");Digit.Utils.browser.isMobile();const T=(null==h||null===(d=h.data)||void 0===d||null===(s=d.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(p=c.tradeLicenseDetail)||void 0===p||null===(v=p.tradeUnits)||void 0===v||null===(m=v[0])||void 0===m||null===(E=m.tradeType)||void 0===E?void 0:E.split(".")[0])||"ARCHITECT";t.useEffect(()=>{try{var e,t,l,n;let i=null!=f&&null!==(e=f.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.tenantId?null==f||null===(l=f.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tenantId:i;f.tenantId=i;let o={};o=(e=>{var t,l,n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W;return{Licenses:[{...null==e||null===(t=e.result)||void 0===t?void 0:t.Licenses[0],action:"APPLY",tradeLicenseDetail:{...null==e||null===(l=e.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tradeLicenseDetail,additionalDetail:{counsilForArchNo:null==e||null===(i=e.formData)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.ArchitectNo,isSelfCertificationRequired:null==e||null===(a=e.formData)||void 0===a||null===(r=a.LicneseType)||void 0===r?void 0:r.selfCertification},tradeUnits:[{...null==e||null===(u=e.result)||void 0===u||null===(d=u.Licenses[0])||void 0===d||null===(s=d.tradeLicenseDetail)||void 0===s||null===(c=s.tradeUnits)||void 0===c?void 0:c[0],tradeType:null==e||null===(p=e.formData)||void 0===p||null===(v=p.LicneseType)||void 0===v||null===(m=v.LicenseType)||void 0===m?void 0:m.tradeType,id:null==e||null===(E=e.result)||void 0===E||null===(f=E.Licenses[0])||void 0===f||null===(_=f.tradeLicenseDetail)||void 0===_||null===(g=_.tradeUnits)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.id}],owners:[{...null==e||null===(S=e.result)||void 0===S||null===(h=S.Licenses[0])||void 0===h||null===(b=h.tradeLicenseDetail)||void 0===b||null===(y=b.owners)||void 0===y?void 0:y[0],gender:null==e||null===(C=e.formData)||void 0===C||null===(T=C.LicneseDetails)||void 0===T||null===(D=T.gender)||void 0===D?void 0:D.code,mobileNumber:null==e||null===(P=e.formData)||void 0===P||null===(N=P.LicneseDetails)||void 0===N?void 0:N.mobileNumber,name:null==e||null===(I=e.formData)||void 0===I||null===(L=I.LicneseDetails)||void 0===L?void 0:L.name,dob:null,emailId:null==e||null===(B=e.formData)||void 0===B||null===(O=B.LicneseDetails)||void 0===O?void 0:O.email,permanentAddress:null==e||null===(R=e.formData)||void 0===R||null===(x=R.LicneseDetails)||void 0===x?void 0:x.PermanentAddress,correspondenceAddress:null==e?void 0:e.Correspondenceaddress,pan:null==e||null===(w=e.formData)||void 0===w||null===(M=w.LicneseDetails)||void 0===M?void 0:M.PanNumber,uuid:null==e||null===(k=e.result)||void 0===k||null===(F=k.Licenses[0])||void 0===F||null===(U=F.tradeLicenseDetail)||void 0===U||null===(H=U.owners)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.uuid}],applicationDocuments:yt(e)}}]}})(f),h.mutate(o,{onSuccess:_})}catch(e){}},[]);const D=null==S?void 0:S.split(".")[0],{data:P}=(Digit.Hooks.useWorkflowDetails({tenantId:null==S?void 0:S.split(".")[0],id:A,moduleCode:"BPAREG"}),Digit.Hooks.obps.useLicenseDetails(D,{applicationNumber:A,tenantId:D},{}));return h.isLoading||h.isIdle?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:C?"OpenlinkContainer":""},C&&l.createElement(o.BackButton,{style:{border:"none"}},g("CS_COMMON_BACK")),l.createElement(o.Card,null,l.createElement(Ca,{t:g,data:h.data,isSuccess:h.isSuccess,isLoading:h.isIdle||h.isLoading}),h.isSuccess&&l.createElement(o.CardText,null,`${g("TRADELICENSE_TRADETYPE_"+T)}${g("CS_FILE_STAKEHOLDER_RESPONSE")}`),!h.isSuccess&&l.createElement(o.CardText,null,g("CS_FILE_PROPERTY_FAILED_RESPONSE")),h.isSuccess&&!C&&l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${h.data.Licenses[0].businessService}/${h.data.Licenses[0].applicationNumber}/${h.data.Licenses[0].tenantId}?tenantId=${h.data.Licenses[0].tenantId}`,state:{tenantId:h.data.Licenses[0].tenantId}}},l.createElement(o.SubmitBar,{label:g("COMMON_MAKE_PAYMENT")})),h.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:g("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=P,t=y.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${x=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),x.toLowerCase().split(" ").map(ba).join(" ")}`,email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_STAKEHOLDER_REGISTRATION"),applicationNumber:(null==e||null===(i=e.applicationData)||void 0===i?void 0:i.applicationNumber)||"NA",details:[{title:l("CS_APPLICATION_DETAILS"),values:[{title:l("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(o=e.applicationData)||void 0===o||null===(a=o.auditDetails)||void 0===a?void 0:a.createdTime,"dd/MM/yyyy")||"NA"}]},{title:l("BPA_LICENSE_DETAILS_LABEL"),values:[{title:l("BPA_LICENSE_TYPE"),value:(null==e||null===(r=e.applicationDetails)||void 0===r||null===(u=r[1])||void 0===u||null===(d=u.values[0])||void 0===d?void 0:d.value)||"NA"},{title:l("BPA_COUNCIL_OF_ARCH_NO_LABEL"),value:(null==e||null===(s=e.applicationDetails)||void 0===s||null===(c=s[1])||void 0===c||null===(p=c.values[1])||void 0===p?void 0:p.value)||"NA"},{title:l("LICENSE_TYPE"),value:(null==e||null===(v=e.applicationData)||void 0===v?void 0:v.licenseType)||"NA"}]},{title:l("BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO"),values:[{title:l("BPA_APPLICANT_NAME_LABEL"),value:(null==e||null===(m=e.applicationData)||void 0===m||null===(E=m.tradeLicenseDetail)||void 0===E||null===(f=E.owners)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.name)||"NA"},{title:l("BPA_OWNER_MOBILE_NO_LABEL"),value:(null==e||null===(g=e.applicationData)||void 0===g||null===(A=g.tradeLicenseDetail)||void 0===A||null===(S=A.owners)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.mobileNumber)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(b=e.applicationDetails)||void 0===b||null===(y=b[2])||void 0===y||null===(C=y.values[1])||void 0===C?void 0:C.value)||"NA"},{title:l("BPA_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(T=e.applicationDetails)||void 0===T||null===(D=T[2])||void 0===D||null===(P=D.values[3])||void 0===P?void 0:P.value)||"NA"}]},{title:l("BPA_ADDRESS_LABEL"),values:[{title:l("BPA_PERMANANT_ADDRESS_LABEL"),value:(null==e||null===(N=e.applicationDetails)||void 0===N||null===(I=N[3])||void 0===I||null===(L=I.values[0])||void 0===L?void 0:L.value)||"NA"},{title:l("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL"),value:(null==e||null===(B=e.applicationDetails)||void 0===B||null===(O=B[4])||void 0===O||null===(R=O.values[0])||void 0===R?void 0:R.value)||"NA"}]}]})}catch(e){return Promise.reject(e)}var x}(e,t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),!C&&l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:g("CORE_COMMON_GO_TO_HOME")})),h.isSuccess&&C&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:g("BPA_COMMON_PROCEED_NEXT")})))))},ObpsCreateEDCR:e=>{var o,a,u,d;const s=r.useQueryClient(),c=i.useRouteMatch(),{t:p}=n.useTranslation(),v=(i.useLocation(),i.useHistory());let m=[];const[E,f,_]=Digit.Hooks.useSessionStorage("EDCR_CREATE",{}),[g,A]=t.useState(null),[S,h]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const b=Digit.ULBService.getStateId();let{data:y}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(b,[]);function C(e,t,l,n){var i,o,a;h(!0);const r=Digit.UserService.getUser();let u={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{id:null==r||null===(i=r.info)||void 0===i?void 0:i.uuid,tenantId:null==r||null===(o=r.info)||void 0===o?void 0:o.tenantId}}};const d=null==t?void 0:t.applicantName,s=null==t?void 0:t.file,c=null==t||null===(a=t.tenantId)||void 0===a?void 0:a.code,p=mt();u={...u,tenantId:c},u={...u,transactionNumber:p},u={...u,applicantName:d},u={...u,appliactionType:"BUILDING_PLAN_SCRUTINY"},u={...u,applicationSubType:"NEW_CONSTRUCTION"};let m=new FormData;m.append("edcrRequest",JSON.stringify(u)),m.append("planFile",s),Digit.EDCRService.create({data:m},c).then((e,t)=>{var l,n,i,o,a,r;h(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(console.log("result?.data",null==e?void 0:e.data),sessionStorage.setItem("plotArea",(null==e||null===(n=e.data)||void 0===n||null===(i=n.edcrDetail[0].planDetail)||void 0===i||null===(o=i.plot)||void 0===o?void 0:o.area)||0),f(null==e||null===(a=e.data)||void 0===a?void 0:a.edcrDetail),v.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null==e||null===(r=e.data)||void 0===r?void 0:r.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;f({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),h(!1),A({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}const T=()=>{},D=()=>{};y=null!==(o=y)&&void 0!==o&&o.EdcrConfig?null===(a=y)||void 0===a?void 0:a.EdcrConfig:Gl,y.forEach(e=>{m=m.concat(e.body.filter(e=>!e.hideInCitizen))}),m.indexRoute="home";const P=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("EDCRAcknowledgement");return l.createElement(i.Switch,null,m.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${c.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:C,onSkip:T,t:p,formData:E,onAdd:D,isShowToast:g,isSubmitBtnDisable:S,setIsShowToast:A}))}),l.createElement(i.Route,{path:c.path+"/acknowledgement"},l.createElement(P,{data:E,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),s.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${c.path}/${m.indexRoute}`})))},ObpsCreateOCEDCR:e=>{var o,a,u,d;const s=r.useQueryClient(),c=i.useRouteMatch(),{t:p}=n.useTranslation(),{pathname:v}=i.useLocation(),{path:m}=i.useRouteMatch(),E=i.useHistory();let f=[];const[_,g,A]=Digit.Hooks.useSessionStorage("OC_EDCR_CREATE",{}),[S,h]=t.useState(null),[b,y]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const C=Digit.ULBService.getStateId();let{data:T}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(C,[]);const D=(e,t,l,n)=>{n?function(e,t,l,n){var i,o,a,r,u,d,s,c;y(!0);const p=_,v=Digit.UserService.getUser();let m={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{id:null==v||null===(i=v.info)||void 0===i?void 0:i.uuid,tenantId:null==v||null===(o=v.info)||void 0===o?void 0:o.tenantId}}};const f=mt(),A=null==p||null===(a=p.ScrutinyDetails)||void 0===a?void 0:a.edcrNumber,S=null==p||null===(r=p.ScrutinyDetails)||void 0===r?void 0:r.tenantId,b=null==p||null===(u=p.ScrutinyDetails)||void 0===u?void 0:u.applicantName,C=Ct(null==p||null===(d=p.ScrutinyDetails)||void 0===d?void 0:d.ocPermitdate),T=null==p||null===(s=p.ScrutinyDetails)||void 0===s?void 0:s.ocPermitNumber,D=null==p||null===(c=p.ScrutinyDetails)||void 0===c?void 0:c.edcrNumber,P=null==t?void 0:t.file;m={...m,transactionNumber:f},m={...m,edcrNumber:A},m={...m,tenantId:S},m={...m,applicantName:b},m={...m,appliactionType:"BUILDING_OC_PLAN_SCRUTINY"},m={...m,applicationSubType:"NEW_CONSTRUCTION"},m={...m,permitDate:C},m={...m,permitNumber:T},m={...m,comparisonEdcrNumber:D};let N=new FormData;N.append("edcrRequest",JSON.stringify(m)),N.append("planFile",P),Digit.EDCRService.create({data:N},S).then((e,t)=>{var l,n,i;y(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(g(null==e||null===(n=e.data)||void 0===n?void 0:n.edcrDetail),E.replace("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null==e||null===(i=e.data)||void 0===i?void 0:i.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;g({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),y(!1),h({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}(0,t):g({..._,[e]:{..._[e],...t}}),l||(e=>{const t=v.split("/").pop(),{nextStep:l}=f.find(e=>e.route===t);let n=E.push;if(null===l)return n(m+"/check");n(`${m}/${l}`)})()},P=()=>{},N=()=>{};T=null!==(o=T)&&void 0!==o&&o.OCEdcrConfig?null===(a=T)||void 0===a?void 0:a.OCEdcrConfig:Kl,T.forEach(e=>{f=f.concat(e.body.filter(e=>!e.hideInCitizen))}),f.indexRoute="docs-required";const I=null===(u=Digit)||void 0===u||null===(d=u.ComponentRegistryService)||void 0===d?void 0:d.getComponent("OCEDCRAcknowledgement");return l.createElement(i.Switch,null,f.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${c.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:D,onSkip:P,t:p,formData:_,onAdd:N,isShowToast:S,isSubmitBtnDisable:b,setIsShowToast:h}))}),l.createElement(i.Route,{path:c.path+"/acknowledgement"},l.createElement(I,{data:_,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),s.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${c.path}/${f.indexRoute}`})))},ObpsNewBuildingPermit:()=>{var e,o,a,u,d,s;const c=r.useQueryClient(),{t:p}=n.useTranslation(),{pathname:v,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useRouteMatch(),f=i.useHistory();i.useLocation(),Digit.SessionStorage.set("OBPS_PT","true"),sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[_,g,A]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=m&&m.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==m?void 0:m.edcrNumber}}}:{}),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const b=(e,t,l,n)=>{g(n?t:""===e?{...t}:{..._,[e]:{..._[e],...t}}),(e=>{const t=v.split("/").pop(),{nextStep:l}=ql.find(e=>e.route===t);let n=f.push;if(null===l)return n(Xl(E.path,E.params)+"/check");n(`${Xl(E.path,E.params)}/${l}`)})()},y=()=>{};let C=[];h=null!==(e=h)&&void 0!==e&&e.BuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.BuildingPermitConfig:Vl,h.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const T=null===(a=Digit)||void 0===a||null===(u=a.ComponentRegistryService)||void 0===u?void 0:u.getComponent("BPACheckPage"),D=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("BPAAcknowledgement");return l.createElement(i.Switch,null,ql.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${Xl(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:p,formData:_}))}),l.createElement(i.Route,{path:Xl(E.path,E.params)+"/check"},l.createElement(T,{onSubmit:function(){try{return f.push(Xl(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(i.Route,{path:Xl(E.path,E.params)+"/acknowledgement"},l.createElement(D,{data:_,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Xl(E.path,E.params)}/${C.indexRoute}`})))},ObpsOCBuildingPermit:()=>{var e,o,a,u,d,s;const c=r.useQueryClient(),{t:p}=n.useTranslation(),{pathname:v,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useHistory(),f=i.useRouteMatch();sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[_,g,A]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=m&&m.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==m?void 0:m.edcrNumber}}}:{}),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const b=(e,t,l,n)=>{g(n?t:""===e?{...t}:{..._,[e]:{..._[e],...t}}),(e=>{const t=v.split("/").pop(),{nextStep:l}=C.find(e=>e.route===t);let n=E.push;if(null===l)return n(Zl(f.path,f.params)+"/check");n(`${Zl(f.path,f.params)}/${l}`)})()},y=()=>{};let C=[];h=null!==(e=h)&&void 0!==e&&e.OCBuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.OCBuildingPermitConfig:Jl,h.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const T=null===(a=Digit)||void 0===a||null===(u=a.ComponentRegistryService)||void 0===u?void 0:u.getComponent("OCBPACheckPage"),D=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("OCBPAAcknowledgement");return l.createElement(i.Switch,null,C.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${Zl(f.path,f.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:p,formData:_}))}),l.createElement(i.Route,{path:Zl(f.path,f.params)+"/check"},l.createElement(T,{onSubmit:function(){try{return E.push(Zl(f.path,f.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(i.Route,{path:Zl(f.path,f.params)+"/acknowledgement"},l.createElement(D,{data:_,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Zl(f.path,f.params)}/${C.indexRoute}`})))},ObpsStakeholderRegistration:()=>{var e,o,a,u,d,s;const c=r.useQueryClient(),{t:p}=n.useTranslation(),{path:v}=i.useRouteMatch(),{pathname:m,state:E}=i.useLocation(),f=i.useHistory(),[_,g,A]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=E&&E.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==E?void 0:E.edcrNumber}}}:{})),S=Digit.ULBService.getStateId();let{data:h}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(S,[]);const b=(e,t,l,n)=>{g(n?t:""===e?{...t}:{..._,[e]:{..._[e],...t}}),(e=>{const t=m.split("/").pop(),{nextStep:l}=C.find(e=>e.route===t);let n=f.push;if(null===l)return n(v+"/check");n(`${v}/${l}`)})()},y=()=>{};let C=[];h=null!==(e=h)&&void 0!==e&&e.StakeholderConfig?null===(o=h)||void 0===o?void 0:o.StakeholderConfig:Ql,h.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="stakeholder-docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const T=null===(a=Digit)||void 0===a||null===(u=a.ComponentRegistryService)||void 0===u?void 0:u.getComponent("StakeholderCheckPage"),D=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("StakeholderAcknowledgement");return l.createElement(i.Switch,null,C.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${v}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:p,formData:_}))}),l.createElement(i.Route,{path:v+"/check"},l.createElement(T,{onSubmit:function(){try{return f.push(v+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(i.Route,{path:v+"/acknowledgement"},l.createElement(D,{data:_,onSuccess:()=>{A(),c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${v}/${C.indexRoute}`})))},ObpsCitizenBpaApplicationDetail:()=>{var e,a,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N;const I=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{let e=new Date;ue.applicationData.additionalDetails.runDate=Ct(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let i={...null==ue?void 0:ue.applicationData,edcrDetail:[{...null==ue?void 0:ue.edcrDetails}]};return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[i]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,o;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),i.applicationType=null==ue||null===(n=ue.applicationData)||void 0===n||null===(o=n.additionalDetails)||void 0===o?void 0:o.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...i}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?Bt(new Blob([e.data],{type:"application/pdf"})):Lt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},L=function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const n=function(){if(null==l||!l.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==l?void 0:l.fileStoreId]}}();return Promise.resolve(n&&n.then?n.then(i):i())}catch(e){return Promise.reject(e)}},{id:B}=i.useParams(),{t:O}=n.useTranslation(),R=Digit.ULBService.getCurrentTenantId(),x=Digit.ULBService.getStateId(),w=window.Digit.Utils.browser.isMobile(),M=r.useQueryClient(),[k,F]=t.useState(null),[U,H]=t.useState(!1),[W,j]=t.useState(!1),[$,z]=t.useState(!1),[Y,G]=t.useState(!1),[K,V]=t.useState(null),[q,X]=t.useState(!1),[J,Z]=t.useState(!1),[Q,ee]=t.useState(!1),[te,le]=t.useState(!1);sessionStorage.removeItem("BPA_SUBMIT_APP"),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!1));const ne=i.useHistory();sessionStorage.setItem("bpaApplicationDetails",!1);let ie=!1;const{data:oe}=Digit.Hooks.obps.useMDMS(x,"StakeholderRegistraition","TradeTypetoRoleMapping"),{isLoading:ae,data:re}=Digit.Hooks.obps.useMDMS(x,"BPA",["DocTypeMapping"]),{data:ue,isLoading:de}=Digit.Hooks.obps.useBPADetailsPage(R,{applicationNo:B}),{data:se}=Digit.Hooks.obps.useMDMS(R.split(".")[0],"BPA",["RiskTypeComputation"]),ce=Digit.Hooks.obps.useObpsAPI(null==ue||null===(e=ue.applicationData)||void 0===e?void 0:e.tenantId,!1);let pe=Digit.Hooks.useWorkflowDetails({tenantId:null==ue||null===(a=ue.applicationData)||void 0===a?void 0:a.tenantId,id:B,moduleCode:"OBPS",config:{enabled:!!ue}});t.useEffect(()=>{if(!ae&&!de){var e;let p=[];if(null!=re&&null!==(e=re.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;p=null==re||null===(t=re.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==ue||null===(l=ue.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==ue||null===(i=ue.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==ue||null===(n=ue.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,v=[];p&&(null===(u=p)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=p)||void 0===s||null===(c=s[0])||void 0===c||c.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{v.push(e)})}));const m=null==ue?void 0:ue.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:v}]}}:e);ue.applicationDetails=[...m]}}},[re,ue]),t.useEffect(()=>{var e,t;"CITIZEN_APPROVAL_INPROCESS"==(null==ue||null===(e=ue.applicationData)||void 0===e?void 0:e.status)||"INPROGRESS"==(null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.status)?Z(!0):Z(!1)},[ue]);const ve=(e,t)=>e?t?e:O(e):O("NA");t.useEffect(()=>{switch(K){case"APPROVE":case"SEND_TO_ARCHITECT":case"APPLY":case"SKIP_PAYMENT":z(!0)}},[K]);const me=()=>{F(null)};function Ee(e){var t;let l="BPA_OC"==(null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.businessService)?"ocbpa":"bpa";var n,i,o,a,r,u,d;"FORWARD"===e&&ne.replace(`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==ue||null===(n=ue.applicationData)||void 0===n?void 0:n.tenantId}/${null==ue||null===(i=ue.applicationData)||void 0===i?void 0:i.applicationNo}/check`,{data:null==ue?void 0:ue.applicationData,edcrDetails:null==ue?void 0:ue.edcrDetails}),"PAY"===e&&window.location.assign(`${window.location.origin}/digit-ui/citizen/payment/collect/${It(null==ue?void 0:ue.businessService,null==ue?void 0:ue.applicationStatus)}/${B}/${null==ue?void 0:ue.tenantId}?tenantId=${null==ue?void 0:ue.tenantId}`),"SEND_TO_CITIZEN"===e&&((null===(o=pe)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.processInstances)||void 0===r?void 0:r.length)>2?window.location.replace(`/digit-ui/citizen/obps/editApplication/${l}/${null==ue||null===(u=ue.applicationData)||void 0===u?void 0:u.tenantId}/${null==ue||null===(d=ue.applicationData)||void 0===d?void 0:d.applicationNo}`):ft(null==ue?void 0:ue.applicationData,se,ne,O)),V(e),j(!1)}function fe(){return!!J&&(ie?!ie:!U)}const _e=e=>{ee(!0),ce.mutate({BPA:{...null==ue?void 0:ue.applicationData,workflow:e}},{onError:(e,t)=>{var l,n,i,o,a,r;ee(!1),z(!1),F({key:"error",action:null!=e&&null!==(l=e.response)&&void 0!==l&&null!==(n=l.data)&&void 0!==n&&null!==(i=n.Errors[0])&&void 0!==i&&i.message?null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.Errors[0])||void 0===r?void 0:r.message:e}),setTimeout(me,5e3)},onSuccess:(e,t)=>{ee(!1),ne.replace("/digit-ui/citizen/obps/response",{data:e}),z(!1),F({key:"success",action:K}),setTimeout(me,5e3),M.invalidateQueries("BPA_DETAILS_PAGE"),M.invalidateQueries("workFlowDetails")}})};if((null===(u=pe)||void 0===u||null===(d=u.data)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.length)>0&&"CITIZEN_APPROVAL_INPROCESS"==(null==ue||null===(c=ue.applicationData)||void 0===c?void 0:c.status)){var ge,Ae,Se;const e=Digit.UserService.getUser(),t=null==e||null===(ge=e.info)||void 0===ge?void 0:ge.roles;var he,be,ye;if("CITIZEN_APPROVAL_INPROCESS"==(null==ue||null===(Ae=ue.applicationData)||void 0===Ae?void 0:Ae.status))pe.data.nextActions=1==(null==t?void 0:t.length)&&"CITIZEN"==(null==t||null===(he=t[0])||void 0===he?void 0:he.code)?null===(be=pe)||void 0===be||null===(ye=be.data)||void 0===ye?void 0:ye.nextActions:[];else if("INPROGRESS"==(null==ue||null===(Se=ue.applicationData)||void 0===Se?void 0:Se.status)){var Ce,Te;let e=!1;null==oe||null===(Ce=oe.StakeholderRegistraition)||void 0===Ce||null===(Te=Ce.TradeTypetoRoleMapping)||void 0===Te||Te.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{roles.push(e)})});const l=roles.filter((e,t,l)=>l.indexOf(e)===t);var De,Pe;(null==t?void 0:t.length)>1&&t.forEach(t=>{l.includes(t.code)&&(e=!0)}),pe.data.nextActions=e?null===(De=pe)||void 0===De||null===(Pe=De.data)||void 0===Pe?void 0:Pe.nextActions:[]}}if("SEND_BACK_TO_CITIZEN"===(null===(p=pe)||void 0===p||null===(v=p.data)||void 0===v||null===(m=v.processInstances)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.action)){var Ne;U&&H(!0),ie=!0;const e=Digit.UserService.getUser(),t=null==e||null===(Ne=e.info)||void 0===Ne?void 0:Ne.roles;var Ie,Le;1!==(null==t?void 0:t.length)&&(pe={...pe,data:{...null===(Ie=pe)||void 0===Ie?void 0:Ie.data,actionState:{nextActions:[]}},data:{...null===(Le=pe)||void 0===Le?void 0:Le.data,nextActions:[]}})}if(de||Q)return l.createElement(o.Loader,null);let Be=[];var Oe,Re,xe,we,Me,ke,Fe,Ue,He,We,je,$e,ze;if((null==ue||null===(f=ue.collectionBillDetails)||void 0===f?void 0:f.length)>0&&ct(null==ue?void 0:ue.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&Be.push({order:1,label:O("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return L({tenantId:null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ue||null===(l=ue.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&Be.push({order:2,label:O("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return L({tenantId:null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ue||null===(l=ue.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&Be.push({order:1,label:O("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return L({tenantId:null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ue||null===(l=ue.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&Be.push({order:1,label:O("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return L({tenantId:null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ue||null===(l=ue.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&Be.push({order:2,label:O("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return L({tenantId:null==ue||null===(t=ue.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ue||null===(l=ue.applicationData)||void 0===l?void 0:l.applicationNo})}})}),ue&&"BPA_LOW"===(null==ue||null===(_=ue.applicationData)||void 0===_?void 0:_.businessService)&&(null==ue||null===(g=ue.collectionBillDetails)||void 0===g?void 0:g.length)>0)(null==ue||null===(Oe=ue.applicationData)||void 0===Oe||!Oe.status.includes("REVOCATION"))&&Be.push({order:3,label:O("BPA_PERMIT_ORDER"),onClick:()=>{var e;return I({tenantId:null==ue||null===(e=ue.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==ue||null===(Re=ue.applicationData)||void 0===Re?void 0:Re.status.includes("REVOCATION"))&&Be.push({order:3,label:O("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t,...l}=e;try{let e={...null==ue?void 0:ue.applicationData};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).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")})})}catch(e){return Promise.reject(e)}}({tenantId:null==ue||null===(e=ue.applicationData)||void 0===e?void 0:e.tenantId})}});else if(ue&&"BPA"===(null==ue||null===(A=ue.applicationData)||void 0===A?void 0:A.businessService)&&(null==ue||null===(S=ue.collectionBillDetails)||void 0===S?void 0:S.length)>0){var Ye;"APPROVED"===(null==ue||null===(Ye=ue.applicationData)||void 0===Ye?void 0:Ye.status)&&Be.push({order:3,label:O("BPA_PERMIT_ORDER"),onClick:()=>{var e;return I({tenantId:null==ue||null===(e=ue.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Ge;"APPROVED"===(null==ue||null===(Ge=ue.applicationData)||void 0===Ge?void 0:Ge.status)&&Be.push({order:3,label:O("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return I({tenantId:null==ue||null===(e=ue.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=ue&&ue.comparisionReport&&Be.push({order:4,label:O("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==ue||null===(e=ue.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),Be.sort(function(e,t){return e.order-t.order}),(null===(h=pe)||void 0===h||null===(b=h.data)||void 0===b||null===(y=b.nextActions)||void 0===y?void 0:y.length)>0&&(pe.data.nextActions=null===(xe=pe)||void 0===xe||null===(we=xe.data)||void 0===we||null===(Me=we.nextActions)||void 0===Me?void 0:Me.filter(e=>"INITIATE"!==e.action),pe.data.nextActions=null===(ke=pe)||void 0===ke||null===(Fe=ke.data)||void 0===Fe||null===(Ue=Fe.nextActions)||void 0===Ue?void 0:Ue.filter(e=>"ADHOC"!==e.action),pe.data.nextActions=null===(He=pe)||void 0===He||null===(We=He.data)||void 0===We||null===(je=We.nextActions)||void 0===je?void 0:je.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==ue||null===(C=ue.applicationDetails)||void 0===C?void 0:C.length)>0&&(ue.applicationDetails=(null==ue||null===($e=ue.applicationDetails)||void 0===$e?void 0:$e.length)>0&&(null==ue||null===(ze=ue.applicationDetails)||void 0===ze?void 0:ze.filter(e=>0!==Object.keys(e).length)));const Ke=null==ue||null===(T=ue.applicationDetails)||void 0===T?void 0:T.filter(e=>0!==Object.keys(e).length);return(null==Ke?void 0:Ke.length)>0&&(ue.applicationDetails=Ke),l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},O("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",{style:{display:"flex",alignItems:"center",color:"#A52A2A"}},l.createElement(o.LinkButton,{label:O("VIEW_TIMELINE"),onClick:()=>{const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"}),le(!0)}})),Be&&Be.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>X(!q),displayOptions:q,options:Be})),null==ue||null===(D=ue.applicationDetails)||void 0===D?void 0:D.filter(e=>Object.keys(e).length>0).map((e,n,a)=>{var r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,R,x,M,k,F,$,z,K,V,q,X,Z,Q,ee,te,le,ne,oe,ae,re,de,se,ce,me,_e,ge,Ae,Se,he,be,ye,Ce,Te,De,Pe,Ne,Ie;return l.createElement("div",null,null!=e&&e.isNotAllowed?null:l.createElement(o.Card,{key:n,style:null!=e&&null!==(r=e.additionalDetails)&&void 0!==r&&r.fiReport||""!==(null==e?void 0:e.title)?{}:{marginTop:"-30px"}},null!=e&&e.isTitleVisible?null:l.createElement(o.CardSubHeader,{style:{fontSize:"24px"}},O(null==e?void 0:e.title)),l.createElement("div",{style:null!=e&&e.isBackGroundColor?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},l.createElement(o.StatusTable,null,null!=e&&e.isCommon&&(null==e||null===(u=e.values)||void 0===u?void 0:u.length)>0?null==e||null===(d=e.values)||void 0===d?void 0:d.map(e=>l.createElement(o.Row,null!=e&&e.isUnit?{className:"border-none",label:O(null==e?void 0:e.title),text:null!=e&&e.value?`${ve(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${O(null==e?void 0:e.isUnit)}`:O("CS_NA")}:null!=e&&e.isLink?{className:"border-none",label:O(null==e?void 0:e.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==e?void 0:e.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e?void 0:e.value)))}:{className:"border-none",label:O(null==e?void 0:e.title),text:ve(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||O("CS_NA")})):null,(null==e||!e.isFeeDetails)&&(null==e||null===(s=e.additionalDetails)||void 0===s||null===(c=s.values)||void 0===c?void 0:c.length)>0?null==e||null===(p=e.additionalDetails)||void 0===p||null===(v=p.values)||void 0===v?void 0:v.map(t=>l.createElement("div",null,null!=e&&e.isTitleRepeat||null!=t&&t.isHeader||null!=t&&t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:O(null==t?void 0:t.title),textStyle:"Paid"===(null==t?void 0:t.value)?{color:"darkgreen"}:"Unpaid"===(null==t?void 0:t.value)?{color:"red"}:{},text:null!=t&&t.value?ve(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated):O("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:O(null==t?void 0:t.title),text:null!=t&&t.value?`${ve(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated)} ${O(null==t?void 0:t.isUnit)}`:O("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isHeader?null:l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},O(null==t?void 0:t.title)))):null,null!=e&&e.isSubOccupancyTable&&null!=e&&null!==(m=e.additionalDetails)&&void 0!==m&&m.subOccupancyTableDetails?l.createElement(un,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==ue?void 0:ue.applicationData}):null,null!=e&&e.isScrutinyDetails&&(null==e||null===(E=e.additionalDetails)||void 0===E||null===(f=E.scruntinyDetails)||void 0===f?void 0:f.length)>0?null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.scruntinyDetails.map(e=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:O(null==e?void 0:e.title)}),l.createElement(o.LinkButton,{onClick:()=>{location.href=null==e?void 0:e.value},label:l.createElement(o.PDFSvg,null)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},O(null==e?void 0:e.text)))):null,null!=e&&e.isOwnerDetails&&(null==e||null===(g=e.additionalDetails)||void 0===g||null===(A=g.owners)||void 0===A?void 0:A.length)>0?null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.owners.map((t,n)=>{var i,a,r,u;return l.createElement("div",{key:n,style:(null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.owners)||void 0===a?void 0:a.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},(null==e||null===(r=e.additionalDetails)||void 0===r||null===(u=r.owners)||void 0===u?void 0:u.length)>1?l.createElement(o.Row,{className:"border-none",label:`${O("Owner")} - ${n+1}`}):null,null==t?void 0:t.values.map(e=>l.createElement(o.Row,{className:"border-none",label:O(null==e?void 0:e.title),text:ve(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||O("CS_NA")})))}):null,(null==e?void 0:e.isDocumentDetails)&&(null==e||null===(h=e.additionalDetails)||void 0===h||null===(b=h.obpsDocuments)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.values)&&l.createElement("div",{style:{marginTop:"-8px"}},l.createElement(Wl,{documents:xt(null==e||null===(C=e.additionalDetails)||void 0===C||null===(T=C.obpsDocuments)||void 0===T||null===(D=T[0])||void 0===D?void 0:D.values),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"20px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})),null!=e&&e.isFieldInspection&&(null==ue||null===(P=ue.applicationData)||void 0===P||null===(N=P.additionalDetails)||void 0===N||null===(I=N.fieldinspection_pending)||void 0===I?void 0:I.length)>0?l.createElement(dn,{isCitizen:!0,fiReport:null==ue||null===(L=ue.applicationData)||void 0===L||null===(R=L.additionalDetails)||void 0===R?void 0:R.fieldinspection_pending}):null,(null==e||null===(x=e.additionalDetails)||void 0===x||null===(M=x.noc)||void 0===M?void 0:M.length)>0?null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.noc.map((t,n)=>{var i,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,R,x,w,M,k,F,U,H,W,j,$,z,Y,G,K;return l.createElement("div",{key:n,style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:O(`BPA_${null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.nocType}_HEADER`),labelStyle:{fontSize:"20px"}}),l.createElement(o.Row,{className:"border-none",label:O(""+(null==e||null===(r=e.values)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.title)),textStyle:{marginLeft:"10px"},text:ve(null==e||null===(d=e.values)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.value,null==e||null===(c=e.values)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.isNotTranslated)}),l.createElement(o.Row,{className:"border-none",label:O(""+(null==e||null===(v=e.values)||void 0===v||null===(m=v[1])||void 0===m?void 0:m.title)),textStyle:"APPROVED"==(null==e||null===(E=e.values)||void 0===E||null===(f=E[1])||void 0===f?void 0:f.value)||"AUTO_APPROVED"==(null==e||null===(_=e.values)||void 0===_||null===(g=_[1])||void 0===g?void 0:g.value)?{marginLeft:"10px",color:"#00703C"}:{marginLeft:"10px",color:"#D4351C"},text:ve(null==e||null===(A=e.values)||void 0===A||null===(S=A[1])||void 0===S?void 0:S.value,null==e||null===(h=e.values)||void 0===h||null===(b=h[1])||void 0===b?void 0:b.isNotTranslated)}),null!=e&&null!==(y=e.values)&&void 0!==y&&null!==(C=y[2])&&void 0!==C&&C.value?l.createElement(o.Row,{className:"border-none",label:O(""+(null==e||null===(T=e.values)||void 0===T||null===(D=T[2])||void 0===D?void 0:D.title)),textStyle:{marginLeft:"10px"},text:ve(null==e||null===(P=e.values)||void 0===P||null===(N=P[2])||void 0===N?void 0:N.value,null==e||null===(I=e.values)||void 0===I||null===(L=I[2])||void 0===L?void 0:L.isNotTranslated)}):null,null!=e&&null!==(B=e.values)&&void 0!==B&&null!==(R=B[3])&&void 0!==R&&R.value?l.createElement(o.Row,{className:"border-none",label:O(""+(null==e||null===(x=e.values)||void 0===x||null===(w=x[3])||void 0===w?void 0:w.title)),textStyle:{marginLeft:"10px"},text:ve(null==e||null===(M=e.values)||void 0===M||null===(k=M[3])||void 0===k?void 0:k.value,null==e||null===(F=e.values)||void 0===F||null===(U=F[3])||void 0===U?void 0:U.isNotTranslated)}):null,null!=e&&null!==(H=e.values)&&void 0!==H&&null!==(W=H[3])&&void 0!==W&&W.value?l.createElement(o.Row,{className:"border-none",label:O(""+(null==e||null===(j=e.values)||void 0===j||null===($=j[4])||void 0===$?void 0:$.title)),textStyle:{marginLeft:"10px"},text:ve(null==e||null===(z=e.values)||void 0===z||null===(Y=z[4])||void 0===Y?void 0:Y.value,null==e||null===(G=e.values)||void 0===G||null===(K=G[4])||void 0===K?void 0:K.isNotTranslated)}):null,l.createElement(o.Row,{className:"border-none",label:O(""+(null==t?void 0:t.title))})),l.createElement(o.StatusTable,null,null!=t&&t.values?l.createElement(Wl,{documents:xt(null==t?void 0:t.values,!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}):l.createElement("div",null,l.createElement(o.CardText,null,O("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}):null,(null==e||!e.isTitleVisible)&&(null==e||null===(F=e.additionalDetails)||void 0===F||null===($=F.permit)||void 0===$?void 0:$.length)>0?null==e||null===(z=e.additionalDetails)||void 0===z||null===(K=z.permit)||void 0===K?void 0:K.map(e=>l.createElement(o.CardText,null,null==e?void 0:e.title)):null,(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&l.createElement(sn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:[]})))),n===a.length-1&&l.createElement(o.Card,null,l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(en,{application:null==ue?void 0:ue.applicationData,id:B}),!(null!==(q=pe)&&void 0!==q&&q.isLoading)&&(null===(X=pe)||void 0===X||null===(Z=X.data)||void 0===Z||null===(Q=Z.nextActions)||void 0===Q?void 0:Q.length)>0&&!ie&&J&&l.createElement(o.CheckBox,{styles:{margin:"20px 0 40px",paddingTop:"10px"},checked:U,label:l.createElement("div",null,l.createElement("span",null,O("BPA_I_AGREE_THE_LABEL")+" "),l.createElement("span",{style:{color:"#a82227",cursor:"pointer"},onClick:()=>G(!Y)},O("BPA_TERMS_AND_CONDITIONS_LABEL"))),onChange:()=>{H(!U),U&&j(!U)}})),!(null!==(ee=pe)&&void 0!==ee&&ee.isLoading)&&(null===(te=pe)||void 0===te||null===(le=te.data)||void 0===le||null===(ne=le.nextActions)||void 0===ne?void 0:ne.length)>1&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},W&&null!==(oe=pe)&&void 0!==oe&&null!==(ae=oe.data)&&void 0!==ae&&ae.nextActions?l.createElement(o.Menu,{localeKeyPrefix:"WF_BPA",options:null===(re=pe)||void 0===re||null===(de=re.data)||void 0===de?void 0:de.nextActions.map(e=>e.action),t:O,onSelect:Ee}):null,l.createElement(o.SubmitBar,{disabled:fe(),label:O("ES_COMMON_TAKE_ACTION"),onSubmit:()=>j(!W)}))),!(null!==(se=pe)&&void 0!==se&&se.isLoading)&&1==(null===(ce=pe)||void 0===ce||null===(me=ce.data)||void 0===me||null===(_e=me.nextActions)||void 0===_e?void 0:_e.length)&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:w?"19px":"initial"},className:fe()?"submit-bar-disabled":"submit-bar",disabled:fe(),name:null===(ge=pe)||void 0===ge||null===(Ae=ge.data)||void 0===Ae||null===(Se=Ae.nextActions)||void 0===Se||null===(he=Se[0])||void 0===he?void 0:he.action,value:null===(be=pe)||void 0===be||null===(ye=be.data)||void 0===ye||null===(Ce=ye.nextActions)||void 0===Ce||null===(Te=Ce[0])||void 0===Te?void 0:Te.action,onClick:e=>{Ee(e.target.value)}},O("WF_BPA_"+(null===(De=pe)||void 0===De||null===(Pe=De.data)||void 0===Pe||null===(Ne=Pe.nextActions)||void 0===Ne||null===(Ie=Ne[0])||void 0===Ie?void 0:Ie.action))))))))}),Y?l.createElement(an,{t:O,action:"TERMS_AND_CONDITIONS",tenantId:R,id:B,closeModal:()=>{G(!1)},submitAction:_e,applicationData:(null==ue?void 0:ue.applicationData)||{}}):null,$?l.createElement(an,{t:O,action:K,tenantId:R,id:B,closeModal:()=>{V(null),z(!1)},submitAction:_e,actionData:null===(P=pe)||void 0===P||null===(N=P.data)||void 0===N?void 0:N.timeline}):null,k&&l.createElement(o.Toast,{error:"error"===k.key,label:O("success"===k.key?`ES_OBPS_${k.action}_UPDATE_SUCCESS`:k.action),onClose:me,style:{zIndex:"1000"}}))},ObpsBPASendToArchitect:e=>{var a,u,d,s,c,p,v;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const m=r.useQueryClient(),E=i.useRouteMatch(),{t:f}=n.useTranslation(),{applicationNo:_,tenantId:g}=i.useParams(),{pathname:A}=i.useLocation(),S=i.useHistory();let h=[],b={};const[y,C,T]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),D=Digit.ULBService.getStateId();let{data:P}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(D,[]);const{data:N}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:I,isLoading:L}=Digit.Hooks.obps.useBPASearch(g,{applicationNo:_});let B={edcrNumber:null==I||null===(a=I[0])||void 0===a?void 0:a.edcrNumber};const{data:O,isLoading:R}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),B,{enabled:!!B.edcrNumber});let x=_;const{data:w,isLoading:M}=Digit.Hooks.obps.useNocDetails(g,{sourceRefId:x}),k=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||M||L||R)){b=I?I[0]:{};const e=function(){if(O&&w)return b=I[0],k&&(b.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...b})),Promise.resolve(function(e,t,l,n,i){try{var o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I,L,B,O,R,x,w,M,k,F,U,H,W;const j=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.city={code:null==e||null===(r=e.landInfo)||void 0===r||null===(u=r.address)||void 0===u?void 0:u.city,name:null==e||null===(d=e.landInfo)||void 0===d||null===(s=d.address)||void 0===s||null===(c=s.city)||void 0===c?void 0:c.split(".")[1]},e.address.locality={...null==e||null===(p=e.landInfo)||void 0===p||null===(v=p.address)||void 0===v?void 0:v.locality,i18nkey:null==e||null===(m=e.landInfo)||void 0===m||null===(E=m.address)||void 0===E||null===(f=E.locality)||void 0===f?void 0:f.name},e.data={applicantName:null==t||null===(_=t.planDetail)||void 0===_||null===(g=_.planInformation)||void 0===g?void 0:g.applicantName,applicationDate:null==e||null===(A=e.auditDetails)||void 0===A?void 0:A.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.holdingNo,boundaryWallLength:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.boundaryWallLength,occupancyType:null==t||null===(b=t.planDetail)||void 0===b||null===(y=b.planInformation)||void 0===y?void 0:y.occupancy,registrationDetails:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(T=l.BPA)||void 0===T?void 0:T.RiskTypeComputation,null==t||null===(D=t.planDetail)||void 0===D||null===(P=D.plot)||void 0===P?void 0:P.area,null==t||null===(N=t.planDetail)||void 0===N?void 0:N.blocks),serviceType:(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.serviceType)||(null==t?void 0:t.applicationSubType),scrutinyNumber:{edcrNumber:null==e?void 0:e.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let $=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{$.push(e)})}),e.PrevStateNocDocuments=$,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(L=e.landInfo)||void 0===L?void 0:L.owners,ownershipCategory:{active:!0,code:null==e||null===(B=e.landInfo)||void 0===B?void 0:B.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(O=e.landInfo)||void 0===O?void 0:O.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(R=l.BPA)||void 0===R?void 0:R.RiskTypeComputation,null==t||null===(x=t.planDetail)||void 0===x||null===(w=x.plot)||void 0===w?void 0:w.area,null==t||null===(M=t.planDetail)||void 0===M?void 0:M.blocks),e.subOccupancy=j(null==e||null===(k=e.landInfo)||void 0===k?void 0:k.unit),e.uiFlow={flow:null==e||null===(F=e.businessService)||void 0===F||null===(U=F.split("."))||void 0===U?void 0:U[0],applicationType:(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(b,O,N,w,f)).then(function(e){C({...y,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[I,O,N,w]);const F=(e,t,l,n)=>{C(n?t:{...y,[e]:{...y[e],...t}}),(e=>{var t;const l=null==A||null===(t=A.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=h.find(e=>e.route===l);let i=S.push;if(null===n)return i(cn(E.path,E.params)+"/check");i(`${cn(E.path,E.params)}/${n}`)})()},U=()=>{};P=null!==(u=P)&&void 0!==u&&u.BuildingPermitConfig?null===(d=P)||void 0===d?void 0:d.BuildingPermitConfig:Vl,P.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(T(),sessionStorage.setItem("isPermitApplication",!1))},[]);const H=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("BPACheckPage"),W=null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v?void 0:v.getComponent("BPAAcknowledgement");return M||L||R?l.createElement(o.Loader,null):l.createElement(i.Switch,null,h.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${cn(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:F,onSkip:U,t:f,formData:y}))}),l.createElement(i.Route,{path:cn(E.path,E.params)+"/check"},l.createElement(H,{onSubmit:function(){try{return S.push(cn(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),l.createElement(i.Route,{path:cn(E.path,E.params)+"/acknowledgement"},l.createElement(W,{data:y,onSuccess:()=>{m.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,O&&l.createElement(i.Redirect,{to:`${cn(E.path,E.params)}/${h.indexRoute}`})))},ObpsOCSendToArchitect:e=>{var a,u,d,s,c,p,v,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const E=r.useQueryClient(),f=i.useRouteMatch(),{t:_}=n.useTranslation(),{applicationNo:g,tenantId:A}=i.useParams(),{pathname:S}=i.useLocation(),h=i.useHistory();let b=[],y={};const[C,T,D]=Digit.Hooks.useSessionStorage("OC_BUILDING_PERMIT_EDITFLOW",{}),P=Digit.ULBService.getStateId();let{data:N}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(P,[]);const{data:I}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:L,isLoading:B}=Digit.Hooks.obps.useBPASearch(A,{applicationNo:g});let O={edcrNumber:null==L||null===(a=L[0])||void 0===a?void 0:a.edcrNumber};const{data:R,isLoading:x}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),O,{enabled:!(null==L||null===(u=L[0])||void 0===u||!u.edcrNumber)});let w=null==R?void 0:R.permitNumber;const{data:M}=Digit.Hooks.obps.useOCEdcrSearch(A,{approvalNo:w},{enabled:!(!w||null==R||!R.permitNumber)},O);let k=g;const{data:F,isLoading:U}=Digit.Hooks.obps.useNocDetails(A,{sourceRefId:k}),H=window.location.href.includes("editApplication");JSON.parse(sessionStorage.getItem("tl-trade")),t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||U||B||x)){y=L?L[0]:{};const e=function(){if(R&&M)return y=L[0],H&&(y.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...y})),Promise.resolve(function(e,t,l,n,i,o){try{var a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N;const I=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.additionalDetails={...null==e?void 0:e.additionalDetails,applicationType:null==t?void 0:t.appliactionType,holdingNo:null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.holdingNo,landId:null==e||null===(u=e.landInfo)||void 0===u?void 0:u.id,serviceType:(null==e||null===(d=e.additionalDetails)||void 0===d?void 0:d.serviceType)||(null==t?void 0:t.applicationSubType)},e.data={applicantName:null==t||null===(s=t.planDetail)||void 0===s||null===(c=s.planInformation)||void 0===c?void 0:c.applicantName,applicationDate:null==e||null===(p=e.auditDetails)||void 0===p?void 0:p.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.holdingNo,bpaData:o,occupancyType:null==t||null===(m=t.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.occupancy,registrationDetails:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(_=l.BPA)||void 0===_?void 0:_.RiskTypeComputation,null==t||null===(g=t.planDetail)||void 0===g||null===(A=g.plot)||void 0===A?void 0:A.area,null==t||null===(S=t.planDetail)||void 0===S?void 0:S.blocks),serviceType:(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let L=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{L.push(e)})}),e.PrevStateNocDocuments=L,e.nocDocuments={NocDetails:n,nocDocuments:[]},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(b=l.BPA)||void 0===b?void 0:b.RiskTypeComputation,null==t||null===(y=t.planDetail)||void 0===y||null===(C=y.plot)||void 0===C?void 0:C.area,null==t||null===(T=t.planDetail)||void 0===T?void 0:T.blocks),e.subOccupancy=I(null==e||null===(D=e.landInfo)||void 0===D?void 0:D.unit),e.uiFlow={flow:"OCBPA",applicationType:(null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(y,R,I,F,_,M)).then(function(e){T({...C,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[L,R,I,F,M]);const W=(e,t,l,n)=>{T(n?t:{...C,[e]:{...C[e],...t}}),(e=>{var t;const l=null==S||null===(t=S.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=b.find(e=>e.route===l);let i=h.push;if(null===n)return i(pn(f.path,f.params)+"/check");i(`${pn(f.path,f.params)}/${n}`)})()},j=()=>{};N=null!==(d=N)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=N)||void 0===s?void 0:s.OCBuildingPermitConfig:Jl,N.forEach(e=>{b=b.concat(e.body.filter(e=>!e.hideInCitizen))}),b.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(D(),sessionStorage.setItem("isPermitApplication",!1))},[]);const $=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("OCBPACheckPage"),z=null===(v=Digit)||void 0===v||null===(m=v.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCBPAAcknowledgement");return U||B||x?l.createElement(o.Loader,null):l.createElement(i.Switch,null,b.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${pn(f.path,f.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:j,t:_,formData:C}))}),l.createElement(i.Route,{path:pn(f.path,f.params)+"/check"},l.createElement($,{onSubmit:function(){try{return h.push(pn(f.path,f.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:C})),l.createElement(i.Route,{path:pn(f.path,f.params)+"/acknowledgement"},l.createElement(z,{data:C,onSuccess:()=>{E.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,R&&M&&l.createElement(i.Redirect,{to:`${pn(f.path,f.params)}/${b.indexRoute}`})))},ObpsBPASendBackToCitizen:e=>{var a,u,d,s,c,p,v,m;const{t:E}=n.useTranslation(),f=r.useQueryClient(),_=i.useRouteMatch(),{pathname:g}=i.useLocation(),A=i.useHistory(),S=Digit.ULBService.getStateId(),{applicationNo:h,tenantId:b}=i.useParams();sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));let y=[],C={};const[T,D,P]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),N=Digit.ULBService.getStateId();let{data:I}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(N,[]);const{data:L}=Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),{data:B,isLoading:O}=Digit.Hooks.obps.useBPASearch(b,{applicationNo:h});let R={edcrNumber:null==B||null===(a=B[0])||void 0===a?void 0:a.edcrNumber},x=h;const{data:w,isLoading:M}=Digit.Hooks.obps.useScrutinyDetails(S,R,{enabled:!(null==B||null===(u=B[0])||void 0===u||!u.edcrNumber)}),{data:k,isLoading:F}=Digit.Hooks.obps.useNocDetails(b,{sourceRefId:x}),U=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||F||O||M)){C=B?B[0]:{};const e=function(){if(B&&C&&w&&L&&k)return C=B[0],U&&(C.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...C})),Promise.resolve(Dt(C,w,L,k,E)).then(function(e){D({...T,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[B,w,L,k]);const H=(e,t,l,n)=>{D(n?t:{...T,[e]:{...T[e],...t}}),(e=>{const t=g.split("/").pop(),{nextStep:l}=y.find(e=>e.route===t);let n=A.push;if(null===l)return n(Pt(_.path,_.params)+"/check");n(`${Pt(_.path,_.params)}/${l}`)})()},W=()=>{};I=null!==(d=I)&&void 0!==d&&d.BuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.BuildingPermitConfig:Vl,I.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(P(),sessionStorage.setItem("isPermitApplication",!1))},[]);const j=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("OCBPASendBackCheckPage"),$=null===(v=Digit)||void 0===v||null===(m=v.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCSendBackAcknowledgement");return F||O||M?l.createElement(o.Loader,null):l.createElement(i.Switch,null,y.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${Pt(_.path,_.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:H,onSkip:W,t:E,formData:T}))}),l.createElement(i.Route,{path:Pt(_.path,_.params)+"/check"},l.createElement(j,{onSubmit:function(){try{return A.push(Pt(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:T})),l.createElement(i.Route,{path:Pt(_.path,_.params)+"/acknowledgement"},l.createElement($,{data:T,onSuccess:()=>{f.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Pt(_.path,_.params)}/${y.indexRoute}`})))},ObpsOCSendBackToCitizen:e=>{var a,u,d,s,c,p,v,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const{t:E}=n.useTranslation(),f=r.useQueryClient(),_=i.useRouteMatch(),{pathname:g}=i.useLocation(),A=i.useHistory(),S=Digit.ULBService.getStateId(),{applicationNo:h,tenantId:b}=i.useParams();let y=[],C={};const[T,D,P]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),N=Digit.ULBService.getStateId();let{data:I}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(N,[]);const{isMdmsLoading:L,data:B}=Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation","homePageUrlLinks"]),{data:O,isLoading:R}=Digit.Hooks.obps.useBPASearch(b,{applicationNo:h});let x={edcrNumber:null==O||null===(a=O[0])||void 0===a?void 0:a.edcrNumber},w=h;const{data:M,isLoading:k}=Digit.Hooks.obps.useScrutinyDetails(S,x,{enabled:!(null==O||null===(u=O[0])||void 0===u||!u.edcrNumber)}),{data:F,isLoading:U}=Digit.Hooks.obps.useNocDetails(b,{sourceRefId:w}),H=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||U||R||k||L)){C=O?O[0]:{};const e=function(){if(O&&C&&M&&B&&F)return C=O[0],H&&(C.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...C})),Promise.resolve(Dt(C,M,B,F,E)).then(function(e){D({...T,...e})})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[O,M,B,F]);const W=(e,t,l,n)=>{D(n?t:{...T,[e]:{...T[e],...t}}),(e=>{const t=g.split("/").pop(),{nextStep:l}=y.find(e=>e.route===t);let n=A.push;if(null===l)return n(Pt(_.path,_.params)+"/check");n(`${Pt(_.path,_.params)}/${l}`)})()},j=()=>{};I=null!==(d=I)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.OCBuildingPermitConfig:Jl,I.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(P(),sessionStorage.setItem("isPermitApplication",!1))},[]);const $=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("OCBPASendBackCheckPage"),z=null===(v=Digit)||void 0===v||null===(m=v.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCSendBackAcknowledgement");return U||R||k?l.createElement(o.Loader,null):l.createElement(i.Switch,null,y.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:`${Pt(_.path,_.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:j,t:E,formData:T}))}),l.createElement(i.Route,{path:Pt(_.path,_.params)+"/check"},l.createElement($,{onSubmit:function(){return Promise.resolve()},value:T})),l.createElement(i.Route,{path:Pt(_.path,_.params)+"/acknowledgement"},l.createElement(z,{data:T,onSuccess:()=>{f.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Pt(_.path,_.params)}/${y.indexRoute}`})))},ObpsEdcrInbox:e=>{let{parentRoute:i}=e;window.scroll(0,0);const{t:r}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s={},c={appliactionType:"",status:""},p={sortBy:"createdDate",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},v=Digit.SessionStorage.get("EDCR.INBOX"),m=t.useMemo(()=>"IS_EDCR_BACK"===Digit.SessionStorage.get("EDCR_BACK")?{filterForm:c,searchForm:s,tableForm:p}:v||{filterForm:c,searchForm:s,tableForm:p},[Object.values((null==v?void 0:v.filterForm)||{}),Object.values((null==v?void 0:v.searchForm)||{}),Object.values((null==v?void 0:v.tableForm)||{})]),[E,f]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,searchForm:t.data}),{...e,searchForm:t.data};case"mutateFilterForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,filterForm:t.data}),{...e,filterForm:t.data};case"mutateTableForm":return Digit.SessionStorage.set("EDCR.INBOX",{...e,tableForm:t.data}),{...e,tableForm:t.data}}},m),{isLoading:_,data:{table:g,totalCount:A}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:d,filters:{...E}}),S={logoIcon:l.createElement(o.CaseIcon,null),headerText:"ACTION_TEST_EDCR_SCRUTINY",links:[{link:"/digit-ui/citizen/obps/edcrscrutiny/apply",text:r("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"/digit-ui/citizen/obps/edcrscrutiny/oc-apply",text:r("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}]},h=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(mn,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),b=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(vn,{isInboxLoading:_,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:o})},[_]),y={SearchFormFields:h,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("edcrNumber",null),e("applicationNumber",null),f({action:"mutateSearchForm",data:s})}},C={FilterFormFields:b,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:c,onFilterFormReset:e=>{e("status",""),e("appliactionType",""),f({action:"mutateFilterForm",data:c})}},T=(e=>{var i,o,a,r;let{onPageSizeChange:u,formState:d,totalCount:s,table:c,dispatch:p,onSortingByData:v}=e;const{t:m}=n.useTranslation(),E=t.useMemo(()=>[{Header:m("EDCR_COMMON_TABLE_APPL_NO"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:""},t.original.applicationId))}},{Header:m("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"createdDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Rl(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:m("EDCR_COMMON_TABLE_CITY_LABEL"),accessor:e=>m(null==e?void 0:e.locality),disableSortBy:!0},{Header:m("EDCR_COMMON_TABLE_APPL_NAME"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:m("EDCR_COMMON_TABLE_SCRUTINY_NO"),disableSortBy:!0,Cell:e=>{var t;let{row:n}=e;return l.createElement("div",null,"null"!==(null===(t=n.original)||void 0===t?void 0:t.edcrNumber)?l.createElement("span",{className:""},n.original.edcrNumber):"NA")}},{Header:m("EDCR_COMMON_TABLE_COL_STATUS"),accessor:e=>(e=>l.createElement("span","Accepted"===e?{className:"sla-cell-success ",style:{background:"none",padding:"unset"}}:{className:"sla-cell-error",style:{background:"none",padding:"unset"}},e))(null==e?void 0:e.status),disableSortBy:!0},{Header:m("PT_COMMON_TABLE_COL_ACTION_LABEL"),Cell:e=>{let{row:t}=e;return l.createElement(En,{dowloadOptions:[{label:m("BPA_UPLOADED_PLAN_DXF"),onClick:()=>window.open(""+t.original.dxfFileurl)},{label:m("EDCR_SCUTINY_REPORT"),onClick:()=>window.open(""+t.original.planReportUrl)}]})},disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),className:"table edcr-citizen-inbox",disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"createdDate",onPageSizeChange:u,currentPage:(null===(i=d.tableForm)||void 0===i?void 0:i.offset)/(null===(o=d.tableForm)||void 0===o?void 0:o.limit),onNextPage:()=>{var e,t;return p({action:"mutateTableForm",data:{...d.tableForm,offset:parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=d.tableForm)||void 0===t?void 0:t.limit)}})},onPrevPage:()=>{var e,t;return p({action:"mutateTableForm",data:{...d.tableForm,offset:parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=d.tableForm)||void 0===t?void 0:t.limit)}})},pageSizeLimit:null===(a=d.tableForm)||void 0===a?void 0:a.limit,onSort:v,totalRecords:s,onSearch:null==d||null===(r=d.searchForm)||void 0===r?void 0:r.message,onLastPage:()=>{var e;return p({action:"mutateTableForm",data:{...d.tableForm,offset:10*Math.ceil(s/10)-parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>p({action:"mutateTableForm",data:{...d.tableForm,offset:0}}),data:c,columns:E}})({parentRoute:i,onPageSizeChange:e=>{f({action:"mutateTableForm",data:{...E.tableForm,limit:e.target.value}})},formState:E,totalCount:A,table:g,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===n||f({action:"mutateTableForm",data:{...E.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),D=(e=>{let{table:t}=e;const{t:i}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,edcrNumber:n,date:o,planReportUrl:a,dxfFileurl:r,locality:u,status:d,owner:s}=e;return{[i("EDCR_COMMON_TABLE_APPL_NO")]:t,[i("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:o?Rl(new Date(o),"dd/MM/yyyy"):"NA",[i("EDCR_COMMON_TABLE_CITY_LABEL")]:i(u),[i("EDCR_COMMON_TABLE_APPL_NAME")]:s,[i("EDCR_COMMON_TABLE_SCRUTINY_NO")]:n,[i("EDCR_COMMON_TABLE_COL_STATUS")]:l.createElement("span","Accepted"===d?{className:"sla-cell-success ",style:{background:"none",padding:"0px"}}:{className:"sla-cell-error",style:{background:"none",padding:"0px"}},d),[i("BPA_UPLOADED_PLAN_DXF")]:l.createElement("a",{href:""+r},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD"))),[i("EDCR_SCUTINY_REPORT")]:l.createElement("a",{href:""+a},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD")))}}),isTwoDynamicPrefix:!0,getRedirectionLink:()=>{},handleClickEnabled:!1,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_INBOX_DATE_LATEST_FIRST"},{code:"ASC",i18nKey:"ES_INBOX_DATE_LATEST_LAST"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({table:g}),P={onMobileSortOrderData:e=>{const{sortOrder:t}=e;f({action:"mutateTableForm",data:{...E.tableForm,sortOrder:t}})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,r("ES_COMMON_INBOX"),A?l.createElement("p",{className:"inbox-count"},A):null),l.createElement(o.InboxComposer,u({isInboxLoading:_,PropsForInboxLinks:S},y,C,P,{propsForInboxTable:T,propsForInboxMobileCards:D,formState:E})))},ObpsEmpApplicationDetail:()=>{var e,a,r,u,d,s,c;const{id:p}=i.useParams(),{t:v}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),E=null==m?void 0:m.split(".")[0],[f,_]=t.useState(null),[g,A]=t.useState(!1),{isLoading:S,data:h}=Digit.Hooks.obps.useLicenseDetails(E,{applicationNumber:p,tenantId:E},{}),b=window.Digit.Utils.browser.isMobile(),[y,C]=t.useState(!1),{mutate:T}=Digit.Hooks.obps.useBPAREGApplicationActions(m),D=Digit.Hooks.useWorkflowDetails({tenantId:null==m?void 0:m.split(".")[0],id:p,moduleCode:"BPAREG"});let P=[];return console.log("applicationDetails",h),(null==h||null===(e=h.payments)||void 0===e?void 0:e.length)>0&&P.push({label:v("TL_RECEIPT"),onClick:()=>{var e,t;return Ot(0,null==h||null===(e=h.applicationData)||void 0===e?void 0:e.applicationNumber,null==h||null===(t=h.applicationData)||void 0===t?void 0:t.tenantId,null==h?void 0:h.payments)}}),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details"},l.createElement(o.Header,null,v("CS_TITLE_APPLICATION_DETAILS")),(null==D||null===(a=D.data)||void 0===a||null===(r=a.timeline)||void 0===r?void 0:r.length)>0&&l.createElement("div",{style:{color:"#A52A2A"}},l.createElement(o.LinkButton,{label:v("VIEW_TIMELINE"),onClick:()=>{C(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}})),(null==h||null===(u=h.payments)||void 0===u?void 0:u.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>A(!g),displayOptions:g,options:P,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(Vi,{applicationDetails:h,isLoading:S,id:"timeline",isDataLoading:S,applicationData:null==h?void 0:h.applicationData,mutate:T,workflowDetails:D,businessService:null!=D&&null!==(d=D.data)&&void 0!==d&&d.applicationBusinessService?null==D||null===(s=D.data)||void 0===s?void 0:s.applicationBusinessService:null==h||null===(c=h.applicationData)||void 0===c?void 0:c.businessService,moduleCode:"BPAREG",showToast:f,setShowToast:_,ActionBarStyle:b?{}:{paddingRight:"50px"},MenuStyle:b?{}:{right:"50px"},closeToast:()=>{_(null)},timelineStatusPrefix:"WF_NEWTL_"}))},ObpsEmployeeBpaApplicationDetail:()=>{var e,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,N,I;const L=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{let e=new Date;ie.applicationData.additionalDetails.runDate=Ct(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let i={...null==ie?void 0:ie.applicationData,edcrDetail:[{...null==ie?void 0:ie.edcrDetails}]};return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[i]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,o;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),i.applicationType=null==ie||null===(n=ie.applicationData)||void 0===n||null===(o=n.additionalDetails)||void 0===o?void 0:o.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...i}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?Bt(new Blob([e.data],{type:"application/pdf"})):Lt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},B=function(e){let{tenantId:t,payments:l,...n}=e;try{function i(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const n=function(){if(null==l||!l.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...l}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==l?void 0:l.fileStoreId]}}();return Promise.resolve(n&&n.then?n.then(i):i())}catch(e){return Promise.reject(e)}},{id:O}=i.useParams(),{t:R}=n.useTranslation(),x=Digit.ULBService.getCurrentTenantId(),[w,M]=t.useState(null),[k,F]=t.useState(!1),[U,H,W]=(i.useHistory(),Digit.Hooks.useSessionStorage("store-data",null)),[j,$,z]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[Y,G,K]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{}),[V,q]=t.useState(null),X=Digit.ULBService.getStateId(),J=window.Digit.Utils.browser.isMobile(),{isLoading:Z,data:Q}=Digit.Hooks.obps.useMDMS(X,"BPA",["DocTypeMapping"]),[ee,te]=t.useState(!1);let{data:le}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(X,[]);const{data:ne}=Digit.Hooks.obps.useMDMS(X,"BPA",["RiskTypeComputation"]),{data:ie={},isLoading:oe}=Digit.Hooks.obps.useBPADetailsPage(x,{applicationNo:O});t.useEffect(()=>{if(!Z&&!oe){var e;let p=[];if(null!=Q&&null!==(e=Q.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;p=null==Q||null===(t=Q.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==ie||null===(l=ie.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==ie||null===(i=ie.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==ie||null===(n=ie.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,v=[];p&&(null===(u=p)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=p)||void 0===s||null===(c=s[0])||void 0===c||c.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{v.push(e)})}));const m=ie.applicationDetails&&ie.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:v}]}}:e);ie.applicationDetails=m&&m.length>0?[...m]:null==ie?void 0:ie.applicationDetails}}},[Q,ie]);const[ae,ue]=t.useState(!1),{mutate:de}=Digit.Hooks.obps.useApplicationActions(x),se=Digit.Hooks.obps.useObpsAPI(x,!0);let ce="";sessionStorage.setItem("bpaApplicationDetails",!0),t.useEffect(()=>{$(!1),K()},[]);let pe=null!=le&&le.InspectionReportConfig?null==le?void 0:le.InspectionReportConfig:qi,ve=Digit.Hooks.useWorkflowDetails({tenantId:x,id:O,moduleCode:"BPA"});var Ee,fe,_e,ge,Ae,Se,he,be,ye;ve&&ve.data&&!ve.isLoading&&(ve.data.initialActionState=(null==ve||null===(Ee=ve.data)||void 0===Ee?void 0:Ee.initialActionState)||{...null==ve||null===(fe=ve.data)||void 0===fe?void 0:fe.actionState}||{},ve.data.actionState={...ve.data}),null!=ne&&null!==(e=ne.BPA)&&void 0!==e&&e.RiskTypeComputation&&null!=ie&&ie.edcrDetails&&(ce=Digit.Utils.obps.calculateRiskType(null==ne||null===(_e=ne.BPA)||void 0===_e?void 0:_e.RiskTypeComputation,null==ie||null===(ge=ie.edcrDetails)||void 0===ge||null===(Ae=ge.planDetail)||void 0===Ae||null===(Se=Ae.plot)||void 0===Se?void 0:Se.area,null==ie||null===(he=ie.edcrDetails)||void 0===he||null===(be=he.planDetail)||void 0===be?void 0:be.blocks),null==ie||null===(ye=ie.applicationDetails)||void 0===ye||ye.map(e=>{var t;null!=e&&e.isInsert&&(null===(t=e.values)||void 0===t||t.forEach(e=>{null!=e&&e.isInsert&&(e.value="WF_BPA_"+ce)}))}));const Ce=Digit.UserService.getUser(),Pe=null==Ce||null===(a=Ce.info)||void 0===a?void 0:a.roles.filter(e=>{if("CEMP"==e.code&&e.tenantId===x||"CITIZEN"==e.code)return!0});if((null==ve||null===(r=ve.data)||void 0===r||null===(u=r.processInstances)||void 0===u?void 0:u.length)>0){var Ne,Ie,Le;let e=[];e=null===(Ne=vo(null==ve||null===(Ie=ve.data)||void 0===Ie?void 0:Ie.processInstances[0],"nextActions",[]))||void 0===Ne?void 0:Ne.filter(e=>"ADHOC"!=e.action);let t=(Oe=["action"],Re=["desc"],null==(Be=e)?[]:(re(Oe)||(Oe=null==Oe?[]:[Oe]),re(Re=Re)||(Re=null==Re?[]:[Re]),function(e,t,l){t=t.length?ao(t,function(e){return re(e)?function(t){return po(t,1===e.length?e[0]:e)}:e}):[Io];var n=-1;return t=ao(t,me(Lo)),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=Bo(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(function(e,t){var l=-1,n=Te(e)?Array(e.length):[];return function(e,t){if(null==e)return e;if(!Te(e))return function(e,t){return e&&function(e,t,l){for(var n=-1,i=Object(e),o=l(e),a=o.length;a--;){var r=o[++n];if(!1===t(i[r],r,i))break}return e}(e,t,De)}(e,t);for(var l=e.length,n=-1,i=Object(e);++n<l&&!1!==t(i[n]););}(e,function(e,i,o){n[++l]=t(e)}),n}(e,function(e,l,i){return{criteria:ao(t,function(t){return t(e)}),index:++n,value:e}}))}(Be,Oe,Re)));t&&0!=(null==t?void 0:t.length)||null==ve||null===(Le=ve.data)||void 0===Le||!Le.actionState||(ve.data.actionState.nextActions=[])}var Be,Oe,Re,xe,we,Me,ke,Fe,Ue;(null==ve||null===(d=ve.data)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.length)>0&&(ve.data.nextActions=null==ve||null===(xe=ve.data)||void 0===xe||null===(we=xe.nextActions)||void 0===we?void 0:we.filter(e=>"INITIATE"!==e.action),ve.data.nextActions=null==ve||null===(Me=ve.data)||void 0===Me||null===(ke=Me.nextActions)||void 0===ke?void 0:ke.filter(e=>"ADHOC"!==e.action)),Pe&&(null==ve||null===(Fe=ve.data)||void 0===Fe||null===(Ue=Fe.nextActions)||void 0===Ue||Ue.forEach(e=>{var t,l,n;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:`${It(null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.businessService,null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.status)}/${null==ie||null===(n=ie.applicationData)||void 0===n?void 0:n.applicationNo}/${x}?tenantId=${x}`,state:x})}));let He=[];var We,je,$e,ze,Ye,Ge;if((null==ie||null===(c=ie.collectionBillDetails)||void 0===c?void 0:c.length)>0&&ct(null==ie?void 0:ie.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&He.push({order:1,label:R("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&He.push({order:2,label:R("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&He.push({order:1,label:R("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&He.push({order:1,label:R("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&He.push({order:2,label:R("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return B({tenantId:null==ie||null===(t=ie.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ie||null===(l=ie.applicationData)||void 0===l?void 0:l.applicationNo})}})}),ie&&"BPA_LOW"===(null==ie||null===(p=ie.applicationData)||void 0===p?void 0:p.businessService)&&(null==ie||null===(v=ie.collectionBillDetails)||void 0===v?void 0:v.length)>0)(null==ie||null===(We=ie.applicationData)||void 0===We||!We.status.includes("REVOCATION"))&&He.push({order:3,label:R("BPA_PERMIT_ORDER"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==ie||null===(je=ie.applicationData)||void 0===je?void 0:je.status.includes("REVOCATION"))&&He.push({order:3,label:R("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t,...l}=e;try{let e={...null==ie?void 0:ie.applicationData};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).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")})})}catch(e){return Promise.reject(e)}}({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId})}});else if(ie&&"BPA"===(null==ie||null===(m=ie.applicationData)||void 0===m?void 0:m.businessService)&&(null==ie||null===(E=ie.collectionBillDetails)||void 0===E?void 0:E.length)>0){var Ke;"APPROVED"===(null==ie||null===(Ke=ie.applicationData)||void 0===Ke?void 0:Ke.status)&&He.push({order:3,label:R("BPA_PERMIT_ORDER"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Ve;"APPROVED"===(null==ie||null===(Ve=ie.applicationData)||void 0===Ve?void 0:Ve.status)&&He.push({order:3,label:R("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return L({tenantId:null==ie||null===(e=ie.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=ie&&ie.comparisionReport&&ie&&"BPA_OC"===(null==ie||null===(f=ie.applicationData)||void 0===f?void 0:f.businessService)&&He.push({order:4,label:R("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==ie||null===(e=ie.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),He.sort(function(e,t){return e.order-t.order}),(null==ve||null===(_=ve.data)||void 0===_||null===(g=_.nextActions)||void 0===g?void 0:g.length)>0&&(ve.data.nextActions=null==ve||null===($e=ve.data)||void 0===$e||null===(ze=$e.nextActions)||void 0===ze?void 0:ze.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==ve||null===(A=ve.data)||void 0===A||null===(S=A.nextActions)||void 0===S?void 0:S.length)>0&&(ve.data.nextActions=null==ve||null===(Ye=ve.data)||void 0===Ye||null===(Ge=Ye.nextActions)||void 0===Ge?void 0:Ge.filter(e=>"SKIP_PAYMENT"!==e.action));const qe=null==ie||null===(h=ie.applicationDetails)||void 0===h?void 0:h.filter(e=>0!==Object.keys(e).length);return ie.applicationDetails=qe,l.createElement(t.Fragment,null,l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(o.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},R("CS_TITLE_APPLICATION_DETAILS")),l.createElement(o.LinkButton,{label:R("VIEW_TIMELINE"),onClick:()=>{te(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}),He&&He.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>ue(!ae),displayOptions:ae,options:He,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),"FIELDINSPECTION_INPROGRESS"===(null==ie||null===(b=ie.applicationData)||void 0===b?void 0:b.status)&&(null==Ce||null===(y=Ce.info)||void 0===y?void 0:y.roles.filter(e=>"BPA_FIELD_INSPECTOR"===e.code)).length>0&&l.createElement(o.FormComposer,{heading:R(""),isDisabled:!k,config:pe.map(e=>{return{...e,body:e.body.filter(e=>!e.hideInEmployee),head:(t=e.head,"ES_NEW_APPLICATION_LOCATION_DETAILS"===t?"TL_CHECK_ADDRESS":"ES_NEW_APPLICATION_OWNERSHIP_DETAILS"===t?"TL_OWNERSHIP_DETAILS_HEADER":t)};var t}),fieldStyle:{marginRight:0},submitInForm:!1,defaultValues:{},onFormValueChange:(e,t,l)=>{F(!Object.keys(l.errors).length)},breaklineStyle:{border:"0px"},className:"employeeCard-override",cardClassName:"employeeCard-override"}),l.createElement(Vi,{applicationDetails:ie,isLoading:oe,isDataLoading:oe,applicationData:null==ie?void 0:ie.applicationData,nocMutation:se,mutate:de,id:"timeline",workflowDetails:ve,businessService:null!=ve&&null!==(C=ve.data)&&void 0!==C&&C.applicationBusinessService?null==ve||null===(T=ve.data)||void 0===T?void 0:T.applicationBusinessService:null==ie||null===(D=ie.applicationData)||void 0===D?void 0:D.businessService,moduleCode:"BPA",showToast:w,ActionBarStyle:J?{}:{paddingRight:"50px"},MenuStyle:J?{}:{right:"50px"},setShowToast:M,closeToast:()=>{M(null),q(null)},statusAttribute:"state",timelineStatusPrefix:`WF_${null!=ve&&null!==(P=ve.data)&&void 0!==P&&P.applicationBusinessService?null==ve||null===(N=ve.data)||void 0===N?void 0:N.applicationBusinessService:null==ie||null===(I=ie.applicationData)||void 0===I?void 0:I.businessService}_`})))}};exports.initOBPSComponents=()=>{Object.entries(Ta).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
1
+ var e,t=require("react"),l=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("react-i18next"),i=require("react-router-dom"),o=require("@mseva/digit-ui-react-components"),a=require("react-hook-form");require("react-dom");var r=require("react-query");function u(){return(u=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 d(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}function s(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var c=function(e,t){return e===t||e!=e&&t!=t},p=function(e,t){for(var l=e.length;l--;)if(c(e[l][0],t))return l;return-1},v=Array.prototype.splice;function m(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])}}m.prototype.clear=function(){this.__data__=[],this.size=0},m.prototype.delete=function(e){var t=this.__data__,l=p(t,e);return!(l<0||(l==t.length-1?t.pop():v.call(t,l,1),--this.size,0))},m.prototype.get=function(e){var t=this.__data__,l=p(t,e);return l<0?void 0:t[l][1]},m.prototype.has=function(e){return p(this.__data__,e)>-1},m.prototype.set=function(e,t){var l=this.__data__,n=p(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var E=m,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e,t){return e(t={exports:{}},t.exports),t.exports}var A,S="object"==typeof f&&f&&f.Object===Object&&f,h="object"==typeof self&&self&&self.Object===Object&&self,b=S||h||Function("return this")(),y=b.Symbol,C=Object.prototype,T=C.hasOwnProperty,D=C.toString,P=y?y.toStringTag:void 0,I=Object.prototype.toString,N=y?y.toStringTag:void 0,L=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":N&&N in Object(e)?function(e){var t=T.call(e,P),l=e[P];try{e[P]=void 0;var n=!0}catch(e){}var i=D.call(e);return n&&(t?e[P]=l:delete e[P]),i}(e):function(e){return I.call(e)}(e)},B=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},O=function(e){if(!B(e))return!1;var t=L(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},R=b["__core-js_shared__"],x=(A=/[^.]+$/.exec(R&&R.keys&&R.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",w=Function.prototype.toString,M=function(e){if(null!=e){try{return w.call(e)}catch(e){}try{return e+""}catch(e){}}return""},k=/^\[object .+?Constructor\]$/,F=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!B(e)||(t=e,x&&x in t))&&(O(e)?F:k).test(M(e));var t}(l)?l:void 0},H=U(b,"Map"),W=U(Object,"create"),j=Object.prototype.hasOwnProperty,z=Object.prototype.hasOwnProperty;function Y(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])}}Y.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},Y.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Y.prototype.get=function(e){var t=this.__data__;if(W){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return j.call(t,e)?t[e]:void 0},Y.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:z.call(t,e)},Y.prototype.set=function(e,t){var l=this.__data__;return this.size+=this.has(e)?0:1,l[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this};var G=Y,K=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 V(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])}}V.prototype.clear=function(){this.size=0,this.__data__={hash:new G,map:new(H||E),string:new G}},V.prototype.delete=function(e){var t=K(this,e).delete(e);return this.size-=t?1:0,t},V.prototype.get=function(e){return K(this,e).get(e)},V.prototype.has=function(e){return K(this,e).has(e)},V.prototype.set=function(e,t){var l=K(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var q=V;function X(e){var t=this.__data__=new E(e);this.size=t.size}X.prototype.clear=function(){this.__data__=new E,this.size=0},X.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},X.prototype.get=function(e){return this.__data__.get(e)},X.prototype.has=function(e){return this.__data__.has(e)},X.prototype.set=function(e,t){var l=this.__data__;if(l instanceof E){var n=l.__data__;if(!H||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new q(n)}return l.set(e,t),this.size=l.size,this};var J=X,Z=function(){try{var e=U(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),$=function(e,t,l){"__proto__"==t&&Z?Z(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},Q=Object.prototype.hasOwnProperty,ee=function(e,t,l){var n=e[t];Q.call(e,t)&&c(n,l)&&(void 0!==l||t in e)||$(e,t,l)},te=function(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?$(l,r,u):ee(l,r,u)}return l},le=function(e){return null!=e&&"object"==typeof e},ne=function(e){return le(e)&&"[object Arguments]"==L(e)},ie=Object.prototype,oe=ie.hasOwnProperty,ae=ie.propertyIsEnumerable,re=ne(function(){return arguments}())?ne:function(e){return le(e)&&oe.call(e,"callee")&&!ae.call(e,"callee")},ue=Array.isArray,de=function(){return!1},se=g(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?b.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||de}),ce=/^(?:0|[1-9]\d*)$/,pe=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&ce.test(e))&&e>-1&&e%1==0&&e<t},ve=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},me={};me["[object Float32Array]"]=me["[object Float64Array]"]=me["[object Int8Array]"]=me["[object Int16Array]"]=me["[object Int32Array]"]=me["[object Uint8Array]"]=me["[object Uint8ClampedArray]"]=me["[object Uint16Array]"]=me["[object Uint32Array]"]=!0,me["[object Arguments]"]=me["[object Array]"]=me["[object ArrayBuffer]"]=me["[object Boolean]"]=me["[object DataView]"]=me["[object Date]"]=me["[object Error]"]=me["[object Function]"]=me["[object Map]"]=me["[object Number]"]=me["[object Object]"]=me["[object RegExp]"]=me["[object Set]"]=me["[object String]"]=me["[object WeakMap]"]=!1;var Ee=function(e){return function(t){return e(t)}},fe=g(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&S.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),_e=fe&&fe.isTypedArray,ge=_e?Ee(_e):function(e){return le(e)&&ve(e.length)&&!!me[L(e)]},Ae=Object.prototype.hasOwnProperty,Se=function(e,t){var l=ue(e),n=!l&&re(e),i=!l&&!n&&se(e),o=!l&&!n&&!i&&ge(e),a=l||n||i||o,r=a?function(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}(e.length,String):[],u=r.length;for(var d in e)!t&&!Ae.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||pe(d,u))||r.push(d);return r},he=Object.prototype,be=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)},ye=function(e,t){return function(l){return e(t(l))}},Ce=ye(Object.keys,Object),Te=Object.prototype.hasOwnProperty,De=function(e){return null!=e&&ve(e.length)&&!O(e)},Pe=function(e){return De(e)?Se(e):function(e){if(!be(e))return Ce(e);var t=[];for(var l in Object(e))Te.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Ie=Object.prototype.hasOwnProperty,Ne=function(e){return De(e)?Se(e,!0):function(e){if(!B(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=be(e),l=[];for(var n in e)("constructor"!=n||!t&&Ie.call(e,n))&&l.push(n);return l}(e)},Le=g(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?b.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var l=e.length,n=o?o(l):new e.constructor(l);return e.copy(n),n}}),Be=function(){return[]},Oe=Object.prototype.propertyIsEnumerable,Re=Object.getOwnPropertySymbols,xe=Re?function(e){return null==e?[]:(e=Object(e),function(t,l){for(var n=-1,i=null==t?0:t.length,o=0,a=[];++n<i;){var r=t[n];Oe.call(e,r)&&(a[o++]=r)}return a}(Re(e)))}:Be,we=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},Me=ye(Object.getPrototypeOf,Object),ke=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)we(t,xe(e)),e=Me(e);return t}:Be,Fe=function(e,t,l){var n=t(e);return ue(e)?n:we(n,l(e))},Ue=function(e){return Fe(e,Pe,xe)},He=function(e){return Fe(e,Ne,ke)},We=U(b,"DataView"),je=U(b,"Promise"),ze=U(b,"Set"),Ye=U(b,"WeakMap"),Ge=M(We),Ke=M(H),Ve=M(je),qe=M(ze),Xe=M(Ye),Je=L;(We&&"[object DataView]"!=Je(new We(new ArrayBuffer(1)))||H&&"[object Map]"!=Je(new H)||je&&"[object Promise]"!=Je(je.resolve())||ze&&"[object Set]"!=Je(new ze)||Ye&&"[object WeakMap]"!=Je(new Ye))&&(Je=function(e){var t=L(e),l="[object Object]"==t?e.constructor:void 0,n=l?M(l):"";if(n)switch(n){case Ge:return"[object DataView]";case Ke:return"[object Map]";case Ve:return"[object Promise]";case qe:return"[object Set]";case Xe:return"[object WeakMap]"}return t});var Ze=Je,$e=Object.prototype.hasOwnProperty,Qe=b.Uint8Array,et=function(e){var t=new e.constructor(e.byteLength);return new Qe(t).set(new Qe(e)),t},tt=/\w*$/,lt=y?y.prototype:void 0,nt=lt?lt.valueOf:void 0,it=Object.create,ot=function(){function e(){}return function(t){if(!B(t))return{};if(it)return it(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),at=fe&&fe.isMap,rt=at?Ee(at):function(e){return le(e)&&"[object Map]"==Ze(e)},ut=fe&&fe.isSet,dt=ut?Ee(ut):function(e){return le(e)&&"[object Set]"==Ze(e)},st={};st["[object Arguments]"]=st["[object Array]"]=st["[object ArrayBuffer]"]=st["[object DataView]"]=st["[object Boolean]"]=st["[object Date]"]=st["[object Float32Array]"]=st["[object Float64Array]"]=st["[object Int8Array]"]=st["[object Int16Array]"]=st["[object Int32Array]"]=st["[object Map]"]=st["[object Number]"]=st["[object Object]"]=st["[object RegExp]"]=st["[object Set]"]=st["[object String]"]=st["[object Symbol]"]=st["[object Uint8Array]"]=st["[object Uint8ClampedArray]"]=st["[object Uint16Array]"]=st["[object Uint32Array]"]=!0,st["[object Error]"]=st["[object Function]"]=st["[object WeakMap]"]=!1;var ct=function e(t,l,n,i,o,a){var r,u=1&l,d=2&l,s=4&l;if(n&&(r=o?n(t,i,o,a):n(t)),void 0!==r)return r;if(!B(t))return t;var c=ue(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&$e.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 p=Ze(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(se(t))return Le(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(r=d||v?{}:function(e){return"function"!=typeof e.constructor||be(e)?{}:ot(Me(e))}(t),!u)return d?function(e,t){return te(e,ke(e),t)}(t,function(e,t){return e&&te(t,Ne(t),e)}(r,t)):function(e,t){return te(e,xe(e),t)}(t,function(e,t){return e&&te(t,Pe(t),e)}(r,t))}else{if(!st[p])return o?t:{};r=function(e,t,l){var n,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return et(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var l=t?et(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?et(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}(e,l);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return(i=new(n=e).constructor(n.source,tt.exec(n))).lastIndex=n.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return nt?Object(nt.call(e)):{}}}(t,p,u)}}a||(a=new J);var m=a.get(t);if(m)return m;a.set(t,r),dt(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):rt(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?He:Ue:d?Ne:Pe)(t);return function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l););}(E||t,function(i,o){E&&(i=t[o=i]),ee(r,o,e(i,l,n,o,t,a))}),r},pt=function(e){return ct(e,5)};const vt=e=>{switch(e){case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6-9]{1}[0-9]{9}$/i}},mt=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},Et=()=>require("uuid/v4")(),ft=(e,t)=>{var l,n;let i={Noc:e},o=(null==t||null===(l=t.nocDocuments)||void 0===l?void 0:l.nocDocuments.length)>0&&(null==t||null===(n=t.nocDocuments)||void 0===n?void 0:n.nocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}).map(e=>({fileName:(null==e?void 0:e.fileName)||"",name:(null==e?void 0:e.name)||"",fileStoreId:null==e?void 0:e.fileStoreId,fileUrl:"",isClickable:!0,link:"",title:null==e?void 0:e.documentType,documentType:null==e?void 0:e.documentType,id:null==e?void 0:e.id,additionalDetails:{}})))||[];return o=[...o,...null!=t&&t.PrevStateNocDocuments?null==t?void 0:t.PrevStateNocDocuments.filter(t=>{var l;return t.documentType.includes(null==e||null===(l=e.nocType)||void 0===l?void 0:l.split("_")[0])}):[]],i.Noc.documents=o,i},_t=function(e,t,l,n){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(null==e?void 0:e.tenantId,{edcrNumber:null==e?void 0:e.edcrNumber})).then(function(i){var o,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k;const F=null==i?void 0:i.edcrDetail[0];var U,H,W,j;e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.locality.i18nkey=""+n(mt(null==e||null===(r=e.landInfo)||void 0===r||null===(d=r.address)||void 0===d?void 0:d.tenantId,".","_").toUpperCase()+"_REVENUE_"+(null==e||null===(s=e.landInfo)||void 0===s||null===(c=s.address)||void 0===c||null===(p=c.locality)||void 0===p?void 0:p.code)),e.placeName=(null==e||null===(v=e.additionalDetails)||void 0===v?void 0:v.GISPlaceName)||"",e.data={scrutinyNumber:{edcrNumber:null==F?void 0:F.edcrNumber},applicantName:null==F||null===(m=F.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.applicantName,applicationDate:null==e||null===(f=e.auditDetails)||void 0===f?void 0:f.createdTime,applicationType:null==F?void 0:F.appliactionType,holdingNumber:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.holdingNo,boundaryWallLength:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.boundaryWallLength,occupancyType:null==F||null===(A=F.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.occupancy,registrationDetails:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==t||null===(b=t.BPA)||void 0===b?void 0:b.RiskTypeComputation,null==F||null===(y=F.planDetail)||void 0===y||null===(C=y.plot)||void 0===C?void 0:C.area,null==F||null===(T=F.planDetail)||void 0===T?void 0:T.blocks),serviceType:(null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.serviceType)||(null==F?void 0:F.applicationSubType)},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(P=e.landInfo)||void 0===P?void 0:P.owners,ownershipCategory:{active:!0,code:null==e||null===(I=e.landInfo)||void 0===I?void 0:I.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(N=e.landInfo)||void 0===N?void 0:N.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==t||null===(L=t.BPA)||void 0===L?void 0:L.RiskTypeComputation,null==F||null===(B=F.planDetail)||void 0===B||null===(O=B.plot)||void 0===O?void 0:O.area,null==F||null===(R=F.planDetail)||void 0===R?void 0:R.blocks),e.subOccupancy=(e=>{let t=[],l=[],i={};return e&&e.map((e,o)=>{var a,r;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&(null===(r=t)||void 0===r?void 0:r.length)>0&&""!=t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:n("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),i["Block_"+(o+1)]=l}),i})(null==e||null===(x=e.landInfo)||void 0===x?void 0:x.unit),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(w=e.businessService)||void 0===w?void 0:w.split(".")[0],applicationType:(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.applicationType)||(null==F?void 0:F.appliactionType),serviceType:(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.serviceType)||(null==F?void 0:F.applicationSubType)},null!=e&&e.businessService.includes("OC")?(sessionStorage.setItem("BPAintermediateValue",JSON.stringify(u({},e))),l.push("/digit-ui/citizen/obps/ocbpa/"+(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.applicationType.toLowerCase())+"/"+(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.serviceType.toLowerCase()))):(sessionStorage.setItem("BPAintermediateValue",JSON.stringify(u({},e))),l.push("/digit-ui/citizen/obps/bpa/"+(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.applicationType.toLowerCase())+"/"+(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.serviceType.toLowerCase())))})}catch(e){return Promise.reject(e)}},gt=(e,t)=>{let l=[];return e&&e.map(e=>{l.push(e.id?{documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{},id:e.id}:{documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",fileUrl:"",additionalDetails:{}})}),l=[...l,...t||[]],l};function At(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}const St=e=>{var t;let l=[],n=null==e?void 0:e.subOccupancy;if(n){var i;let t=Object.entries(n);null==e||null===(i=e.landInfo)||void 0===i||i.unit.map((e,n)=>{t.map((t,n)=>{var i;e.id&&e.floorNo===(null===(i=t[0])||void 0===i?void 0:i.split("_")[1])&&l.push(u({},e,{usageCategory:At(t[1])}))})}),t&&t.map((e,t)=>{var n;l.length>0&&(null==l?void 0:l.some(t=>{var l;return(null==t?void 0:t.floorNo)===(null===(l=e[0])||void 0===l?void 0:l.split("_")[1])}))||l.push({blockIndex:t,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:At(e[1])})})}return l.length>0?l:null==e||null===(t=e.landInfo)||void 0===t?void 0:t.unit},ht=(e,t)=>{var l,n,i;if(t)return e.landInfo.owners;let o=pt(null==e||null===(l=e.owners)||void 0===l?void 0:l.owners);return o&&(null==o||o.forEach(e=>{var t,l;null!=e&&null!==(t=e.gender)&&void 0!==t&&t.code&&(e.gender=null===(l=e.gender)||void 0===l?void 0:l.code),null!=e&&e.fatherOrHusbandName||(e.fatherOrHusbandName="NAME"),e.active=!0})),null==e||null===(n=e.landInfo)||void 0===n||null===(i=n.owners)||void 0===i||i.map(e=>{(null==o?void 0:o.length)>0&&(null==o?void 0:o.some(t=>t.id===e.id))||null==o||o.push(u({},e,{active:!1}))}),o},bt=(e,t)=>{var l,n;return t?null==e||null===(l=e.landInfo)||void 0===l?void 0:l.ownershipCategory:e.owners.ownershipCategory.code||(null==e||null===(n=e.landInfo)||void 0===n?void 0:n.ownershipCategory)},yt=function(e,t,l){var n,i,o,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L;return void 0===t&&(t=!1),void 0===l&&(l=!1),t?(e.landInfo=e.landInfo,e.landInfo.owners.forEach((t,l)=>{var n,i;null!=t&&null!==(n=t.gender)&&void 0!==n&&n.code&&(e.landInfo.owners[l].gender=null==t||null===(i=t.gender)||void 0===i?void 0:i.code)})):(e.landInfo.owners.map((t,l)=>{var n;e.landInfo.owners[l].gender=null==t||null===(n=t.gender)||void 0===n?void 0:n.code}),e.landInfo.address.pincode=null==e||null===(f=e.address)||void 0===f?void 0:f.pincode,e.landInfo.address.city=null==e||null===(_=e.address)||void 0===_||null===(g=_.city)||void 0===g?void 0:g.code,e.landInfo.address.locality=null==e||null===(A=e.address)||void 0===A?void 0:A.locality,e.landInfo.address.landmark=null==e||null===(S=e.address)||void 0===S?void 0:S.landmark,e.landInfo.address.street=null!=e&&null!==(h=e.address)&&void 0!==h&&h.street?null==e||null===(b=e.address)||void 0===b?void 0:b.street:null,e.landInfo.address.city=(null==e||null===(y=e.landInfo)||void 0===y||null===(C=y.address)||void 0===C||null===(T=C.city)||void 0===T?void 0:T.code)||(null==e||null===(D=e.landInfo)||void 0===D||null===(P=D.address)||void 0===P?void 0:P.tenantId),e.landInfo.unit=null!=e&&null!==(I=e.landInfo)&&void 0!==I&&I.unit&&(null==e||null===(N=e.landInfo)||void 0===N?void 0:N.unit.length)>0?(e=>{let t=[];return e&&e.map((e,l)=>{t.push({blockIndex:l,usageCategory:e.usageCategory,occupancyType:e.occupancyType,floorNo:e.floorNo,unitType:e.unitType,id:e.id})}),t})(null==e||null===(L=e.landInfo)||void 0===L?void 0:L.unit):null!=e&&e.subOccupancy?(e=>{let t=[];return e&&Object.entries(e).map((e,l)=>{var n;t.push({blockIndex:l,floorNo:null===(n=e[0])||void 0===n?void 0:n.split("_")[1],unitType:"Block",usageCategory:At(e[1])})}),t})(null==e?void 0:e.subOccupancy):[]),{BPA:{id:null==e?void 0:e.id,applicationNo:null==e?void 0:e.applicationNo,approvalNo:null==e?void 0:e.approvalNo,accountId:null==e?void 0:e.accountId,edcrNumber:null==e?void 0:e.edcrNumber,riskType:null==e?void 0:e.riskType,businessService:null==e?void 0:e.businessService,landId:null==e?void 0:e.landId,tenantId:(null==e?void 0:e.tenantId)||(null==e||null===(n=e.address)||void 0===n?void 0:n.tenantId),approvalDate:null==e?void 0:e.approvalDate,applicationDate:null==e?void 0:e.applicationDate,status:l||e.status?e.status:"INITIATED",documents:gt(null==e||null===(i=e.documents)||void 0===i?void 0:i.documents,null==e?void 0:e.PrevStateDocuments),landInfo:t?null==e?void 0:e.landInfo:u({},null==e?void 0:e.landInfo,{ownershipCategory:bt(e,t),owners:ht(e,t),unit:St(e)}),assignee:l?e.assignee:[],workflow:{action:"SEND_TO_CITIZEN",assignes:null,comments:null,varificationDocuments:null},auditDetails:null==e?void 0:e.auditDetails,additionalDetails:u({},null==e?void 0:e.additionalDetails,{selfCertificationCharges:{BPA_MALBA_CHARGES:sessionStorage.getItem("Malbafees"),BPA_LABOUR_CESS:sessionStorage.getItem("LabourCess"),BPA_WATER_CHARGES:sessionStorage.getItem("WaterCharges"),BPA_GAUSHALA_CHARGES_CESS:sessionStorage.getItem("GaushalaFees"),BPA_LESS_ADJUSMENT_PLOT:sessionStorage.getItem("lessAdjusment"),BPA_DEVELOPMENT_CHARGES:sessionStorage.getItem("development"),BPA_OTHER_CHARGES:sessionStorage.getItem("otherCharges")},GISPlaceName:null==e||null===(o=e.address)||void 0===o?void 0:o.placeName,holdingNo:null!=e&&null!==(a=e.data)&&void 0!==a&&a.holdingNumber?null==e||null===(r=e.data)||void 0===r?void 0:r.holdingNumber:null==e||null===(d=e.additionalDetails)||void 0===d?void 0:d.holdingNo,boundaryWallLength:null!=e&&null!==(s=e.data)&&void 0!==s&&s.boundaryWallLength?null==e||null===(c=e.data)||void 0===c?void 0:c.boundaryWallLength:null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.boundaryWallLength,registrationDetails:null!=e&&null!==(v=e.data)&&void 0!==v&&v.registrationDetails?null==e||null===(m=e.data)||void 0===m?void 0:m.registrationDetails:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.registrationDetails}),applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",occupancyType:"A"}}},Ct=e=>{var t;let l=[];return null===(t=e.documents)||void 0===t||t.documents.map(t=>{var n,i;l.push({fileStoreId:t.fileStoreId,fileStore:t.fileStoreId,fileName:t.fileName,fileUrl:"",documentType:t.documentType,tenantId:null==e||null===(n=e.result)||void 0===n||null===(i=n.Licenses[0])||void 0===i?void 0:i.tenantId})}),l},Tt=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}},Dt=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()},Pt=function(e,t,l,n,i){try{var o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O;const R=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","),l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),n["Block_"+(o+1)]=l}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.data={applicantName:null==t||null===(r=t.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.applicantName,applicationDate:null==e||null===(d=e.auditDetails)||void 0===d?void 0:d.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.holdingNo,boundaryWallLength:null==e||null===(c=e.additionalDetails)||void 0===c?void 0:c.boundaryWallLength,occupancyType:null==t||null===(p=t.planDetail)||void 0===p||null===(v=p.planInformation)||void 0===v?void 0:v.occupancy,registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(E=l.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==t||null===(f=t.planDetail)||void 0===f||null===(_=f.plot)||void 0===_?void 0:_.area,null==t||null===(g=t.planDetail)||void 0===g?void 0:g.blocks),serviceType:(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}};let x=[];null==e||e.documents.map(e=>x.push(e)),e.PrevStateDocuments=pt(x),e.documents={documents:[]};let w=[];n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{w.push(e)})}),e.PrevStateNocDocuments=w,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(S=e.landInfo)||void 0===S?void 0:S.owners,ownershipCategory:{active:!0,code:null==e||null===(h=e.landInfo)||void 0===h?void 0:h.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(b=e.landInfo)||void 0===b?void 0:b.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(y=l.BPA)||void 0===y?void 0:y.RiskTypeComputation,null==t||null===(C=t.planDetail)||void 0===C||null===(T=C.plot)||void 0===T?void 0:T.area,null==t||null===(D=t.planDetail)||void 0===D?void 0:D.blocks),e.subOccupancy=R(null==e||null===(P=e.landInfo)||void 0===P?void 0:P.unit);let M="BPA";return null==l||null===(I=l.BPA)||void 0===I||null===(N=I.homePageUrlLinks)||void 0===N||N.map(e=>{(null==t?void 0:t.appliactionType)===(null==e?void 0:e.applicationType)&&(null==t?void 0:t.applicationSubType)===(null==e?void 0:e.serviceType)&&(M=null==e?void 0:e.flow)}),e.uiFlow={flow:null!=e&&e.businessService.includes("OC")?"OCBPA":null==e||null===(L=e.businessService)||void 0===L?void 0:L.split(".")[0],applicationType:(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}},It=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),Nt=e=>{try{const t=e.match(/(\d{2})-(\d{2})-(\d{4}) (\d{2}):(\d{2}):(\d{2})/);return Date.UTC(+t[3],t[2]-1,+t[1],+t[4],+t[5])}catch(t){return e}},Lt=(e,t)=>{let l="BPA.NC_APP_FEE";return"BPA_LOW"===e?l="BPA.LOW_RISK_PERMIT_FEE":"BPA"===e?l="PENDING_APPL_FEE"==t?"BPA.NC_APP_FEE":"BPA.NC_SAN_FEE":"BPA_OC"===e&&(l="PENDING_APPL_FEE"==t?"BPA.NC_OC_APP_FEE":"BPA.NC_OC_SAN_FEE"),l},Bt=(e,t)=>{if(window.mSewaApp&&window.mSewaApp.isMsewaApp()&&window.mSewaApp.downloadBase64File){var l=new FileReader;l.readAsDataURL(e),l.onloadend=function(){mSewaApp.downloadBase64File(l.result,t)}}else{const l=document.createElement("a");l.href=URL.createObjectURL(e),l.download=t,document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(l.href),7e3)}},Ot=e=>{const t=URL.createObjectURL(e);var l=window.open(t);null!=l&&l.addEventListener("load",e=>{l.focus(),l.print()})},Rt=function(e,t,l,n,i,o){void 0===i&&(i="download");try{function a(){return Promise.resolve(Digit.PaymentService.printReciept(l,{fileStoreIds:e.filestoreIds[0]})).then(function(l){var n;window.open(l[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank");const o=parseInt(e.status,10);201!==o&&200!==o||("print"==i?Ot(new Blob([e.data],{type:"application/pdf"})):Bt(new Blob([e.data],{type:"application/pdf"}),"RECEIPT-"+t+".pdf"))})}let e=null;console.log("payments",n);const o=function(t){if(null===(t=n[0])||void 0===t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(l,{Payments:n},"bpa-receipt")).then(function(t){e=t});var i;e={filestoreIds:[null===(i=n[0])||void 0===i?void 0:i.fileStoreId]}}();return Promise.resolve(o&&o.then?o.then(a):a())}catch(e){return Promise.reject(e)}},xt=function(e,t){try{return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e})).then(function(l){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,n,i,o,a,r,u,d,s,c,p,v;return 0==(null==e||null===(t=e.BPA)||void 0===t?void 0:t.length)?null!=l&&null!==(s=l.edcrDetail)&&void 0!==s&&s[0]?null==l||null===(c=l.edcrDetail)||void 0===c?void 0:c[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&("INITIATED"==(null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.status)||"REJECTED"==(null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.status)||"PERMIT REVOCATION"==(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.status))?null!=l&&null!==(p=l.edcrDetail)&&void 0!==p&&p[0]?null==l||null===(v=l.edcrDetail)||void 0===v?void 0:v[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:"APPLICATION_NUMBER_ALREADY_EXISTS"}})})}catch(e){return Promise.reject(e)}},wt=function(e,t){void 0===t&&(t=!1);let l=[];if((null==e?void 0:e.length)>0){let n=e.filter((t,l)=>e.findIndex(e=>{var l,n,i,o,a,r;return(null==e||null===(l=e.documentType)||void 0===l||null===(n=l.split("."))||void 0===n||null===(i=n.slice(0,2))||void 0===i?void 0:i.join("_"))===(null==t||null===(o=t.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))})===l);null==n||n.map(n=>{var i,o,a,r;const u=null==e?void 0:e.filter(e=>{var t,l,i,o,a,r;return(null==n||null===(t=n.documentType)||void 0===t||null===(l=t.split("."))||void 0===l||null===(i=l.slice(0,2))||void 0===i?void 0:i.join("_"))==(null==e||null===(o=e.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"))});null==u||u.forEach(e=>e.title=e.documentType),l.push({title:t?"":null==u||null===(i=u[0])||void 0===i||null===(o=i.documentType)||void 0===o||null===(a=o.split("."))||void 0===a||null===(r=a.slice(0,2))||void 0===r?void 0:r.join("_"),values:u})})}return l},Mt=e=>{var n,i,r,u,d,s,c;let{formState:p,Controller:v,register:m,control:E,t:f,reset:_,previousPage:g}=e;const A=Digit.ULBService.getStateId(),S=Digit.ULBService.getCurrentTenantId(),h=sessionStorage.getItem("Digit.citizen.userRequestObject"),b=h?JSON.parse(h):{},y=null==b||null===(n=b.value)||void 0===n?void 0:n.info,C=null==y?void 0:y.mobileNumber,T=a.useWatch({control:E,name:"applicationType"}),D=sessionStorage.getItem("search_application")||"";D&&"undefined"!=D&&(null===(i=JSON.parse(D))||void 0===i?void 0:i.code)!==(null==T?void 0:T.code)&&E.setValue("status",""),sessionStorage.setItem("search_application",JSON.stringify(T));const{applicationTypes:P,ServiceTypes:I}=Digit.Hooks.obps.useServiceTypeFromApplicationType({Applicationtype:(null==T?void 0:T.code)||((null==y||null===(r=y.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPAREG_")).length)>0&&(null==y||null===(u=y.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY"),tenantId:A}),{data:N}=Digit.Hooks.obps.useBusinessServiceData(S,"BPA,BPA_LOW,BPA_OC,ARCHITECT,BUILDER,ENGINEER,STRUCTURALENGINEER",{});let L=[],B=[],O=[],R=[];null==N||null===(d=N.BusinessServices)||void 0===d||d.map(e=>{e.states.map(t=>{t.state&&t.applicationStatus&&("BPAREG"==e.business?O.push({code:t.applicationStatus,i18nKey:"WF_ARCHITECT_"+t.state,module:e.business}):"BPA_OC"==(null==e?void 0:e.businessService)?B.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}):L.push({code:t.applicationStatus,i18nKey:"WF_BPA_"+t.state,module:e.business}))})});let x,w=[],M=[];for(x=0;x<L.length;x++)w[L[x].code]||(w[L[x].code]=!0,M.push(L[x].code));let k,F=[],U=[];for(k=0;k<B.length;k++)F[B[k].code]||(F[B[k].code]=!0,U.push(B[k].code));let H,W=[],j=[];for(H=0;H<O.length;H++)W[O[H].code]||(W[O[H].code]=!0,j.push(O[H].code));const z=[],Y=[],G=[];return M.forEach(e=>z.push({i18nKey:"WF_BPA_"+e,code:e})),U.forEach(e=>Y.push({i18nKey:"WF_BPA_"+e,code:e})),j.forEach(e=>G.push({i18nKey:"WF_BPA_"+e,code:e})),z.forEach(e=>{L.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),Y.forEach(e=>{B.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),G.forEach(e=>{O.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),R="BPA_STAKEHOLDER_REGISTRATION"===(null==T?void 0:T.code)?G:"BUILDING_PLAN_SCRUTINY"===(null==T?void 0:T.code)?z:"BUILDING_OC_PLAN_SCRUTINY"===(null==T?void 0:T.code)?Y:[],l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_NO_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:m({})})),!window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_MOBILE_NO_SEARCH_PARAM")),l.createElement(o.MobileNumber,{name:"mobileNumber",disable:!!window.location.href.includes("obps/search/obps-application"),inputRef:m({minLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:f("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:f("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(o.CardLabelError,null,null==p||null===(s=p.errors)||void 0===s||null===(c=s.mobileNumber)||void 0===c?void 0:c.message)),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(v,{control:E,name:"applicationType",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:f})})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(v,{control:E,name:"serviceType",render:e=>l.createElement(o.Dropdown,{selected:I&&(null==I?void 0:I.length)>0?e.value:I[0],select:e.onChange,onBlur:e.onBlur,option:I,optionKey:"i18nKey",t:f,isBPAREG:!!(I&&(null==I?void 0:I.length)>0)})})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_FROM_DATE_SEARCH_PARAM")),l.createElement(v,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_APP_TO_DATE_SEARCH_PARAM")),l.createElement(v,{render:e=>l.createElement(o.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:E})),l.createElement(o.SearchField,null,l.createElement("label",null,f("BPA_SEARCH_APPLICATION_STATUS_LABEL")),l.createElement(v,{control:E,name:"status",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:R,optionKey:"i18nKey",t:f})})),window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null),l.createElement(o.SearchField,{className:"submit"},l.createElement(o.SubmitBar,{label:f("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"24px"},onClick:()=>{var e,t,l,n,i,o,a,r,u,d,s,c;_({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?C:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==y||null===(e=y.roles)||void 0===e||null===(t=e.filter(e=>e.code.includes("BPAREG_")))||void 0===t?void 0:t.length)<=0&&(null==y||null===(l=y.roles)||void 0===l?void 0:l.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==y||null===(n=y.roles)||void 0===n||null===(i=n.filter(e=>e.code.includes("BPAREG_")))||void 0===i?void 0:i.length)>0&&(null==y||null===(o=y.roles)||void 0===o?void 0:o.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==y||null===(a=y.roles)||void 0===a||null===(r=a.filter(e=>e.code.includes("BPAREG_")))||void 0===r?void 0:r.length)<=0&&(null==y||null===(u=y.roles)||void 0===u?void 0:u.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==y||null===(d=y.roles)||void 0===d||null===(s=d.filter(e=>e.code.includes("BPAREG_")))||void 0===s?void 0:s.length)>0&&(null==y||null===(c=y.roles)||void 0===c?void 0:c.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},isSubmitSuccessful:!1}),g()}},f("ES_COMMON_CLEAR_ALL"))))},kt=["currentlyActiveMobileModal","searchFormFieldsComponentProps"],Ft=["currentlyActiveMobileModal","searchFormFieldsComponentProps"],Ut=e=>{var o,a;const r=sessionStorage.getItem("Digit.citizen.userRequestObject"),d=r?JSON.parse(r):{},s=null==d||null===(o=d.value)||void 0===o?void 0:o.info,{t:c}=n.useTranslation(),p=Digit.ULBService.getCurrentTenantId(),v=i.useLocation(),[m,E]=t.useState((null==s||null===(f=s.roles)||void 0===f||null===(_=f.filter(e=>e.code.includes("BPAREG_")))||void 0===_?void 0:_.length)<=0&&(null==s||null===(g=s.roles)||void 0===g?void 0:g.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?"BUILDING_PLAN_SCRUTINY":(null==s||null===(A=s.roles)||void 0===A||null===(S=A.filter(e=>e.code.includes("BPAREG_")))||void 0===S?void 0:S.length)>0&&(null==s||null===(h=s.roles)||void 0===h?void 0:h.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"BPA_STAKEHOLDER_REGISTRATION":"BUILDING_PLAN_SCRUTINY");var f,_,g,A,S,h;const[b,y]=t.useState({}),[C,T]=t.useState({});t.useEffect(()=>{"/digit-ui/citizen/obps/search/application"!==v.pathname&&"/digit-ui/employee/obps/search/application"!==v.pathname||(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[v.pathname]);const D=Digit.ComponentRegistryService.getComponent("OBPSSearchApplication"),[P,I]=t.useState("");let N={},L={};if(m&&m.includes("STAKEHOLDER")||Object.keys(b).length>0&&null!=b&&b.applicationType&&null!=b&&b.applicationType.includes("STAKEHOLDER"))Object.entries(b).length<=2&&0==Object.keys(b).filter(e=>"applicationType"===e).length||(b.applicationNo&&(b.applicationNumber=b.applicationNo,b.applicationNo=""),b&&b.applicationType&&delete b.applicationType,b&&b.serviceType&&(b.tradeType=b.serviceType,delete b.serviceType),N=u({},b,{tenantId:Digit.ULBService.getStateId()}));else{if(0===Object.keys(b).length){var B,O;let e=u({applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION"},window.location.href.includes("/search/obps-application")&&{mobileNumber:null===(B=Digit.UserService.getUser())||void 0===B||null===(O=B.info)||void 0===O?void 0:O.mobileNumber});y(u({},b,e))}L=b}const{data:R=[],isLoading:x,isSuccess:w}=Digit.Hooks.obps.useOBPSSearch(m,b,p,L,N,{enabled:""===P});return l.createElement(D,{t:c,tenantId:p,onSubmit:function(e){var t,l,n;"BPA_STAKEHOLDER_REGISTRATION"===(null==e||null===(t=e.applicationType)||void 0===t?void 0:t.code)&&((e=>""!==(null==e?void 0:e.applicationNo)||""!==(null==e?void 0:e.fromDate)||""!==(null==e?void 0:e.mobileNumber)||""!==(null==e?void 0:e.serviceType)||""!==(null==e?void 0:e.status)||""!==(null==e?void 0:e.toDate))(e)||I("BPA_ADD_MORE_PARAM_STAKEHOLDER")),T(e);var i=new Date(null==e?void 0:e.fromDate);null==i||i.setSeconds((null==i?void 0:i.getSeconds())-19800);var o=new Date(null==e?void 0:e.toDate);E(null!=e&&null!==(l=e.applicationType)&&void 0!==l&&l.code?null==e||null===(n=e.applicationType)||void 0===n?void 0:n.code:m),null==o||o.setSeconds((null==o?void 0:o.getSeconds())+86399-19800);const a=u({},e,e.toDate?{toDate:null==o?void 0:o.getTime()}:{},e.fromDate?{fromDate:null==i?void 0:i.getTime()}:{});y(Object.keys(a).filter(e=>a[e]).reduce((e,t)=>u({},e,{[t]:"object"==typeof a[t]?a[t].code:a[t]}),{}))},searchData:C,isLoading:x,Count:null==R||null===(a=R[0])||void 0===a?void 0:a.Count,error:P,data:!x&&w&&(null==R?void 0:R.length)>0?R:[{display:"ES_COMMON_NO_DATA"}],setparamerror:I})},Ht=()=>{var e,a,r,d;const{t:s}=n.useTranslation(),c=i.useHistory(),[p,v]=t.useState([]),[m,E]=t.useState(!1),f=Digit.ULBService.getCurrentTenantId(),_=sessionStorage.getItem("Digit.citizen.userRequestObject"),g=_?JSON.parse(_):{},A=null==g?void 0:g.value,S=null==A||null===(e=A.info)||void 0===e?void 0:e.mobileNumber,{data:h,isLoading:b,revalidate:y}=Digit.Hooks.obps.useBPAREGSearch(f,{},{mobileNumber:S},{cacheTime:0}),{data:C,isLoading:T,revalidate:D}=Digit.Hooks.obps.useBPASearch(f,{requestor:S,mobileNumber:S,limit:50-(null!=h&&null!==(a=h.Licenses)&&void 0!==a&&a.length?Number(null==h||null===(r=h.Licenses)||void 0===r?void 0:r.length):0),offset:0},{enabled:!b}),{data:P}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]);return t.useEffect(()=>()=>{v([]),null==y||y(),null==D||D()},[]),t.useEffect(()=>{if(!b&&!T){var e,t,l,n,i,o,a,r;let d=[],s=[];var u;null!=h&&null!==(e=h.Licenses)&&void 0!==e&&e.length&&(null==h||null===(u=h.Licenses)||void 0===u||u.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPAREG",d.push(e)})),null!=C&&C.length&&(null==C||C.forEach(e=>{e.sortNumber=0,e.modifiedTime=e.auditDetails.lastModifiedTime,e.type="BPA",d.push(e)})),s=[].slice.call(d).sort(function(e,t){return new Date(t.modifiedTime)-new Date(e.modifiedTime)||e.sortNumber-t.sortNumber}),v(s);let c=sessionStorage.getItem("Digit.citizen.userRequestObject");const p=c?JSON.parse(c):{};1==(null==p||null===(t=p.value)||void 0===t||null===(l=t.info)||void 0===l||null===(n=l.roles)||void 0===n?void 0:n.length)&&"CITIZEN"==(null==p||null===(i=p.value)||void 0===i||null===(o=i.info)||void 0===o||null===(a=o.roles)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.code)&&E(!0)}},[b,T,C,h]),b||T?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Header,{styles:{marginLeft:"10px"}},s("BPA_MY_APPLICATIONS")+" "+((e,t)=>{let l=0;return"number"==typeof e&&(l+=e),"number"==typeof t&&(l+=t),l>0?"("+l+")":""})(null==h||null===(d=h.Licenses)||void 0===d?void 0:d.length,null==C?void 0:C.length)),null==p?void 0:p.map((e,t)=>{var n,a,r,d,p,v,E,f,_,g,A,S,h;return"BPAREG"===e.type?l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:s("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNumber}),l.createElement(o.KeyNote,{keyValue:s("BPA_LICENSE_TYPE"),note:s("TRADELICENSE_TRADETYPE_"+(null==e||null===(n=e.tradeLicenseDetail)||void 0===n||null===(a=n.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(d=r.tradeType)||void 0===d?void 0:d.split(".")[0]))}),(null==e||null===(p=e.tradeLicenseDetail)||void 0===p||null===(v=p.tradeUnits)||void 0===v||null===(E=v[0])||void 0===E?void 0:E.tradeType.includes("ARCHITECT"))&&l.createElement(o.KeyNote,{keyValue:s("BPA_COUNCIL_OF_ARCH_NO_LABEL"),note:null==e||null===(f=e.tradeLicenseDetail)||void 0===f||null===(_=f.additionalDetail)||void 0===_?void 0:_.counsilForArchNo}),l.createElement(o.KeyNote,{keyValue:s("BPA_APPLICANT_NAME_LABEL"),note:null==e||null===(g=e.tradeLicenseDetail)||void 0===g||null===(A=g.owners)||void 0===A||null===(S=A[0])||void 0===S?void 0:S.name}),l.createElement(o.KeyNote,{keyValue:s("TL_COMMON_TABLE_COL_STATUS"),note:s("WF_ARCHITECT_"+(null==e?void 0:e.status)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/stakeholder/"+(null==e?void 0:e.applicationNumber),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:s("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:s("BPA_COMP_WORKFLOW"),onSubmit:()=>(e=>{var t,l,n,i,o,a,r,d,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j,z,Y,G,K,V,q,X,J,Z,$,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,pe,ve,me,Ee;let fe=e,_e={Correspondenceaddress:(null==fe||null===(t=fe.tradeLicenseDetail)||void 0===t||null===(l=t.owners)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.correspondenceAddress)||(null!=fe&&null!==(i=fe.tradeLicenseDetail)&&void 0!==i&&null!==(o=i.address)&&void 0!==o&&o.doorNo?(null==fe||null===(a=fe.tradeLicenseDetail)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.doorNo)+", ":"")+" "+(null!=fe&&null!==(d=fe.tradeLicenseDetail)&&void 0!==d&&null!==(p=d.address)&&void 0!==p&&p.street?(null==fe||null===(v=fe.tradeLicenseDetail)||void 0===v||null===(m=v.address)||void 0===m?void 0:m.street)+", ":"")+(null!=fe&&null!==(E=fe.tradeLicenseDetail)&&void 0!==E&&null!==(f=E.address)&&void 0!==f&&f.landmark?(null==fe||null===(_=fe.tradeLicenseDetail)||void 0===_||null===(g=_.address)||void 0===g?void 0:g.landmark)+", ":"")+s(null==fe||null===(A=fe.tradeLicenseDetail)||void 0===A||null===(S=A.address)||void 0===S?void 0:S.locality.code)+", "+s(null!=fe&&null!==(h=fe.tradeLicenseDetail)&&void 0!==h&&null!==(b=h.address)&&void 0!==b&&b.city?null==fe||null===(y=fe.tradeLicenseDetail)||void 0===y||null===(C=y.address)||void 0===C?void 0:C.city.code:"")+","+(s(null==fe||null===(T=fe.tradeLicenseDetail)||void 0===T||null===(D=T.address)||void 0===D?void 0:D.pincode)?""+(null===(P=fe.tradeLicenseDetail)||void 0===P||null===(I=P.address)||void 0===I?void 0:I.pincode):" "),formData:{LicneseDetails:{PanNumber:null==fe||null===(N=fe.tradeLicenseDetail)||void 0===N||null===(L=N.owners)||void 0===L||null===(B=L[0])||void 0===B?void 0:B.pan,PermanentAddress:null==fe||null===(O=fe.tradeLicenseDetail)||void 0===O||null===(R=O.owners)||void 0===R||null===(x=R[0])||void 0===x?void 0:x.permanentAddress,email:null==fe||null===(w=fe.tradeLicenseDetail)||void 0===w||null===(M=w.owners)||void 0===M||null===(k=M[0])||void 0===k?void 0:k.emailId,gender:{code:null==fe||null===(F=fe.tradeLicenseDetail)||void 0===F||null===(U=F.owners)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.gender,i18nKey:"COMMON_GENDER_"+(null==fe||null===(W=fe.tradeLicenseDetail)||void 0===W||null===(j=W.owners)||void 0===j||null===(z=j[0])||void 0===z?void 0:z.gender),value:null==fe||null===(Y=fe.tradeLicenseDetail)||void 0===Y||null===(G=Y.owners)||void 0===G||null===(K=G[0])||void 0===K?void 0:K.gender},mobileNumber:null==fe||null===(V=fe.tradeLicenseDetail)||void 0===V||null===(q=V.owners)||void 0===q||null===(X=q[0])||void 0===X?void 0:X.mobileNumber,name:null==fe||null===(J=fe.tradeLicenseDetail)||void 0===J||null===(Z=J.owners)||void 0===Z||null===($=Z[0])||void 0===$?void 0:$.name},LicneseType:{LicenseType:{i18nKey:"TRADELICENSE_TRADETYPE_"+(null==fe||null===(Q=fe.tradeLicenseDetail)||void 0===Q||null===(ee=Q.tradeUnits)||void 0===ee||null===(te=ee[0])||void 0===te?void 0:te.tradeType.split(".")[0]),role:["BPA_"+(null==fe||null===(le=fe.tradeLicenseDetail)||void 0===le||null===(ne=le.tradeUnits)||void 0===ne||null===(ie=ne[0])||void 0===ie?void 0:ie.tradeType.split(".")[0])],tradeType:null==fe||null===(oe=fe.tradeLicenseDetail)||void 0===oe||null===(ae=oe.tradeUnits)||void 0===ae||null===(re=ae[0])||void 0===re?void 0:re.tradeType},ArchitectNo:(null==fe||null===(ue=fe.tradeLicenseDetail)||void 0===ue||null===(de=ue.additionalDetail)||void 0===de?void 0:de.counsilForArchNo)||null}},isAddressSame:(null==fe||null===(se=fe.tradeLicenseDetail)||void 0===se||null===(ce=se.owners)||void 0===ce||null===(pe=ce[0])||void 0===pe?void 0:pe.correspondenceAddress)===(null==fe||null===(ve=fe.tradeLicenseDetail)||void 0===ve||null===(me=ve.owners)||void 0===me||null===(Ee=me[0])||void 0===Ee?void 0:Ee.permanentAddress),result:{Licenses:[u({},e)]},initiationFlow:!0};sessionStorage.setItem("BPAREGintermediateValue",JSON.stringify(_e)),c.push("/digit-ui/citizen/obps/stakeholder/apply/stakeholder-docs-required")})(e)}),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/"+(null==e?void 0:e.businessService)+"/"+(null==e?void 0:e.applicationNumber)}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:s("COMMON_MAKE_PAYMENT")}))):null):l.createElement(o.Card,{key:t},l.createElement(o.KeyNote,{keyValue:s("BPA_APPLICATION_NUMBER_LABEL"),note:null==e?void 0:e.applicationNo}),l.createElement(o.KeyNote,{keyValue:s("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),note:s("BPA_OC"!==(null==e?void 0:e.businessService)?"WF_BPA_BUILDING_PLAN_SCRUTINY":"WF_BPA_BUILDING_OC_PLAN_SCRUTINY")}),l.createElement(o.KeyNote,{keyValue:s("BPA_COMMON_SERVICE"),note:s("BPA_SERVICETYPE_NEW_CONSTRUCTION")}),l.createElement(o.KeyNote,{keyValue:s("TL_COMMON_TABLE_COL_STATUS"),note:s("WF_BPA_"+(null==e?void 0:e.state)),noteStyle:"APPROVED"===(null==e?void 0:e.status)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.KeyNote,{keyValue:s("BPA_COMMON_SLA"),note:"string"==typeof(null==e?void 0:e.sla)&&null!=e&&null!==(h=e.sla)&&void 0!==h&&h.includes("NA")?s("CS_NA"):null==e?void 0:e.sla}),"SEND_TO_ARCHITECT"===e.action||"INITIATED"!==e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:s("TL_VIEW_DETAILS")})):l.createElement("div",null,m?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/bpa/"+(null==e?void 0:e.applicationNo),state:{tenantId:""}}},l.createElement(o.SubmitBar,{label:s("TL_VIEW_DETAILS")})):l.createElement(o.SubmitBar,{label:s("BPA_COMP_WORKFLOW"),onSubmit:()=>_t(e,P,c,s)})),"PENDINGPAYMENT"===e.status?l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/"+(null==e?void 0:e.businessService)+"/"+(null==e?void 0:e.applicationNumber)}},l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:s("COMMON_MAKE_PAYMENT")}))):null)}),l.createElement("div",{style:{marginLeft:"16px",marginTop:"16px",marginBottom:"46px"}},l.createElement("span",null,s("BPA_NOT_ABLE_TO_FIND_APP_MSG")+" "," "),l.createElement("span",{className:"link"},l.createElement(i.Link,{to:"/digit-ui/citizen/obps/search/obps-application"},s("BPA_CLICK_HERE_TO_SEARCH_LINK")))))},Wt=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},jt=e=>{var t,i,a;let{data:r,OpenImage:u}=e;const{t:d}=n.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(o.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,d("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Wt,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(t=r.wfComment)||void 0===t?void 0:t.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("WF_COMMON_COMMENTS")),l.createElement("p",null,e)))):null,(null==r||null===(i=r.thumbnailsToShow)||void 0===i||null===(a=i.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,d("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)},zt=e=>{var a,r,u,d,s;let{id:c,tenantId:p}=e;const{t:v}=n.useTranslation(),[m,E]=t.useState(!1),{isLoading:f,data:_}=Digit.Hooks.useWorkflowDetails({tenantId:p,id:c,moduleCode:"OBPS"});if(f)return l.createElement(o.Loader,null);function g(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const A=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:v(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(jt,{data:r,OpenImage:g})};return l.createElement(l.Fragment,null,!f&&l.createElement(t.Fragment,null,(null==_||null===(a=_.timeline)||void 0===a?void 0:a.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=_&&_.timeline&&1===(null==_||null===(r=_.timeline)||void 0===r?void 0:r.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:v((null==_||null===(u=_.timeline[0])||void 0===u?void 0:u.state)&&"WF_ARCHITECT_"+_.timeline[0].state||"NA"),customChild:A(null==_?void 0:_.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==_?void 0:_.timeline)&&(null==_?void 0:_.timeline.slice(0,m?_.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=_&&null!==(a=_.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=_&&null!==(u=_.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?v("WF_ARCHITECT_"+e.state+i):"NA",customChild:A(e)}))}))),(null==_||null===(d=_.timeline)||void 0===d?void 0:d.length)>2&&l.createElement(o.LinkButton,{label:v(m?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{E(e=>!e)}})),_&&(e=>{var t,n,a,r,u,d;switch(null==e?void 0:e.action){case"PAY":return l.createElement("div",{style:{marginTop:"24px"},className:"action-bar-wrap"},l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/"+(null==_||null===(t=_.processInstances)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.moduleName)+"/"+(null==_||null===(a=_.processInstances)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.businessId),state:{tenantId:null==_||null===(u=_.processInstances)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.tenantId}}},l.createElement(o.SubmitBar,{label:v("TL_COMMON_BUTTON_CITIZEN_MAKE_PAYMENT")})));case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(i.Link,{to:"/digit-ui/citizen/fsm/rate/"+props.id},l.createElement(o.SubmitBar,{label:v("CS_APPLICATION_DETAILS_RATE")})))}})(null==_||null===(s=_.nextActions)||void 0===s?void 0:s[0]))},Yt=()=>{var e,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j,z,Y;const{id:G}=i.useParams(),{t:K}=n.useTranslation(),[V,q]=t.useState({}),X=Digit.ULBService.getCurrentTenantId(),[J,Z]=t.useState(!1),[$,Q]=t.useState([]),{id:ee}=i.useParams(),te={applicationNumber:ee},le=Digit.ULBService.getStateId(),ne=window.Digit.Utils.browser.isMobile(),{data:ie,isLoading:oe}=Digit.Hooks.obps.useBPAREGSearch(le,{},te);let ae=null==ie||null===(e=ie.Licenses)||void 0===e?void 0:e[0];const{data:re}=Digit.Hooks.obps.useMDMS(le,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:ue}=Digit.Hooks.useRecieptSearch({tenantId:le,businessService:"BPAREG",consumerCodes:G,isEmployee:!1},{}),[de,se]=t.useState(!1);var ce,pe;return t.useEffect(()=>{var e,t;if(null!=ae&&null!==(e=ae.tradeLicenseDetail)&&void 0!==e&&null!==(t=e.applicationDocuments)&&void 0!==t&&t.length){var l,n;const e=null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.applicationDocuments)||void 0===n?void 0:n.map(e=>null==e?void 0:e.fileStoreId);Digit.UploadServices.Filefetch(e,X.split(".")[0]).then(e=>q(null==e?void 0:e.data))}},[ae]),t.useEffect(()=>{var e,t,l;ae&&((null==ue||null===(e=ue.Payments)||void 0===e?void 0:e.length)>0&&Q([{label:K("TL_RECEIPT"),onClick:()=>Rt(0,null==ae?void 0:ae.applicationNumber,null==ae?void 0:ae.tenantId,null==ue?void 0:ue.Payments)}]),null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.map(e=>null==e?void 0:e.fileStoreId))},[ae,ue]),null!=ae&&null!==(a=ae.tradeLicenseDetail)&&void 0!==a&&null!==(r=a.applicationDocuments)&&void 0!==r&&r.length&&(null==re||null===(u=re.StakeholderRegistraition)||void 0===u||null===(d=u.TradeTypetoRoleMapping)||void 0===d?void 0:d.length)>0&&(null==re||null===(ce=re.StakeholderRegistraition)||void 0===ce||null===(pe=ce.TradeTypetoRoleMapping)||void 0===pe||pe.map(e=>{var t,l,n,i,o;(null==e||null===(t=e.docTypes)||void 0===t?void 0:t.length)>0&&(null==e?void 0:e.tradeType)==(null==ae||null===(l=ae.tradeLicenseDetail)||void 0===l||null===(n=l.tradeUnits)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.tradeType)&&(null==e||null===(o=e.docTypes)||void 0===o||o.map(e=>{var t,l;null==ae||null===(t=ae.tradeLicenseDetail)||void 0===t||null===(l=t.applicationDocuments)||void 0===l||l.forEach(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.documentType)&&null!=e&&e.info&&(t.info=null==e?void 0:e.info)})}))})),oe?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:ne?{}:{maxWidth:"980px"}},l.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:ne?"0px":"10px"}},K("BPA_TASK_DETAILS_HEADER")),l.createElement("div",{style:{display:"flex",alignItems:"center",color:"#A52A2A"}}),l.createElement(o.LinkButton,{label:K("VIEW_TIMELINE"),styles:{fontSize:"32px",marginLeft:ne?"0px":"10px"},onClick:()=>{se(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}})),(null==ue||null===(s=ue.Payments)||void 0===s?void 0:s.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>Z(!J),displayOptions:J,options:$,style:{top:"90px"}})),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:K("BPA_APPLICATION_NUMBER_LABEL"),text:(null==ae?void 0:ae.applicationNumber)||"NA"}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:K("BPA_LICENSE_TYPE"),text:K("TRADELICENSE_TRADETYPE_"+(null==ae||null===(c=ae.tradeLicenseDetail)||void 0===c||null===(p=c.tradeUnits)||void 0===p||null===(v=p[0])||void 0===v||null===(m=v.tradeType)||void 0===m?void 0:m.split(".")[0]))}),(null==ae||null===(E=ae.tradeLicenseDetail)||void 0===E||null===(f=E.tradeUnits)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.tradeType.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:K("BPA_COUNCIL_OF_ARCH_NO_LABEL"),text:null==ae||null===(g=ae.tradeLicenseDetail)||void 0===g||null===(A=g.additionalDetail)||void 0===A?void 0:A.counsilForArchNo}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("BPA_LICENSE_DET_CAPTION")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:K("BPA_APPLICANT_NAME_LABEL"),text:K(null==ae||null===(S=ae.tradeLicenseDetail)||void 0===S||null===(h=S.owners)||void 0===h||null===(b=h[0])||void 0===b?void 0:b.name)}),l.createElement(o.Row,{className:"border-none",label:K("BPA_APPLICANT_GENDER_LABEL"),text:K(null==ae||null===(y=ae.tradeLicenseDetail)||void 0===y||null===(C=y.owners)||void 0===C||null===(T=C[0])||void 0===T?void 0:T.gender)}),l.createElement(o.Row,{className:"border-none",label:K("BPA_OWNER_MOBILE_NO_LABEL"),text:null==ae||null===(D=ae.tradeLicenseDetail)||void 0===D||null===(P=D.owners)||void 0===P||null===(I=P[0])||void 0===I?void 0:I.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:K("BPA_APPLICANT_EMAIL_LABEL"),text:(null==ae||null===(N=ae.tradeLicenseDetail)||void 0===N||null===(L=N.owners)||void 0===L||null===(B=L[0])||void 0===B?void 0:B.emailId)||K("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:K("BPA_APPLICANT_PAN_NO"),text:(null==ae||null===(O=ae.tradeLicenseDetail)||void 0===O||null===(R=O.owners)||void 0===R||null===(x=R[0])||void 0===x?void 0:x.pan)||K("CS_NA")}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("BPA_LICENSEE_PERMANENT_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(w=ae.tradeLicenseDetail)||void 0===w||null===(M=w.owners)||void 0===M||null===(k=M[0])||void 0===k?void 0:k.permanentAddress)||K("CS_NA")})),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("BPA_CORRESPONDANCE_ADDRESS_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(F=ae.tradeLicenseDetail)||void 0===F||null===(U=F.owners)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.correspondenceAddress)||K("CS_NA")})),(null==ae||null===(W=ae.tradeLicenseDetail)||void 0===W||null===(j=W.applicationDocuments)||void 0===j?void 0:j.length)>0&&l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},K("BPA_DOC_DETAILS_SUMMARY")),null==ae||null===(z=ae.tradeLicenseDetail)||void 0===z||null===(Y=z.applicationDocuments)||void 0===Y?void 0:Y.map((e,n)=>{var i,a,r,u,d;return l.createElement(t.Fragment,null,l.createElement("div",null,l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},K("BPAREG_HEADER_"+mt(null==e||null===(i=e.documentType)||void 0===i?void 0:i.toUpperCase(),".","_"))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",margin:"10px 0px"}},""+K(null==e?void 0:e.info)):null,l.createElement("a",{target:"_blank",href:null===(a=V[e.fileStoreId])||void 0===a?void 0:a.split(",")[0]},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},K("BPAREG_HEADER_"+mt(null==e||null===(r=e.documentType)||void 0===r?void 0:r.toUpperCase(),".","_")))),(null==ae||null===(u=ae.tradeLicenseDetail)||void 0===u||null===(d=u.applicationDocuments)||void 0===d?void 0:d.length)!=n+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),l.createElement("div",{id:"timeline"},l.createElement(o.Card,null,l.createElement(zt,{id:G,tenantId:null==ae?void 0:ae.tenantId})))))},Gt=e=>{var a,r;const{state:u}=e.location,{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=null==u||null===(a=u.data)||void 0===a||null===(r=a.BPA)||void 0===r?void 0:r[0],[p,v]=t.useState({}),[m,E]=t.useState(!0),f=i.useHistory(),[_,g]=t.useState(""),[A,S]=t.useState(null);let h=null==p?void 0:p.businessService,b=null==p?void 0:p.status;"BPA_LOW"==h&&(h="BPA");let y=Digit.Hooks.useWorkflowDetails({tenantId:null==c?void 0:c.tenantId,id:null==c?void 0:c.applicationNo,moduleCode:"BPA"});t.useEffect(function(){try{return E(!0),Promise.resolve(Digit.OBPSService.BPASearch(s,{applicationNo:null==c?void 0:c.applicationNo})).then(function(e){var t,l,n,i;return Promise.resolve(Lt(null==e||null===(t=e.BPA)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.businessService,null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.status)).then(function(t){var l,n;return Promise.resolve(Digit.PaymentService.fetchBill(s,{consumerCode:null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.applicationNo,businessService:t})).then(function(t){var l,n,i,o;"APPROVED"==(null==e||null===(l=e.BPA)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.status)&&null!=t&&t.Bill[0]&&0!=(null==t||null===(i=t.Bill[0])||void 0===i?void 0:i.totalAmount)&&g("_SAN_FEE"),E(!1),v(null==e||null===(o=e.BPA)||void 0===o?void 0:o[0]),S(null==t?void 0:t.Bill)})})})}catch(e){return Promise.reject(e)}},[]);let C=!1;var T,D,P,I,N,L;return!y||null==y||!y.data||null!=y&&y.isLoading||null==y||null===(T=y.data)||void 0===T||null===(D=T.nextActions)||void 0===D||D.forEach(e=>{"PAY"!=e.action||C||(C=!0)}),l.createElement("div",null,m||null!=y&&y.isLoading?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(o.Banner,{message:d("BPA_HEADER_"+h+"_"+(null==c||null===(L=c.workflow)||void 0===L?void 0:L.action)+"_"+mt(b," ","_").toUpperCase()+(_||"")),applicationNumber:null==p?void 0:p.applicationNo,info:d("BPA"==h?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:"PERMIT REVOCATION"!=(null==p?void 0:p.status)&&"REJECTED"!=(null==p?void 0:p.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},d("BPA_SUB_HEADER_"+h+"_"+(null==c||null===(P=c.workflow)||void 0===P?void 0:P.action)+"_"+(null!=c&&null!==(I=c.additionalDetails)&&void 0!==I&&I.typeOfArchitect?null==c||null===(N=c.additionalDetails)||void 0===N?void 0:N.typeOfArchitect:"ARCHITECT")+"_"+mt(b," ","_").toUpperCase()+(_||""))),"PERMIT REVOCATION"==(null==p?void 0:p.status)?l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:function(){try{return Promise.resolve(Digit.PaymentService.generatePdf(s,{Bpa:[p]},"bpa-revocation")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(s,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),d("BPA_REVOCATION_PDF_LABEL")):null,window.location.href.includes("/citizen")?l.createElement("div",null,("PENDING_APPL_FEE"==(null==p?void 0:p.status)||"PENDING_FEE"==(null==p?void 0:p.status)||"PENDING_SANC_FEE_PAYMENT"==(null==p?void 0:p.status))&&(null==A?void 0:A.length)>0&&C?l.createElement("div",null,l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/"+Lt(null==p?void 0:p.businessService,null==p?void 0:p.status)+"/"+(null==p?void 0:p.applicationNo)+"/"+(null==p?void 0:p.tenantId)+"?tenantId="+(null==p?void 0:p.tenantId)}},l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),style:{margin:"10px 0px 0px 0px"}})),l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")}))):l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),style:{margin:"10px 10px 0px 0px"}}))):l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement("div",null,("PENDING_APPL_FEE"==(null==p?void 0:p.status)||"PENDING_FEE"==(null==p?void 0:p.status)||"PENDING_SANC_FEE_PAYMENT"==(null==p?void 0:p.status))&&(null==A?void 0:A.length)>0&&C?l.createElement("div",null,l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),onSubmit:()=>{f.push("/digit-ui/employee/payment/collect/"+Lt(null==p?void 0:p.businessService,null==p?void 0:p.status)+"/"+(null==p?void 0:p.applicationNo)+"/"+(null==p?void 0:p.tenantId)+"?tenantId="+(null==p?void 0:p.tenantId))},style:{margin:"10px 0px 0px 0px"}}),l.createElement(i.Link,{to:"/digit-ui/employee"},l.createElement("span",{style:{color:"#a82227",margin:"0px 10px"}},d("CORE_COMMON_GO_TO_HOME")))):l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{f.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}})))))},Kt=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d,filterFormState:s,localitiesForEmployeesCurrentTenant:c,loadingLocalitiesForEmployeesCurrentTenant:p}=e;const{t:v}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),{data:E,isLoading:f}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(m),_=[{code:"ASSIGNED_TO_ME",name:""+v("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+v("ES_INBOX_ASSIGNED_TO_ALL")}],g=a.useWatch({control:u,name:"applicationType",defaultValue:(null==s?void 0:s.applicationType)||null}),A=Digit.Hooks.obps.useBusinessServiceBasedOnServiceType({applicationType:g}),S=a.useWatch({control:u,name:"businessService",defaultValue:(null==s?void 0:s.businessService)||null}),h=(e,t)=>{const l=e.map(e=>e[1]);return t.onChange(l)};return l.createElement(t.Fragment,null,window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:_.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:_})})),window.location.href.includes("/citizen")?null:l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"locality",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==e||null===(t=e.value)||void 0===t?void 0:t.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:t.i18nkey,onClick:()=>{var l;e.onChange(null==e||null===(l=e.value)||void 0===l?void 0:l.filter(e=>e.code!==t.code))}}))},[null==e?void 0:e.value]);return p?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("ES_INBOX_LOCALITY")),l.createElement(o.MultiSelectDropdown,{options:c||[],optionsKey:"i18nkey",props:e,isPropsNeeded:!0,onSelect:h,selected:null==e?void 0:e.value,defaultLabel:v("ES_BPA_ALL_SELECTED"),defaultUnit:v("BPA_SELECTED_TEXT")}),l.createElement("div",{className:"tag-container"},n))}})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"applicationType",control:u,render:e=>f?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[]),d("businessService",[])},selectedOption:E.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"applicationType",options:E}))})),(null==g?void 0:g.length)>0&&"BUILDING_OC_PLAN_SCRUTINY"!=g?l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("ES_INBOX_RISK_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),d("applicationStatus",[])},selectedOption:A.filter(t=>t.code===e.value)[0],optionsKey:"i18nKey",name:"businessService",options:A}))})):null,"BUILDING_OC_PLAN_SCRUTINY"==g||(null==g?void 0:g.length)>0&&(null==S?void 0:S.length)>0?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},v("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{function n(t){e.onChange(t)}const a=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>{let t=pt(S);return"BUILDING_OC_PLAN_SCRUTINY"==g&&(t="BPA_OC"),e.businessservice===t}))||void 0===t?void 0:t.map((t,i)=>{var a;return l.createElement(o.CheckBox,{key:i,onChange:l=>{if(l.target.checked&&null!=e&&e.value)n([...null==e?void 0:e.value,null==t?void 0:t.statusid]);else if(l.target.checked)n([null==t?void 0:t.statusid]);else{var i;n(null==e||null===(i=e.value)||void 0===i?void 0:i.filter(e=>e!==(null==t?void 0:t.statusid)))}},checked:null==e||null===(a=e.value)||void 0===a?void 0:a.includes(null==t?void 0:t.statusid),label:v("WF_STATE_"+t.businessservice+"_"+t.applicationstatus)+" ("+t.count+")"})})},[e.value,i,S,g]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,a))}})):null)},Vt=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:p}=n.useTranslation();var v,m,E,f;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:window.location.href.includes("/citizen")?{gridTemplateColumns:"33.33% 67.33%",textAlign:"start"}:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),window.location.href.includes("/citizen")?null:l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(v=s.errors)&&void 0!==v&&null!==(m=v.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(f=E.mobileNumber)||void 0===f?void 0:f.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};function qt(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 Xt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Jt(e){Xt(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 Zt(e,t){Xt(2,arguments);var l=Jt(e).getTime(),n=qt(t);return new Date(l+n)}function $t(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 Qt(e){return Xt(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function el(e){if(Xt(1,arguments),!Qt(e)&&"number"!=typeof e)return!1;var t=Jt(e);return!isNaN(Number(t))}var tl={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 ll(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 nl={date:ll({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ll({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:ll({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},il={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function ol(e){return function(t,l){var n,i=l||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,a=i.width?String(i.width):o;n=e.formattingValues[a]||e.formattingValues[o]}else{var r=e.defaultWidth,u=i.width?String(i.width):e.defaultWidth;n=e.values[u]||e.values[r]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function al(e){return function(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=l.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,r=o[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?ul(u,function(e){return e.test(r)}):rl(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 rl(e,t){for(var l in e)if(e.hasOwnProperty(l)&&t(e[l]))return l}function ul(e,t){for(var l=0;l<e.length;l++)if(t(e[l]))return l}var dl,sl={code:"en-US",formatDistance:function(e,t,l){var n,i=tl[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=l&&l.addSuffix?l.comparison&&l.comparison>0?"in "+n:n+" ago":n},formatLong:nl,formatRelative:function(e,t,l,n){return il[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:ol({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:ol({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:ol({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:ol({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:ol({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:(dl={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(dl.matchPattern);if(!l)return null;var n=l[0],i=e.match(dl.parsePattern);if(!i)return null;var o=dl.valueCallback?dl.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var a=e.slice(n.length);return{value:o,rest:a}}),era:al({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:al({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:al({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:al({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:al({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 cl(e,t){Xt(2,arguments);var l=qt(t);return Zt(e,-l)}function pl(e){Xt(1,arguments);var t=1,l=Jt(e),n=l.getUTCDay(),i=(n<t?7:0)+n-t;return l.setUTCDate(l.getUTCDate()-i),l.setUTCHours(0,0,0,0),l}function vl(e){Xt(1,arguments);var t=Jt(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var i=pl(n),o=new Date(0);o.setUTCFullYear(l,0,4),o.setUTCHours(0,0,0,0);var a=pl(o);return t.getTime()>=i.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function ml(e){Xt(1,arguments);var t=vl(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=pl(l);return n}function El(e,t){Xt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:qt(i),a=null==l.weekStartsOn?o:qt(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Jt(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 fl(e,t){Xt(1,arguments);var l=Jt(e),n=l.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:qt(a),u=null==i.firstWeekContainsDate?r:qt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=new Date(0);d.setUTCFullYear(n+1,0,u),d.setUTCHours(0,0,0,0);var s=El(d,t),c=new Date(0);c.setUTCFullYear(n,0,u),c.setUTCHours(0,0,0,0);var p=El(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=p.getTime()?n:n-1}function _l(e,t){Xt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:qt(i),a=null==l.firstWeekContainsDate?o:qt(l.firstWeekContainsDate),r=fl(e,t),u=new Date(0);u.setUTCFullYear(r,0,a),u.setUTCHours(0,0,0,0);var d=El(u,t);return d}function gl(e,t){for(var l=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return l+n}var Al={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 gl("yy"===t?n%100:n,t.length)}(e,t)},Y:function(e,t,l,n){var i=fl(e,n),o=i>0?i:1-i;return"YY"===t?gl(o%100,2):"Yo"===t?l.ordinalNumber(o,{unit:"year"}):gl(o,t.length)},R:function(e,t){return gl(vl(e),t.length)},u:function(e,t){return gl(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 gl(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 gl(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):gl(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 gl(n+1,2);case"Lo":return l.ordinalNumber(n+1,{unit:"month"});case"LLL":return l.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return l.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return l.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,l,n){var i=function(e,t){Xt(1,arguments);var l=Jt(e),n=El(l,t).getTime()-_l(l,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?l.ordinalNumber(i,{unit:"week"}):gl(i,t.length)},I:function(e,t,l){var n=function(e){Xt(1,arguments);var t=Jt(e),l=pl(t).getTime()-ml(t).getTime();return Math.round(l/6048e5)+1}(e);return"Io"===t?l.ordinalNumber(n,{unit:"week"}):gl(n,t.length)},d:function(e,t,l){return"do"===t?l.ordinalNumber(e.getUTCDate(),{unit:"date"}):function(e,t){return gl(e.getUTCDate(),t.length)}(e,t)},D:function(e,t,l){var n=function(e){Xt(1,arguments);var t=Jt(e),l=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=l-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?l.ordinalNumber(n,{unit:"dayOfYear"}):gl(n,t.length)},E:function(e,t,l){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return l.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return l.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return l.day(n,{width:"short",context:"formatting"});case"EEEE":default:return l.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return gl(o,2);case"eo":return l.ordinalNumber(o,{unit:"day"});case"eee":return l.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return l.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return l.day(i,{width:"short",context:"formatting"});case"eeee":default:return l.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,l,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return gl(o,t.length);case"co":return l.ordinalNumber(o,{unit:"day"});case"ccc":return l.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return l.day(i,{width:"narrow",context:"standalone"});case"cccccc":return l.day(i,{width:"short",context:"standalone"});case"cccc":default:return l.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,l){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return gl(i,t.length);case"io":return l.ordinalNumber(i,{unit:"day"});case"iii":return l.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return l.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return l.day(n,{width:"short",context:"formatting"});case"iiii":default:return l.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,l){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,l){var n,i=e.getUTCHours();switch(n=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,l){var n,i=e.getUTCHours();switch(n=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return l.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return l.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return l.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,l){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),l.ordinalNumber(n,{unit:"hour"})}return function(e,t){return gl(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 gl(e.getUTCHours(),t.length)}(e,t)},K:function(e,t,l){var n=e.getUTCHours()%12;return"Ko"===t?l.ordinalNumber(n,{unit:"hour"}):gl(n,t.length)},k:function(e,t,l){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?l.ordinalNumber(n,{unit:"hour"}):gl(n,t.length)},m:function(e,t,l){return"mo"===t?l.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):function(e,t){return gl(e.getUTCMinutes(),t.length)}(e,t)},s:function(e,t,l){return"so"===t?l.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):function(e,t){return gl(e.getUTCSeconds(),t.length)}(e,t)},S:function(e,t){return function(e,t){var l=t.length,n=e.getUTCMilliseconds();return gl(Math.floor(n*Math.pow(10,l-3)),t.length)}(e,t)},X:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return hl(i);case"XXXX":case"XX":return bl(i);case"XXXXX":case"XXX":default:return bl(i,":")}},x:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return hl(i);case"xxxx":case"xx":return bl(i);case"xxxxx":case"xxx":default:return bl(i,":")}},O:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Sl(i,":");case"OOOO":default:return"GMT"+bl(i,":")}},z:function(e,t,l,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Sl(i,":");case"zzzz":default:return"GMT"+bl(i,":")}},t:function(e,t,l,n){return gl(Math.floor((n._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,l,n){return gl((n._originalDate||e).getTime(),t.length)}};function Sl(e,t){var l=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return l+String(i);var a=t||"";return l+String(i)+a+gl(o,2)}function hl(e,t){return e%60==0?(e>0?"-":"+")+gl(Math.abs(e)/60,2):bl(e,t)}function bl(e,t){var l=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+gl(Math.floor(i/60),2)+l+gl(i%60,2)}function yl(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 Cl(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 Tl={p:Cl,P:function(e,t){var l,n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return yl(e,t);switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"})}return l.replace("{{date}}",yl(i,t)).replace("{{time}}",Cl(o,t))}},Dl=["D","DD"],Pl=["YY","YYYY"];function Il(e){return-1!==Dl.indexOf(e)}function Nl(e){return-1!==Pl.indexOf(e)}function Ll(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 Bl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ol=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Rl=/^'([^]*?)'?$/,xl=/''/g,wl=/[a-zA-Z]/;function Ml(e,t,l){Xt(2,arguments);var n=String(t),i=l||{},o=i.locale||sl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:qt(a),u=null==i.firstWeekContainsDate?r:qt(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=o.options&&o.options.weekStartsOn,s=null==d?0:qt(d),c=null==i.weekStartsOn?s:qt(i.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var p=Jt(e);if(!el(p))throw new RangeError("Invalid time value");var v=$t(p),m=cl(p,v),E={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:p},f=n.match(Ol).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Tl[t])(e,o.formatLong,E):e}).join("").match(Bl).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return kl(l);var a=Al[n];if(a)return!i.useAdditionalWeekYearTokens&&Nl(l)&&Ll(l,t,e),!i.useAdditionalDayOfYearTokens&&Il(l)&&Ll(l,t,e),a(m,l,o.localize,E);if(n.match(wl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return f}function kl(e){return e.match(Rl)[1].replace(xl,"'")}const Fl=e=>{let{parentRoute:r}=e;window.scroll(0,0);const{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c={},p={moduleName:"bpa-services",applicationStatus:[],locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},v={sortBy:"",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("OBPS.INBOX"),E=t.useMemo(()=>m||{filterForm:p,searchForm:c,tableForm:v},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[f,_]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("OBPS.INBOX",u({},e,{searchForm:t.data})),u({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("OBPS.INBOX",u({},e,{filterForm:t.data})),u({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("OBPS.INBOX",u({},e,{tableForm:t.data})),u({},e,{tableForm:t.data})}},E),{data:g,isLoading:A}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},d),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:s,filters:u({},f)}),C={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:d("BPA_SEARCH_PAGE_TITLE"),link:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},T=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Vt,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),D=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Kt,{statuses:b,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==f?void 0:f.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),P={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:u({},v)}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==f?void 0:f.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:c})}},I={FilterFormFields:D,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:u({},v)}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==f?void 0:f.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),_({action:"mutateFilterForm",data:p})}},N=(e=>{var o,a,r,d;let{parentRoute:s,onPageSizeChange:c,formState:p,totalCount:v,table:m,dispatch:E,onSortingByData:f}=e;const{t:_}=n.useTranslation(),g=t.useMemo(()=>[{Header:_("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:window.location.href.includes("/citizen")?s+"/bpa/"+t.original.applicationId:s+"/inbox/bpa/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Ml(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:_("ES_INBOX_LOCALITY"),accessor:e=>_(null==e?void 0:e.locality),disableSortBy:!0},{Header:_("EVENTS_STATUS_LABEL"),accessor:e=>_(null!=e&&e.state?"WF_"+(null==e?void 0:e.businessService)+"_"+(null==e?void 0:e.state):"WF_"+(null==e?void 0:e.businessService)+"_"+(null==e?void 0:e.status)),disableSortBy:!0},{Header:_("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>_(null==e?void 0:e.owner),disableSortBy:!0},{Header:_("BPA_SEARCH_APPLICATION_TYPE_LABEL"),accessor:e=>_(null==e?void 0:e.applicationType),disableSortBy:!0},{Header:_("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>"CS_NA"===e?_(e):l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"applicationDate",onPageSizeChange:c,currentPage:(null===(o=p.tableForm)||void 0===o?void 0:o.offset)/(null===(a=p.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return E({action:"mutateTableForm",data:u({},p.tableForm,{offset:parseInt(null===(e=p.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=p.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return E({action:"mutateTableForm",data:u({},p.tableForm,{offset:parseInt(null===(e=p.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=p.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=p.tableForm)||void 0===r?void 0:r.limit,onSort:f,totalRecords:v,onSearch:null==p||null===(d=p.searchForm)||void 0===d?void 0:d.message,onLastPage:()=>{var e;return E({action:"mutateTableForm",data:u({},p.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=p.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>E({action:"mutateTableForm",data:u({},p.tableForm,{offset:0})}),data:m,columns:g}})(u({},{parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:u({},f.tableForm,{limit:e.target.value})})},formState:f,totalCount:y,table:h,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";f.tableForm.sortBy===t&&f.tableForm.sortOrder===n||_({action:"mutateTableForm",data:u({},f.tableForm,{sortBy:t,sortOrder:l?"DESC":"ASC"})})}}})),L=(e=>{let{table:t,getRedirectionLink:i}=e;const{t:r}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,date:l,applicationType:n,businessService:i,locality:o,status:a,owner:u,sla:d,state:s}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Ml(new Date(l),"dd/MM/yyyy"),[r("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:r(n),[r("ES_INBOX_LOCALITY")]:r(o),[r("EVENTS_STATUS_LABEL")]:r(s?"WF_"+i+"_"+s:"WF_"+i+"_"+a),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:u,[r("ES_INBOX_SLA_DAYS_REMAINING")]:d}}),isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:i,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h,getRedirectionLink:e=>{let t="";return t="BPAREG"===e?"search/application/stakeholder":window.location.href.includes("/citizen")?"bpa":"search/application/bpa",t}}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:u({},f.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==f?void 0:f.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:v})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,d("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},d("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,u({isInboxLoading:S,PropsForInboxLinks:C},P,I,B,{propsForInboxTable:N,propsForInboxMobileCards:L,formState:f})))},Ul=e=>{var t,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N;let{path:L}=e;const B=i.useLocation(),{t:O}=n.useTranslation();window.location.href.includes("/ws/create-application/property-details"),window.location.href.includes("/acknowledgement")||window.location.href.includes("/disconnect-acknowledge");const R=null===(t=Digit)||void 0===t||null===(a=t.ComponentRegistryService)||void 0===a?void 0:a.getComponent("BPACitizenHomeScreen"),x=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.getComponent("ObpsCreateEDCR"),w=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ObpsCreateOCEDCR"),M=null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v?void 0:v.getComponent("ObpsNewBuildingPermit"),k=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("ObpsOCBuildingPermit"),F=null===(f=Digit)||void 0===f||null===(_=f.ComponentRegistryService)||void 0===_?void 0:_.getComponent("ObpsStakeholderRegistration"),U=null===(g=Digit)||void 0===g||null===(A=g.ComponentRegistryService)||void 0===A?void 0:A.getComponent("ObpsEdcrInbox"),H=null===(S=Digit)||void 0===S||null===(h=S.ComponentRegistryService)||void 0===h?void 0:h.getComponent("ObpsCitizenBpaApplicationDetail"),W=null===(b=Digit)||void 0===b||null===(y=b.ComponentRegistryService)||void 0===y?void 0:y.getComponent("ObpsBPASendToArchitect"),j=null===(C=Digit)||void 0===C||null===(T=C.ComponentRegistryService)||void 0===T?void 0:T.getComponent("ObpsOCSendToArchitect"),z=null===(D=Digit)||void 0===D||null===(P=D.ComponentRegistryService)||void 0===P?void 0:P.getComponent("ObpsBPASendBackToCitizen"),Y=null===(I=Digit)||void 0===I||null===(N=I.ComponentRegistryService)||void 0===N?void 0:N.getComponent("ObpsOCSendBackToCitizen"),G="true"===sessionStorage.getItem("clickOnBPAApplyAfterEDCR");return l.createElement(l.Fragment,null,l.createElement("div",{className:"ws-citizen-wrapper"},!B.pathname.includes("response")&&!B.pathname.includes("openlink/stakeholder")&&!B.pathname.includes("/acknowledgement")&&!G&&l.createElement(o.BackButton,{style:{border:"none"}},O("CS_COMMON_BACK")),l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:L+"/home",component:R}),l.createElement(o.PrivateRoute,{path:L+"/search/application",component:e=>l.createElement(Ut,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/search/obps-application",component:e=>l.createElement(Ut,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/apply",component:x}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/oc-apply",component:w}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:applicationType/:serviceType",component:M}),l.createElement(o.PrivateRoute,{path:L+"/ocbpa/:applicationType/:serviceType",component:k}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/apply",component:F}),l.createElement(i.Route,{path:L+"/openlink/stakeholder/apply",component:F}),l.createElement(o.PrivateRoute,{path:L+"/my-applications",component:Ht}),l.createElement(o.PrivateRoute,{path:L+"/bpa/inbox",component:e=>l.createElement(Fl,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcr/inbox",component:e=>l.createElement(U,u({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/:id",component:Yt}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:id",component:H}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/bpa/:tenantId/:applicationNo",component:W}),l.createElement(o.PrivateRoute,{path:L+"/editApplication/ocbpa/:tenantId/:applicationNo",component:j}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/bpa/:tenantId/:applicationNo",component:z}),l.createElement(o.PrivateRoute,{path:L+"/sendbacktocitizen/ocbpa/:tenantId/:applicationNo",component:Y}),l.createElement(o.PrivateRoute,{path:L+"/response",component:Gt}))))},Hl=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d}=e;const{t:s}=n.useTranslation(),c=[{code:"ASSIGNED_TO_ME",name:""+s("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+s("ES_INBOX_ASSIGNED_TO_ALL")}],p=Digit.ULBService.getStateId(),{data:v,isLoading:m}=Digit.Hooks.obps.useMDMS(p,"StakeholderRegistraition","TradeTypetoRoleMapping",{select:e=>{var t;return null==e||null===(t=e.StakeholderRegistraition)||void 0===t?void 0:t.TradeTypetoRoleMapping.reduce((e,t)=>{const l=t.tradeType.split(".")[0];return e.find(e=>e.i18nKey.includes(l))?e:[...e,{role:t.role[0],i18nKey:"TRADELICENSE_TRADETYPE_"+t.tradeType.split(".")[0],tradeType:t.tradeType,identifier:l}]},[])}}),E=a.useWatch({control:u,name:"businessService",defaultValue:null});return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"assignee",control:u,render:e=>l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code)},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:c})})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"businessService",control:u,render:e=>m?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("BPA_LICENSE_TYPE")),l.createElement(o.RadioButtons,{onSelect:t=>{d("applicationStatus",[]),e.onChange(t)},selectedOption:e.value,optionsKey:"i18nKey",options:v}))})),E?l.createElement(o.FilterFormField,null,l.createElement("div",{className:"filter-label",style:{fontSize:"18px",fontWeight:"600"}},s("ACTION_TEST_APPLICATION_STATUS")),l.createElement(a.Controller,{name:"applicationStatus",control:u,render:e=>{const n=t.useMemo(()=>{var t;return null==i||null===(t=i.filter(e=>e.businessservice===E.identifier))||void 0===t?void 0:t.map((t,n)=>{var i;return l.createElement(o.CheckBox,{key:n,onChange:l=>{var n;return function(t){e.onChange(t)}(l.target.checked?[...e.value,null==t?void 0:t.statusid]:null===(n=e.value)||void 0===n?void 0:n.filter(e=>e!==(null==t?void 0:t.statusid)))},checked:null===(i=e.value)||void 0===i?void 0:i.includes(null==t?void 0:t.statusid),label:s("WF_"+t.businessservice+"_"+t.applicationstatus)+" ("+t.count+")"})})},[e.value,i,E]);return l.createElement(t.Fragment,null,r?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,n))}})):null)},Wl=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:p}=n.useTranslation();var v,m,E,f;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(i=s.errors)&&void 0!==i&&null!==(a=i.mobileNumber)&&void 0!==a&&a.message?l.createElement(o.CardLabelError,null,null==s||null===(r=s.errors)||void 0===r||null===(u=r.mobileNumber)||void 0===u?void 0:u.message):null)):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,p("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,p("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:p("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:p("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(v=s.errors)&&void 0!==v&&null!==(m=v.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(f=E.mobileNumber)||void 0===f?void 0:f.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};let jl=[];const zl=e=>{let{currentStep:t=1,flow:i=""}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":jl=["BPA_LICENSE_DETAILS_LABEL","BPA_NEW_ADDRESS_HEADER_DETAILS","BPA_DOC_DETAILS_SUMMARY","BPA_STEPPER_SUMMARY_HEADER"];break;case"OCBPA":jl=["BPA_BASIC_AND_PLOT_DETAILS_LABEL","BPA_SCRUTINY_DETAILS","BPA_DOCUMENT_AND_NOC_DETAILS_LABEL","BPA_STEPPER_SUMMARY_HEADER"];break;default:jl=["BPA_STEPPER_SCRUTINY_DETAILS_HEADER","BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL","BPA_NOC_DETAILS_SUMMARY","BPA_STEPPER_SUMMARY_HEADER"]}})(i),l.createElement("div",{className:"timeline-container",style:r?{}:{margin:"0 8px 15px"}},jl.map((e,n,i)=>l.createElement("div",{className:"timeline-checkpoint",key:n},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(n<=t-1&&"active")},n<t-1?l.createElement(o.TickMark,null):n+1),l.createElement("span",{className:"secondary-color"},a(e))),n<i.length-1&&l.createElement("span",{className:"line "+(n<t-1&&"active")}))))};function Yl(e){let{documents:t,svgStyles:i={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:d}=n.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!s&&(null==t?void 0:t.map((e,n)=>{var i,s,c;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((t,n)=>{var i;return l.createElement("div",{style:{width:"180px"}},l.createElement(o.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==t?void 0:t.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},d(null==t?void 0:t.title)),a?null!=t&&null!==(i=t.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},d(null==t?void 0:t.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(o.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(o.PDFSvg,null)),l.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"),l.createElement("p",{style:{textAlign:"center"}})):"")))),r&&(null==t?void 0:t.length)!=n+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),s&&(null==t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},d(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=i&&i.minWidth?null==i?void 0:i.minWidth:"160px",marginRight:"20px"},key:t},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},d(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+d(null==e?void 0:e.docInfo)):null,l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+d(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,d("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const Gl=l.memo(function(e){var n,i,a;let{t:r,document:d,setDocuments:s,documents:c,formData:p,beforeUploadDocuments:v}=e;const m=(null==c?void 0:c.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==v?void 0:v.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]),E=Digit.ULBService.getStateId(),[f,_]=t.useState(m?u({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):(null==d||null===(n=d.dropdownData)||void 0===n?void 0:n.length)>0?null==d?void 0:d.dropdownData[0]:{}),[g,A]=t.useState(null),[S,h]=t.useState(()=>(null==c?void 0:c.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),[b,y]=t.useState([]),[C,T]=t.useState([]),[D,P]=t.useState([]||(null==p||null===(i=p.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===f.code)));t.useEffect(()=>{C.length>0&&null!=f&&f.code&&(s(e=>{if(null===S||null==(null==S?void 0:S.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==S.fileStoreId);let l=[];return C&&C.map((e,t)=>{var n,i;l.push({documentType:null==f?void 0:f.code,fileStoreId:e.fileStoreId,additionalDetails:{category:null==f?void 0:f.code.split(".").slice(0,2).join("_")},documentUid:e.fileStoreId,fileName:(null===(n=D[t])||void 0===n?void 0:n.name)||"",id:c?null===(i=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===i?void 0:i.id:void 0})}),[...t,...l]}),T([])),null!=f&&f.code&&s(e=>{var t;return null===S||null==(null==S?void 0:S.fileStoreId)?((null==e?void 0:e.length)>0&&(null==e||e.forEach(e=>{var t,l,n,i,o;(null==e||null===(t=e.documentType)||void 0===t?void 0:t.split(".")[0])+"."+(null==e||null===(l=e.documentType)||void 0===l?void 0:l.split(".")[1])==(null==f||null===(n=f.code)||void 0===n?void 0:n.split(".")[0])+"."+(null==f||null===(i=f.code)||void 0===i?void 0:i.split(".")[1])&&(null!=e&&e.documentType&&(e.documentType=null==f?void 0:f.code),null!=e&&null!==(o=e.file)&&void 0!==o&&o.documentType&&(e.file.documentType=null==f?void 0:f.code))})),e):[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==S.fileStoreId),{documentType:null==f?void 0:f.code,fileStoreId:S.fileStoreId,documentUid:S.fileStoreId,fileName:(null==g?void 0:g.name)||S.fileName||"document",id:c?null===(t=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[S,f]),t.useEffect(()=>{f.code||null===S||T([...C,S])},[S]);const I=t.useMemo(()=>{var e,t;let l=[];return null==p||null===(e=p.documents)||void 0===e||null===(t=e.documents)||void 0===t||t.filter(e=>e.documentType===f.code).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:E}}])),l},[p]);return l.createElement("div",null,l.createElement(o.CardLabel,null,null!=d&&d.required?r(null==d?void 0:d.code)+" *":""+r(null==d?void 0:d.code)),l.createElement(o.Dropdown,{t:r,isMandatory:!1,option:Digit.Utils.locale.sortDropdownNames(null==d?void 0:d.dropdownData,"i18nKey",r),selected:f,optionKey:"i18nKey",select:e=>{if(null!=m&&m.documentType){m.documentType=null==e?void 0:e.code;let t=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.code)});t.map(t=>t.documentType=null==e?void 0:e.code);let l=[...null==c?void 0:c.filter(e=>{var t;return!(null!=e&&null!==(t=e.documentType)&&void 0!==t&&t.includes(null==d?void 0:d.code))}),...t];s(l)}_(e)}}),l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:E,getFormState:function(e){var t;let l,n,i=f.code;if((null==e?void 0:e.length)>0){var o,a;l=Object.fromEntries(e),n=Object.values(l),n=null==p||null===(o=p.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===f.code),y(n);let t=[];null==e||e.map((e,l)=>{var n,i,o,a;t.push({documentType:null==f?void 0:f.code,additionalDetails:{category:null==f?void 0:f.code.split(".").slice(0,2).join("_")},fileStoreId:null==e||null===(n=e[1])||void 0===n||null===(i=n.fileStoreId)||void 0===i?void 0:i.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:c?null===(a=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===a?void 0:a.id:void 0})});const r=[...c.filter(e=>e.documentType!==i),...t];s(r)}else if(0==(null==e?void 0:e.length)){const e=[...c.filter(e=>e.documentType!==i)];s(e)}null===(t=n)||void 0===t||t.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=i,function(e,t){e&&A(e.file),e&&P([...D,e.file])}(e)})},setuploadedstate:I,t:r,extraStyleName:"OBPS",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==d||null===(a=d.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(Yl,{isSendBackFlow:!0,documents:null==d?void 0:d.uploadedDocuments}))});function Kl(e){let{documents:i,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=n.useTranslation(),[d,s]=t.useState(()=>[]),[c,p]=(Digit.ULBService.getCurrentTenantId(),t.useState({}));t.useEffect(()=>{var e;let t=[];null==i||i.forEach((e,l,n)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[i]),t.useEffect(()=>{var e;null!=d&&d.length&&"BillAmend"===(null==i||null===(e=i[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(d,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[d]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==i?void 0:i.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n,i;return l.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(o.PDFSvg,null)),l.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},u(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})),m&&(null==i?void 0:i.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},null!=e&&e.title?l.createElement(o.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement("a",{target:"_",href:null===(n=c[e.fileStoreId])||void 0===n?void 0:n.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:t},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function Vl(e){var n,i,a;let{t:r,document:u,setNocDocuments:d,nocDocuments:s,formData:c,beforeUploadNocDocuments:p,pdfLoading:v}=e;(null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||null==p||p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)});const m=Digit.ULBService.getStateId(),[E,f]=t.useState(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n[0]),[_,g]=t.useState(null),[A,S]=t.useState(()=>{var e,t;return{fileStoreId:null==s||null===(e=s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||void 0===e?void 0:e.fileStoreId,fileName:null==s||null===(t=s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==u?void 0:u.code)})[0])||void 0===t?void 0:t.fileName}||null}),[h,b]=t.useState([]);t.useEffect(()=>{null==E||!E.documentType||0!=s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length&&h.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==E?void 0:E.documentType)}).length===s.filter(e=>e.documentType===(null==E?void 0:E.documentType)).length||d(e=>{var t,l;return null===A||null==(null==A?void 0:A.fileStoreId)?e:[...null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==A.fileStoreId),{documentType:null==u||null===(t=u.dropdownData)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.code,fileStoreId:A.fileStoreId,documentUid:A.fileStoreId,fileName:(null==A?void 0:A.fileName)||""}]})},[A,E]);const y=t.useMemo(()=>{var e,t;let l=[];const n=E.code;return null==c||null===(e=c.nocDocuments)||void 0===e||null===(t=e.nocDocuments)||void 0===t||t.filter(e=>e.documentType===n).forEach(e=>l.push([e.fileName,{file:{name:e.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:m}}])),l},[c]);return l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 8px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",marginTop:"5px"}},l.createElement("div",null,l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"37px",fontWeight:"700",fontSize:"32px",fontFamily:"Roboto Condensed",paddingBottom:"24px"}},r("BPA_"+(null==u?void 0:u.nocType)+"_HEADER")),l.createElement("div",{style:{display:"flex",paddingBottom:"24px"}},l.createElement("h1",{style:{color:"#0B0C0C",lineHeight:"19px",fontWeight:"700",fontSize:"16px",fontFamily:"Roboto",marginRight:"10px"}},r("BPA_"+(null==u?void 0:u.nocType)+"_LABEL")),l.createElement("h1",null,null==u||null===(i=u.additionalDetails)||void 0===i?void 0:i.appNumberLink))),!window.location.href.includes("sendbacktocitizen")&&l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:m,getFormState:e=>function(e,t){var l;let n,i;if((null==e?void 0:e.length)>0){var o;n=Object.fromEntries(e),i=Object.values(n),i=null==c||null===(o=c.nocDocuments)||void 0===o?void 0:o.nocDocuments.filter(e=>e.documentType===t),b(i);let l=[];null==e||e.map((e,n)=>{var i,o,a,r;l.push({documentType:t,fileStoreId:null==e||null===(i=e[1])||void 0===i||null===(o=i.fileStoreId)||void 0===o?void 0:o.fileStoreId,documentUid:null==e||null===(a=e[1].fileStoreId)||void 0===a?void 0:a.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:s?null===(r=s.find(e=>e.documentType===t))||void 0===r?void 0:r.id:void 0})});const a=[...s.filter(e=>e.documentType!==t),...l];d(a)}null===(l=i)||void 0===l||l.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=t,function(e,t){e&&f({documentType:t}),e&&g(e.file)}(e,t)})}(e,u.dropdownData[0].code),setuploadedstate:y,t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==u||null===(a=u.uploadedDocuments)||void 0===a?void 0:a.length)&&!v&&l.createElement(Yl,{documents:null==u?void 0:u.uploadedDocuments,svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))}const ql=e=>{var n,i;let{t:a,onSelect:r,formData:u={},handleRemove:d,onSave:s}=e;const[c,p]=t.useState((null==u||null===(n=u.address)||void 0===n?void 0:n.pincode)||""),[v,m]=t.useState((null==u||null===(i=u.address)||void 0===i?void 0:i.geoLocation)||{}),E=Digit.Hooks.obps.useTenants(),[f,_]=t.useState(null),[g,A]=t.useState("");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let S=!Digit.Utils.browser.isMobile();return l.createElement("div",{style:{position:"fixed",background:"#00000050",width:"100%",height:"100vh",top:"0",left:"0"}},l.createElement("div",{style:{position:"relative",marginTop:"60px"}},l.createElement("div",{style:S?{marginLeft:"25%",marginRight:"25%"}:{}},l.createElement(o.LocationSearchCard,{style:{position:"relative",marginTop:"100px",marginBottom:"-100px"},header:a("BPA_GIS_LABEL"),cardText:a(""),nextText:a("BPA_PIN_LOCATION_LABEL"),skip:()=>r(),t:a,position:v,onSave:()=>s(v,c,g),onChange:(e,t,l)=>((e,t,l)=>{_(null),(null==E?void 0:E.find(t=>{var l;return null===(l=t.pincode)||void 0===l?void 0:l.find(t=>t==e)}))?(p(e),m(t),A(l)):(_("BPA_COMMON_PINCODE_NOT_SERVICABLE"),p(""),m({}),A(""))})(e,t,l),disabled:""===c,forcedError:a(f),isPlaceRequired:!0,handleRemove:d,Webview:S,isPopUp:!0}))))},Xl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"home",component:"EDCRForm",nextStep:"",hideInEmployee:!0,key:"ScrutinyDetails",texts:{headerCaption:"",header:"EDCR_COMMON_APPL_NEW",cardText:"BPA_PROVIDE_REQ_FOR_NEW_BPA",submitBarLabel:"EDCR_SCRUTINY_SUBMIT_BUTTON",skipText:"EDCR_CLEAR_FORM"}}]}],Jl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"OCEDCRDocsRequired",key:"data",nextStep:"home"},{route:"home",component:"OCeDCRScrutiny",nextStep:"upload-diagram",hideInEmployee:!0,key:"ScrutinyDetails"},{route:"upload-diagram",component:"OCUploadPlanDiagram",nextStep:null,hideInEmployee:!0,key:"uploadData",texts:{headerCaption:"BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL",header:"BPA_UPLOAD_OC_PLAN_DIAGRAM_LABEL",cardText:"",submitBarLabel:"BPA_COMMON_BUTTON_SUBMIT",skipText:""}}]}],Zl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL",type:"text",validation:{},name:"boundaryWallLength"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{route:"location",component:"LocationDetails",nextStep:"owner-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"owner-details",component:"OwnerDetails",nextStep:"document-details",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}]}],$l=[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"BasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL",type:"text",validation:{},name:"boundaryWallLength"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"location",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}},{type:"component",route:"search-property",isMandatory:!0,component:"CPTSearchProperty",key:"cptsearchproperty",withoutLabel:!0,nextStep:"search-results",hideInEmployee:!0},{type:"component",route:"search-results",isMandatory:!0,component:"CPTSearchResults",key:"cptsearchresults",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{type:"component",route:"create-property",isMandatory:!0,component:"CPTCreateProperty",key:"cptcreateproperty",withoutLabel:!0,nextStep:"acknowledge-create-property",hideInEmployee:!0},{type:"component",route:"acknowledge-create-property",isMandatory:!0,component:"CPTAcknowledgement",key:"cptacknowledgement",withoutLabel:!0,nextStep:"location",hideInEmployee:!0},{route:"location",component:"LocationDetails",nextStep:"owner-details",hideInEmployee:!0,key:"address",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_NEW_TRADE_DETAILS_HEADER_DETAILS",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"owner-details",component:"OwnerDetails",nextStep:"noc-number",key:"owners",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_APPLICANT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-number",component:"NOCNumber",nextStep:"document-details",key:"nocnumber",texts:{headerCaption:"BPA_NOC_NUMBER_DETAILS",header:"",submitBarLabel:"CS_COMMON_NEXT"},inputs:[{label:"BPA_NOC_NUMBER",type:"text",validation:{},name:"nocNumber"}]},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}],Ql=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),en=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"basic-details"},{route:"basic-details",component:"OCBasicDetails",key:"data",nextStep:"plot-details"},{route:"plot-details",component:"PlotDetails",key:"data",nextStep:"scrutiny-details",texts:{headerCaption:"BPA_SCRUTINY_DETAILS",header:"BPA_PLOT_DETAILS_TITLE",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},inputs:[{label:"BPA_HOLDING_NUMBER_LABEL",type:"text",validation:{},name:"holdingNumber"},{label:"BPA_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"}]},{route:"scrutiny-details",component:"ScrutinyDetails",nextStep:"document-details",hideInEmployee:!0,key:"subOccupancy",texts:{headerCaption:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",header:"BPA_STEPPER_SCRUTINY_DETAILS_HEADER",cardText:"",submitBarLabel:"CS_COMMON_NEXT",skipAndContinueText:""}},{route:"document-details",component:"DocumentDetails",nextStep:"noc-details",key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}},{route:"noc-details",component:"NOCDetails",nextStep:null,key:"nocDocuments",texts:{headerCaption:"BPA_NOC_DETAILS_SUMMARY",header:"",submitBarLabel:"CS_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"}}]}],tn=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),ln=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"stakeholder-docs-required",component:"StakeholderDocsRequired",key:"data",nextStep:"provide-license-type"},{type:"component",route:"provide-license-type",isMandatory:!0,component:"LicenseType",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_TYPE",cardText:"BPA_LICENSE_TYPE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"license-details",key:"LicneseType",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"license-details",isMandatory:!0,component:"LicenseDetails",texts:{headerCaption:"BPA_LICENSE_DET_CAPTION",header:"BPA_LICENSE_DET_CAPTION",cardText:"BPA_LICENSE_DETAILS_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"Permanent-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"Permanent-address",isMandatory:!0,component:"PermanentAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_PERM_ADDR_HEADER",cardText:"BPA_LICENSEE_PERMANENT_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"correspondence-address",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{type:"component",route:"correspondence-address",isMandatory:!0,component:"CorrospondenceAddress",texts:{headerCaption:"BPA_NEW_ADDRESS_HEADER_DETAILS",header:"BPA_LICENSEE_CORRESPONDENCE_LABEL",cardText:"BPA_LICENSEE_CORRESPONDENCE_TEXT",submitBarLabel:"CS_COMMON_NEXT"},nextStep:"stakeholder-document-details",key:"LicneseDetails",withoutLabel:!0,hideInEmployee:!0},{route:"stakeholder-document-details",component:"StakeholderDocuments",nextStep:null,key:"documents",texts:{headerCaption:"BPA_DOCUMENT_DETAILS_LABEL",header:"BPA_LICENSEE_DOCUMENT_DETAILS_HEADER",submitBarLabel:"CS_COMMON_NEXT"}}]}],nn=e=>{var i,a,r,u,d,s;const{t:c}=n.useTranslation(),p=null===(i=e.application)||void 0===i?void 0:i.businessService,{isLoading:v,data:m}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id,moduleCode:p}),[E,f]=t.useState(!1);function _(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const g=e=>{var t,n,i,o,a;const r={date:null==e||null===(t=e.auditDetails)||void 0===t?void 0:t.lastModified,name:null==e||null===(n=e.assignes)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.name,mobileNumber:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.mobileNumber,comment:c(null==e?void 0:e.comment),wfComment:e.wfComment,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(jt,{data:r,OpenImage:_})};return v?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,!v&&l.createElement(t.Fragment,null,(null==m||null===(r=m.timeline)||void 0===r?void 0:r.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},c("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=m&&m.timeline&&1===(null==m||null===(u=m.timeline)||void 0===u?void 0:u.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:c((null==m||null===(d=m.timeline[0])||void 0===d?void 0:d.state)&&"WF_"+p+"_"+m.timeline[0].state||"NA"),customChild:g(null==m?void 0:m.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==m?void 0:m.timeline)&&(null==m?void 0:m.timeline.slice(0,E?m.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=m&&null!==(a=m.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=m&&null!==(u=m.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,label:e.state?c("WF_"+p+"_"+e.state+i):"NA",customChild:g(e)}))}))),(null==m||null===(s=m.timeline)||void 0===s?void 0:s.length)>2&&l.createElement(o.LinkButton,{label:c(E?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{f(e=>!e)}})))},on=e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,error:r,isCommentRequired:u=!0,setUploadedFile:d}=e;return{label:{heading:"BPA_FORWARD_APPLICATION_HEADER",submit:"BPA_"+n+"_BUTTON",cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:t("ES_OBPS_ACTION_COMMENTS"),isMandatory:u,type:"textarea",populators:{name:"comments",validation:{required:u}}},{label:""+t("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{d(null)},message:a?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:r})}]}]}},an=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),rn=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"#FFFFFF",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"#0B0C0C"})),un=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick,style:{backgroundColor:"#FFFFFF"}},l.createElement(rn,null)),dn=e=>{var n,i,a,r,d;let{t:c,closeModal:p,submitAction:v,action:m,applicationData:E}=e;const[f,_]=t.useState({}),[g,A]=t.useState(null),[S,h]=t.useState(null),[b,y]=t.useState({}),[C,T]=t.useState(null),[D,P]=t.useState(!1),I=!!Digit.Utils.browser.isMobile(),N=e=>{A(e.target.files[0])};return t.useEffect(()=>{switch(m){case"APPROVE":_(on({t:c,action:m,selectFile:N,uploadedFile:S,error:C,isCommentRequired:!1,setUploadedFile:h,file:g,error:C}));break;case"SEND_TO_ARCHITECT":_(on({t:c,action:m,selectFile:N,uploadedFile:S,error:C,setUploadedFile:h,file:g,error:C}));break;case"TERMS_AND_CONDITIONS":P(!0),_((e=>{let{t:t,applicationData:l}=e;return{label:{heading:"",submit:null,cancel:null,hideSubmit:!0},data:[((e,t)=>"CITIZEN_APPROVAL_INPROCESS"==(null==t?void 0:t.status)?""+e("BPA_CITIZEN_1_DECLARAION_LABEL")+e("BPA_CITIZEN_2_DECLARAION_LABEL"):"INPROGRESS"==(null==t?void 0:t.status)?""+e("BPA_STAKEHOLDER_1_DECLARAION_LABEL")+e("BPA_STAKEHOLDER_2_DECLARAION_LABEL"):void 0)(t,l)]}})({t:c,applicationData:E}));break;default:_(on({t:c,action:m,selectFile:N,uploadedFile:S,error:C,isCommentRequired:!1,setUploadedFile:h,file:g,error:C}))}},[m,S,C]),t.useEffect(()=>{!function(){try{T(null);const e=function(){if(g){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(g.size>=5242880)T(c("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=g&&g.type&&!e.test(null==g?void 0:g.type))T(c("NOT_SUPPORTED_FILE_TYPE"));else{const e=s(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("BPA",g,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?h(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):T(c("CS_FILE_UPLOAD_ERROR"))})},function(){T(c("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[g]),l.createElement(o.Modal,{headerBarMain:l.createElement(an,{label:c(null==f||null===(n=f.label)||void 0===n?void 0:n.heading)}),headerBarEnd:l.createElement(un,{onClick:p}),actionCancelLabel:c(null==f||null===(i=f.label)||void 0===i?void 0:i.cancel),actionCancelOnSubmit:p,actionSaveLabel:c(null==f||null===(a=f.label)||void 0===a?void 0:a.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isDisabled:!1,isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{minHeight:"45px",height:"auto",width:"160px"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},hideSubmit:!(null==f||null===(r=f.label)||void 0===r||!r.hideSubmit),popupModuleMianStyles:"TERMS_AND_CONDITIONS"==m?{height:"92%",boxSizing:"border-box"}:I?{paddingLeft:"0px"}:{},headerBarMainStyle:"TERMS_AND_CONDITIONS"==m?{margin:"0px",height:"35px"}:{}},null!=f&&f.form?l.createElement(o.FormComposer,{cardStyle:{minWidth:"unset",paddingRight:"unset",marginRight:"18px",paddingBottom:"64px"},config:null==f?void 0:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:e=>{let t={action:m};S&&(t.varificationDocuments=[{documentType:"Document - 1",fileName:(null==g?void 0:g.name)||"",fileStoreId:S}]),null!=e&&e.comments||delete e.comments,v(u({},e,t))},defaultValues:b,formId:"modal-action"}):null,D?l.createElement("div",{style:{height:"100%"}},l.createElement("div",{style:{height:"95%"}},l.createElement("div",{style:{fontSize:"18px",paddingBottom:"16px",color:"#000000",fontWeight:"700"}},c("TERMS_AND_CONDITIONS")),(null==f?void 0:f.data)&&(null==f||null===(d=f.data)||void 0===d?void 0:d.map((e,t)=>l.createElement("div",{style:{height:"90%",overflow:"auto"}},""+e)))),l.createElement("div",{style:{display:"flex",justifyContent:"center",minHeight:"5%"}},l.createElement(o.ButtonSelector,{label:c("BPA_GO_BACK_LABEL"),onSubmit:p,style:{minWidth:"240px"}}))):null)};function sn(e){let{value:t={},Code:i,index:a,isNOC:r=!1,svgStyles:u={width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"},isStakeHolder:d=!1}=e;const{t:s}=n.useTranslation(),{isLoading:c,data:p}=Digit.Hooks.obps.useOBPSDocumentSearch({value:t},{value:t},i,a,r);let v=[];var m,E,f;return r?null!=t&&t.nocDocuments?(null==t||null===(m=t.nocDocuments)||void 0===m?void 0:m.nocDocuments.length)>0&&(null==t||null===(E=t.nocDocuments)||void 0===E||E.nocDocuments.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{v.push(e)})):(null==t?void 0:t.length)>0&&(null==t||t.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(i)}).map(e=>{v.push(e)})):null!=t&&t.documents?null==t||null===(f=t.documents)||void 0===f||f.documents.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{v.push(e)}):t.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{v.push(e)}),c?l.createElement(o.Loader,null):l.createElement("div",{style:{marginTop:"19px"}},l.createElement(l.Fragment,null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},v.length>0?l.createElement("div",{style:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap"}},null==v?void 0:v.map((e,t)=>{let n=function(e,t,l){void 0===e&&(e={}),void 0===t&&(t="");let n=e[t]||"",i=(null==n?void 0:n.split(","))||[],o="";return i.length>0&&i.map(e=>{e.includes("large")||e.includes("medium")||e.includes("small")||(o=e)}),o}(p.pdfFiles,null==e?void 0:e.fileStoreId);return l.createElement("a",{target:"_blank",href:n,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:t},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(o.PDFSvg,null)),d?l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},s("BPAREG_HEADER_"+mt(null==i?void 0:i.toUpperCase(),".","_"))):null," ",d?null:l.createElement("p",{style:{marginTop:"8px",textAlign:"center",color:"#505A5F"}},""+s(i)))})):l.createElement(o.CardText,null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}const cn=e=>{var i,a,r,u,d;let{edcrDetails:s,applicationData:c}=e;const{t:p}=n.useTranslation(),v=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},f=t.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:E(e.id),id:e.id})));function _(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),l}function g(e){var t;let l=null==c||null===(t=c.landInfo)||void 0===t?void 0:t.unit,n="";if((null==l?void 0:l.length)>0){var i,o;let t=null===(i=l[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(n=t.map(e=>e?""+p("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 l.createElement(t.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(o.StatusTable,null,null==s||null===(i=s.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isHeader?l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},p(null==e?void 0:e.title)):l.createElement(o.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(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,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==s||null===(n=s.subOccupancyTableDetails)||void 0===n||null===(i=n[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"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},p("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:g(t)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:f,getCellProps:e=>({style:{}})})))})))};function pn(e){let{fiReport:t,isCitizen:i=!1}=e;const{t:a}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(i?o.CardHeader:o.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),t.map((e,n)=>{var i,r,u,d,s,c;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==t?void 0:t.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(n+1)),l.createElement(o.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"}),l.createElement(o.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=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(o.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(o.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Yl,{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"}})))})))}const vn=e=>{var i,a,r,u,d,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I;let{scrutinyDetails:N,paymentsList:L=[],additionalDetails:B,applicationData:O}=e;const R=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==O?void 0:O.status))&&window.location.href.includes("bpa"),[x,w]=t.useState(),[M,k]=t.useState(),[F,U]=t.useState(),H=Digit.ULBService.getStateId(),[W,j]=t.useState(),[z,Y]=t.useState(),[G,K]=t.useState([]),[V,q]=t.useState(),[X,J]=t.useState(""),[Z,$]=t.useState(null),[Q,ee]=t.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[le,ne]=t.useState(!1),[ie,oe]=t.useState(!1);t.useEffect(()=>{!function(){try{$(null);const e=function(){if(V&&null!=V&&V.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==V||null===(t=V.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(V.size>=2e6)$(ae("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",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?K([...G,{fileStoreId:null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):$(ae("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else $(ae("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[V]),t.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(G))},[G]),t.useEffect(()=>{var e,t,l,n,i,o,a;if(null!=B&&null!==(e=B.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==B?void 0:B.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i;return t===(null==B||null===(l=B.lessAdjustmentFeeFiles)||void 0===l?void 0:l.length)-1?null==B||null===(n=B.lessAdjustmentFeeFiles[(null==B||null===(i=B.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===n?void 0:n.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}w(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_DEVELOPMENT_CHARGES),k(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==B||null===(i=B.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==B||null===(o=B.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==B||null===(a=B.selfCertificationCharges)||void 0===a?void 0:a.BPA_LESS_ADJUSMENT_PLOT),j(null==B?void 0:B.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==B?void 0:B.otherFeesDiscription),K(null==B?void 0:B.lessAdjustmentFeeFiles)},[B]);const{t:ae}=n.useTranslation(),re=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},ae(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?ae(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void ae("NA");return l.createElement(t.Fragment,null,!(null!=N&&N.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement("div",null,null==N||null===(i=N.values)||void 0===i?void 0:i.map((e,t)=>null!=e&&e.isUnit?l.createElement(o.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:""+ae(""+e.title),text:null!=e&&e.value?re(e)+" "+ae(null==e?void 0:e.isUnit):ae("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(o.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:""+ae(""+e.title),text:re(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},ae(null==e?void 0:e.title)):l.createElement(o.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},ae(null==e?void 0:e.title))),null==N||null===(a=N.permit)||void 0===a?void 0:a.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==N||null===(r=N.values[0])||void 0===r?void 0:r.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},ae("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},ae("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==B?void 0:B.builtUpArea)*2.5)}),l.createElement(o.Row,{className:"border-none",label:ae("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==B?void 0:B.boundaryWallLength)}),l.createElement(o.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==N||null===(u=N.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!0)}},ae("SHOW_P2_FEES_DETAILS"))),le&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{ne(!1)}},ae("HIDE_P2_FEES_DETAILS"))),le&&l.createElement("div",null,l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==B||null===(d=B.selfCertificationCharges)||void 0===d?void 0:d.BPA_MALBA_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==B||null===(c=B.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==B||null===(p=B.selfCertificationCharges)||void 0===p?void 0:p.BPA_WATER_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==B||null===(v=B.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(o.CardSubHeader,null,ae("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,ae("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==B||null===(m=B.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:x,disabled:!R,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(w(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==B||null===(E=B.selfCertificationCharges)||void 0===E?void 0:E.BPA_OTHER_CHARGES)||0,value:M,disabled:!R,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(k(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(o.TextArea,{t:ae,type:"text",name:"otherChargesDiscription",defaultValue:null==B||null===(f=B.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:W,disabled:!R,onChange:e=>{!function(e){j(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:ae,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==B||null===(_=B.selfCertificationCharges)||void 0===_?void 0:_.BPA_LESS_ADJUSMENT_PLOT)||"",value:F,disabled:!R,onChange:e=>{!function(e){var t,l,n,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(x)?parseFloat(x):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(t=B.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(l=B.selfCertificationCharges)||void 0===l?void 0:l.BPA_LABOUR_CESS)+parseFloat(null==B||null===(n=B.selfCertificationCharges)||void 0===n?void 0:n.BPA_WATER_CHARGES)+parseFloat(null==B||null===(i=B.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>0&&R?l.createElement("div",null,l.createElement(o.CardLabel,null,ae("BPA_COMMON_LESS_AMT_FILE")),l.createElement(o.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){Y(e.target.files[0]),q(e.target.files[0])},disabled:!R,onDelete:()=>{Y(null),q("")},message:z?"1 "+ae("FILEUPLOADED"):ae("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:X})):null,(null==Q||null===(g=Q.fileStoreIds)||void 0===g?void 0:g.length)&&parseInt(null==B||null===(A=B.selfCertificationCharges)||void 0===A?void 0:A.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(o.CardLabel,{style:{marginTop:"15px"}},ae("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(S=Q.fileStoreIds)||void 0===S?void 0:S.length)&&parseInt(null==B||null===(h=B.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(b=Q.fileStoreIds[(null==Q||null===(y=Q.fileStoreIds)||void 0===y?void 0:y.length)-1])||void 0===b?void 0:b.url},l.createElement(o.PDFSvg,null)),l.createElement(o.Row,{className:"border-none"}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(x)?parseFloat(x):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(C=B.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(T=B.selfCertificationCharges)||void 0===T?void 0:T.BPA_LABOUR_CESS)+parseFloat(null==B||null===(D=B.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==B||null===(P=B.selfCertificationCharges)||void 0===P?void 0:P.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(F)?parseFloat(F):0))}))),l.createElement("div",null,null==N||null===(I=N.scruntinyDetails)||void 0===I?void 0:I.map((e,n)=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:""+ae(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(o.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},ae(null==e?void 0:e.text))))))))},mn=["tenantId"],En=["tenantId","payments"],fn=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),_n=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),gn=e=>{let{controlFilterForm:i}=e;const{t:r}=n.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),{data:d,isLoading:s}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(u),c=[{code:"Accepted",name:""+r("EDCR_ACCEPTED")},{code:"Not Accepted",name:""+r("EDCR_NOT_ACCEPTED")}];return l.createElement(t.Fragment,null,l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"status",control:i,render:e=>l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_COMMON_TABLE_COL_APP_STATUS_LABEL")),l.createElement(o.RadioButtons,{onSelect:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")},selectedOption:c.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"status",options:c}))})),l.createElement(o.FilterFormField,null,l.createElement(a.Controller,{name:"appliactionType",control:i,render:e=>s?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontWeight:"400",fontSize:"16px"}},r("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(o.Dropdown,{t:r,option:d,selected:d.filter(t=>t.code===e.value)[0],optionKey:"i18nKey",select:t=>{e.onChange(t.code),Digit.SessionStorage.set("EDCR_BACK","")}}))})))},An=e=>{let{registerRef:i,searchFieldComponents:a}=e;const{t:r}=n.useTranslation();return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",inputRef:i({})}))):l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:"24px"}},l.createElement("div",{className:"search-complaint-container"},l.createElement("div",{className:"complaint-input-container",style:{textAlign:"start"}},l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNumber",inputRef:i({})})),l.createElement(o.SearchField,null,l.createElement("label",null,r("BPA_EDCR_NO_LABEL")),l.createElement(o.TextInput,{name:"edcrNumber",inputRef:i({})})),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},a)))))},Sn=e=>{let{dowloadOptions:n}=e;const[i,a]=t.useState(!1);return l.createElement("div",null,l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>a(!i),displayOptions:i,options:n,style:{right:"0",position:"unset",top:"0px",margin:"0px"},optionsStyle:{right:"10px",top:"unset",margin:"0px",position:"absolute"}}))},hn={ARCHITECT:"The registered architect shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign all plans, sub-division/layout plans and information connected with building permit.\nb. Layout Plans of plots measuring upto 1 Ha. in size.\nc. Issuing certificate of supervision and completion of all buildings.\nd. Issuing certificate of supervision for development permit of Layout Plans of plots measuring upto 1 Ha. in size.",ENGINEER:"The registered engineer shall be competent to carry out the work related to the building/development permit as given below:\na. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\nb. Preparation of structural drawings, details and calculations of buildings on plot up to 500 m2 and up to 5 storeys or 16 m in height, all service plans and related information.\nc. Issuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings) pertaining including structure and building services.",STRUCTURALENGINEER:"The registered structural engineer shall be competent to prepare the structural design, calculations and details for all buildings and undertake their supervision.\nIn case of buildings having special structural features, as decided by the Authority, they shall be designed only by Structural engineers.",TOWNPLANNER:"The registered town planner shall be competent to carry out the work related to the development permit as given below:\na. Preparation of plans for land sub-division/ layout and related information connected development permit for all areas more than 1 Hectare.\nb. Issuing of certificate of supervision for development of land of all areas.\nc. Prepare and sign building plans of plots up to 500 sq.m.(for all types of Buildings), structural drawings and service plans and information connected with building permit;\nIssuing certificate of supervision and completion of plots upto 500 sq.m.(for all types of Buildings).\nNOTE — However, for land layouts for development permit above 5 hectare in area, landscape architect shall also be associated, and for land development infrastructural services for roads, water supplies, sewerage / drainage, electrification, etc, the registered engineers for utility services shall be associated.","LANDSCAPE ARCHITECT":"The registered landscape architect shall be competent to carry out the work related to landscape design for building/development permit for land areas 5 hectares and above. In case of metro-cities, this limit of land area shall be 2 hectares and above.\nNOTE — For smaller areas below the limits indicated above, association of landscape architect may also be considered from the point of view of desired landscape development.","URBAN DESIGNER":"The registered urban designer shall be competent to carry out the work related to urban design for city areas more than 5 hectares and campus area more than 2 hectares. He/She shall also be competent to carry out the work of urban renewal for all blighted/congested areas.\nNOTE — For smaller areas below the limits indicated above, association of urban designer may be considered from the point of view of desired urban design.",SUPERVISOR:"The Registered Building Designer and Supervisor shall be competent to carry out the work related to the building / development permit.\na. Prepare and (sign in case of plots upto 250 Sq.Mtr. Only) plans, sub division/layout plans and information connected with building permit.\nb. Issuing certificate of supervision and completion of (In case of plots upto 250 Sq.mtr. only) buildings."};function bn(e){var n,i,a;let{t:r,document:d,setDocuments:c,error:p,setError:v,documents:m,setCheckRequiredFields:E}=e;const f=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],_=Digit.ULBService.getCurrentTenantId(),[g,A]=t.useState(f?u({},f,{active:!0,code:null==f?void 0:f.documentType,i18nKey:null==f?void 0:f.documentType}):1===(null==d||null===(n=d.dropdownData)||void 0===n?void 0:n.length)?null==d?void 0:d.dropdownData[0]:{}),[S,h]=t.useState(null),[b,y]=t.useState(()=>(null==f?void 0:f.fileStoreId)||null);return t.useEffect(()=>{c(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==d?void 0:d.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==d?void 0:d.code,fileStoreId:b,documentUid:b,fileName:(null==S?void 0:S.name)||"",info:(null==d?void 0:d.info)||""}]})},[b,S]),t.useEffect(()=>{!function(){try{v(null);const e=function(){if(S){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(S.size>=5242880)v(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=S&&S.type&&!e.test(null==S?void 0:S.type))v(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=s(function(){return y(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",S,null==_?void 0:_.split(".")[0])).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?y(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):v(r("CS_FILE_UPLOAD_ERROR"))})},function(){v(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[S]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.CardLabel,{style:{marginBottom:"10px"}},null!=d&&d.required?r("BPAREG_HEADER_"+(null==d||null===(i=d.code)||void 0===i?void 0:i.replace(".","_")))+" *":""+r("BPAREG_HEADER_"+(null==d||null===(a=d.code)||void 0===a?void 0:a.replace(".","_")))),null!=d&&d.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+r(null==d?void 0:d.info)):null,l.createElement(o.UploadFile,{extraStyleName:"OBPS",accept:"image/*, .pdf, .png, .jpeg, .jpg",onUpload:function(e){h(e.target.files[0])},onDelete:()=>{y(null),E(!0)},message:b?"1 "+r("CS_ACTION_FILEUPLOADED"):r("CS_ACTION_NO_FILEUPLOADED"),iserror:p}))}const yn=e=>{var t,a,r,u,d,s;const{state:c}=e.location,{t:p}=n.useTranslation(),v=i.useHistory(),m=null==c||null===(t=c.data)||void 0===t||null===(a=t.Licenses)||void 0===a?void 0:a[0];return null==m||null===(r=m.tradeLicenseDetail)||void 0===r||null===(u=r.tradeUnits)||void 0===u||null===(d=u[0])||void 0===d||null===(s=d.tradeType)||void 0===s||s.split("."),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:p("BPA_ARCHITECT_"+(null==m?void 0:m.status)+"_MAIN_HEAD"),applicationNumber:null==m?void 0:m.applicationNumber,info:p("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL"),successful:"REJECTED"!=(null==m?void 0:m.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}},p("BPA_ARCHITECT_"+(null==m?void 0:m.status)+"_SUB_MAIN_HEAD")),l.createElement(o.ActionBar,{style:{display:"flex",justifyContent:"flex-end",alignItems:"baseline"}},l.createElement(o.SubmitBar,{label:p("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{v.push("/digit-ui/employee")}}))))},Cn=e=>{let{location:t}=e;const{t:i}=n.useTranslation(),a=[{path:"/digit-ui/employee",content:i("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/obps/inbox",content:i("ES_COMMON_OBPS_INBOX_LABEL"),show:!!t.pathname.includes("obps/inbox")},{path:"/digit-ui/employee/obps/stakeholder-inbox",content:i("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),show:!!t.pathname.includes("obps/stakeholder-inbox")},{path:"/digit-ui/employee/obps/inbox/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/inbox/bpa")},{path:"/digit-ui/employee/obps/inbox/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("obps/stakeholder-inbox/stakeholder")},{path:"/digit-ui/employee/obps/search/application",content:i("ES_OBPS_SEARCH"),show:!!t.pathname.includes("/obps/search/application")},{path:"/digit-ui/employee/obps/search/application/bpa/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/bpa")},{path:"/digit-ui/employee/obps/search/application/stakeholder/:id",content:i("ES_OBPS_SEARCH_BPA"),show:!!t.pathname.includes("/obps/search/application/stakeholder/")}];return l.createElement(o.BreadCrumb,{crumbs:a})},Tn=e=>{let{path:a}=e;const r=i.useLocation(),{t:d}=n.useTranslation(),s=Digit.ComponentRegistryService.getComponent("BPAInbox"),c=Digit.ComponentRegistryService.getComponent("StakeholderInbox"),p=Digit.ComponentRegistryService.getComponent("ObpsEmpApplicationDetail"),v=Digit.ComponentRegistryService.getComponent("ObpsEmployeeBpaApplicationDetail"),m=window.location.href.includes("bpa")||window.location.href.includes("stakeholder-inbox/stakeholder")||window.location.href.includes("application"),E=window.location.href.includes("digit-ui/employee/obps/bpa/"),f=window.location.href.includes("obps/response")||window.location.href.includes("obps/stakeholder-response");return l.createElement(t.Fragment,null,E||f?null:l.createElement("div",{style:m?{marginLeft:"10px"}:{}},l.createElement(Cn,{location:r})),E?l.createElement(o.BackButton,{style:{border:"none",margin:"0",padding:"0"}},d("CS_COMMON_BACK")):null,l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox/stakeholder/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application/stakeholder/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application/bpa/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application",component:e=>l.createElement(Ut,u({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/inbox/bpa/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/inbox",component:e=>l.createElement(s,u({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox",component:e=>l.createElement(c,u({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/bpa/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/response",component:Gt}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-response",component:yn})))};var Dn=g(function(e,t){(function(){var l="Expected a function",n="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",a="[object Array]",r="[object Boolean]",u="[object Date]",d="[object Error]",s="[object Function]",c="[object GeneratorFunction]",p="[object Map]",v="[object Number]",m="[object Object]",E="[object RegExp]",_="[object Set]",g="[object String]",A="[object Symbol]",S="[object WeakMap]",h="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",D="[object Int16Array]",P="[object Int32Array]",I="[object Uint8Array]",N="[object Uint16Array]",L="[object Uint32Array]",B=/\b__p \+= '';/g,O=/\b(__p \+=) '' \+/g,R=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,w=/[&<>"']/g,M=RegExp(x.source),k=RegExp(w.source),F=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,G=RegExp(Y.source),K=/^\s+/,V=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,le=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,ae=/^(?:0|[1-9]\d*)$/,re=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,de=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+ce+"]",ve="["+se+"]",me="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",fe="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",Ae="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+Ee+"|"+fe+")",ye="(?:"+he+"|"+fe+")",Ce="(?:"+ve+"|"+_e+")?",Te="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,Ae,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",Ae,Se].join("|")+")"+Te,Pe="(?:"+[ge+ve+"?",ve,Ae,Se,"[\\ud800-\\udfff]"].join("|")+")",Ie=RegExp("['’]","g"),Ne=RegExp(ve,"g"),Le=RegExp(_e+"(?="+_e+")|"+Pe+Te,"g"),Be=RegExp([he+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,he,"$"].join("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,he+be,"$"].join("|")+")",he+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,De].join("|"),"g"),Oe=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"],we=-1,Me={};Me[y]=Me[C]=Me[T]=Me[D]=Me[P]=Me[I]=Me["[object Uint8ClampedArray]"]=Me[N]=Me[L]=!0,Me[o]=Me[a]=Me[h]=Me[r]=Me[b]=Me[u]=Me[d]=Me[s]=Me[p]=Me[v]=Me[m]=Me[E]=Me[_]=Me[g]=Me[S]=!1;var ke={};ke[o]=ke[a]=ke[h]=ke[b]=ke[r]=ke[u]=ke[y]=ke[C]=ke[T]=ke[D]=ke[P]=ke[p]=ke[v]=ke[m]=ke[E]=ke[_]=ke[g]=ke[A]=ke[I]=ke["[object Uint8ClampedArray]"]=ke[N]=ke[L]=!0,ke[d]=ke[s]=ke[S]=!1;var Fe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,We="object"==typeof f&&f&&f.Object===Object&&f,je="object"==typeof self&&self&&self.Object===Object&&self,ze=We||je||Function("return this")(),Ye=t&&!t.nodeType&&t,Ge=Ye&&e&&!e.nodeType&&e,Ke=Ge&&Ge.exports===Ye,Ve=Ke&&We.process,qe=function(){try{return Ge&&Ge.require&&Ge.require("util").types||Ve&&Ve.binding&&Ve.binding("util")}catch(e){}}(),Xe=qe&&qe.isArrayBuffer,Je=qe&&qe.isDate,Ze=qe&&qe.isMap,$e=qe&&qe.isRegExp,Qe=qe&&qe.isSet,et=qe&&qe.isTypedArray;function tt(e,t,l){switch(l.length){case 0:return e.call(t);case 1:return e.call(t,l[0]);case 2:return e.call(t,l[0],l[1]);case 3:return e.call(t,l[0],l[1],l[2])}return e.apply(t,l)}function lt(e,t,l,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,l(a),e)}return n}function nt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n&&!1!==t(e[l],l,e););return e}function it(e,t){for(var l=null==e?0:e.length;l--&&!1!==t(e[l],l,e););return e}function ot(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(!t(e[l],l,e))return!1;return!0}function at(e,t){for(var l=-1,n=null==e?0:e.length,i=0,o=[];++l<n;){var a=e[l];t(a,l,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,l){for(var n=-1,i=null==e?0:e.length;++n<i;)if(l(t,e[n]))return!0;return!1}function dt(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i}function st(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e}function ct(e,t,l,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(l=e[++i]);++i<o;)l=t(l,e[i],i,e);return l}function pt(e,t,l,n){var i=null==e?0:e.length;for(n&&i&&(l=e[--i]);i--;)l=t(l,e[i],i,e);return l}function vt(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1}var mt=ht("length");function Et(e,t,l){var n;return l(e,function(e,l,i){if(t(e,l,i))return n=l,!1}),n}function ft(e,t,l,n){for(var i=e.length,o=l+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,l){return t==t?function(e,t,l){for(var n=l-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,l):ft(e,At,l)}function gt(e,t,l,n){for(var i=l-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function At(e){return e!=e}function St(e,t){var l=null==e?0:e.length;return l?Ct(e,t)/l:NaN}function ht(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function yt(e,t,l,n,i){return i(e,function(e,i,o){l=n?(n=!1,e):t(l,e,i,o)}),l}function Ct(e,t){for(var l,n=-1,i=e.length;++n<i;){var o=t(e[n]);void 0!==o&&(l=void 0===l?o:l+o)}return l}function Tt(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,Yt(e)+1).replace(K,""):e}function Pt(e){return function(t){return e(t)}}function It(e,t){return dt(t,function(t){return e[t]})}function Nt(e,t){return e.has(t)}function Lt(e,t){for(var l=-1,n=e.length;++l<n&&_t(t,e[l],0)>-1;);return l}function Bt(e,t){for(var l=e.length;l--&&_t(t,e[l],0)>-1;);return l}function Ot(e,t){for(var l=e.length,n=0;l--;)e[l]===t&&++n;return n}var Rt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function wt(e){return"\\"+Fe[e]}function Mt(e){return Oe.test(e)}function kt(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function Ft(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return Mt(e)?function(e){for(var t=Le.lastIndex=0;Le.test(e);)++t;return t}(e):mt(e)}function zt(e){return Mt(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.split("")}(e)}function Yt(e){for(var t=e.length;t--&&V.test(e.charAt(t)););return t}var Gt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Kt=function e(t){var f=(t=null==t?ze:Kt.defaults(ze.Object(),t,Kt.pick(ze,xe))).Array,V=t.Date,se=t.Error,ce=t.Function,pe=t.Math,ve=t.Object,me=t.RegExp,Ee=t.String,fe=t.TypeError,_e=f.prototype,ge=ve.prototype,Ae=t["__core-js_shared__"],Se=ce.prototype.toString,he=ge.hasOwnProperty,be=0,ye=function(){var e=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ce=ge.toString,Te=Se.call(ve),De=ze._,Pe=me("^"+Se.call(he).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ke?t.Buffer:void 0,Oe=t.Symbol,Fe=t.Uint8Array,We=Le?Le.allocUnsafe:void 0,je=Ft(ve.getPrototypeOf,ve),Ye=ve.create,Ge=ge.propertyIsEnumerable,Ve=_e.splice,qe=Oe?Oe.isConcatSpreadable:void 0,mt=Oe?Oe.iterator:void 0,bt=Oe?Oe.toStringTag:void 0,Vt=function(){try{var e=Zi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=V&&V.now!==ze.Date.now&&V.now,Jt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Zt=pe.ceil,$t=pe.floor,Qt=ve.getOwnPropertySymbols,el=Le?Le.isBuffer:void 0,tl=t.isFinite,ll=_e.join,nl=Ft(ve.keys,ve),il=pe.max,ol=pe.min,al=V.now,rl=t.parseInt,ul=pe.random,dl=_e.reverse,sl=Zi(t,"DataView"),cl=Zi(t,"Map"),pl=Zi(t,"Promise"),vl=Zi(t,"Set"),ml=Zi(t,"WeakMap"),El=Zi(ve,"create"),fl=ml&&new ml,_l={},gl=Po(sl),Al=Po(cl),Sl=Po(pl),hl=Po(vl),bl=Po(ml),yl=Oe?Oe.prototype:void 0,Cl=yl?yl.valueOf:void 0,Tl=yl?yl.toString:void 0;function Dl(e){if(Ya(e)&&!Ra(e)&&!(e instanceof Ll)){if(e instanceof Nl)return e;if(he.call(e,"__wrapped__"))return Io(e)}return new Nl(e)}var Pl=function(){function e(){}return function(t){if(!za(t))return{};if(Ye)return Ye(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}();function Il(){}function Nl(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Ll(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Bl(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 Ol(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 wl(e){var t=this.__data__=new Ol(e);this.size=t.size}function Ml(e,t){var l=Ra(e),n=!l&&Oa(e),i=!l&&!n&&ka(e),o=!l&&!n&&!i&&$a(e),a=l||n||i||o,r=a?Tt(e.length,Ee):[],u=r.length;for(var d in e)!t&&!he.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||io(d,u))||r.push(d);return r}function kl(e){var t=e.length;return t?e[xn(0,t-1)]:void 0}function Fl(e,t){return bo(Ei(e),Vl(t,0,e.length))}function Ul(e){return bo(Ei(e))}function Hl(e,t,l){(void 0!==l&&!Na(e[t],l)||void 0===l&&!(t in e))&&Gl(e,t,l)}function Wl(e,t,l){var n=e[t];he.call(e,t)&&Na(n,l)&&(void 0!==l||t in e)||Gl(e,t,l)}function jl(e,t){for(var l=e.length;l--;)if(Na(e[l][0],t))return l;return-1}function zl(e,t,l,n){return $l(e,function(e,i,o){t(n,e,l(e),o)}),n}function Yl(e,t){return e&&fi(t,Sr(t),e)}function Gl(e,t,l){"__proto__"==t&&Vt?Vt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Kl(e,t){for(var l=-1,n=t.length,i=f(n),o=null==e;++l<n;)i[l]=o?void 0:Er(e,t[l]);return i}function Vl(e,t,l){return e==e&&(void 0!==l&&(e=e<=l?e:l),void 0!==t&&(e=e>=t?e:t)),e}function ql(e,t,l,n,i,a){var d,f=1&t,S=2&t,B=4&t;if(l&&(d=i?l(e,n,i,a):l(e)),void 0!==d)return d;if(!za(e))return e;var O=Ra(e);if(O){if(d=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&he.call(e,"index")&&(l.index=e.index,l.input=e.input),l}(e),!f)return Ei(e,d)}else{var R=eo(e),x=R==s||R==c;if(ka(e))return di(e,f);if(R==m||R==o||x&&!i){if(d=S||x?{}:lo(e),!f)return S?function(e,t){return fi(e,Qi(e),t)}(e,function(e,t){return e&&fi(t,hr(t),e)}(d,e)):function(e,t){return fi(e,$i(e),t)}(e,Yl(d,e))}else{if(!ke[R])return i?e:{};d=function(e,t,l){var n=e.constructor;switch(t){case h:return si(e);case r:case u:return new n(+e);case b:return function(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.byteLength)}(e,l);case y:case C:case T:case D:case P:case I:case"[object Uint8ClampedArray]":case N:case L:return ci(e,l);case p: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 _:return new n;case A:return Cl?ve(Cl.call(e)):{}}}(e,R,f)}}a||(a=new wl);var w=a.get(e);if(w)return w;a.set(e,d),Xa(e)?e.forEach(function(n){d.add(ql(n,t,l,n,e,a))}):Ga(e)&&e.forEach(function(n,i){d.set(i,ql(n,t,l,i,e,a))});var M=O?void 0:(B?S?Yi:zi:S?hr:Sr)(e);return nt(M||e,function(n,i){M&&(n=e[i=n]),Wl(d,i,ql(n,t,l,i,e,a))}),d}function Xl(e,t,l){var n=l.length;if(null==e)return!n;for(e=ve(e);n--;){var i=l[n],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Jl(e,t,n){if("function"!=typeof e)throw new fe(l);return go(function(){e.apply(void 0,n)},t)}function Zl(e,t,l,n){var i=-1,o=rt,a=!0,r=e.length,u=[],d=t.length;if(!r)return u;l&&(t=dt(t,Pt(l))),n?(o=ut,a=!1):t.length>=200&&(o=Nt,a=!1,t=new xl(t));e:for(;++i<r;){var s=e[i],c=null==l?s:l(s);if(s=n||0!==s?s:0,a&&c==c){for(var p=d;p--;)if(t[p]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Dl.templateSettings={escape:F,evaluate:U,interpolate:H,variable:"",imports:{_:Dl}},(Dl.prototype=Il.prototype).constructor=Dl,(Nl.prototype=Pl(Il.prototype)).constructor=Nl,(Ll.prototype=Pl(Il.prototype)).constructor=Ll,Bl.prototype.clear=function(){this.__data__=El?El(null):{},this.size=0},Bl.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bl.prototype.get=function(e){var t=this.__data__;if(El){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return he.call(t,e)?t[e]:void 0},Bl.prototype.has=function(e){var t=this.__data__;return El?void 0!==t[e]:he.call(t,e)},Bl.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},Ol.prototype.clear=function(){this.__data__=[],this.size=0},Ol.prototype.delete=function(e){var t=this.__data__,l=jl(t,e);return!(l<0||(l==t.length-1?t.pop():Ve.call(t,l,1),--this.size,0))},Ol.prototype.get=function(e){var t=this.__data__,l=jl(t,e);return l<0?void 0:t[l][1]},Ol.prototype.has=function(e){return jl(this.__data__,e)>-1},Ol.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 Bl,map:new(cl||Ol),string:new Bl}},Rl.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},Rl.prototype.get=function(e){return Xi(this,e).get(e)},Rl.prototype.has=function(e){return Xi(this,e).has(e)},Rl.prototype.set=function(e,t){var l=Xi(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this},xl.prototype.add=xl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},xl.prototype.has=function(e){return this.__data__.has(e)},wl.prototype.clear=function(){this.__data__=new Ol,this.size=0},wl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},wl.prototype.get=function(e){return this.__data__.get(e)},wl.prototype.has=function(e){return this.__data__.has(e)},wl.prototype.set=function(e,t){var l=this.__data__;if(l instanceof Ol){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 $l=Ai(rn),Ql=Ai(un,!0);function en(e,t){var l=!0;return $l(e,function(e,n,i){return l=!!t(e,n,i)}),l}function tn(e,t,l){for(var n=-1,i=e.length;++n<i;){var o=e[n],a=t(o);if(null!=a&&(void 0===r?a==a&&!Za(a):l(a,r)))var r=a,u=o}return u}function ln(e,t){var l=[];return $l(e,function(e,n,i){t(e,n,i)&&l.push(e)}),l}function nn(e,t,l,n,i){var o=-1,a=e.length;for(l||(l=no),i||(i=[]);++o<a;){var r=e[o];t>0&&l(r)?t>1?nn(r,t-1,l,n,i):st(i,r):n||(i[i.length]=r)}return i}var on=Si(),an=Si(!0);function rn(e,t){return e&&on(e,t,Sr)}function un(e,t){return e&&an(e,t,Sr)}function dn(e,t){return at(t,function(t){return Ha(e[t])})}function sn(e,t){for(var l=0,n=(t=oi(t,e)).length;null!=e&&l<n;)e=e[Do(t[l++])];return l&&l==n?e:void 0}function cn(e,t,l){var n=t(e);return Ra(e)?n:st(n,l(e))}function pn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=he.call(e,bt),l=e[bt];try{e[bt]=void 0;var n=!0}catch(e){}var i=Ce.call(e);return n&&(t?e[bt]=l:delete e[bt]),i}(e):function(e){return Ce.call(e)}(e)}function vn(e,t){return e>t}function mn(e,t){return null!=e&&he.call(e,t)}function En(e,t){return null!=e&&t in ve(e)}function fn(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=f(o),u=Infinity,d=[];a--;){var s=e[a];a&&t&&(s=dt(s,Pt(t))),u=ol(s.length,u),r[a]=!l&&(t||i>=120&&s.length>=120)?new xl(a&&s):void 0}s=e[0];var c=-1,p=r[0];e:for(;++c<i&&d.length<u;){var v=s[c],m=t?t(v):v;if(v=l||0!==v?v:0,!(p?Nt(p,m):n(d,m,l))){for(a=o;--a;){var E=r[a];if(!(E?Nt(E,m):n(e[a],m,l)))continue e}p&&p.push(m),d.push(v)}}return d}function _n(e,t,l){var n=null==(e=mo(e,t=oi(t,e)))?e:e[Do(Uo(t))];return null==n?void 0:tt(n,e,l)}function gn(e){return Ya(e)&&pn(e)==o}function An(e,t,l,n,i){return e===t||(null==e||null==t||!Ya(e)&&!Ya(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=Ra(e),f=Ra(t),S=c?a:eo(e),y=f?a:eo(t),C=(S=S==o?m:S)==m,T=(y=y==o?m:y)==m,D=S==y;if(D&&ka(e)){if(!ka(t))return!1;c=!0,C=!1}if(D&&!C)return s||(s=new wl),c||$a(e)?Wi(e,t,l,n,i,s):function(e,t,l,n,i,o,a){switch(l){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case h:return!(e.byteLength!=t.byteLength||!o(new Fe(e),new Fe(t)));case r:case u:case v:return Na(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case p:var s=kt;case _: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 m=Wi(s(e),s(t),n,i,o,a);return a.delete(e),m;case A:if(Cl)return Cl.call(e)==Cl.call(t)}return!1}(e,t,S,l,n,i,s);if(!(1&l)){var P=C&&he.call(e,"__wrapped__"),I=T&&he.call(t,"__wrapped__");if(P||I){var N=P?e.value():e,L=I?t.value():t;return s||(s=new wl),i(N,L,l,n,s)}}return!!D&&(s||(s=new wl),function(e,t,l,n,i,o){var a=1&l,r=zi(e),u=r.length;if(u!=zi(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:he.call(t,s)))return!1}var c=o.get(e),p=o.get(t);if(c&&p)return c==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var _=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===_?E===f||i(E,f,l,n,o):_)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var g=e.constructor,A=t.constructor;g==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof A&&A instanceof A||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,s))}(e,t,l,n,An,i))}function Sn(e,t,l,n){var i=l.length,o=i,a=!n;if(null==e)return!o;for(e=ve(e);i--;){var r=l[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=l[i])[0],d=e[u],s=r[1];if(a&&r[2]){if(void 0===d&&!(u in e))return!1}else{var c=new wl;if(n)var p=n(d,s,u,e,t,c);if(!(void 0===p?An(s,d,3,n,c):p))return!1}}return!0}function hn(e){return!(!za(e)||(t=e,ye&&ye in t))&&(Ha(e)?Pe:ie).test(Po(e));var t}function bn(e){return"function"==typeof e?e:null==e?Kr:"object"==typeof e?Ra(e)?Pn(e[0],e[1]):Dn(e):tu(e)}function yn(e){if(!so(e))return nl(e);var t=[];for(var l in ve(e))he.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Cn(e,t){return e<t}function Tn(e,t){var l=-1,n=wa(e)?f(e.length):[];return $l(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Dn(e){var t=Ji(e);return 1==t.length&&t[0][2]?po(t[0][0],t[0][1]):function(l){return l===e||Sn(l,e,t)}}function Pn(e,t){return ao(e)&&co(t)?po(Do(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?fr(l,e):An(t,n,3)}}function In(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new wl),za(o))!function(e,t,l,n,i,o,a){var r=fo(e,l),u=fo(t,l),d=a.get(u);if(d)Hl(e,l,d);else{var s=o?o(r,u,l+"",e,t,a):void 0,c=void 0===s;if(c){var p=Ra(u),v=!p&&ka(u),m=!p&&!v&&$a(u);s=u,p||v||m?Ra(r)?s=r:Ma(r)?s=Ei(r):v?(c=!1,s=di(u,!0)):m?(c=!1,s=ci(u,!0)):s=[]:Va(u)||Oa(u)?(s=r,Oa(r)?s=ar(r):za(r)&&!Ha(r)||(s=lo(u))):c=!1}c&&(a.set(u,s),i(s,u,n,o,a),a.delete(u)),Hl(e,l,s)}}(e,t,a,l,In,n,i);else{var r=n?n(fo(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Hl(e,a,r)}},hr)}function Nn(e,t){var l=e.length;if(l)return io(t+=t<0?l:0,l)?e[t]:void 0}function Ln(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}):[Kr];var n=-1;return t=dt(t,Pt(qi())),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=pi(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(Tn(e,function(e,l,i){return{criteria:dt(t,function(t){return t(e)}),index:++n,value:e}}))}function Bn(e,t,l){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],r=sn(e,a);l(r,a)&&Un(o,oi(a,e),r)}return o}function On(e,t,l,n){var i=n?gt:_t,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),l&&(r=dt(e,Pt(l)));++o<a;)for(var u=0,d=t[o],s=l?l(d):d;(u=i(r,s,u,n))>-1;)r!==e&&Ve.call(r,u,1),Ve.call(e,u,1);return e}function Rn(e,t){for(var l=e?t.length:0,n=l-1;l--;){var i=t[l];if(l==n||i!==o){var o=i;io(i)?Ve.call(e,i,1):Zn(e,i)}}return e}function xn(e,t){return e+$t(ul()*(t-e+1))}function wn(e,t){var l="";if(!e||t<1||t>9007199254740991)return l;do{t%2&&(l+=e),(t=$t(t/2))&&(e+=e)}while(t);return l}function Mn(e,t){return Ao(vo(e,t,Kr),e+"")}function kn(e){return kl(Nr(e))}function Fn(e,t){var l=Nr(e);return bo(l,Vl(t,0,l.length))}function Un(e,t,l,n){if(!za(e))return e;for(var i=-1,o=(t=oi(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=Do(t[i]),d=l;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(d=n?n(s,u,r):void 0)&&(d=za(s)?s:io(t[i+1])?[]:{})}Wl(r,u,d),r=r[u]}return e}var Hn=fl?function(e,t){return fl.set(e,t),e}:Kr,Wn=Vt?function(e,t){return Vt(e,"toString",{configurable:!0,enumerable:!1,value:zr(t),writable:!0})}:Kr;function jn(e){return bo(Nr(e))}function zn(e,t,l){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(l=l>i?i:l)<0&&(l+=i),i=t>l?0:l-t>>>0,t>>>=0;for(var o=f(i);++n<i;)o[n]=e[n+t];return o}function Yn(e,t){var l;return $l(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function Gn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Za(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Kn(e,t,Kr,l)}function Kn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Za(t),d=void 0===t;i<o;){var s=$t((i+o)/2),c=l(e[s]),p=void 0!==c,v=null===c,m=c==c,E=Za(c);if(a)var f=n||m;else f=d?m&&(n||p):r?m&&p&&(n||!v):u?m&&p&&!v&&(n||!E):!v&&!E&&(n?c<=t:c<t);f?i=s+1:o=s}return ol(o,4294967294)}function Vn(e,t){for(var l=-1,n=e.length,i=0,o=[];++l<n;){var a=e[l],r=t?t(a):a;if(!l||!Na(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function qn(e){return"number"==typeof e?e:Za(e)?NaN:+e}function Xn(e){if("string"==typeof e)return e;if(Ra(e))return dt(e,Xn)+"";if(Za(e))return Tl?Tl.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Jn(e,t,l){var n=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(l)a=!1,i=ut;else if(o>=200){var d=t?null:wi(e);if(d)return Ht(d);a=!1,i=Nt,u=new xl}else u=t?[]:r;e:for(;++n<o;){var s=e[n],c=t?t(s):s;if(s=l||0!==s?s:0,a&&c==c){for(var p=u.length;p--;)if(u[p]===c)continue e;t&&u.push(c),r.push(s)}else i(u,c,l)||(u!==r&&u.push(c),r.push(s))}return r}function Zn(e,t){return null==(e=mo(e,t=oi(t,e)))||delete e[Do(Uo(t))]}function $n(e,t,l,n){return Un(e,t,l(sn(e,t)),n)}function Qn(e,t,l,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return l?zn(e,n?0:o,n?o+1:i):zn(e,n?o+1:0,n?i:o)}function ei(e,t){var l=e;return l instanceof Ll&&(l=l.value()),ct(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},l)}function ti(e,t,l){var n=e.length;if(n<2)return n?Jn(e[0]):[];for(var i=-1,o=f(n);++i<n;)for(var a=e[i],r=-1;++r<n;)r!=i&&(o[i]=Zl(o[i]||a,e[r],t,l));return Jn(nn(o,1),t,l)}function li(e,t,l){for(var n=-1,i=e.length,o=t.length,a={};++n<i;)l(a,e[n],n<o?t[n]:void 0);return a}function ni(e){return Ma(e)?e:[]}function ii(e){return"function"==typeof e?e:Kr}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:To(rr(e))}var ai=Mn;function ri(e,t,l){var n=e.length;return l=void 0===l?n:l,!t&&l>=n?e:zn(e,t,l)}var ui=qt||function(e){return ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var l=e.length,n=We?We(l):new e.constructor(l);return e.copy(n),n}function si(e){var t=new e.constructor(e.byteLength);return new Fe(t).set(new Fe(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Za(e),a=void 0!==t,r=null===t,u=t==t,d=Za(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0}function vi(e,t,l,n){for(var i=-1,o=e.length,a=l.length,r=-1,u=t.length,d=il(o-a,0),s=f(u+d),c=!n;++r<u;)s[r]=t[r];for(;++i<a;)(c||i<o)&&(s[l[i]]=e[i]);for(;d--;)s[r++]=e[i++];return s}function mi(e,t,l,n){for(var i=-1,o=e.length,a=-1,r=l.length,u=-1,d=t.length,s=il(o-r,0),c=f(s+d),p=!n;++i<s;)c[i]=e[i];for(var v=i;++u<d;)c[v+u]=t[u];for(;++a<r;)(p||i<o)&&(c[v+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=f(n));++l<n;)t[l]=e[l];return t}function fi(e,t,l,n){var i=!l;l||(l={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=n?n(l[r],e[r],r,l,e):void 0;void 0===u&&(u=e[r]),i?Gl(l,r,u):Wl(l,r,u)}return l}function _i(e,t){return function(l,n){var i=Ra(l)?lt:zl,o=t?t():{};return i(l,e,qi(n,2),o)}}function gi(e){return Mn(function(t,l){var n=-1,i=l.length,o=i>1?l[i-1]:void 0,a=i>2?l[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&oo(l[0],l[1],a)&&(o=i<3?void 0:o,i=1),t=ve(t);++n<i;){var r=l[n];r&&e(t,r,n,o)}return t})}function Ai(e,t){return function(l,n){if(null==l)return l;if(!wa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=ve(l);(t?o--:++o<i)&&!1!==n(a[o],o,a););return l}}function Si(e){return function(t,l,n){for(var i=-1,o=ve(t),a=n(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===l(o[u],u,o))break}return t}}function hi(e){return function(t){var l=Mt(t=rr(t))?zt(t):void 0,n=l?l[0]:t.charAt(0),i=l?ri(l,1).join(""):t.slice(1);return n[e]()+i}}function bi(e){return function(t){return ct(Hr(Or(t).replace(Ie,"")),e,"")}}function yi(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=Pl(e.prototype),n=e.apply(l,t);return za(n)?n:l}}function Ci(e){return function(t,l,n){var i=ve(t);if(!wa(t)){var o=qi(l,3);t=Sr(t),l=function(e){return o(i[e],e,i)}}var a=e(t,l,n);return a>-1?i[o?t[a]:a]:void 0}}function Ti(e){return ji(function(t){var n=t.length,i=n,o=Nl.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new fe(l);if(o&&!r&&"wrapper"==Ki(a))var r=new Nl([],!0)}for(i=r?i:n;++i<n;){var u=Ki(a=t[i]),d="wrapper"==u?Gi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Ki(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&Ra(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Di(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,p=2&t,v=24&t,m=512&t,E=p?void 0:yi(e);return function _(){for(var g=arguments.length,A=f(g),S=g;S--;)A[S]=arguments[S];if(v)var h=Vi(_),b=Ot(A,h);if(n&&(A=vi(A,n,i,v)),o&&(A=mi(A,o,a,v)),g-=b,v&&g<d){var y=Ut(A,h);return Ri(e,t,Di,_.placeholder,l,A,y,r,u,d-g)}var C=c?l:this,T=p?C[e]:e;return g=A.length,r?A=Eo(A,r):m&&g>1&&A.reverse(),s&&u<g&&(A.length=u),this&&this!==ze&&this instanceof _&&(T=E||yi(T)),T.apply(C,A)}}function Pi(e,t){return function(l,n){return function(e,t,l,n){return rn(e,function(e,i,o){t(n,l(e),i,o)}),n}(l,e,t(n),{})}}function Ii(e,t){return function(l,n){var i;if(void 0===l&&void 0===n)return t;if(void 0!==l&&(i=l),void 0!==n){if(void 0===i)return n;"string"==typeof l||"string"==typeof n?(l=Xn(l),n=Xn(n)):(l=qn(l),n=qn(n)),i=e(l,n)}return i}}function Ni(e){return ji(function(t){return t=dt(t,Pt(qi())),Mn(function(l){var n=this;return e(t,function(e){return tt(e,n,l)})})})}function Li(e,t){var l=(t=void 0===t?" ":Xn(t)).length;if(l<2)return l?wn(t,e):t;var n=wn(t,Zt(e/jt(t)));return Mt(t)?ri(zt(n),0,e).join(""):n.slice(0,e)}function Bi(e){return function(t,l,n){return n&&"number"!=typeof n&&oo(t,l,n)&&(l=n=void 0),t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l,n){for(var i=-1,o=il(Zt((t-e)/(l||1)),0),a=f(o);o--;)a[n?o:++i]=e,e+=l;return a}(t,l,n=void 0===n?t<l?1:-1:lr(n),e)}}function Oi(e){return function(t,l){return"string"==typeof t&&"string"==typeof l||(t=or(t),l=or(l)),e(t,l)}}function Ri(e,t,l,n,i,o,a,r,u,d){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var c=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,d],p=l.apply(void 0,c);return ro(e)&&_o(p,c),p.placeholder=n,So(p,e,t)}function xi(e){var t=pe[e];return function(e,l){if(e=or(e),(l=null==l?0:ol(nr(l),292))&&tl(e)){var n=(rr(e)+"e").split("e");return+((n=(rr(t(n[0]+"e"+(+n[1]+l)))+"e").split("e"))[0]+"e"+(+n[1]-l))}return t(e)}}var wi=vl&&1/Ht(new vl([,-0]))[1]==1/0?function(e){return new vl(e)}:Zr;function Mi(e){return function(t){var l=eo(t);return l==p?kt(t):l==_?Wt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function ki(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new fe(l);var c=o?o.length:0;if(c||(t&=-97,o=a=void 0),u=void 0===u?u:il(nr(u),0),d=void 0===d?d:nr(d),c-=a?a.length:0,64&t){var p=o,v=a;o=a=void 0}var m=s?void 0:Gi(e),E=[e,t,i,o,a,p,v,r,u,d];if(m&&function(e,t){var l=e[1],i=t[1],o=l|i;if(!(o<131||128==i&&8==l||128==i&&256==l&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==l))return e;1&i&&(e[2]=t[2],o|=1&l?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?vi(r,a,t[4]):a,e[4]=r?Ut(e[3],n):t[4]}(a=t[5])&&(e[5]=(r=e[5])?mi(r,a,t[6]):a,e[6]=r?Ut(e[5],n):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:ol(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(E,m),e=E[0],t=E[1],i=E[2],o=E[3],a=E[4],!(d=E[9]=void 0===E[9]?s?0:e.length:il(E[9]-c,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,l){var n=yi(e);return function i(){for(var o=arguments.length,a=f(o),r=o,u=Vi(i);r--;)a[r]=arguments[r];var d=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=d.length)<l)return Ri(e,t,Di,i.placeholder,void 0,a,d,void 0,void 0,l-o);var s=this&&this!==ze&&this instanceof i?n:e;return tt(s,this,a)}}(e,t,d):32!=t&&33!=t||a.length?Di.apply(void 0,E):function(e,t,l,n){var i=1&t,o=yi(e);return function t(){for(var a=-1,r=arguments.length,u=-1,d=n.length,s=f(d+r),c=this&&this!==ze&&this instanceof t?o:e;++u<d;)s[u]=n[u];for(;r--;)s[u++]=arguments[++a];return tt(c,i?l:this,s)}}(e,t,i,o);else var _=function(e,t,l){var n=1&t,i=yi(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(n?l:this,arguments)}}(e,t,i);return So((m?Hn:_o)(_,E),e,t)}function Fi(e,t,l,n){return void 0===e||Na(e,ge[l])&&!he.call(n,l)?t:e}function Ui(e,t,l,n,i,o){return za(e)&&za(t)&&(o.set(t,e),In(e,t,void 0,Ui,o),o.delete(t)),e}function Hi(e){return Va(e)?void 0:e}function Wi(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,p=!0,v=2&l?new xl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var f=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==f){if(f)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Nt(v,t)&&(m===e||i(m,e,l,n,o)))return v.push(t)})){p=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function ji(e){return Ao(vo(e,void 0,xo),e+"")}function zi(e){return cn(e,Sr,$i)}function Yi(e){return cn(e,hr,Qi)}var Gi=fl?function(e){return fl.get(e)}:Zr;function Ki(e){for(var t=e.name+"",l=_l[t],n=he.call(_l,t)?l.length:0;n--;){var i=l[n],o=i.func;if(null==o||o==e)return i.name}return t}function Vi(e){return(he.call(Dl,"placeholder")?Dl:e).placeholder}function qi(){var e=Dl.iteratee||Vr;return e=e===Vr?bn:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var l=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?l["string"==typeof t?"string":"hash"]:l.map}function Ji(e){for(var t=Sr(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,co(i)]}return t}function Zi(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return hn(l)?l:void 0}var $i=Qt?function(e){return null==e?[]:(e=ve(e),at(Qt(e),function(t){return Ge.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)st(t,$i(e)),e=je(e);return t}:iu,eo=pn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=Do(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ja(i)&&io(a,i)&&(Ra(e)||Oa(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Pl(je(e))}function no(e){return Ra(e)||Oa(e)||!!(qe&&e&&e[qe])}function io(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&ae.test(e))&&e>-1&&e%1==0&&e<t}function oo(e,t,l){if(!za(l))return!1;var n=typeof t;return!!("number"==n?wa(l)&&io(t,l.length):"string"==n&&t in l)&&Na(l[t],e)}function ao(e,t){if(Ra(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Za(e))||j.test(e)||!W.test(e)||null!=t&&e in ve(t)}function ro(e){var t=Ki(e),l=Dl[t];if("function"!=typeof l||!(t in Ll.prototype))return!1;if(e===l)return!0;var n=Gi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=b||cl&&eo(new cl)!=p||pl&&"[object Promise]"!=eo(pl.resolve())||vl&&eo(new vl)!=_||ml&&eo(new ml)!=S)&&(eo=function(e){var t=pn(e),l=t==m?e.constructor:void 0,n=l?Po(l):"";if(n)switch(n){case gl:return b;case Al:return p;case Sl:return"[object Promise]";case hl:return _;case bl:return S}return t});var uo=Ae?Ha:ou;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function co(e){return e==e&&!za(e)}function po(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in ve(l))}}function vo(e,t,l){return t=il(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=il(n.length-t,0),a=f(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=f(t+1);++i<t;)r[i]=n[i];return r[t]=l(a),tt(e,this,r)}}function mo(e,t){return t.length<2?e:sn(e,zn(t,0,-1))}function Eo(e,t){for(var l=e.length,n=ol(t.length,l),i=Ei(e);n--;){var o=t[n];e[n]=io(o,l)?i[o]:void 0}return e}function fo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _o=ho(Hn),go=Jt||function(e,t){return ze.setTimeout(e,t)},Ao=ho(Wn);function So(e,t,l){var n=t+"";return Ao(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(q,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return nt(i,function(l){var n="_."+l[0];t&l[1]&&!rt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(J):[]}(n),l)))}function ho(e){var t=0,l=0;return function(){var n=al(),i=16-(n-l);if(l=n,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var l=-1,n=e.length,i=n-1;for(t=void 0===t?n:t;++l<t;){var o=xn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var yo,Co,To=(yo=ya(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,l,n,i){t.push(n?i.replace(Q,"$1"):l||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=yo.cache,yo);function Do(e){if("string"==typeof e||Za(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Io(e){if(e instanceof Ll)return e.clone();var t=new Nl(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var No=Mn(function(e,t){return Ma(e)?Zl(e,nn(t,1,Ma,!0)):[]}),Lo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Zl(e,nn(t,1,Ma,!0),qi(l,2)):[]}),Bo=Mn(function(e,t){var l=Uo(t);return Ma(l)&&(l=void 0),Ma(e)?Zl(e,nn(t,1,Ma,!0),void 0,l):[]});function Oo(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),ft(e,qi(t,3),i)}function Ro(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n-1;return void 0!==l&&(i=nr(l),i=l<0?il(n+i,0):ol(i,n-1)),ft(e,qi(t,3),i,!0)}function xo(e){return null!=e&&e.length?nn(e,1):[]}function wo(e){return e&&e.length?e[0]:void 0}var Mo=Mn(function(e){var t=dt(e,ni);return t.length&&t[0]===e[0]?fn(t):[]}),ko=Mn(function(e){var t=Uo(e),l=dt(e,ni);return t===Uo(l)?t=void 0:l.pop(),l.length&&l[0]===e[0]?fn(l,qi(t,2)):[]}),Fo=Mn(function(e){var t=Uo(e),l=dt(e,ni);return(t="function"==typeof t?t:void 0)&&l.pop(),l.length&&l[0]===e[0]?fn(l,void 0,t):[]});function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Mn(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?On(e,t):e}var jo=ji(function(e,t){var l=null==e?0:e.length,n=Kl(e,t);return Rn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(pi)),n});function zo(e){return null==e?e:dl.call(e)}var Yo=Mn(function(e){return Jn(nn(e,1,Ma,!0))}),Go=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),Jn(nn(e,1,Ma,!0),qi(t,2))}),Ko=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Jn(nn(e,1,Ma,!0),void 0,t)});function Vo(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(Ma(e))return t=il(e.length,t),!0}),Tt(t,function(t){return dt(e,ht(t))})}function qo(e,t){if(!e||!e.length)return[];var l=Vo(e);return null==t?l:dt(l,function(e){return tt(t,void 0,e)})}var Xo=Mn(function(e,t){return Ma(e)?Zl(e,t):[]}),Jo=Mn(function(e){return ti(at(e,Ma))}),Zo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),ti(at(e,Ma),qi(t,2))}),$o=Mn(function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ti(at(e,Ma),void 0,t)}),Qo=Mn(Vo),ea=Mn(function(e){var t=e.length,l=t>1?e[t-1]:void 0;return l="function"==typeof l?(e.pop(),l):void 0,qo(e,l)});function ta(e){var t=Dl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Kl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Ll&&io(l)?((n=n.slice(l,+l+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new Nl(n,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),ia=_i(function(e,t,l){he.call(e,l)?++e[l]:Gl(e,l,1)}),oa=Ci(Oo),aa=Ci(Ro);function ra(e,t){return(Ra(e)?nt:$l)(e,qi(t,3))}function ua(e,t){return(Ra(e)?it:Ql)(e,qi(t,3))}var da=_i(function(e,t,l){he.call(e,l)?e[l].push(t):Gl(e,l,[t])}),sa=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=wa(e)?f(e.length):[];return $l(e,function(e){o[++n]=i?tt(t,e,l):_n(e,t,l)}),o}),ca=_i(function(e,t,l){Gl(e,l,t)});function pa(e,t){return(Ra(e)?dt:Tn)(e,qi(t,3))}var va=_i(function(e,t,l){e[l?0:1].push(t)},function(){return[[],[]]}),ma=Mn(function(e,t){if(null==e)return[];var l=t.length;return l>1&&oo(e,t[0],t[1])?t=[]:l>2&&oo(t[0],t[1],t[2])&&(t=[t[0]]),Ln(e,nn(t,1),[])}),Ea=Xt||function(){return ze.Date.now()};function fa(e,t,l){return t=l?void 0:t,ki(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function _a(e,t){var n;if("function"!=typeof t)throw new fe(l);return e=nr(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ga=Mn(function(e,t,l){var n=1;if(l.length){var i=Ut(l,Vi(ga));n|=32}return ki(e,n,t,l,i)}),Aa=Mn(function(e,t,l){var n=3;if(l.length){var i=Ut(l,Vi(Aa));n|=32}return ki(t,n,e,l,i)});function Sa(e,t,n){var i,o,a,r,u,d,s=0,c=!1,p=!1,v=!0;if("function"!=typeof e)throw new fe(l);function m(t){var l=i,n=o;return i=o=void 0,s=t,r=e.apply(n,l)}function E(e){return s=e,u=go(_,t),c?m(e):r}function f(e){var l=e-d;return void 0===d||l>=t||l<0||p&&e-s>=a}function _(){var e=Ea();if(f(e))return g(e);u=go(_,function(e){var l=t-(e-d);return p?ol(l,a-(e-s)):l}(e))}function g(e){return u=void 0,v&&i?m(e):(i=o=void 0,r)}function A(){var e=Ea(),l=f(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(p)return ui(u),u=go(_,t),m(d)}return void 0===u&&(u=go(_,t)),r}return t=or(t)||0,za(n)&&(c=!!n.leading,a=(p="maxWait"in n)?il(or(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),A.cancel=function(){void 0!==u&&ui(u),s=0,i=d=o=u=void 0},A.flush=function(){return void 0===u?r:g(Ea())},A}var ha=Mn(function(e,t){return Jl(e,1,t)}),ba=Mn(function(e,t,l){return Jl(e,or(t)||0,l)});function ya(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new fe(l);var n=function(){var l=arguments,i=t?t.apply(this,l):l[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,l);return n.cache=o.set(i,a)||o,a};return n.cache=new(ya.Cache||Rl),n}function Ca(e){if("function"!=typeof e)throw new fe(l);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ya.Cache=Rl;var Ta=ai(function(e,t){var l=(t=1==t.length&&Ra(t[0])?dt(t[0],Pt(qi())):dt(nn(t,1),Pt(qi()))).length;return Mn(function(n){for(var i=-1,o=ol(n.length,l);++i<o;)n[i]=t[i].call(this,n[i]);return tt(e,this,n)})}),Da=Mn(function(e,t){return ki(e,32,void 0,t,Ut(t,Vi(Da)))}),Pa=Mn(function(e,t){return ki(e,64,void 0,t,Ut(t,Vi(Pa)))}),Ia=ji(function(e,t){return ki(e,256,void 0,void 0,void 0,t)});function Na(e,t){return e===t||e!=e&&t!=t}var La=Oi(vn),Ba=Oi(function(e,t){return e>=t}),Oa=gn(function(){return arguments}())?gn:function(e){return Ya(e)&&he.call(e,"callee")&&!Ge.call(e,"callee")},Ra=f.isArray,xa=Xe?Pt(Xe):function(e){return Ya(e)&&pn(e)==h};function wa(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ma(e){return Ya(e)&&wa(e)}var ka=el||ou,Fa=Je?Pt(Je):function(e){return Ya(e)&&pn(e)==u};function Ua(e){if(!Ya(e))return!1;var t=pn(e);return t==d||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Va(e)}function Ha(e){if(!za(e))return!1;var t=pn(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 Ya(e){return null!=e&&"object"==typeof e}var Ga=Ze?Pt(Ze):function(e){return Ya(e)&&eo(e)==p};function Ka(e){return"number"==typeof e||Ya(e)&&pn(e)==v}function Va(e){if(!Ya(e)||pn(e)!=m)return!1;var t=je(e);if(null===t)return!0;var l=he.call(t,"constructor")&&t.constructor;return"function"==typeof l&&l instanceof l&&Se.call(l)==Te}var qa=$e?Pt($e):function(e){return Ya(e)&&pn(e)==E},Xa=Qe?Pt(Qe):function(e){return Ya(e)&&eo(e)==_};function Ja(e){return"string"==typeof e||!Ra(e)&&Ya(e)&&pn(e)==g}function Za(e){return"symbol"==typeof e||Ya(e)&&pn(e)==A}var $a=et?Pt(et):function(e){return Ya(e)&&ja(e.length)&&!!Me[pn(e)]},Qa=Oi(Cn),er=Oi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(wa(e))return Ja(e)?zt(e):Ei(e);if(mt&&e[mt])return function(e){for(var t,l=[];!(t=e.next()).done;)l.push(t.value);return l}(e[mt]());var t=eo(e);return(t==p?kt:t==_?Ht:Nr)(e)}function lr(e){return e?(e=or(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function nr(e){var t=lr(e),l=t%1;return t==t?l?t-l:t:0}function ir(e){return e?Vl(nr(e),0,4294967295):0}function or(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||oe.test(e)?He(e.slice(2),l?2:8):le.test(e)?NaN:+e}function ar(e){return fi(e,hr(e))}function rr(e){return null==e?"":Xn(e)}var ur=gi(function(e,t){if(so(t)||wa(t))fi(t,Sr(t),e);else for(var l in t)he.call(t,l)&&Wl(e,l,t[l])}),dr=gi(function(e,t){fi(t,hr(t),e)}),sr=gi(function(e,t,l,n){fi(t,hr(t),e,n)}),cr=gi(function(e,t,l,n){fi(t,Sr(t),e,n)}),pr=ji(Kl),vr=Mn(function(e,t){e=ve(e);var l=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&oo(t[0],t[1],i)&&(n=1);++l<n;)for(var o=t[l],a=hr(o),r=-1,u=a.length;++r<u;){var d=a[r],s=e[d];(void 0===s||Na(s,ge[d])&&!he.call(e,d))&&(e[d]=o[d])}return e}),mr=Mn(function(e){return e.push(void 0,Ui),tt(yr,void 0,e)});function Er(e,t,l){var n=null==e?void 0:sn(e,t);return void 0===n?l:n}function fr(e,t){return null!=e&&to(e,t,En)}var _r=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=l},zr(Kr)),gr=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),he.call(e,t)?e[t].push(l):e[t]=[l]},qi),Ar=Mn(_n);function Sr(e){return wa(e)?Ml(e):yn(e)}function hr(e){return wa(e)?Ml(e,!0):function(e){if(!za(e))return function(e){var t=[];if(null!=e)for(var l in ve(e))t.push(l);return t}(e);var t=so(e),l=[];for(var n in e)("constructor"!=n||!t&&he.call(e,n))&&l.push(n);return l}(e)}var br=gi(function(e,t,l){In(e,t,l)}),yr=gi(function(e,t,l,n){In(e,t,l,n)}),Cr=ji(function(e,t){var l={};if(null==e)return l;var n=!1;t=dt(t,function(t){return t=oi(t,e),n||(n=t.length>1),t}),fi(e,Yi(e),l),n&&(l=ql(l,7,Hi));for(var i=t.length;i--;)Zn(l,t[i]);return l}),Tr=ji(function(e,t){return null==e?{}:function(e,t){return Bn(e,t,function(t,l){return fr(e,l)})}(e,t)});function Dr(e,t){if(null==e)return{};var l=dt(Yi(e),function(e){return[e]});return t=qi(t),Bn(e,l,function(e,l){return t(e,l[0])})}var Pr=Mi(Sr),Ir=Mi(hr);function Nr(e){return null==e?[]:It(e,Sr(e))}var Lr=bi(function(e,t,l){return t=t.toLowerCase(),e+(l?Br(t):t)});function Br(e){return Ur(rr(e).toLowerCase())}function Or(e){return(e=rr(e))&&e.replace(re,Rt).replace(Ne,"")}var Rr=bi(function(e,t,l){return e+(l?"-":"")+t.toLowerCase()}),xr=bi(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),wr=hi("toLowerCase"),Mr=bi(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),kr=bi(function(e,t,l){return e+(l?" ":"")+Ur(t)}),Fr=bi(function(e,t,l){return e+(l?" ":"")+t.toUpperCase()}),Ur=hi("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(Be)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wr=Mn(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ua(e)?e:new se(e)}}),jr=ji(function(e,t){return nt(t,function(t){t=Do(t),Gl(e,t,ga(e[t],e))}),e});function zr(e){return function(){return e}}var Yr=Ti(),Gr=Ti(!0);function Kr(e){return e}function Vr(e){return bn("function"==typeof e?e:ql(e,1))}var qr=Mn(function(e,t){return function(l){return _n(l,e,t)}}),Xr=Mn(function(e,t){return function(l){return _n(e,l,t)}});function Jr(e,t,l){var n=Sr(t),i=dn(t,n);null!=l||za(t)&&(i.length||!n.length)||(l=t,t=e,e=this,i=dn(t,Sr(t)));var o=!(za(l)&&"chain"in l&&!l.chain),a=Ha(e);return nt(i,function(l){var n=t[l];e[l]=n,a&&(e.prototype[l]=function(){var t=this.__chain__;if(o||t){var l=e(this.__wrapped__),i=l.__actions__=Ei(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),l.__chain__=t,l}return n.apply(e,st([this.value()],arguments))})}),e}function Zr(){}var $r=Ni(dt),Qr=Ni(ot),eu=Ni(vt);function tu(e){return ao(e)?ht(Do(e)):function(e){return function(t){return sn(t,e)}}(e)}var lu=Bi(),nu=Bi(!0);function iu(){return[]}function ou(){return!1}var au,ru=Ii(function(e,t){return e+t},0),uu=xi("ceil"),du=Ii(function(e,t){return e/t},1),su=xi("floor"),cu=Ii(function(e,t){return e*t},1),pu=xi("round"),vu=Ii(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=pr,Dl.before=_a,Dl.bind=ga,Dl.bindAll=jr,Dl.bindKey=Aa,Dl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Dl.chain=ta,Dl.chunk=function(e,t,l){t=(l?oo(e,t,l):void 0===t)?1:il(nr(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var i=0,o=0,a=f(Zt(n/t));i<n;)a[o++]=zn(e,i,i+=t);return a},Dl.compact=function(e){for(var t=-1,l=null==e?0:e.length,n=0,i=[];++t<l;){var o=e[t];o&&(i[n++]=o)}return i},Dl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=f(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?Ei(l):[l],nn(t,1))},Dl.cond=function(e){var t=null==e?0:e.length,n=qi();return e=t?dt(e,function(e){if("function"!=typeof e[1])throw new fe(l);return[n(e[0]),e[1]]}):[],Mn(function(l){for(var n=-1;++n<t;){var i=e[n];if(tt(i[0],this,l))return tt(i[1],this,l)}})},Dl.conforms=function(e){return function(e){var t=Sr(e);return function(l){return Xl(l,e,t)}}(ql(e,1))},Dl.constant=zr,Dl.countBy=ia,Dl.create=function(e,t){var l=Pl(e);return null==t?l:Yl(l,t)},Dl.curry=function e(t,l,n){var i=ki(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.curryRight=function e(t,l,n){var i=ki(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Dl.debounce=Sa,Dl.defaults=vr,Dl.defaultsDeep=mr,Dl.defer=ha,Dl.delay=ba,Dl.difference=No,Dl.differenceBy=Lo,Dl.differenceWith=Bo,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,qi(t,3),!0,!0):[]},Dl.dropWhile=function(e,t){return e&&e.length?Qn(e,qi(t,3),!0):[]},Dl.fill=function(e,t,l,n){var i=null==e?0:e.length;return i?(l&&"number"!=typeof l&&oo(e,t,l)&&(l=0,n=i),function(e,t,l,n){var i=e.length;for((l=nr(l))<0&&(l=-l>i?0:i+l),(n=void 0===n||n>i?i:nr(n))<0&&(n+=i),n=l>n?0:ir(n);l<n;)e[l++]=t;return e}(e,t,l,n)):[]},Dl.filter=function(e,t){return(Ra(e)?at:ln)(e,qi(t,3))},Dl.flatMap=function(e,t){return nn(pa(e,t),1)},Dl.flatMapDeep=function(e,t){return nn(pa(e,t),1/0)},Dl.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(pa(e,t),l)},Dl.flatten=xo,Dl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Dl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Dl.flip=function(e){return ki(e,512)},Dl.flow=Yr,Dl.flowRight=Gr,Dl.fromPairs=function(e){for(var t=-1,l=null==e?0:e.length,n={};++t<l;){var i=e[t];n[i[0]]=i[1]}return n},Dl.functions=function(e){return null==e?[]:dn(e,Sr(e))},Dl.functionsIn=function(e){return null==e?[]:dn(e,hr(e))},Dl.groupBy=da,Dl.initial=function(e){return null!=e&&e.length?zn(e,0,-1):[]},Dl.intersection=Mo,Dl.intersectionBy=ko,Dl.intersectionWith=Fo,Dl.invert=_r,Dl.invertBy=gr,Dl.invokeMap=sa,Dl.iteratee=Vr,Dl.keyBy=ca,Dl.keys=Sr,Dl.keysIn=hr,Dl.map=pa,Dl.mapKeys=function(e,t){var l={};return t=qi(t,3),rn(e,function(e,n,i){Gl(l,t(e,n,i),e)}),l},Dl.mapValues=function(e,t){var l={};return t=qi(t,3),rn(e,function(e,n,i){Gl(l,n,t(e,n,i))}),l},Dl.matches=function(e){return Dn(ql(e,1))},Dl.matchesProperty=function(e,t){return Pn(e,ql(t,1))},Dl.memoize=ya,Dl.merge=br,Dl.mergeWith=yr,Dl.method=qr,Dl.methodOf=Xr,Dl.mixin=Jr,Dl.negate=Ca,Dl.nthArg=function(e){return e=nr(e),Mn(function(t){return Nn(t,e)})},Dl.omit=Cr,Dl.omitBy=function(e,t){return Dr(e,Ca(qi(t)))},Dl.once=function(e){return _a(2,e)},Dl.orderBy=function(e,t,l,n){return null==e?[]:(Ra(t)||(t=null==t?[]:[t]),Ra(l=n?void 0:l)||(l=null==l?[]:[l]),Ln(e,t,l))},Dl.over=$r,Dl.overArgs=Ta,Dl.overEvery=Qr,Dl.overSome=eu,Dl.partial=Da,Dl.partialRight=Pa,Dl.partition=va,Dl.pick=Tr,Dl.pickBy=Dr,Dl.property=tu,Dl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Dl.pull=Ho,Dl.pullAll=Wo,Dl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,qi(l,2)):e},Dl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,void 0,l):e},Dl.pullAt=jo,Dl.range=lu,Dl.rangeRight=nu,Dl.rearg=Ia,Dl.reject=function(e,t){return(Ra(e)?at:ln)(e,Ca(qi(t,3)))},Dl.remove=function(e,t){var l=[];if(!e||!e.length)return l;var n=-1,i=[],o=e.length;for(t=qi(t,3);++n<o;){var a=e[n];t(a,n,e)&&(l.push(a),i.push(n))}return Rn(e,i),l},Dl.rest=function(e,t){if("function"!=typeof e)throw new fe(l);return Mn(e,t=void 0===t?t:nr(t))},Dl.reverse=zo,Dl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),(Ra(e)?Fl:Fn)(e,t)},Dl.set=function(e,t,l){return null==e?e:Un(e,t,l)},Dl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Dl.shuffle=function(e){return(Ra(e)?Ul:jn)(e)},Dl.slice=function(e,t,l){var n=null==e?0:e.length;return n?(l&&"number"!=typeof l&&oo(e,t,l)?(t=0,l=n):(t=null==t?0:nr(t),l=void 0===l?n:nr(l)),zn(e,t,l)):[]},Dl.sortBy=ma,Dl.sortedUniq=function(e){return e&&e.length?Vn(e):[]},Dl.sortedUniqBy=function(e,t){return e&&e.length?Vn(e,qi(t,2)):[]},Dl.split=function(e,t,l){return l&&"number"!=typeof l&&oo(e,t,l)&&(t=l=void 0),(l=void 0===l?4294967295:l>>>0)?(e=rr(e))&&("string"==typeof t||null!=t&&!qa(t))&&!(t=Xn(t))&&Mt(e)?ri(zt(e),0,l):e.split(t,l):[]},Dl.spread=function(e,t){if("function"!=typeof e)throw new fe(l);return t=null==t?0:il(nr(t),0),Mn(function(l){var n=l[t],i=ri(l,0,t);return n&&st(i,n),tt(e,this,i)})},Dl.tail=function(e){var t=null==e?0:e.length;return t?zn(e,1,t):[]},Dl.take=function(e,t,l){return e&&e.length?zn(e,0,(t=l||void 0===t?1:nr(t))<0?0:t):[]},Dl.takeRight=function(e,t,l){var n=null==e?0:e.length;return n?zn(e,(t=n-(t=l||void 0===t?1:nr(t)))<0?0:t,n):[]},Dl.takeRightWhile=function(e,t){return e&&e.length?Qn(e,qi(t,3),!1,!0):[]},Dl.takeWhile=function(e,t){return e&&e.length?Qn(e,qi(t,3)):[]},Dl.tap=function(e,t){return t(e),e},Dl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new fe(l);return za(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),Sa(e,t,{leading:i,maxWait:t,trailing:o})},Dl.thru=la,Dl.toArray=tr,Dl.toPairs=Pr,Dl.toPairsIn=Ir,Dl.toPath=function(e){return Ra(e)?dt(e,Do):Za(e)?[e]:Ei(To(rr(e)))},Dl.toPlainObject=ar,Dl.transform=function(e,t,l){var n=Ra(e),i=n||ka(e)||$a(e);if(t=qi(t,4),null==l){var o=e&&e.constructor;l=i?n?new o:[]:za(e)&&Ha(o)?Pl(je(e)):{}}return(i?nt:rn)(e,function(e,n,i){return t(l,e,n,i)}),l},Dl.unary=function(e){return fa(e,1)},Dl.union=Yo,Dl.unionBy=Go,Dl.unionWith=Ko,Dl.uniq=function(e){return e&&e.length?Jn(e):[]},Dl.uniqBy=function(e,t){return e&&e.length?Jn(e,qi(t,2)):[]},Dl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Jn(e,void 0,t):[]},Dl.unset=function(e,t){return null==e||Zn(e,t)},Dl.unzip=Vo,Dl.unzipWith=qo,Dl.update=function(e,t,l){return null==e?e:$n(e,t,ii(l))},Dl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:$n(e,t,ii(l),n)},Dl.values=Nr,Dl.valuesIn=function(e){return null==e?[]:It(e,hr(e))},Dl.without=Xo,Dl.words=Hr,Dl.wrap=function(e,t){return Da(ii(t),e)},Dl.xor=Jo,Dl.xorBy=Zo,Dl.xorWith=$o,Dl.zip=Qo,Dl.zipObject=function(e,t){return li(e||[],t||[],Wl)},Dl.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Dl.zipWith=ea,Dl.entries=Pr,Dl.entriesIn=Ir,Dl.extend=dr,Dl.extendWith=sr,Jr(Dl,Dl),Dl.add=ru,Dl.attempt=Wr,Dl.camelCase=Lr,Dl.capitalize=Br,Dl.ceil=uu,Dl.clamp=function(e,t,l){return void 0===l&&(l=t,t=void 0),void 0!==l&&(l=(l=or(l))==l?l:0),void 0!==t&&(t=(t=or(t))==t?t:0),Vl(or(e),t,l)},Dl.clone=function(e){return ql(e,4)},Dl.cloneDeep=function(e){return ql(e,5)},Dl.cloneDeepWith=function(e,t){return ql(e,5,t="function"==typeof t?t:void 0)},Dl.cloneWith=function(e,t){return ql(e,4,t="function"==typeof t?t:void 0)},Dl.conformsTo=function(e,t){return null==t||Xl(e,t,Sr(t))},Dl.deburr=Or,Dl.defaultTo=function(e,t){return null==e||e!=e?t:e},Dl.divide=du,Dl.endsWith=function(e,t,l){e=rr(e),t=Xn(t);var n=e.length,i=l=void 0===l?n:Vl(nr(l),0,n);return(l-=t.length)>=0&&e.slice(l,i)==t},Dl.eq=Na,Dl.escape=function(e){return(e=rr(e))&&k.test(e)?e.replace(w,xt):e},Dl.escapeRegExp=function(e){return(e=rr(e))&&G.test(e)?e.replace(Y,"\\$&"):e},Dl.every=function(e,t,l){var n=Ra(e)?ot:en;return l&&oo(e,t,l)&&(t=void 0),n(e,qi(t,3))},Dl.find=oa,Dl.findIndex=Oo,Dl.findKey=function(e,t){return Et(e,qi(t,3),rn)},Dl.findLast=aa,Dl.findLastIndex=Ro,Dl.findLastKey=function(e,t){return Et(e,qi(t,3),un)},Dl.floor=su,Dl.forEach=ra,Dl.forEachRight=ua,Dl.forIn=function(e,t){return null==e?e:on(e,qi(t,3),hr)},Dl.forInRight=function(e,t){return null==e?e:an(e,qi(t,3),hr)},Dl.forOwn=function(e,t){return e&&rn(e,qi(t,3))},Dl.forOwnRight=function(e,t){return e&&un(e,qi(t,3))},Dl.get=Er,Dl.gt=La,Dl.gte=Ba,Dl.has=function(e,t){return null!=e&&to(e,t,mn)},Dl.hasIn=fr,Dl.head=wo,Dl.identity=Kr,Dl.includes=function(e,t,l,n){e=wa(e)?e:Nr(e),l=l&&!n?nr(l):0;var i=e.length;return l<0&&(l=il(i+l,0)),Ja(e)?l<=i&&e.indexOf(t,l)>-1:!!i&&_t(e,t,l)>-1},Dl.indexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=null==l?0:nr(l);return i<0&&(i=il(n+i,0)),_t(e,t,i)},Dl.inRange=function(e,t,l){return t=lr(t),void 0===l?(l=t,t=0):l=lr(l),function(e,t,l){return e>=ol(t,l)&&e<il(t,l)}(e=or(e),t,l)},Dl.invoke=Ar,Dl.isArguments=Oa,Dl.isArray=Ra,Dl.isArrayBuffer=xa,Dl.isArrayLike=wa,Dl.isArrayLikeObject=Ma,Dl.isBoolean=function(e){return!0===e||!1===e||Ya(e)&&pn(e)==r},Dl.isBuffer=ka,Dl.isDate=Fa,Dl.isElement=function(e){return Ya(e)&&1===e.nodeType&&!Va(e)},Dl.isEmpty=function(e){if(null==e)return!0;if(wa(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||ka(e)||$a(e)||Oa(e)))return!e.length;var t=eo(e);if(t==p||t==_)return!e.size;if(so(e))return!yn(e).length;for(var l in e)if(he.call(e,l))return!1;return!0},Dl.isEqual=function(e,t){return An(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?An(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||Sn(e,t,Ji(t))},Dl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Sn(e,t,Ji(t),l)},Dl.isNaN=function(e){return Ka(e)&&e!=+e},Dl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hn(e)},Dl.isNil=function(e){return null==e},Dl.isNull=function(e){return null===e},Dl.isNumber=Ka,Dl.isObject=za,Dl.isObjectLike=Ya,Dl.isPlainObject=Va,Dl.isRegExp=qa,Dl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Dl.isSet=Xa,Dl.isString=Ja,Dl.isSymbol=Za,Dl.isTypedArray=$a,Dl.isUndefined=function(e){return void 0===e},Dl.isWeakMap=function(e){return Ya(e)&&eo(e)==S},Dl.isWeakSet=function(e){return Ya(e)&&"[object WeakSet]"==pn(e)},Dl.join=function(e,t){return null==e?"":ll.call(e,t)},Dl.kebabCase=Rr,Dl.last=Uo,Dl.lastIndexOf=function(e,t,l){var n=null==e?0:e.length;if(!n)return-1;var i=n;return void 0!==l&&(i=(i=nr(l))<0?il(n+i,0):ol(i,n-1)),t==t?function(e,t,l){for(var n=l+1;n--;)if(e[n]===t)return n;return n}(e,t,i):ft(e,At,i,!0)},Dl.lowerCase=xr,Dl.lowerFirst=wr,Dl.lt=Qa,Dl.lte=er,Dl.max=function(e){return e&&e.length?tn(e,Kr,vn):void 0},Dl.maxBy=function(e,t){return e&&e.length?tn(e,qi(t,2),vn):void 0},Dl.mean=function(e){return St(e,Kr)},Dl.meanBy=function(e,t){return St(e,qi(t,2))},Dl.min=function(e){return e&&e.length?tn(e,Kr,Cn):void 0},Dl.minBy=function(e,t){return e&&e.length?tn(e,qi(t,2),Cn):void 0},Dl.stubArray=iu,Dl.stubFalse=ou,Dl.stubObject=function(){return{}},Dl.stubString=function(){return""},Dl.stubTrue=function(){return!0},Dl.multiply=cu,Dl.nth=function(e,t){return e&&e.length?Nn(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 i=(t-n)/2;return Li($t(i),l)+e+Li(Zt(i),l)},Dl.padEnd=function(e,t,l){e=rr(e);var n=(t=nr(t))?jt(e):0;return t&&n<t?e+Li(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?Li(t-n,l)+e:e},Dl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace(K,""),t||0)},Dl.random=function(e,t,l){if(l&&"boolean"!=typeof l&&oo(e,t,l)&&(t=l=void 0),void 0===l&&("boolean"==typeof t?(l=t,t=void 0):"boolean"==typeof e&&(l=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var n=e;e=t,t=n}if(l||e%1||t%1){var i=ul();return ol(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return xn(e,t)},Dl.reduce=function(e,t,l){var n=Ra(e)?ct:yt,i=arguments.length<3;return n(e,qi(t,4),l,i,$l)},Dl.reduceRight=function(e,t,l){var n=Ra(e)?pt:yt,i=arguments.length<3;return n(e,qi(t,4),l,i,Ql)},Dl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),wn(rr(e),t)},Dl.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dl.result=function(e,t,l){var n=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++n<i;){var o=null==e?void 0:e[Do(t[n])];void 0===o&&(n=i,o=l),e=Ha(o)?o.call(e):o}return e},Dl.round=pu,Dl.runInContext=e,Dl.sample=function(e){return(Ra(e)?kl:kn)(e)},Dl.size=function(e){if(null==e)return 0;if(wa(e))return Ja(e)?jt(e):e.length;var t=eo(e);return t==p||t==_?e.size:yn(e).length},Dl.snakeCase=Mr,Dl.some=function(e,t,l){var n=Ra(e)?vt:Yn;return l&&oo(e,t,l)&&(t=void 0),n(e,qi(t,3))},Dl.sortedIndex=function(e,t){return Gn(e,t)},Dl.sortedIndexBy=function(e,t,l){return Kn(e,t,qi(l,2))},Dl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=Gn(e,t);if(n<l&&Na(e[n],t))return n}return-1},Dl.sortedLastIndex=function(e,t){return Gn(e,t,!0)},Dl.sortedLastIndexBy=function(e,t,l){return Kn(e,t,qi(l,2),!0)},Dl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=Gn(e,t,!0)-1;if(Na(e[l],t))return l}return-1},Dl.startCase=kr,Dl.startsWith=function(e,t,l){return e=rr(e),l=null==l?0:Vl(nr(l),0,e.length),t=Xn(t),e.slice(l,l+t.length)==t},Dl.subtract=vu,Dl.sum=function(e){return e&&e.length?Ct(e,Kr):0},Dl.sumBy=function(e,t){return e&&e.length?Ct(e,qi(t,2)):0},Dl.template=function(e,t,l){var n=Dl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,Fi);var i,o,a=sr({},t.imports,n.imports,Fi),r=Sr(a),u=It(a,r),d=0,s=t.interpolate||ue,c="__p += '",p=me((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(he.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++we+"]")+"\n";e.replace(p,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,wt),l&&(i=!0,c+="' +\n__e("+l+") +\n'"),r&&(o=!0,c+="';\n"+r+";\n__p += '"),n&&(c+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),d=u+t.length,t}),c+="';\n";var m=he.call(t,"variable")&&t.variable;if(m){if($.test(m))throw new se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(o?c.replace(B,""):c).replace(O,"$1").replace(R,"$1;"),c="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var E=Wr(function(){return ce(r,v+"return "+c).apply(void 0,u)});if(E.source=c,Ua(E))throw E;return E},Dl.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=Tt(n,t=qi(t));++l<e;)t(l);return i},Dl.toFinite=lr,Dl.toInteger=nr,Dl.toLength=ir,Dl.toLower=function(e){return rr(e).toLowerCase()},Dl.toNumber=or,Dl.toSafeInteger=function(e){return e?Vl(nr(e),-9007199254740991,9007199254740991):0===e?e:0},Dl.toString=rr,Dl.toUpper=function(e){return rr(e).toUpperCase()},Dl.trim=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return Dt(e);if(!e||!(t=Xn(t)))return e;var n=zt(e),i=zt(t);return ri(n,Lt(n,i),Bt(n,i)+1).join("")},Dl.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,Yt(e)+1);if(!e||!(t=Xn(t)))return e;var n=zt(e);return ri(n,0,Bt(n,zt(t))+1).join("")},Dl.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace(K,"");if(!e||!(t=Xn(t)))return e;var n=zt(e);return ri(n,Lt(n,zt(t))).join("")},Dl.truncate=function(e,t){var l=30,n="...";if(za(t)){var i="separator"in t?t.separator:i;l="length"in t?nr(t.length):l,n="omission"in t?Xn(t.omission):n}var o=(e=rr(e)).length;if(Mt(e)){var a=zt(e);o=a.length}if(l>=o)return e;var r=l-jt(n);if(r<1)return n;var u=a?ri(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+n;if(a&&(r+=u.length-r),qa(i)){if(e.slice(r).search(i)){var d,s=u;for(i.global||(i=me(i.source,rr(te.exec(i))+"g")),i.lastIndex=0;d=i.exec(s);)var c=d.index;u=u.slice(0,void 0===c?r:c)}}else if(e.indexOf(Xn(i),r)!=r){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+n},Dl.unescape=function(e){return(e=rr(e))&&M.test(e)?e.replace(x,Gt):e},Dl.uniqueId=function(e){var t=++be;return rr(e)+t},Dl.upperCase=Fr,Dl.upperFirst=Ur,Dl.each=ra,Dl.eachRight=ua,Dl.first=wo,Jr(Dl,(au={},rn(Dl,function(e,t){he.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){Ll.prototype[e]=function(l){l=void 0===l?1:il(nr(l),0);var n=this.__filtered__&&!t?new Ll(this):this.clone();return n.__filtered__?n.__takeCount__=ol(l,n.__takeCount__):n.__views__.push({size:ol(l,4294967295),type:e+(n.__dir__<0?"Right":"")}),n},Ll.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;Ll.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:l}),t.__filtered__=t.__filtered__||n,t}}),nt(["head","last"],function(e,t){var l="take"+(t?"Right":"");Ll.prototype[e]=function(){return this[l](1).value()[0]}}),nt(["initial","tail"],function(e,t){var l="drop"+(t?"":"Right");Ll.prototype[e]=function(){return this.__filtered__?new Ll(this):this[l](1)}}),Ll.prototype.compact=function(){return this.filter(Kr)},Ll.prototype.find=function(e){return this.filter(e).head()},Ll.prototype.findLast=function(e){return this.reverse().find(e)},Ll.prototype.invokeMap=Mn(function(e,t){return"function"==typeof e?new Ll(this):this.map(function(l){return _n(l,e,t)})}),Ll.prototype.reject=function(e){return this.filter(Ca(qi(e)))},Ll.prototype.slice=function(e,t){e=nr(e);var l=this;return l.__filtered__&&(e>0||t<0)?new Ll(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)},Ll.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ll.prototype.toArray=function(){return this.take(4294967295)},rn(Ll.prototype,function(e,t){var l=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),i=Dl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Dl.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,r=t instanceof Ll,u=a[0],d=r||Ra(t),s=function(e){var t=i.apply(Dl,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,p=!!this.__actions__.length,v=o&&!c,m=r&&!p;if(!o&&d){t=m?t:new Ll(this);var E=e.apply(t,a);return E.__actions__.push({func:la,args:[s],thisArg:void 0}),new Nl(E,c)}return v&&m?e.apply(this,a):(E=this.thru(s),v?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dl.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ra(i)?i:[],e)}return this[l](function(l){return t.apply(Ra(l)?l:[],e)})}}),rn(Ll.prototype,function(e,t){var l=Dl[t];if(l){var n=l.name+"";he.call(_l,n)||(_l[n]=[]),_l[n].push({name:t,func:l})}}),_l[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],Ll.prototype.clone=function(){var e=new Ll(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Ll.prototype.reverse=function(){if(this.__filtered__){var e=new Ll(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Ll.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,l=Ra(e),n=t<0,i=l?e.length:0,o=function(e,t,l){for(var n=-1,i=l.length;++n<i;){var o=l[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ol(t,e+a);break;case"takeRight":e=il(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,d=n?r:a-1,s=this.__iteratees__,c=s.length,p=0,v=ol(u,this.__takeCount__);if(!l||!n&&i==u&&v==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&p<v;){for(var E=-1,f=e[d+=t];++E<c;){var _=s[E],g=_.type,A=(0,_.iteratee)(f);if(2==g)f=A;else if(!A){if(1==g)continue e;break e}}m[p++]=f}return m},Dl.prototype.at=na,Dl.prototype.chain=function(){return ta(this)},Dl.prototype.commit=function(){return new Nl(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 Il;){var n=Io(l);n.__index__=0,n.__values__=void 0,t?i.__wrapped__=n:t=n;var i=n;l=l.__wrapped__}return i.__wrapped__=e,t},Dl.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Ll){var t=e;return this.__actions__.length&&(t=new Ll(this)),(t=t.reverse()).__actions__.push({func:la,args:[zo],thisArg:void 0}),new Nl(t,this.__chain__)}return this.thru(zo)},Dl.prototype.toJSON=Dl.prototype.valueOf=Dl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Dl.prototype.first=Dl.prototype.head,mt&&(Dl.prototype[mt]=function(){return this}),Dl}();Ge?((Ge.exports=Kt)._=Kt,Ye._=Kt):ze._=Kt}).call(f)});const Pn=e=>{var n,a;let{t:r,config:d,formData:s,setError:c,clearErrors:p,formState:v,index:m,setFieldReports:E,documentList:f}=e;Digit.ULBService.getCurrentTenantId();const _=Digit.ULBService.getStateId(),[g,A]=t.useState((null==s||null===(n=s.FeildReports)||void 0===n||null===(a=n[m])||void 0===a?void 0:a.Documents)||[]),[S,h]=t.useState(null),[b,y]=t.useState((null==s?void 0:s.tradedetils1)||[]);let C="create";const{pathname:T}=i.useLocation();T.includes("/modify-application/")&&(C="update");const{isLoading:D}=Digit.Hooks.pt.usePropertyMDMS(_,"TradeLicense",["documentObj"]);window.location.href.includes("renew-application-details");let P=[];return f&&f.map(e=>{P.push({documentType:e.code,code:e.code})}),t.useEffect(()=>{(()=>{let e=s;e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&(null==g?void 0:g.length)>0&&(e.FieldReports[m]=u({},e.FieldReports[m],{Documents:g})),e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&g.length>0&&E(e.FieldReports)})()},[g]),D?l.createElement(o.Loader,null):l.createElement("div",null,null==P?void 0:P.map((e,t)=>l.createElement("div",null,l.createElement(In,{key:t,document:e,action:C,t:r,id:"obps-doc-"+t,error:S,setError:h,setDocuments:A,documents:g,formData:s,setFormError:c,clearFormErrors:p,config:d,formState:v,stateId:_}))),S&&l.createElement(o.Toast,{label:S,onClose:()=>h(null),error:!0}))};function In(e){let{t:n,document:i,setDocuments:a,documents:r,formData:u,setFormError:d,clearFormErrors:s,config:c,formState:p,stateId:v={stateId:v}}=e;const m=null==r?void 0:r.filter(e=>null==e?void 0:e.documentType),E=Digit.ULBService.getCurrentTenantId(),[f,_]=t.useState(""),[g,A]=t.useState(null),[S,h]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,y]=t.useState(!1),[C,T]=t.useState([]),D=()=>{var e,t;let l=null===(e=p.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(null==i?void 0:i.documentType)&&(l=l.filter(e=>e!=(null==i?void 0:i.documentType)),l.length?d(c.key,{type:l}):s(c.key))};return t.useEffect(()=>{null==f||!f.documentType||0!=r.filter(e=>e.documentType===(null==f?void 0:f.documentType)).length&&C.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==f?void 0:f.documentType)}).length===r.filter(e=>e.documentType===(null==f?void 0:f.documentType)).length||a(e=>{if(0===(null==S?void 0:S.length)||null===S)return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==S),l=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.documentType));if(null!=f&&f.id)return[...t,{documentType:null==f?void 0:f.documentType,fileStoreId:S,tenantId:E,id:null==f?void 0:f.id}];{let e=[];return C.map(t=>{var l,n;e.push({documentType:null==f?void 0:f.documentType,fileStoreId:null==t||null===(l=t.fileStoreId)||void 0===l?void 0:l.fileStoreId,tenantId:null==t||null===(n=t.fileStoreId)||void 0===n?void 0:n.tenantId})}),[...l,...e]}}),b?b&&D():window.location.href.includes("renew-application-details")||(S&&null!=f&&f.documentType?S&&null!=f&&f.documentType&&D():(()=>{var e,t;let l=null===(e=p.errors)||void 0===e||null===(t=e[c.key])||void 0===t?void 0:t.type;Array.isArray(l)||(l=[]),l.includes(i.documentType)||(l.push(i.documentType),d(c.key,{type:l}))})())},[S,f,b]),t.useEffect(()=>{var e,t;if(i&&(null==u||null===(e=u.documents)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.length)>0)for(let e=0;e<(null==u||null===(l=u.documents)||void 0===l||null===(n=l.documents)||void 0===n?void 0:n.length);e++){var l,n,o,a,r,d,s,c,p,v,m,E,f,g;(null==i?void 0:i.documentType)===(null==u||null===(o=u.documents)||void 0===o||null===(a=o.documents)||void 0===a||null===(r=a[e])||void 0===r?void 0:r.documentType)&&(_({documentType:null==u||null===(d=u.documents)||void 0===d||null===(s=d.documents)||void 0===s||null===(c=s[e])||void 0===c?void 0:c.documentType,id:null==u||null===(p=u.documents)||void 0===p||null===(v=p.documents)||void 0===v||null===(m=v[e])||void 0===m?void 0:m.id}),h(null==u||null===(E=u.documents)||void 0===E||null===(f=E.documents)||void 0===f||null===(g=f[e])||void 0===g?void 0:g.fileStoreId))}},[i]),l.createElement("div",{style:{marginBottom:"24px"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}},"OLDLICENCENO"!=(null==i?void 0:i.documentType)?n(""+(null==i?void 0:i.documentType.replaceAll(".","_")))+"*":""+n(""+(null==i?void 0:i.documentType.replaceAll(".","_")))),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:v,getFormState:e=>function(e,t){let l=Object.fromEntries(e),n=Object.values(l);T(n),r&&n&&r.filter(e=>e.documentType===t).length>n.length&&a(r.filter(e=>e.documentType!==t)),n&&n.map(e=>{e.file.documentType=t,function(e,t){var l;e&&_({documentType:t}),e&&A(e.file),e&&h(null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.fileStoreId)}(e,t)})}(e,null==i?void 0:i.documentType.replaceAll(".","_")),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Nn=()=>({InspectionDate:"",InspectionTime:"",Checklist:[],Documents:[],key:Date.now()}),Ln=e=>{var n;const{unit:i,index:r,allFieldReport:d,removeUnit:s,setFieldReports:c,t:p,formData:v,config:m,onSelect:E,userType:f,setError:_,clearErrors:g,formState:A,isErrors:S,setIsErrors:h,questionList:b,documentList:y}=e,{control:C,formState:T,watch:D,trigger:P,getValues:I}=a.useForm(),N=D(),{errors:L}=T,B=t.useMemo(()=>{var e;return null==v||null===(e=v.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==v||null===(n=v.ownershipCategory)||void 0===n?void 0:n.code]);t.useEffect(()=>{P()},[]),t.useEffect(()=>{const e=Object.keys(N),t={};e.forEach(e=>t[e]=i[e]);let l=B?{}:{ownerType:{code:"NONE"}},n=b?{questionLength:b.length}:{questionLength:0},o=b?{questionList:b}:{questionList:[]};Dn.isEqual(N,t)||(Object.keys(N).map(e=>{"key"==e||null==N[e]||""==N[e]||null==N[e]||S||h(!0)}),c(e=>e.map(e=>e.key&&e.key===i.key?u({},e,N,l,n,o):u({},e))),P())},[N]),t.useEffect(()=>{var e;Object.keys(L).length&&!Dn.isEqual((null===(e=A.errors[m.key])||void 0===e?void 0:e.type)||{},L)?_(m.key,{type:L}):!Object.keys(L).length&&A.errors[m.key]&&S&&g(m.key)},[L]);let O=window.location.href.includes("renew-application-details");window.location.href.includes("edit-application-details")&&(O=!0);const R=e=>{let t=[];return e.split("/").map(e=>{t.push({i18nKey:"SCORE_"+e,code:e})}),t};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px",maxWidth:"950px"}},l.createElement("div",{className:"fieldInspectionWrapper"},(null==d?void 0:d.length)>1?l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"-6px"},fill:1!=d.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>s(i)}):null,l.createElement(o.CardSectionHeader,null,(null==d?void 0:d.length)>1?p("BPA_FI_REPORT")+"-"+(r+1):""+p("BPA_FI_REPORT")),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},p("BPA_FI_DATE_LABEL")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionDate",rules:{required:p("REQUIRED_FIELD")},control:C,render:e=>l.createElement(o.DatePicker,{date:e.value,name:"InspectionDate",onChange:e.onChange})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"0px",width:"100%"},className:"card-label-smaller"},p("ES_COMMON_TIME")+" * "),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{name:"InspectionTime",rules:{required:p("REQUIRED_FIELD")},control:C,render:e=>l.createElement(o.TextInput,{name:"InspectionTime",type:"time",value:e.value,onChange:e.onChange})}))),l.createElement(o.CardSectionHeader,null,p("BPA_CHECK_LIST_DETAILS")),b&&b.map((e,t)=>l.createElement("div",{key:t,className:"fieldInsepctionInsideWrapper",style:{maxWidth:"100%"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},p(e.question)+"*"),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:C,name:"question_"+t,rules:{required:p("REQUIRED_FIELD")},render:n=>l.createElement(o.Dropdown,{className:"form-field",style:{width:"100%",maxWidth:"100%"},selected:I("question"+t),disable:!1,option:R(e.fieldType),select:e=>{var t;if((null==n||null===(t=n.value)||void 0===t?void 0:t.code)==(null==e?void 0:e.code))return!0;n.onChange(e)},optionKey:"i18nKey",onBlur:n.onBlur,t:p})}))),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginRight:"30px",width:"100%"},className:"card-label-smaller"},p("BPA_ENTER_REMARKS")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(a.Controller,{control:C,name:"Remarks_"+t,defaultValue:null==i?void 0:i.uomValue,render:e=>l.createElement(o.TextInput,{value:I("Remarks"+t),onChange:t=>{e.onChange(t)},onBlur:e.onBlur})}))))),l.createElement(o.CardSectionHeader,{style:{marginTop:"20px"}},p("BPA_FIELD_INSPECTION_DOCUMENTS")),l.createElement(Pn,{t:p,config:m,onSelect:E,userType:f,formData:v,setError:_,clearErrors:g,formState:A,index:r,setFieldReports:c,documentList:y}))))},Bn=e=>l.createElement("h1",{className:"heading-m"},e.label),On=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Rn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(On,null)),xn=e=>{var n,i;let{t:a,action:r,tenantId:d,closeModal:c,submitAction:p,applicationData:v,businessService:m,moduleCode:E}=e;const{data:f,isLoading:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:g,data:A}=Digit.Hooks.pt.useMDMS(d,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[S,h]=t.useState({}),[b,y]=t.useState({}),[C,T]=t.useState([]),[D,P]=t.useState(null),[I,N]=t.useState(null),[L,B]=t.useState(null),[O,R]=t.useState(null),[x,w]=t.useState([]),[M,k]=t.useState(null),[F,U]=t.useState(!1);function H(e){N(e.target.files[0])}return t.useEffect(()=>{var e;A&&A["egf-master"]&&w(null===(e=A["egf-master"])||void 0===e?void 0:e.FinancialYear)},[A]),t.useEffect(()=>{var e;T(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),t.useEffect(()=>{!function(){try{R(null);const e=function(){if(I){const e=function(){if(I.size>=5242880)R(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",I,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?B(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):R(a("CS_FILE_UPLOAD_ERROR"))})},function(){R(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)}}()},[I]),t.useEffect(()=>{r&&h(null!=r&&r.showFinancialYearsModal?(e=>{let{t:t,action:n,financialYears:i,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+n.action+"_APPLICATION",submit:"WF_PT.CREATE_"+n.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:t("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(o.RadioButtons,{options:i,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:x,selectedFinancialYear:M,setSelectedFinancialYear:k}):(e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==i?void 0:i.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:n(p||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_PT_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,hintText:n("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:C,selectedApprover:D,setSelectedApprover:P,selectFile:H,uploadedFile:L,setUploadedFile:B,businessService:m}))},[r,C,x,M,L]),r&&S.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Bn,{label:a(S.label.heading)}),headerBarEnd:l.createElement(Rn,{onClick:c}),actionCancelLabel:a(S.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(S.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!M:_||(null==r?void 0:r.docUploadRequired)&&!L,formId:"modal-action"},g?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:S.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"};v.creationReason="STATUS",p({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:u({},v,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)p({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==v?void 0:v.propertyId,tenantId:d,source:null==v?void 0:v.source,channel:null==v?void 0:v.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:E};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],L&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==I?void 0:I.name,fileStoreId:L}]),p({Property:u({},v,{workflow:t})})}},defaultValues:b,formId:"modal-action"})):l.createElement(o.Loader,null)},wn=e=>l.createElement("h1",{className:"heading-m"},e.label),Mn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Mn,null)),Fn=e=>{var n,i;let{t:a,action:r,tenantId:d,closeModal:c,submitAction:p,applicationData:v,businessService:m}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:_}=Digit.Hooks.pt.useMDMS(d,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[g,A]=t.useState({}),[S,h]=t.useState({}),[b,y]=t.useState([]),[C,T]=t.useState({}),[D,P]=t.useState(null),[I,N]=t.useState(null),[L,B]=t.useState(null),[O,R]=t.useState([]),[x,w]=t.useState(null);t.useEffect(()=>{var e;_&&_["egf-master"]&&R(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]);const{data:M}=Digit.Hooks.useCustomMDMS(d,"common-masters",[{name:"Department"}]);function k(e){P(e.target.files[0])}return t.useEffect(()=>{if(E&&M){var e;const t=M["common-masters"].Department;y(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var l,n,i;const o=null==e||null===(l=e.assignments)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.department,a=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",a),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==a?void 0:a.name)}}))}},[E]),t.useEffect(()=>{!function(){try{B(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)B(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,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?N(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(a("CS_FILE_UPLOAD_ERROR"))})},function(){B(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]),t.useEffect(()=>{r&&A((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==n?void 0:n.action)&&"APPROVE"!=(null==n?void 0:n.action)||(p=!1),n.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==n?void 0:n.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:p?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:b,selectedApprover:C,setSelectedApprover:T,selectFile:k,uploadedFile:I,setUploadedFile:N,businessService:m}))},[r,b,O,x,I]),r&&g.form?l.createElement(o.Modal,{headerBarMain:l.createElement(wn,{label:a(g.label.heading)}),headerBarEnd:l.createElement(kn,{onClick:c}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,wfDocuments:I?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:I}]:null}),p({Licenses:[v]})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},Un=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Hn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Wn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Hn,null)),jn=e=>{var n,i;let{t:a,action:r,tenantId:d,closeModal:c,submitAction:p,applicationData:v,businessService:m}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState({}),[T,D]=t.useState(null),[P,I]=t.useState(null),[N,L]=t.useState(null),B=!!Digit.Utils.browser.isMobile();function O(e){D(e.target.files[0])}return t.useEffect(()=>{var e;b(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]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[T]),t.useEffect(()=>{r&&g((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==n?void 0:n.action)&&(v=!1),n.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+(null==c?void 0:c.toUpperCase())+"_"+(null==n?void 0:n.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?t("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?t("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(o.Dropdown,{option:i,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:t("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:d?"1 "+t("ES_PT_ACTION_FILEUPLOADED"):t("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:O,uploadedFile:P,setUploadedFile:I,businessService:m,error:N}))},[r,h,P,N]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Un,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Wn,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:B?{width:"720px"}:{},style:B?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:B?{paddingLeft:"5px"}:{}},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v=u({},v,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null,wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:null}),p({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},zn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Yn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Gn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yn,null)),Kn=e=>{var n,i,a,d,c,p,v,m,E,f,_,g;let{t:A,action:S,tenantId:h,closeModal:b,submitAction:y,applicationDetails:C,applicationData:T,businessService:D,workflowDetails:P,blockReason:I}=e;console.log("applicationData",T),console.log("workflowDetails",P),Digit.Hooks.obps.useObpsAPI(null!==(n=T)&&void 0!==n&&null!==(i=n.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(d=T)||void 0===d||null===(c=d.landInfo)||void 0===c||null===(p=c.address)||void 0===p?void 0:p.city:h,!1);const{data:N,isLoading:L}=Digit.Hooks.useEmployeeSearch(h,{roles:null==P||null===(v=P.data)||void 0===v||null===(m=v.initialActionState)||void 0===m||null===(E=m.nextActions)||void 0===E||null===(f=E.filter(e=>(null==e?void 0:e.action)==(null==S?void 0:S.action)))||void 0===f||null===(_=f[0])||void 0===_||null===(g=_.assigneeRoles)||void 0===g?void 0:g.map(e=>({code:e})),isActive:!0},{enabled:!(null!=S&&S.isTerminateState)}),[B,O]=(r.useQueryClient(),t.useState({})),[R,x]=t.useState({}),[w,M]=t.useState([]),[k,F]=t.useState([]),[U,H]=t.useState({}),[W,j]=t.useState({}),[z,Y]=t.useState(null),[G,K]=t.useState(null),[V,q]=t.useState(null),[X,J]=t.useState(null),Z=!!Digit.Utils.browser.isMobile();function $(e){Y(e.target.files[0])}t.useEffect(()=>{var e;M(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]),t.useEffect(()=>{!function(){try{q(null);const e=function(){if(z){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(z.size>=5242880)q(A("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=z&&z.type&&!e.test(null==z?void 0:z.type))q(A("NOT_SUPPORTED_FILE_TYPE"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",z,Digit.ULBService.getStateId()||(null==h?void 0:h.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?K(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):q(A("CS_FILE_UPLOAD_ERROR"))})},function(){q(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)}}()},[z]);const Q=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},ee=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},te=e=>{var t,l;let n=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.fieldinspection_pending)||void 0===l?void 0:l.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(n=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=n)||void 0===a?void 0:a.length)>0&&n.map((e,t)=>{i.push({docs:Q(e.Documents),date:e.InspectionDate,questions:ee(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},le=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),l=[];return t.map(e=>{var t,n,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.values)||void 0===i?void 0:i.length)>0&&(l=[...l,...null==e||null===(o=e.uploadedDocuments)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.values]),(null==e||null===(r=e.newUploadedDocs)||void 0===r?void 0:r.length)>0&&(l=[...l,...null==e?void 0:e.newUploadedDocs])}),l},ne=()=>{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 t.useEffect(()=>{F(null==I?void 0:I.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),S&&O((e=>{var t,n,i,a,r,u,d;let{t:s,action:c,approvers:p,selectedApprover:v,setSelectedApprover:m,selectedBlockReason:E,setBlockReason:f,selectFile:_,uploadedFile:g,setUploadedFile:A,assigneeLabel:S,businessService:h,error:b,blockReasonFiltered:y}=e,C=!1;return"REVOCATE"!=(null==c?void 0:c.action)&&"REJECT"!=(null==c?void 0:c.action)&&"SKIP_PAYMENT"!=c.action&&"SEND_BACK_TO_CITIZEN"!=(null==c?void 0:c.action)&&"APPROVE"!=(null==c?void 0:c.action)||(C=!0),{label:{heading:"WF_"+(null==c?void 0:c.action)+"_APPLICATION",submit:"WF_"+h+"_"+(null==c?void 0:c.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(t=c.state)||void 0===t?void 0:t.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(n=c.state)||void 0===n?void 0:n.state)?null:s(S||"WF_ROLE_"+(null===(i=c.assigneeRoles)||void 0===i?void 0:i[0])),type:"dropdown",populators:c.isTerminateState||C||"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(a=c.state)||void 0===a?void 0:a.state)||"FORWARD"==(null==c?void 0:c.action)&&"FIELDINSPECTION_PENDING"==(null==c||null===(r=c.state)||void 0===r?void 0:r.state)?null:l.createElement(o.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:v})},{label:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(u=c.state)||void 0===u?void 0:u.state)?s("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==c?void 0:c.action)&&"PENDINGAPPROVAL"==(null==c||null===(d=c.state)||void 0===d?void 0:d.state)?l.createElement(o.Dropdown,{option:y,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:f,selected:E,isMandatory:!0}):null},{label:s("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+s("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:_,onDelete:()=>{A(null)},message:g?"1 "+s("ES_PT_ACTION_FILEUPLOADED"):s("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:A,action:S,approvers:w,selectedApprover:U,setSelectedApprover:H,selectedBlockReason:W,setBlockReason:j,selectFile:$,uploadedFile:G,setUploadedFile:K,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:V,blockReasonFiltered:k}))},[S,w,X,G,V]),S&&B.form?l.createElement(o.Modal,{headerBarMain:l.createElement(zn,{label:A(B.label.heading)}),headerBarEnd:l.createElement(Gn,{onClick:b}),actionCancelLabel:A(B.label.cancel),actionCancelOnSubmit:b,actionSaveLabel:A(B.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Z?{width:"720px"}:{},style:Z?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Z?{paddingLeft:"5px"}:{}},L?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:B.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,l,n,i,o,a,r,d,s,c,p,v,m,E,f,_,g,D,I,N,L,B,O,R,x,w,M;T=u({},T,{documents:le(),additionalDetails:u({},null===(t=T)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:te(T),pendingapproval:ne(),blockingReason:null==W?void 0:W.name}),workflow:{action:null==S?void 0:S.action,comment:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,assignee:"FIELDINSPECTION_INPROGRESS"===(null==P||null===(i=P.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(a=o[0])||void 0===a||null===(r=a.state)||void 0===r?void 0:r.applicationStatus)?[null==P||null===(d=P.data)||void 0===d||null===(s=d.processInstances)||void 0===s||null===(c=s[0])||void 0===c||null===(p=c.assigner)||void 0===p?void 0:p.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==P||null===(v=P.data)||void 0===v||null===(m=v.processInstances)||void 0===m||null===(E=m[0])||void 0===E||null===(f=E.state)||void 0===f?void 0:f.applicationStatus)?[null==P||null===(_=P.data)||void 0===_||null===(g=_.processInstances)||void 0===g||null===(D=g[0])||void 0===D||null===(I=D.assigner)||void 0===I?void 0:I.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:G?[{documentType:(null==S?void 0:S.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:G}]:null},action:null==S?void 0:S.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==P||null===(N=P.data)||void 0===N||null===(L=N.processInstances)||void 0===L||null===(B=L[0])||void 0===B||null===(O=B.state)||void 0===O?void 0:O.applicationStatus)?[null==P||null===(R=P.data)||void 0===R||null===(x=R.processInstances)||void 0===x||null===(w=x[0])||void 0===w||null===(M=w.assigner)||void 0===M?void 0:M.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:G?[{documentType:(null==S?void 0:S.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:G}]:null});const k=function(e,t,l,n,i,o,a,r,d,s,c,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=T)||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===(n=T)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(a=T)||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===(s=T)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(p=c.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS))){var v,m,E;T.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",T.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",T.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",T.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),T.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==C||null===(v=C.nocData)||void 0===v?void 0:v.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let t={sourceRefId:null==e||null===(m=e[0])||void 0===m||null===(E=m.Noc)||void 0===E?void 0:E.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(h,t)).then(function(t){var l;let n=!0,i=!0;null==t||null===(l=t.Noc)||void 0===l||l.map(e=>{var t,l,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(l=e.applicationStatus)||void 0===l?void 0:l.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,l,a,r,u,d,s,c,p,v,m,E;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(l=t.applicationStatus)||void 0===l?void 0:l.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===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==T.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?y({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(b(),alert(A("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else y({BPA:T},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}b(),alert(A("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(k&&k.then?k.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:R,formId:"modal-action"})):l.createElement(o.Loader,null)},Vn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),qn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qn,null)),Jn=e=>{var n,a;let{t:d,action:c,tenantId:p,closeModal:v,submitAction:m,applicationData:E,businessService:f}=e;const{data:_,isLoading:g}=Digit.Hooks.useEmployeeSearch(p,{roles:null==c||null===(n=c.assigneeRoles)||void 0===n||null===(a=n.map)||void 0===a?void 0:a.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),[A,S]=(r.useQueryClient(),t.useState({})),[h,b]=t.useState({}),[y,C]=t.useState([]),[T,D]=t.useState({}),[P,I]=t.useState(null),[N,L]=t.useState(null),[B,O]=t.useState(null),R=!!Digit.Utils.browser.isMobile();function x(e){I(e.target.files[0])}return i.useHistory(),t.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),t.useEffect(()=>{!function(){try{O(null);const e=function(){if(P){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(P.size>=5242880)O(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=P&&P.type&&!e.test(null==P?void 0:P.type))O(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",P,Digit.ULBService.getStateId()||(null==p?void 0:p.split(".")[0]))).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?L(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):O(d("CS_FILE_UPLOAD_ERROR"))})},function(){O(d("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[P]),t.useEffect(()=>{c&&S((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:p,businessService:v,error:m}=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:n(p||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||f?null:l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:n("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:E,populators:{name:"comments"}},{label:""+n("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:d,onDelete:()=>{c(null)},showHint:!0,message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:d,action:c,approvers:y,selectedApprover:T,setSelectedApprover:D,selectFile:x,uploadedFile:N,setUploadedFile:L,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:B}))},[c,y,N,B]),c&&A.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Vn,{label:d(A.label.heading)}),headerBarEnd:l.createElement(Xn,{onClick:v}),actionCancelLabel:d(A.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:d(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},g?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:A.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=E)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.length)>0?[...null===(n=E)||void 0===n?void 0:n.documents]:[];i.map((e,t)=>{o.push(e)}),E=u({},E,{workflow:{action:null==c?void 0:c.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:N?[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:N}]:null},documents:o}),m({Noc:E},!1,{isNoc:!0})},defaultValues:h,formId:"modal-action"})):l.createElement(o.Loader,null)},Zn=e=>l.createElement("h1",{className:"heading-m"},e.label),$n=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Qn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($n,null)),ei=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}},ti=e=>{var n,i;let{t:a,action:r,tenantId:d,closeModal:c,submitAction:p,applicationData:v,businessService:m}=e;const{data:E,isLoading:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState({}),[T,D]=t.useState(null),[P,I]=t.useState(null),[N,L]=t.useState(null),B=window.Digit.Utils.browser.isMobile(),O=window.location.href.includes("/employee");function R(e){D(e.target.files[0])}return t.useEffect(()=>{var e;b(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]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",T,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[T]),t.useEffect(()=>{var e,t,n,i;"DisconnectWSConnection"==(null===(e=v)||void 0===e||null===(t=e.processInstance)||void 0===t?void 0:t.businessService)||"DisconnectSWConnection"==(null===(n=v)||void 0===n||null===(i=n.processInstance)||void 0===i?void 0:i.businessService)?r&&g((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:d,selectFile:s,uploadedFile:c,setUploadedFile:p,businessService:v,error:m}=e,E=!0,f=!1;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.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?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:E?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:E?l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:d,selected:r}):null},f&&{label:n("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!f,type:"custom",populators:f?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,t)=>l.createElement(o.DatePicker,u({onChange:e.onChange,date:e.value},t))}:null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:P,setUploadedFile:I,businessService:m,error:N})):r&&g((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,businessService:p,error:v}=e,m=!0;return(null!=i&&null!==(t=i.action)&&void 0!==t&&t.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==i?void 0:i.action))&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(o.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(o.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:d,onDelete:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:P,setUploadedFile:I,businessService:m,error:N}))},[r,h,P,N]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Zn,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Qn,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:B&&O?{width:"100%",height:"auto"}:{}},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,s,c,m,E;if(null!==(t=v)&&void 0!==t&&t.isBillAmend){var f,_,g,A,S,h,b,C,D;const t=u({},null===(f=v)||void 0===f||null===(_=f.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),l=u({},null===(g=v)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(A=v)||void 0===A||null===(S=A.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:d,businessService:null!==(h=v)&&void 0!==h&&null!==(b=h.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=v)&&void 0!==C&&null!==(D=C.applicationType)&&void 0!==D&&D.includes("WATER")?"WS":"SW",assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]}});p({AmendmentUpdate:l})}else{if(v=u({},v,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=y&&y.uuid?[null==y?void 0:y.uuid]:[],assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:null,processInstance:u({},null===(l=v)||void 0===l?void 0:l.processInstance,{action:null==r?void 0:r.action,assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]:[]})}),null!=e&&e.date&&null!==(n=v)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=pt(null==e?void 0:e.date);v.disconnectionExecutionDate=ei(t)}else if(null!=e&&e.date){const t=pt(null==e?void 0:e.date);v.connectionExecutionDate=ei(t)}var I;if("DisconnectWSConnection"==(null===(o=v)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=v)||void 0===s||null===(c=s.processInstance)||void 0===c?void 0:c.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(I=v)||void 0===I?void 0:I.serviceType)?p({WaterConnection:v,disconnectRequest:!0}):p({SewerageConnection:v,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=v)||void 0===m?void 0:m.applicationType))p({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(E=v)||void 0===E?void 0:E.applicationType))p({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!0});else{var N,L,B,O,R,x,w,M,k,F,U,H,W;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(N=t.value)&&void 0!==N&&N.adhocPenalty&&(v.additionalDetails.adhocPenalty=parseInt(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenalty)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocPenaltyComment&&(v.additionalDetails.adhocPenaltyComment=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(v.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocRebate&&(v.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateComment&&(v.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(v.additionalDetails.adhocRebateReason=(null==t||null===(H=t.value)||void 0===H?void 0:H.adhocRebateReason)||""),"WATER"==(null===(W=v)||void 0===W?void 0:W.serviceType)?p({WaterConnection:v,disconnectRequest:!1,reconnectRequest:!1}):p({SewerageConnection:v,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},li=e=>l.createElement("h1",{className:"heading-m"},e.label),ni=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ii=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ni,null)),oi=e=>{var n,i;let{t:a,action:r,tenantId:d,closeModal:c,submitAction:p,applicationData:v,businessService:m,moduleCode:E}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState(null),[T,D]=t.useState(null),[P,I]=t.useState(null),[N,L]=t.useState(null),[B,O]=t.useState(!1);function R(e){D(e.target.files[0])}return t.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[T]),t.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:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:P,setUploadedFile:I,businessService:m}))},[r,h,P]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(li,{label:a(_.label.heading)}),headerBarEnd:l.createElement(ii,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:_.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"};v.creationReason="CREATE",p({PetRegistrationApplications:[u({},v,{workflow:t})]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:E};t.assignes=null!=r&&r.isTerminateState||!y?[]:[y],P&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]),p({PetRegistrationApplications:[u({},v,{workflow:t})]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},ai=e=>l.createElement("h1",{className:"heading-m"},e.label),ri=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ui=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ri,null)),di=e=>{var n,i,a;let{t:r,action:d,closeModal:s,submitAction:c,applicationData:p,businessService:v}=e;const m=Digit.ULBService.getStateId(),{data:E,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(m,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==E||null===(n=E.TradeLicense)||void 0===n?void 0:n.TradeType),console.log("applicationData",p);const[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState(""),[T,D]=t.useState([]),[P,I]=t.useState(null),N=null===(i=p)||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a?void 0:a.tradeUnits;console.log("tradeUnits",N);const L=t.useMemo(()=>{var e;if(f||!E||!N.length)return[];const t=new Set(N.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,N]);return console.log("years",L),t.useEffect(()=>{d&&g((e=>{let{t:t,action:n,years:i,selectedApprover:a,setSelectedApprover:r,businessService:u}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==n?void 0:n.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:t("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:i,autoComplete:"off",select:r,selected:a})}]}]}})({t:r,action:d,years:L,selectedApprover:y,setSelectedApprover:C,businessService:v}))},[d,L,T,P]),d&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(ai,{label:r(_.label.heading)}),headerBarEnd:l.createElement(ui,{onClick:s}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let l=null===(t=p)||void 0===t?void 0:t.financialYear;const n=null==l?void 0:l.split("-")[1],i="20"+Number(n)+"-"+(Number(n)+1);p=u({},p,{financialYear:i,action:"INITIATE",additionalDetail:u({},p.additionalDetail,{validityYears:y.length>0?parseInt(y):""})}),c({Licenses:[p]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},si=e=>l.createElement("h1",{className:"heading-m"},e.label),ci=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ci,null)),vi=e=>{var n,i;let{t:a,action:r,tenantId:d,closeModal:c,submitAction:p,applicationData:v,businessService:m,moduleCode:E}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState(null),[T,D]=t.useState(null),[P,I]=t.useState(null),[N,L]=t.useState(null),[B,O]=t.useState(!1);function R(e){O(!0),D(e.target.files[0])}return t.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var l=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",T,d)).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):L(a("CS_FILE_UPLOAD_ERROR"))})},function(){L(a("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}(0,function(e,t){if(O(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),console.log("actyhdesh,jhfsefsef",r,v),t.useEffect(()=>{g((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:d,setSelectedApprover:s,isUploading:c}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",c),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"SV_"+(null==n?void 0:n.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==n?void 0:n.action)||"REJECT"===(null==n?void 0:n.action)||"SENDBACKTOCITIZEN"===(null==n?void 0:n.action)?"":{label:t("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(o.Dropdown,{option:u,t:t,optionKey:"name",select:s,selected:d})},{label:t("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:t("SV_ATTATCH_FILE")+(n.docUploadRequired?" *":""),populators:l.createElement(o.UploadFile,{id:"workflow-doc-sv",onUpload:i,onDelete:()=>{r(null)},message:c?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):a?"1 "+t("SV_FILE_UPLOADED"):t("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:P,setUploadedFile:I,businessService:m,isUploading:B}))},[r,h,P]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(si,{label:a(_.label.heading)}),headerBarEnd:l.createElement(pi,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:_.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:m,moduleName:E,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==v||null===(t=v.auditDetails)||void 0===t?void 0:t.createdBy]:null!=y&&y.uuid?[null==y?void 0:y.uuid]:null};P&&(l.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:P}]),p({streetVendingDetail:u({},v,{workflow:l})})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},mi=e=>l.createElement("h1",{className:"heading-m"},e.label),Ei=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),fi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ei,null)),_i=e=>{var n,i;let{t:a,action:r,tenantId:d,closeModal:c,submitAction:p,applicationData:v,businessService:m,moduleCode:E}=e;console.log("applicationData",v);const{data:f}=Digit.Hooks.useEmployeeSearch(d,{roles:null==r||null===(n=r.assigneeRoles)||void 0===n||null===(i=n.map)||void 0===i?void 0:i.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[_,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,C]=t.useState(null),[T,D]=t.useState(null),[P,I]=t.useState(null),[N,L]=t.useState(null),[B,O]=t.useState(!1);function R(e){D(e.target.files[0])}return t.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=s(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,Digit.ULBService.getStateId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.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)}}()},[T]),t.useEffect(()=>{r&&g((e=>{let{t:t,action:n,selectFile:i,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==n?void 0:n.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:t("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:t("ES_CHB_ATTACH_FILE")+(n.docUploadRequired?" *":""),populators:l.createElement(o.UploadFile,{id:"workflow-doc",onUpload:i,onDelete:()=>{r(null)},showHint:!0,hintText:t("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+t("ES_CHB_ACTION_FILEUPLOADED"):t("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:C,selectFile:R,uploadedFile:P,setUploadedFile:I,businessService:m}))},[r,h,P]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(mi,{label:a(_.label.heading)}),headerBarEnd:l.createElement(fi,{onClick:c}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:_.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:m,moduleName:E};P&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:P}]),p({hallsBookingApplication:[u({},v,{workflow:t})]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},gi=e=>l.createElement("h1",{className:"heading-m"},e.label),Ai=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Si=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ai,null)),hi=e=>{var n,a,r;let{t:d,action:s,tenantId:c,closeModal:p,submitAction:v,applicationData:m,businessService:E,moduleCode:f}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(n=s.roles)||void 0===n||null===(a=n[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),g=i.useHistory(),[A,S]=t.useState({}),[h,b]=t.useState({}),[y,C]=t.useState([]),[T,D]=t.useState(null),[P,I]=t.useState(null);return t.useEffect(()=>{var e;C(null==_||null===(e=_.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[_]),t.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):S((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:d,action:s,approvers:y,selectedApprover:T,setSelectedApprover:D,uploadedFile:P,setUploadedFile:I,businessService:E}))},[s,y,P]),s&&A.form?l.createElement(o.Modal,{headerBarMain:l.createElement(gi,{label:d(A.label.heading)}),headerBarEnd:l.createElement(Si,{onClick:p}),actionCancelLabel:d(A.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:d(A.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(o.FormComposer,{config:A.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:E,moduleName:f};P&&(t.documents=[]),v({Asset:u({},m,{workflow:t})})},defaultValues:h,formId:"modal-action"})):l.createElement(o.Loader,null)},bi=e=>null!=e&&e.businessService.includes("PT")?l.createElement(xn,e):null!=e&&e.businessService.includes("ptr")?l.createElement(oi,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(Fn,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(di,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(jn,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Kn,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Jn,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(ti,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(vi,e):null!=e&&e.businessService.includes("chb")?l.createElement(_i,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(hi,e):void 0,yi=e=>{var n,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:d}=e;const s=(null==r?void 0:r.status)||"",c=(null==d||null===(n=d.data)||void 0===n?void 0:n.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=t.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,f]=t.useState(null),[_,g]=t.useState([]),[A,S]=t.useState(!0),[h,b]=t.useState(!1),[y,C]=t.useState(!1),{isLoading:T,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:P,data:I}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,l;return e.WFState==(null==r?void 0:r.status)?null==r?void 0:r.status:e.RiskType==(null==r?void 0:r.riskType)&&e.ServiceType==(null==r||null===(t=r.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==r||null===(l=r.additionalDetails)||void 0===l?void 0:l.applicationType)}));let d=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{var t,l,n,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==I||null===(t=I["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,o.length);o===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(n=u[0])||void 0===n||null===(i=n.values)||void 0===i||i.map(t=>{var l,n;o===(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[0])+"."+(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),d.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)),g(d)},[!T,!P]),t.useEffect(()=>{let e=0;_.map(t=>{let l=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(l=!0)}),!l&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,h]),t.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==_?void 0:_.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Ci,{key:t,index:t,document:e,t:o,error:E,setError:f,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:_,checkEnablingDocs:y}))))};function Ci(e){var n,i;let{t:a,document:r,setDocuments:d,documents:s,index:c,bpaTaxDocuments:p,checkEnablingDocs:v}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],E=Digit.ULBService.getStateId(),[f,_]=t.useState(m?u({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[g,A]=t.useState(null),[S,h]=t.useState(()=>(null==m?void 0:m.fileStoreId)||null),[b,y]=t.useState([]);return t.useEffect(()=>{null!=f&&f.code&&d(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==S?void 0:S.length)||null===S?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==f?void 0:f.code,fileStoreId:S,documentUid:S,fileName:(null==g?void 0:g.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[S,f]),t.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],b.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})}),p[c]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[b,f]),t.useEffect(()=>{},[g]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(o.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)&&l.createElement(Yl,{documents:null==r?void 0:r.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),v?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(o.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:f,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(o.LabelFieldPair,{style:{width:"100%"}},l.createElement(o.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:E,getFormState:e=>((e,t)=>{let l=Object.fromEntries(t),n=Object.values(l);var i;0!==Object.keys(l).length&&y(n),(i=n[n.length-1])&&A(i.file)})(0,e),t:a,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Ti(e){let{t:n,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],c=Digit.ULBService.getStateId(),[p,v]=t.useState(),[m,E]=t.useState(null),[f,_]=t.useState(()=>(null==d?void 0:d.fileStoreId)||null);return t.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==f?void 0:f.length)||null===f?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==m?void 0:m.name)||""}]})},[f]),t.useEffect(()=>{!function(){try{r(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)r(n("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))r(n("NOT_SUPPORTED_FILE_TYPE"));else{const e=s(function(){return _(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,Digit.ULBService.getStateId())).then(function(e){var t,l,i,o;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?_(null==e||null===(i=e.data)||void 0===i||null===(o=i.files[0])||void 0===o?void 0:o.fileStoreId):r(n("CS_FILE_UPLOAD_ERROR"))})},function(){r(n("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)}}()},[m]),l.createElement("div",{style:{}},l.createElement(o.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(o.CardLabel,{style:{width:"100%"}},null!=i&&i.required?n("TL_BUTTON_UPLOAD FILE")+"*":""+n("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"NOC",tenantId:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),l=Object.values(t);var n;(n=l[l.length-1])&&E(n.file)})(e),t:n,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Di=e=>{var n;let{t:i,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==d?void 0:d.status)||"",m=(null==c||null===(n=c.data)||void 0===n?void 0:n.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:f}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[g,A]=t.useState([]),[S,h]=t.useState([]),[b,y]=t.useState(!1),[C,T]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,P]=t.useState(null),I=window.location.href.includes("/employee/");return t.useEffect(()=>{var e;A(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),t.useEffect(()=>{var e,t,l;let n,i=[];var o,r,s,c;n=u?null==E||null===(o=E.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==f||null===(s=f.BPA)||void 0===s||null===(c=s.DocTypeMapping)||void 0===c?void 0:c.filter(e=>{var t,l;return e.WFState==(null==d?void 0:d.status)&&e.RiskType==(null==d?void 0:d.riskType)&&e.ServiceType==(null==d||null===(t=d.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==d||null===(l=d.additionalDetails)||void 0===l?void 0:l.applicationType)}),null!==(e=n)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(l=t.docTypes)&&void 0!==l&&l[0]&&(n[0].docTypes[0].nocType=n[0].nocType,n[0].docTypes[0].additionalDetails={submissionDetails:null==a?void 0:a.additionalDetails,applicationStatus:null==a?void 0:a.applicationStatus,appNumberLink:null==a?void 0:a.applicationNo,nocNo:null==a?void 0:a.nocNo},i.push(n[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.forEach(l=>{let n=l.code.slice(0,null==t?void 0:t.length);t===n&&(e.hasDropdown=!0,e.dropdownData.push(l))}),p.push(e)}),h(p))},[E,g]),t.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:I?""+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,t)=>{if(null!=e&&e.value)return l.createElement(o.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:I?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:I?""+i(null==e?void 0:e.title):i(null==e?void 0:e.title),text:i(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Yl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==S?void 0:S.map((e,t)=>l.createElement(Ti,{key:t,document:e,t:i,error:D,setError:P,setNocDocuments:T,nocDocuments:C,checkEnablingDocs:b}))))},Pi=e=>{let{permissions:n,t:i}=e;const[a,r,d]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==n?void 0:n.map(e=>({label:e,checked:!1}))),[s,c,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);t.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},i("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,t)=>l.createElement(o.CheckBox,{key:t,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?u({},e,{checked:n}):e))})(e,0,t),isLabelFirst:!0,index:t})),null==s?void 0:s.map((e,t)=>l.createElement("div",null,l.createElement(o.TextInput,{key:t,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{c(()=>null==s?void 0:s.map((l,n)=>{var i;return t===n?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:l}))})(e,t),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:i("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(o.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(t)}))),l.createElement(o.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function Ii(e){let{taxHeadEstimatesCalculation:t}=e;const{taxHeadEstimates:i}=t,{t:a}=n.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==i?void 0:i.map((e,t)=>l.createElement(o.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:t===(null==i?void 0:i.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(o.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(o.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==t?void 0:t.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function Ni(e){let{floors:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map(e=>{var t;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},i(null==e?void 0:e.title)),null==e||null===(t=e.values)||void 0===t?void 0:t.map((e,t)=>{var n;return l.createElement(l.Fragment,{key:t},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==t?"16px":"revert"}},i(e.title)),l.createElement(o.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title),text:i(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Li(e){let{owners:t}=e,i={};i=window.location.href.includes("/employee/pt/")?t.slice().reverse():t;const{t:a}=n.useTranslation(),r=(null==t?void 0:t.length)||1;let d={marginTop:"19px"},s={position:"relative",padding:"8px"},c={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?d={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(d={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(d=u({},d,{maxWidth:"950px"}),d=u({},d,{maxWidth:"950px"}),c={}),t.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)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},i.map((e,t)=>{var n;return l.createElement("div",{key:a(null==e?void 0:e.title),style:d,className:"owner-details-child"},l.createElement(o.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)+" "+(t+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return!0===e.map&&"N/A"!==e.value?l.createElement(o.Row,{key:a(e.title),label:a(e.title),text:l.createElement("img",{src:a(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(o.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const Bi=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Oi=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,p]=t.useState(!1),{t:v}=n.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(o.TelePhone,{mobile:u.mobileNumber,privacy:s}),l.createElement("p",null,"    ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(Bi,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(i=u.wfComment)||void 0===i?void 0:i.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},v("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!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?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{d(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function Ri(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(t+1)),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"N/A",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function xi(e){let{units:t}=e;const{t:i}=n.useTranslation();return l.createElement(l.Fragment,null,t.map((e,t)=>{var n;return l.createElement("div",{key:i(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(o.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},i(null==e?void 0:e.title)+" "+(t+1)),l.createElement(l.Fragment,{key:t},l.createElement(o.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,t)=>{var n;return l.createElement(o.Row,!0===e.map&&"N/A"!==e.value?{key:i(e.title),label:i(e.title),text:l.createElement("img",{src:i(e.value),alt:""})}:{key:i(e.title),label:i(e.title)+":",text:i(e.value)||"NA",last:t===(null==e||null===(n=e.values)||void 0===n?void 0:n.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const wi=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=n.useTranslation();let p=(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 m=null==p?void 0:p.mode;var{connectionDetails:E,plumberDetails:f,roadCuttingDetails:_,roadCuttingAddlDetails:g,activationDetails:A}=(null==s?void 0:s.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==s||null===(i=s.additionalDetails)||void 0===i?void 0:i.connectionDetails)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==E?void 0:E.map((e,t)=>l.createElement("div",null,l.createElement(o.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"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,t)=>l.createElement(o.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"!=m&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-details-new-value-wrapper"},null==_?void 0:_.map(e=>{var t;return l.createElement("div",{style:(null==_?void 0:_.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(t=e.values)||void 0===t?void 0:t.map(e=>l.createElement(o.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)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,t)=>l.createElement("div",null,l.createElement(o.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)&&l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},c("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==A?void 0:A.map((e,t)=>l.createElement(o.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:""})))))))},Mi=[{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"}],ki=[{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"}],Fi=e=>{var i,a,r,d;let{wsAdditionalDetails:s}=e;const{t:c}=n.useTranslation(),[p,v,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),A=!(null==s||null===(i=s.additionalDetails)||void 0===i||!i.isPaid),[S,h]=t.useState(!1),[b,y]=t.useState(p||{}),[C,T]=t.useState(null),[D,P]=t.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[I,N]=t.useState(s.additionalDetails.values?s.additionalDetails.values:[]),L=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(L,"BillingService",["TaxHeadMaster"]),t.useEffect(()=>{var e,t,n;const i=u({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,d,c,m,E;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(r=p.billDetails)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(c=p.billDetails)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.taxAmount)}];N(e),P(null==p||null===(E=p.billDetails)||void 0===E?void 0:E[0])}else v(i),y(i)},[]);let B={};const O=e=>l.createElement("h1",{className:"heading-m"},e.label),R=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),x=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(R,null)),w=function(e,t,l){void 0===t&&(t=!1);let n=u({},b);if("adhocPenalty"!=e&&"adhocRebate"!=e||!l.target.value)t?(n[e+"_data"]=l,n[e]=l.title,"PT_OTHERS"==l.title&&"adhocPenaltyReason"==e&&(n.adhocPenaltyComment=""),"PT_OTHERS"==l.title&&"adhocRebateReason"==e&&(n.adhocRebateComment="")):n[e]=l.target.value;else{var i,o;const t=0==(null==l||null===(i=l.target)||void 0===i?void 0:i.value)?1:Math.sign(null==l||null===(o=l.target)||void 0===o?void 0:o.value)||-1;n[e]=1==t?l.target.value:""}y(n)};return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},I&&l.createElement(o.StatusTable,null,l.createElement("div",null,null==I?void 0:I.map((e,t)=>l.createElement(o.Row,{className:"border-none",key:""+e.title,label:""+c(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(o.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+c("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(o.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+c("CS_INBOX_STATUS_FILTER"),text:c(A?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:A?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{h(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},c("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(o.Modal,{headerBarMain:l.createElement(O,{label:c("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(x,{onClick:()=>{y(p),h(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{y(p),h(!1)},actionSaveLabel:c("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,l=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var n,i;if(t||l)if(l>(null==s||null===(n=s.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))T({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,d,p,m,E,g,A,S;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(d=r.appDetails)||void 0===d?void 0:d.tenantId,l=u({},null==s||null===(p=s.additionalDetails)||void 0===p||null===(m=p.appDetails)||void 0===m?void 0:m.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==s||null===(E=s.additionalDetails)||void 0===E||null===(g=E.appDetails)||void 0===g?void 0:g.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(A=s.additionalDetails)||void 0===A||null===(S=A.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(n,i).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,p,m,E,g,A;(null==e||null===(l=e.Calculation)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(E=e.Calculation)||void 0===E||null===(g=E[0])||void 0===g||null===(A=g.taxHeadEstimates)||void 0===A||A.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.taxHeadEstimates,"category");const S=[{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===(p=c[0])||void 0===p?void 0:p.taxAmount}];f(pt(e.Calculation[0])),P(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),N(S),b.billDetails=null==e?void 0:e.Calculation,v(b),h(!1)}).catch(e=>{var t,l,n,i,o,a;T({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?c(""+(null==e||null===(i=e.response)||void 0===i||null===(o=i.data)||void 0===o||null===(a=o.Errors[0])||void 0===a?void 0:a.code)):c("PT_COMMON_ADD_REBATE_PENALITY")})})}else T({isError:!1,isWarning:!0,key:"warning",message:c("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_PENALTY")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:Mi,optionKey:"title",select:e=>w("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:c})),"PT_OTHERS"===(null==b||null===(r=b.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(o.CardLabel,null,c("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>w("adhocPenaltyComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")})))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>w("adhocPenalty",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(o.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(o.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},c("PT_AD_REBATE")),l.createElement(o.CardLabel,null,c("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(o.Dropdown,{isMandatory:!0,option:ki,optionKey:"title",select:e=>w("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==b||null===(d=b.adhocRebateReason_data)||void 0===d?void 0:d.title)&&l.createElement("div",{className:"field"},l.createElement(o.CardLabel,null,c("PT_REASON")),l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>w("adhocRebateComment",!1,e)},B={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:c("TL_NAME_ERROR_MESSAGE")}))),l.createElement(o.CardLabel,null,c("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>w("adhocRebate",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(o.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:c(null==C?void 0:C.message),onClose:()=>{T(!1)},isDleteBtn:!0})))},Ui=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},Hi=e=>{let{t:t,userType:n=!1,infoBannerLabel:i="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;n=n||Digit.SessionStorage.get("userType");const d=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:d?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(o.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},t(i))),t(a)+" ",l.createElement(Ui,{style:{display:"inline",marginBottom:"5px"}})," "+t(r),l.createElement("div",null," "+t(u)))))},Wi=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:p}=e;const{t:v}=n.useTranslation(),[m,E]=t.useState(!1),[f,_]=t.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),A=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),S=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(A,null));return l.createElement(t.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=p&&null!==(i=p.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=p.additionalDetails.data||{};const l=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),n=l?JSON.parse(l):{};null!=n&&null!==(e=n.value)&&void 0!==e&&e.totalAmount&&(t=null==n?void 0:n.value),_(t),E(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(o.Modal,{headerBarMain:l.createElement(g,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{E(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(o.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(o.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=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==f?void 0:f.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(o.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=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==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=>l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==f?void 0:f.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},ji={root:{width:"100%",marginTop:"2px",overflowX:"auto",boxShadow:"none"},table:{minWidth:700,backgroundColor:"rgba(250, 250, 250, var(--bg-opacity))"},cell:{maxWidth:"7em",minWidth:"1em",border:"1px solid #e8e7e6",padding:"4px 5px",fontSize:"0.8em",textAlign:"left",lineHeight:"1.5em"},cellHeader:{overflow:"hidden",textOverflow:"ellipsis"},cellLeft:{},cellRight:{}},zi=e=>{let{className:t="table",headers:i=[],values:o=[],arrears:a=0}=e;const{t:r}=n.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:ji.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:ji.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},ji.cell,ji.cellLeft,ji.cellHeader)},r("CS_BILL_PERIOD")),i.map((e,t)=>l.createElement("th",{style:u({},ji.cell,i.length==t+1?ji.cellRight:{},ji.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},ji.cell,ji.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),i.map((t,n)=>l.createElement("td",{style:u({},ji.cell,{textAlign:"left"},i.length==n+1?ji.cellRight:{},{whiteSpace:"pre"}),key:n,numeric:!0},n>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},ji.cell,ji.cellLeft)}),i.map((e,t)=>t==i.length-1?l.createElement("td",{style:u({},ji.cell,ji.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==i.length-2?l.createElement("td",{style:u({},ji.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:ji.cell,key:t,numeric:!0})))))))},Yi={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},Gi=e=>{var i,o,a;let{bill:r={}}=e;const{t:u}=n.useTranslation();let d={},s=(null==r||null===(i=r.billDetails)||void 0===i?void 0:i.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const c=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,l)=>e+t.amount,0))||0;let p="₹ "+((null==c||null===(a=c.toFixed)||void 0===a?void 0:a.call(c,0))||Number(0).toFixed(0));s.map(e=>{let t=function(e){var t,l,n;void 0===e&&(e={});let i={};const{billAccountDetails:o=[]}=e;return o.map(e=>{i[e.taxHeadCode]={value:e.amount,order:e.order}}),i.CS_BILL_NO={value:(null===(t=e)||void 0===t?void 0:t.billNumber)||"NA",order:-2},i.CS_BILL_DUEDATE={value:(null===(l=e)||void 0===l?void 0:l.expiryDate)&&new Date(null===(n=e)||void 0===n?void 0:n.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);d[((e,t)=>{const l=new Date(e),n=new Date(t);return n.getYear()-l.getYear()!=0?"FY"+(l.getYear()+1900)+"-"+(n.getYear()-100):l.toLocaleDateString()+"-"+n.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let v={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{v[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[t]);const[E,f]=t.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Yi.headerStyle},u("CS_ARREARS_DETAILS")),E&&l.createElement(zi,{headers:[...m],values:d,arrears:p}),!E&&l.createElement("div",{style:Yi.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!0)}},u("CS_SHOW_CARD"))),E&&l.createElement("div",{style:Yi.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{f(!1)}},u("CS_HIDE_CARD"))))},Ki=e=>{let{demandData:t,totalDemandTax:n,totalDemandPenality:i,totalCollectionTax:a,totalCollectionInterest:r,totalCollectionPenality:u,totalBalanceTax:d}=e;const s={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}};return l.createElement("div",null,l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:s.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:s.th},"Installments"),l.createElement("th",{colSpan:"3",style:s.th},"Demand"),l.createElement("th",{colSpan:"3",style:s.th},"Collection"),l.createElement("th",{colSpan:"3",style:s.th},"Balance"),l.createElement("th",{style:s.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:s.th}),l.createElement("th",{style:s.th},"Tax"),l.createElement("th",{style:s.th},"Interest"),l.createElement("th",{style:s.th},"Penalty"),l.createElement("th",{style:s.th},"Tax"),l.createElement("th",{style:s.th},"Interest"),l.createElement("th",{style:s.th},"Penalty"),l.createElement("th",{style:s.th},"Tax"),l.createElement("th",{style:s.th},"Interest"),l.createElement("th",{style:s.th},"Penalty"),l.createElement("th",{style:s.th},"Advance"))),l.createElement("tbody",null,null==t?void 0:t.map(e=>l.createElement("tr",null,l.createElement("td",{style:s.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:s.td},e.demandTax),l.createElement("td",{style:s.td},e.demandInterest),l.createElement("td",{style:s.td},e.demandPenality),l.createElement("td",{style:s.td},e.collectionTax),l.createElement("td",{style:s.td},e.collectionInterest),l.createElement("td",{style:s.td},e.collectionPenality),l.createElement("td",{style:s.td},e.balanceTax),l.createElement("td",{style:s.td},e.balanceInterest),l.createElement("td",{style:s.td},e.balancePenality),l.createElement("td",{style:s.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:s.th},"Total"),l.createElement("td",{style:s.td},n),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td},i),l.createElement("td",{style:s.td},a),l.createElement("td",{style:s.td},r),l.createElement("td",{style:s.td},u),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td})),l.createElement("tr",null,l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("th",{style:s.th},"Total"),l.createElement("td",{style:s.td},d),l.createElement("td",{style:s.td},"0"),l.createElement("td",{style:s.td},"0"),l.createElement("td",{style:s.td},"0")),l.createElement("tr",null,l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("td",{style:s.td}),l.createElement("th",{style:s.th},"Total Balance"),l.createElement("td",{style:s.td})))))};function Vi(e){var a,r,u,d,s,c,p,v,m,E,f,g,A,S;let{applicationDetails:h,demandData:b,workflowDetails:y,isDataLoading:C,applicationData:T,totalDemandTax:D,businessService:P,timelineStatusPrefix:I,showTimeLine:N=!0,statusAttribute:L="status",paymentsList:B,oldValue:O,isInfoLabel:R=!1}=e;const{t:x}=n.useTranslation();let w=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function M(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}console.log("appl",h);const[k,F]=t.useState({}),[U,H]=t.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==T?void 0:T.status)||U.loading||U.loaded||U.canLoad||H({loading:!1,loaded:!1,canLoad:!0}),null==U||!U.canLoad||U.loading||U.loaded||(H({loading:!0,loaded:!1,canLoad:!0}),function(e,t,l,n){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){l(a),n({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(l){if((null==i||null===(l=i.Assessments)||void 0===l?void 0:l.length)>0)return Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){a=e})}();return r&&r.then?r.then(o):o()})}catch(e){return Promise.reject(e)}}((null==T?void 0:T.tenantId)||tenantId,null==T?void 0:T.propertyId,F,H));const W=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()},j=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:W(null==T||null===(i=T.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==T?void 0:T.channel)||""};return l.createElement(Oi,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,d,s,c,p,v,m,E,f,g,A,S,b,y,C;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==h?void 0:h.tenantId,businessIds:null==h?void 0:h.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let l="";return l="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),l}}},D=n[t-1],P={date:null==e||null===(r=e.auditDetails)||void 0===r?void 0:r.lastModified,name:null==e||null===(u=e.assignes)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.name,mobileNumber:(null==T||null===(s=T.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid)&&null!=T&&null!==(E=T.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==T||null===(A=T.processInstance)||void 0===A||null===(S=A.assignes)||void 0===S||null===(b=S[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(y=e.assignes)||void 0===y||null===(C=y[0])||void 0===C?void 0:C.mobileNumber,comment:x(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Oi,{data:P,OpenImage:M,privacy:i})}{var D,P,I,N,L;const t={date:W(null==T||null===(D=T.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(P=e.assignes)||void 0===P||null===(I=P[0])||void 0===I?void 0:I.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(N=e.assignes)||void 0===N||null===(L=N[0])||void 0===L?void 0:L.mobileNumber};return l.createElement(Oi,{data:t})}},z=(e,t)=>e?t?e:x(e):x("NA"),Y=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),G=window.location.href.includes("employee/noc"),K=window.location.href.includes("employee/obps"),V=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),q=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?z(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+x(null==e?void 0:e.isUnit):x("N/A"):null!=e&&e.value?z(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):x("N/A"),[X,J]=t.useState(!1);console.log("demand Data arr",b);const Z=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),$=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),le=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceInterest,0),ie=null==b?void 0:b.reduce((e,t)=>e+t.balancePenality,0);return l.createElement(o.Card,{style:{position:"relative"},className:"employeeCard-override"},R?l.createElement(Hi,{t:x,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==h||null===(a=h.applicationDetails)||void 0===a?void 0:a.map((e,n)=>{var a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,b,C,T,D,P,I,N,L,R,M,F,U,H,W,j,z,X,J,Z,$,Q,ee,te,le,ne;return l.createElement(l.Fragment,{key:n},l.createElement("div",{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||window.location.href.includes("employee/ws")?{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:Y?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(o.CardSectionHeader,{style:0==n&&Y?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},G?""+x(e.title):x(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},x(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},x(e)))),null==e?void 0:e.tableRows.map((n,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(t.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{textAlign:"left"}},x(e))))):l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},x(e)))))),l.createElement(o.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||Y?{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((t,n)=>{var a,r,u;return!0===t.map&&"N/A"!==t.value?l.createElement(o.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:x(t.title),label:x(t.title),text:l.createElement("img",{src:x(t.value),alt:"",privacy:null==t?void 0:t.privacy})}):1==(null==t?void 0:t.isLink)?l.createElement(o.Row,{key:x(t.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},x(null==t?void 0:t.title)))):G||K?""+x(t.title):x(t.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==t?void 0:t.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==t?void 0:t.value))),last:n===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:t.caption,className:"border-none",rowContainerStyle:V(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(o.Row,{className:"border-none",key:""+t.title,label:""+x(""+t.title),privacy:null==t?void 0:t.privacy,text:null!=t&&t.oldValue?null==t?void 0:t.oldValue:null!=t&&t.value?null==t?void 0:t.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(o.Row,{key:x(t.title),label:x(t.title),text:q(t),last:n===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:t.caption,className:"border-none",privacy:null==t?void 0:t.privacy,rowContainerStyle:V(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===t.title?l.createElement(Gi,{bill:null===(r=k.Bill)||void 0===r?void 0:r[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.inspectionReport)&&l.createElement(vn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:B,additionalDetails:null==h||null===(u=h.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==h?void 0:h.applicationData}),(null==h||null===(d=h.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===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(pn,{fiReport:null==h||null===(v=h.applicationData)||void 0===v||null===(m=v.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors)&&l.createElement(Ni,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners)&&l.createElement(Li,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.units)&&l.createElement(xi,{units:null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(Ri,{units:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.accessories}),!w&&(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.permissions)&&(null==y||null===(D=y.data)||void 0===D||null===(P=D.nextActions)||void 0===P?void 0:P.length)>0&&l.createElement(Pi,{applicationData:null==h?void 0:h.applicationData,t:x,permissions:null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.permissions}),(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(yi,{t:x,applicationData:null==h?void 0:h.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:y})),(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.noc)&&l.createElement(Di,{t:x,isNoc:!0,NOCdata:e.values,applicationData:null==h?void 0:h.applicationData,docs:e.additionalDetails.noc,noc:null===(R=e.additionalDetails)||void 0===R?void 0:R.data,bpaActionsDetails:y}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.scruntinyDetails)&&l.createElement(vn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(vn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(cn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==h?void 0:h.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&l.createElement(Yl,{documents:null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documentsWithUrl}),(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documents)&&l.createElement(Kl,{documents:null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.documents}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation)&&l.createElement(Ii,{taxHeadEstimatesCalculation:null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(wi,{wsAdditionalDetails:e,oldValue:O}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(i.Link,{to:null==e||null===($=e.additionalDetails)||void 0===$||null===(Q=$.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(Fi,{wsAdditionalDetails:e,workflowDetails:y}),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Wi,{wsAdditionalDetails:e,workflowDetails:y}))}),N&&(null==y||null===(r=y.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(o.BreakLine,null),((null==y?void 0:y.isLoading)||C)&&l.createElement(o.Loader,null),!(null!=y&&y.isLoading)&&!C&&l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},x("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=y&&null!==(d=y.data)&&void 0!==d&&d.timeline&&1===(null==y||null===(s=y.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:x(""+I+(null==y||null===(p=y.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state)),customChild:j(null==y||null===(m=y.data)||void 0===m?void 0:m.timeline[0],null==y||null===(E=y.data)||void 0===E?void 0:E.timeline)}):l.createElement(o.ConnectingCheckPoints,null,(null==y||null===(f=y.data)||void 0===f?void 0:f.timeline)&&(null==y||null===(g=y.data)||void 0===g?void 0:g.timeline.slice(0,X?null==y?void 0:y.data.timeline.length:2).map((e,t,n)=>{var i;let a="";var r,u,d,s,c,p;return window.location.href.includes("/obps/")&&(a=null!=y&&null!==(r=y.data)&&void 0!==r&&null!==(u=r.timeline[t-1])&&void 0!==u&&null!==(d=u.state)&&void 0!==d&&d.includes("BACK_FROM")||null!=y&&null!==(s=y.data)&&void 0!==s&&null!==(c=s.timeline[t-1])&&void 0!==c&&null!==(p=c.state)&&void 0!==p&&p.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,info:e.comment,label:x(""+I+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[L])+a),customChild:j(e,t,null==y||null===(i=y.data)||void 0===i?void 0:i.timeline)}))}))),(null==y||null===(A=y.data)||void 0===A||null===(S=A.timeline)||void 0===S?void 0:S.length)>2&&l.createElement(o.LinkButton,{label:x(X?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{J(e=>!e)}})))),"PT"===P&&l.createElement(Ki,{demandData:b,totalDemandTax:D,totalDemandInterest:Z,totalDemandPenality:$,totalCollectionTax:Q,totalCollectionInterest:ee,totalCollectionPenality:te,totalBalanceTax:le,totalBalancePenality:ie,totalBalanceInterest:ne}))}function qi(e){var t,n,i,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S;let{t:h,showToast:b,closeToast:y,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var T;let e="";switch(null==b||null===(T=b.action)||void 0===T?void 0:T.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(t=b.error)||void 0===t?void 0:t.message:h("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:h("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:h("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:h("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:h("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:h("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(d=b.error)||void 0===d?void 0:d.message:h("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:h("ES_"+C+"_"+(null==b||null===(c=b.action)||void 0===c?void 0:c.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(o.Toast,{error:"error"===b.key,label:e,onClose:y}))}if(null!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let l=e[0];return l=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.includes("BPA_OC")?h(e[1]):h(e[0]),l};let t="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":t="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":t="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":t="error"===(null==b?void 0:b.key)?null==b||null===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":t="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":t="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:t="error"===(null==b?void 0:b.key)?null==b||null===(A=b.error)||void 0===A?void 0:A.message:h("ES_"+C+"_"+(null==b||null===(S=b.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(o.Toast,{error:"error"===b.key,label:t,onClose:y}))}{var P,I;const e="error"===(null==b?void 0:b.key)?null==b||null===(P=b.error)||void 0===P?void 0:P.message:"ES_"+C+"_"+(null==b||null===(I=b.action)||void 0===I?void 0:I.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(o.Toast,{error:"error"===b.key,label:h(e),onClose:y}))}}function Xi(e){var i,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h;let{workflowDetails:b,displayMenu:y,onActionSelect:C,setDisplayMenu:T,businessService:D,forcedActionPrefix:P,ActionBarStyle:I={},MenuStyle:N={}}=e;const{t:L}=n.useTranslation();let B=Digit.UserService.getUser();const O=t.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};B=null==t?void 0:t.value}const R=null===(i=B)||void 0===i||null===(a=i.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let x=!1,w=!1,M=(null==b||null===(d=b.data)||void 0===d||null===(s=d.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.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==b||null===(p=b.data)||void 0===p||null===(v=p.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 Digit.Hooks.useClickOutside(O,()=>{T(!1)},y),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==M?void 0:M.length)||null!=M&&null!==(m=M[0])&&void 0!==m&&null!==(E=m.redirectionUrl)&&void 0!==E&&E.pathname.includes("/pt/property-details/")&&1==(null==M?void 0:M.length)?(w=!1,x=!0):(null==M?void 0:M.length)>0&&(w=!0,x=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&w&&!x&&l.createElement(o.ActionBar,{style:u({},I)},y&&(null!=b&&null!==(f=b.data)&&void 0!==f&&null!==(_=f.actionState)&&void 0!==_&&_.nextActions||null!=b&&null!==(g=b.data)&&void 0!==g&&g.nextActions)?l.createElement(o.Menu,{localeKeyPrefix:P||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:M,optionKey:"action",t:L,onSelect:C,style:N}):null,l.createElement(o.SubmitBar,{ref:O,label:L("WF_TAKE_ACTION"),onSubmit:()=>T(!y)})),!(null!=b&&b.isLoading)&&!w&&x&&l.createElement(o.ActionBar,{style:u({},I)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==M||null===(A=M[0])||void 0===A?void 0:A.action,value:null==M||null===(S=M[0])||void 0===S?void 0:S.action,onClick:e=>{C((null==M?void 0:M[0])||{})}},L((P||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==M||null===(h=M[0])||void 0===h?void 0:h.action)))))}const Ji=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Zi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ji,null));function $i(e){let{action:t,closeWarningPopup:i}=e;const{t:a}=n.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(o.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Zi,{onClick:()=>{i()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(o.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==t?void 0:t.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(o.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==t?void 0:t.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(o.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:i,style:{marginLeft:"10px"}}),l.createElement(o.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==t||null===(e=t.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Qi=e=>{var a,d;console.log("props",e);let c=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const p=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:m}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:E}=n.useTranslation(),f=i.useHistory();let{id:_}=i.useParams();const[g,A]=t.useState(!1),[S,h]=t.useState(null),[b,y]=t.useState(!1),[C,T]=t.useState(!1),[D,P]=t.useState(!1),{data:I}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:N,demandData:L,totalDemandTax:B,totalBalanceTax:O,showToast:R,setShowToast:x,isLoading:w,isDataLoading:M,applicationData:k,mutate:F,nocMutation:U,workflowDetails:H,id:W,businessService:j,closeToast:z,moduleCode:Y,timelineStatusPrefix:G,forcedActionPrefix:K,statusAttribute:V,ActionBarStyle:q,MenuStyle:X,paymentsList:J,showTimeLine:Z=!0,oldValue:$,isInfoLabel:Q=!1,clearDataDetails:ee}=e;t.useEffect(()=>{R&&H.revalidate()},[R]);const te=r.useQueryClient(),le=()=>{h(null),y(!1)};return w||C?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,w?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Vi,{applicationDetails:N,demandData:L,id:W,workflowDetails:H,isDataLoading:M,applicationData:k,totalDemandTax:B,totalBalanceTax:O,businessService:j,timelineStatusPrefix:G,statusAttribute:V,paymentsList:J,showTimeLine:Z,oldValue:$,isInfoLabel:Q}),b?l.createElement(bi,{t:E,action:S,tenantId:p,state:v,id:_,applicationDetails:N,applicationData:null==N?void 0:N.applicationData,closeModal:le,submitAction:function(e,t,l){void 0===t&&(t=!1),void 0===l&&(l={});try{let n=!1;const i=function(i,o,a,r,d,c,p,v,m,_,g,A,h,b,y,C,D,P){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(a=o.comment)||void 0===a?void 0:a.length)||("INITIATE"===(null==e||null===(r=e.Licenses)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.action)?0==(null==e||null===(c=e.Licenses)||void 0===c||null===(p=c[0])||void 0===p||null===(v=p.additionalDetail)||void 0===v||null===(m=v.validityYears)||void 0===m?void 0:m.length):0==(null==e||null===(_=e.Licenses)||void 0===_||null===(g=_[0])||void 0===g||null===(A=g.comment)||void 0===A?void 0:A.length))||0==(null==e||null===(h=e.WaterConnection)||void 0===h||null===(b=h.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(y=e.SewerageConnection)||void 0===y||null===(C=y.comment)||void 0===C?void 0:C.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(P=D.comment)||void 0===P?void 0:P.length)){var I,N;"INITIATE"===(null==e||null===(I=e.Licenses)||void 0===I||null===(N=I[0])||void 0===N?void 0:N.action)?alert(E("Please fill in the validity before submitting")):alert(E("Please fill in the comments before submitting"))}else{const i=function(i,o,a,r,d){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(a=o.additionalDetails)&&void 0!==a&&a.blockingReason||"BLOCK"!=(null==e||null===(r=e.BPA)||void 0===r||null===(d=r.workflow)||void 0===d?void 0:d.action)){function c(t){if(n)return t;F&&(T(!0),F(e,{onError:(e,t)=>{T(!1),x({key:"error",error:e}),setTimeout(z,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),T(!1),null!==(n=l)&&void 0!==n&&n.bpa&&(e.selectedAction=S,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=l)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=S,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=l)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(a=e.Amendments)||void 0===a?void 0:a.length)>0){var d,s,c,p,v,m,_,g;null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("SEND_BACK")?x({key:"success",label:E("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(p=c.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?x({key:"success",label:E("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(m=v.workflow)&&void 0!==m&&m.action.includes("APPROVE")?x({key:"success",label:E("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(_=t.AmendmentUpdate)&&void 0!==_&&null!==(g=_.workflow)&&void 0!==g&&g.action.includes("REJECT")&&x({key:"success",label:E("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var A;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 x({key:"success",action:S}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(A=e.Licenses[0])||void 0===A?void 0:A.applicationNumber));x({key:"success",action:S}),ee&&setTimeout(ee,3e3),setTimeout(z,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),le()}T(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&U){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=s(function(){return T(!0),Promise.resolve(Promise.all(l)).then(function(e){e&&e.map(e=>{var t,l;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.nocType)})})},function(e){var t,l,i,o,a,r,u,d,s,c,p,v;T(!1);let m=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(i=l.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?E(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===(p=c.Errors)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.message)||e;le(),x({key:"error",error:{message:m}}),setTimeout(z,5e3),n=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(c):c(i)}alert(E("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==H||null===(a=H.data)||void 0===a?void 0:a.timeline,businessService:j,workflowDetails:H,moduleCode:Y,blockReason:null==m||null===(d=m.BPA)||void 0===d?void 0:d.BlockReason}):null,D?l.createElement($i,{action:S,workflowDetails:H,businessService:j,isWarningPop:D,closeWarningPopup:()=>{P(!1)}}):null,l.createElement(qi,{t:E,showToast:R,closeToast:z,businessService:j}),c?l.createElement("div",null,l.createElement(o.SubmitBar,{style:{marginRight:20},label:E("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(p,{applicationNo:null==k?void 0:k.applicationNo})).then(function(e){var t,l,n,i,o,a;const r=Digit.Utils.obps.calculateRiskType(null==I||null===(t=I.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==N||null===(l=N.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n||null===(i=n.plot)||void 0===i?void 0:i.area,null==N||null===(o=N.edcrDetails)||void 0===o||null===(a=o.planDetail)||void 0===a?void 0:a.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=r,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const d=function(e,t,l,n,i,o,a,r,d,s,c,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null==u||null===(n=u.BPA)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(s=u.BPA)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(v=c.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,p)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(E("Enterd Less Adjustment amount is invalid"))}();if(d&&d.then)return d.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(Xi,{workflowDetails:H,displayMenu:g,onActionSelect:function(e){var t,l,n;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa"))window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]);else if(null!=e&&e.isWarningPopUp)P(!0);else if(null!=e&&e.redirectionUrll){var i,o,a,r,d;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),JSON.stringify({data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state,url:""+(null===(d=location)||void 0===d?void 0:d.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var s,c;f.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.state})}else{var p;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(p=e.redirectionUrll)||void 0===p?void 0:p.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))console.log("Got Inside Direct"),y(!0);else{var v,m;f.push({pathname:null===(v=e.redirectionUrl)||void 0===v?void 0:v.pathname,state:u({},null===(m=e.redirectionUrl)||void 0===m?void 0:m.state)})}else y(!0);h(e),A(!1)},setDisplayMenu:A,businessService:j,forcedActionPrefix:K,ActionBarStyle:q,MenuStyle:X})))},eo=[{head:"",body:[{type:"component",component:"InspectionReport",key:"FieldReports",withoutLabel:!0,hideInCitizen:!0}]}];var to=function(e){return"symbol"==typeof e||le(e)&&"[object Symbol]"==L(e)},lo=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,no=/^\w*$/,io=function(e,t){if(ue(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!to(e))||no.test(e)||!lo.test(e)||null!=t&&e in Object(t)};function oo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=l.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return l.cache=o.set(i,a)||o,a};return l.cache=new(oo.Cache||q),l}oo.Cache=q;var ao,ro,uo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,so=/\\(\\)?/g,co=(ao=oo(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(uo,function(e,l,n,i){t.push(n?i.replace(so,"$1"):l||e)}),t},function(e){return 500===ro.size&&ro.clear(),e}),ro=ao.cache,ao),po=function(e,t){for(var l=-1,n=null==e?0:e.length,i=Array(n);++l<n;)i[l]=t(e[l],l,e);return i},vo=y?y.prototype:void 0,mo=vo?vo.toString:void 0,Eo=function(e,t){return ue(e)?e:io(e,t)?[e]:co(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(ue(t))return po(t,e)+"";if(to(t))return mo?mo.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))},fo=function(e){if("string"==typeof e||to(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},_o=function(e,t){for(var l=0,n=(t=Eo(t,e)).length;null!=e&&l<n;)e=e[fo(t[l++])];return l&&l==n?e:void 0},go=function(e,t,l){var n=null==e?void 0:_o(e,t);return void 0===n?l:n};function Ao(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new q;++t<l;)this.add(e[t])}Ao.prototype.add=Ao.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ao.prototype.has=function(e){return this.__data__.has(e)};var So=Ao,ho=function(e,t){for(var l=-1,n=null==e?0:e.length;++l<n;)if(t(e[l],l,e))return!0;return!1},bo=function(e,t){return e.has(t)},yo=function(e,t,l,n,i,o){var a=1&l,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var d=o.get(e),s=o.get(t);if(d&&s)return d==t&&s==e;var c=-1,p=!0,v=2&l?new So:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var f=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==f){if(f)continue;p=!1;break}if(v){if(!ho(t,function(e,t){if(!bo(v,t)&&(m===e||i(m,e,l,n,o)))return v.push(t)})){p=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){p=!1;break}}return o.delete(e),o.delete(t),p},Co=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l},To=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l},Do=y?y.prototype:void 0,Po=Do?Do.valueOf:void 0,Io=Object.prototype.hasOwnProperty,No=Object.prototype.hasOwnProperty,Lo=function e(t,l,n,i,o){return t===l||(null==t||null==l||!le(t)&&!le(l)?t!=t&&l!=l:function(e,t,l,n,i,o){var a=ue(e),r=ue(t),u=a?"[object Array]":Ze(e),d=r?"[object Array]":Ze(t),s="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),p="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),v=u==d;if(v&&se(e)){if(!se(t))return!1;a=!0,s=!1}if(v&&!s)return o||(o=new J),a||ge(e)?yo(e,t,l,n,i,o):function(e,t,l,n,i,o,a){switch(l){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new Qe(e),new Qe(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return c(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var r=Co;case"[object Set]":if(r||(r=To),e.size!=t.size&&!(1&n))return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var d=yo(r(e),r(t),n,i,o,a);return a.delete(e),d;case"[object Symbol]":if(Po)return Po.call(e)==Po.call(t)}return!1}(e,t,u,l,n,i,o);if(!(1&l)){var m=s&&No.call(e,"__wrapped__"),E=p&&No.call(t,"__wrapped__");if(m||E){var f=m?e.value():e,_=E?t.value():t;return o||(o=new J),i(f,_,l,n,o)}}return!!v&&(o||(o=new J),function(e,t,l,n,i,o){var a=1&l,r=Ue(e),u=r.length;if(u!=Ue(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:Io.call(t,s)))return!1}var c=o.get(e),p=o.get(t);if(c&&p)return c==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],f=t[s];if(n)var _=a?n(f,E,s,t,e,o):n(E,f,s,e,t,o);if(!(void 0===_?E===f||i(E,f,l,n,o):_)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var g=e.constructor,A=t.constructor;g==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof A&&A instanceof A||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,l,n,i,o))}(t,l,n,i,e,o))},Bo=function(e){return e==e&&!B(e)},Oo=function(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in Object(l))}},Ro=function(e,t){return null!=e&&t in Object(e)},xo=function(e){return e},wo=function(e){return"function"==typeof e?e:null==e?xo:"object"==typeof e?ue(e)?(i=e[1],io(n=e[0])&&Bo(i)?Oo(fo(n),i):function(e){var t=go(e,n);return void 0===t&&t===i?function(e,t){return null!=e&&function(e,t,l){for(var n=-1,i=(t=Eo(t,e)).length,o=!1;++n<i;){var a=fo(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&ve(i)&&pe(a,i)&&(ue(e)||re(e))}(e,t,Ro)}(e,n):Lo(i,t,3)}):1==(l=function(e){for(var t=Pe(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,Bo(i)]}return t}(t=e)).length&&l[0][2]?Oo(l[0][0],l[0][1]):function(e){return e===t||function(e,t,l,n){var i=l.length,o=i;if(null==e)return!o;for(e=Object(e);i--;){var a=l[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var r=(a=l[i])[0],u=e[r],d=a[1];if(a[2]){if(void 0===u&&!(r in e))return!1}else{var s=new J;if(!Lo(d,u,3,void 0,s))return!1}}return!0}(e,0,l)}:function(e){return io(e)?(t=fo(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return _o(t,e)}}(e);var t}(e);var t,l,n,i},Mo=function(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=to(e),a=void 0!==t,r=null===t,u=t==t,d=to(t);if(!r&&!d&&!o&&e>t||o&&a&&u&&!r&&!d||n&&a&&u||!l&&u||!i)return 1;if(!n&&!o&&!d&&e<t||d&&l&&i&&!n&&!o||r&&l&&i||!a&&i||!u)return-1}return 0};const ko=["tenantId"],Fo=["tenantId","payments"],Uo=e=>e.substr(0,1).toUpperCase()+e.substr(1);var Ho=function(e,t){return function(){for(var l=new Array(arguments.length),n=0;n<l.length;n++)l[n]=arguments[n];return e.apply(t,l)}},Wo=Object.prototype.toString;function jo(e){return"[object Array]"===Wo.call(e)}function zo(e){return void 0===e}function Yo(e){return null!==e&&"object"==typeof e}function Go(e){if("[object Object]"!==Wo.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Ko(e){return"[object Function]"===Wo.call(e)}function Vo(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),jo(e))for(var l=0,n=e.length;l<n;l++)t.call(null,e[l],l,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var qo={isArray:jo,isArrayBuffer:function(e){return"[object ArrayBuffer]"===Wo.call(e)},isBuffer:function(e){return null!==e&&!zo(e)&&null!==e.constructor&&!zo(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Yo,isPlainObject:Go,isUndefined:zo,isDate:function(e){return"[object Date]"===Wo.call(e)},isFile:function(e){return"[object File]"===Wo.call(e)},isBlob:function(e){return"[object Blob]"===Wo.call(e)},isFunction:Ko,isStream:function(e){return Yo(e)&&Ko(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:Vo,merge:function e(){var t={};function l(l,n){t[n]=Go(t[n])&&Go(l)?e(t[n],l):Go(l)?e({},l):jo(l)?l.slice():l}for(var n=0,i=arguments.length;n<i;n++)Vo(arguments[n],l);return t},extend:function(e,t,l){return Vo(t,function(t,n){e[n]=l&&"function"==typeof t?Ho(t,l):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function Xo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Jo=function(e,t,l){if(!t)return e;var n;if(l)n=l(t);else if(qo.isURLSearchParams(t))n=t.toString();else{var i=[];qo.forEach(t,function(e,t){null!=e&&(qo.isArray(e)?t+="[]":e=[e],qo.forEach(e,function(e){qo.isDate(e)?e=e.toISOString():qo.isObject(e)&&(e=JSON.stringify(e)),i.push(Xo(t)+"="+Xo(e))}))}),n=i.join("&")}if(n){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function Zo(){this.handlers=[]}Zo.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},Zo.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Zo.prototype.forEach=function(e){qo.forEach(this.handlers,function(t){null!==t&&e(t)})};var $o=Zo,Qo=function(e,t,l){return qo.forEach(l,function(l){e=l(e,t)}),e},ea=function(e){return!(!e||!e.__CANCEL__)},ta=function(e,t){qo.forEach(e,function(l,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=l,delete e[n])})},la=function(e,t,l,n,i){return function(e,t,l,n,i){return e.config=t,l&&(e.code=l),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,l,n,i)},na=qo.isStandardBrowserEnv()?{write:function(e,t,l,n,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),qo.isNumber(l)&&a.push("expires="+new Date(l).toGMTString()),qo.isString(n)&&a.push("path="+n),qo.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},ia=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],oa=qo.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),l=document.createElement("a");function n(e){var n=e;return t&&(l.setAttribute("href",n),n=l.href),l.setAttribute("href",n),{href:l.href,protocol:l.protocol?l.protocol.replace(/:$/,""):"",host:l.host,search:l.search?l.search.replace(/^\?/,""):"",hash:l.hash?l.hash.replace(/^#/,""):"",hostname:l.hostname,port:l.port,pathname:"/"===l.pathname.charAt(0)?l.pathname:"/"+l.pathname}}return e=n(window.location.href),function(t){var l=qo.isString(t)?n(t):t;return l.protocol===e.protocol&&l.host===e.host}}():function(){return!0},aa={"Content-Type":"application/x-www-form-urlencoded"};function ra(e,t){!qo.isUndefined(e)&&qo.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var ua,da={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(ua=function(e){return new Promise(function(t,l){var n=e.data,i=e.headers;qo.isFormData(n)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(a+":"+r)}var u,d,s=(d=e.url,(u=e.baseURL)&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(d)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,d):d);if(o.open(e.method.toUpperCase(),Jo(s,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var n,i,a,r,u,d="getAllResponseHeaders"in o?(n=o.getAllResponseHeaders(),u={},n?(qo.forEach(n.split("\n"),function(e){if(r=e.indexOf(":"),i=qo.trim(e.substr(0,r)).toLowerCase(),a=qo.trim(e.substr(r+1)),i){if(u[i]&&ia.indexOf(i)>=0)return;u[i]="set-cookie"===i?(u[i]?u[i]:[]).concat([a]):u[i]?u[i]+", "+a:a}}),u):u):null;!function(e,t,l){var n=l.config.validateStatus;l.status&&n&&!n(l.status)?t(la("Request failed with status code "+l.status,l.config,null,l.request,l)):e(l)}(t,l,{data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:d,config:e,request:o}),o=null}},o.onabort=function(){o&&(l(la("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){l(la("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),l(la(t,e,"ECONNABORTED",o)),o=null},qo.isStandardBrowserEnv()){var c=(e.withCredentials||oa(s))&&e.xsrfCookieName?na.read(e.xsrfCookieName):void 0;c&&(i[e.xsrfHeaderName]=c)}if("setRequestHeader"in o&&qo.forEach(i,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)}),qo.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){o&&(o.abort(),l(e),o=null)}),n||(n=null),o.send(n)})}),ua),transformRequest:[function(e,t){return ta(t,"Accept"),ta(t,"Content-Type"),qo.isFormData(e)||qo.isArrayBuffer(e)||qo.isBuffer(e)||qo.isStream(e)||qo.isFile(e)||qo.isBlob(e)?e:qo.isArrayBufferView(e)?e.buffer:qo.isURLSearchParams(e)?(ra(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):qo.isObject(e)?(ra(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};qo.forEach(["delete","get","head"],function(e){da.headers[e]={}}),qo.forEach(["post","put","patch"],function(e){da.headers[e]=qo.merge(aa)});var sa=da;function ca(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var pa=function(e){return ca(e),e.headers=e.headers||{},e.data=Qo(e.data,e.headers,e.transformRequest),e.headers=qo.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),qo.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||sa.adapter)(e).then(function(t){return ca(e),t.data=Qo(t.data,t.headers,e.transformResponse),t},function(t){return ea(t)||(ca(e),t&&t.response&&(t.response.data=Qo(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},va=function(e,t){t=t||{};var l={},n=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function r(e,t){return qo.isPlainObject(e)&&qo.isPlainObject(t)?qo.merge(e,t):qo.isPlainObject(t)?qo.merge({},t):qo.isArray(t)?t.slice():t}function u(n){qo.isUndefined(t[n])?qo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(e[n],t[n])}qo.forEach(n,function(e){qo.isUndefined(t[e])||(l[e]=r(void 0,t[e]))}),qo.forEach(i,u),qo.forEach(o,function(n){qo.isUndefined(t[n])?qo.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(void 0,t[n])}),qo.forEach(a,function(n){n in t?l[n]=r(e[n],t[n]):n in e&&(l[n]=r(void 0,e[n]))});var d=n.concat(i).concat(o).concat(a),s=Object.keys(e).concat(Object.keys(t)).filter(function(e){return-1===d.indexOf(e)});return qo.forEach(s,u),l};function ma(e){this.defaults=e,this.interceptors={request:new $o,response:new $o}}ma.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=va(this.defaults,e)).method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var t=[pa,void 0],l=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)l=l.then(t.shift(),t.shift());return l},ma.prototype.getUri=function(e){return e=va(this.defaults,e),Jo(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},qo.forEach(["delete","get","head","options"],function(e){ma.prototype[e]=function(t,l){return this.request(va(l||{},{method:e,url:t,data:(l||{}).data}))}}),qo.forEach(["post","put","patch"],function(e){ma.prototype[e]=function(t,l,n){return this.request(va(n||{},{method:e,url:t,data:l}))}});var Ea=ma;function fa(e){this.message=e}fa.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},fa.prototype.__CANCEL__=!0;var _a=fa;function ga(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var l=this;e(function(e){l.reason||(l.reason=new _a(e),t(l.reason))})}ga.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},ga.source=function(){var e;return{token:new ga(function(t){e=t}),cancel:e}};var Aa=ga;function Sa(e){var t=new Ea(e),l=Ho(Ea.prototype.request,t);return qo.extend(l,Ea.prototype,t),qo.extend(l,t),l}var ha=Sa(sa);ha.Axios=Ea,ha.create=function(e){return Sa(va(ha.defaults,e))},ha.Cancel=_a,ha.CancelToken=Aa,ha.isCancel=ea,ha.all=function(e){return Promise.all(e)},ha.spread=function(e){return function(t){return e.apply(null,t)}},ha.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var ba=ha;ba.default=ha,ba.interceptors.response.use(e=>e,e=>{var t,l;const n=window.location.pathname.split("/").includes("employee");if(null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.Errors)for(const t of e.response.data.Errors){var i,o,a,r;t.message.includes("InvalidAccessTokenException")?(localStorage.clear(),sessionStorage.clear(),window.location.href=(n?"/digit-ui/employee/user/login":"/digit-ui/citizen/login")+"?from="+encodeURIComponent(window.location.pathname+window.location.search)):null!=t&&null!==(i=t.message)&&void 0!==i&&null!==(o=i.toLowerCase())&&void 0!==o&&o.includes("internal server error")||null!=t&&null!==(a=t.message)&&void 0!==a&&null!==(r=a.toLowerCase())&&void 0!==r&&r.includes("some error occured")?window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=maintenance&from="+encodeURIComponent(window.location.pathname+window.location.search):t.message.includes("ZuulRuntimeException")&&(window.location.href=(n?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=notfound&from="+encodeURIComponent(window.location.pathname+window.location.search))}throw e}),window.Digit=window.Digit||{},window.Digit=u({},window.Digit,{RequestCache:window.Digit.RequestCache||{}});const ya=e=>{var t,l,n,i,o,a,r,u;const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA",c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");let p=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var v,m,E,f;return e.isSuccess?"BPA_SUBMIT_APP"==p?window.location.href.includes("editApplication")?null==e?void 0:e.t("BPA_SUBMIT_HEADER_"+s+"_"+(null==d||null===(m=d.workflow)||void 0===m?void 0:m.action)+"_"+mt(c," ","_").toUpperCase()):null==e?void 0:e.t("BPA_SUBMIT_HEADER_"+s+"_"+(null==d||null===(v=d.workflow)||void 0===v?void 0:v.action)+"_"+mt(c," ","_").toUpperCase()):window.location.href.includes("editApplication")?null==e?void 0:e.t("BPA_HEADER_"+s+"_"+(null==d||null===(f=d.workflow)||void 0===f?void 0:f.action)+"_"+mt(c," ","_").toUpperCase()):null==e?void 0:e.t("BPA_HEADER_"+s+"_"+(null==d||null===(E=d.workflow)||void 0===E?void 0:E.action)+"_"+mt(c," ","_").toUpperCase()):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},Ca=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},Ta=e=>{var t;return l.createElement(o.Banner,{message:ya(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?Ca(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},Da=e=>{var t,l,n,i,o,a,r,u;const d=null==e||null===(t=e.data)||void 0===t||null===(l=t.BPA)||void 0===l?void 0:l[0];let s=null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(i=n.BPA)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.businessService?null==e||null===(a=e.data)||void 0===a||null===(r=a.BPA)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.businessService:"BPA",c=null==d?void 0:d.status;"BPA_LOW"==s&&(s="BPA");let p=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var v,m,E,f;return e.isSuccess?"BPA_SUBMIT_APP"==p?window.location.href.includes("editApplication")?null==e?void 0:e.t("BPA_SUBMIT_HEADER_"+s+"_"+(null==d||null===(m=d.workflow)||void 0===m?void 0:m.action)+"_"+mt(c," ","_").toUpperCase()):null==e?void 0:e.t("BPA_SUBMIT_HEADER_"+s+"_"+(null==d||null===(v=d.workflow)||void 0===v?void 0:v.action)+"_"+mt(c," ","_").toUpperCase()):window.location.href.includes("editApplication")?null==e?void 0:e.t("BPA_HEADER_"+s+"_"+(null==d||null===(f=d.workflow)||void 0===f?void 0:f.action)+"_"+mt(c," ","_").toUpperCase()):null==e?void 0:e.t("BPA_HEADER_"+s+"_"+(null==d||null===(E=d.workflow)||void 0===E?void 0:E.action)+"_"+mt(c," ","_").toUpperCase()):e.isLoading?(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_PENDING")):e.isSuccess?void 0:(window.location.href.includes("editApplication"),null==e?void 0:e.t("CS_BPA_APPLICATION_FAILED"))},Pa=e=>{var t,l,n,i;let o=null!=e&&null!==(t=e.BPA)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.businessService?null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.businessService:"BPA";return"BPA_LOW"==o&&(o="BPA"),"BPA"==o?null==e?void 0:e.t("BPA_PERMIT_APPLICATION_NUMBER_LABEL"):null==e?void 0:e.t("BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL")},Ia=e=>{var t;return l.createElement(o.Banner,{message:Da(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?Pa(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},Na=e=>e.substr(0,1).toUpperCase()+e.substr(1),La=e=>{var t,l,i,o,a,r,u;const d=(null==e||null===(t=e.data)||void 0===t||null===(l=t.Licenses)||void 0===l||null===(i=l[0])||void 0===i||null===(o=i.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0])||"ARCHITECT",{t:s}=n.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_SUCCESS"):""+s("TRADELICENSE_TRADETYPE_"+d)+s("CS_STAKEHOLDER_APPLICATION_SUCCESS"):e.isLoading?window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_PENDING"):s("CS_STAKEHOLDER_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?s("CS_PROPERTY_UPDATE_APPLICATION_FAILED"):s("CS_STAKEHOLDER_APPLICATION_FAILED")},Ba=e=>{var t,n,i,a,r,u,d,s;const c=(null==e||null===(t=e.data)||void 0===t||null===(n=t.Licenses)||void 0===n||null===(i=n[0])||void 0===i||null===(a=i.tradeLicenseDetail)||void 0===a||null===(r=a.tradeUnits)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.tradeType)||void 0===d?void 0:d.split(".")[0])||"ARCHITECT";return l.createElement(o.Banner,{message:La(e),applicationNumber:null===(s=e.data)||void 0===s?void 0:s.Licenses[0].applicationNumber,info:e.isSuccess?e.t("TRADELICENSE_TRADETYPE_"+c)+" "+e.t("BPA_NEW_STAKEHOLDER_REGISTRATION_APP_LABEL"):"",successful:e.isSuccess,style:{padding:"10px"},headerStyles:{fontSize:"32px"}})},Oa={OBPSModule:e=>{let{stateCode:t,userType:n,tenants:a}=e;const{path:r}=i.useRouteMatch(),u=Digit.StoreData.getCurrentLanguage(),{isLoading:d}=Digit.Services.useStore({stateCode:t,moduleCode:["bpa","bpareg","common"],language:u});return Digit.SessionStorage.set("OBPS_TENANTS",a),d?l.createElement(o.Loader,null):l.createElement("citizen"===n?Ul:Tn,{path:r,stateCode:t})},OBPSLinks:e=>{let{matchPath:t}=e;const{t:i}=n.useTranslation(),a=[{link:t+"/my-applications",i18nKey:i("BPA_CITIZEN_HOME_VIEW_APP_BY_CITIZEN_LABEL")},{link:t+"/stakeholder/apply/stakeholder-docs-required",i18nKey:i("BPA_CITIZEN_HOME_STAKEHOLDER_LOGIN_LABEL")},{link:t+"/home",i18nKey:i("BPA_CITIZEN_HOME_ARCHITECT_LOGIN_LABEL")}];return l.createElement(o.CitizenHomeCard,{header:i("ACTION_TEST_BUILDING_PLAN_APPROVAL"),links:a,Icon:()=>l.createElement(o.OBPSIcon,null),Info:()=>l.createElement(o.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:i("CS_FILE_APPLICATION_INFO_LABEL"),text:i("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}),isInfo:!0})},OBPSCard:()=>{const[e,a]=t.useState(0),[r,d]=t.useState(0),{t:s}=n.useTranslation(),c=i.useLocation(),p=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),m=function(e){var t;void 0===e&&(e=[]);let l=sessionStorage.getItem("Digit.citizen.userRequestObject");const n=l?JSON.parse(l):{};let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,l,o;null==n||null===(t=n.value)||void 0===t||null===(l=t.info)||void 0===l||null===(o=l.roles)||void 0===o||o.map(t=>{t.code===e.code&&t.tenantId===e.tenantId&&i.push(t)})}),null==i?void 0:i.length}([{code:"BPAREG_DOC_VERIFIER",tenantId:v},{code:"BPAREG_APPROVER",tenantId:v}]),E=function(e){var t;void 0===e&&(e=[]);const l=Digit.UserService.getUser(),n=Digit.ULBService.getCurrentTenantId();let i=[];return null===(t=e)||void 0===t||t.map(e=>{var t,o;null==l||null===(t=l.info)||void 0===t||null===(o=t.roles)||void 0===o||o.map(t=>{t.code==e&&t.tenantId===n&&i.push(t)})}),null==i?void 0:i.length}(["BPA_FIELD_INSPECTOR","BPA_NOC_VERIFIER","BPA_APPROVER","BPA_VERIFIER","CEMP"]),{isLoading:f,data:_}=Digit.Hooks.obps.useBPAInbox({tenantId:p,filters:u({},{filterForm:{moduleName:"BPAREG",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL"},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}}),config:{enabled:!!m}}),{isLoading:g,data:A}=Digit.Hooks.obps.useBPAInbox({tenantId:p,filters:u({},{filterForm:{moduleName:"bpa-services",applicationStatus:"",locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},searchForm:{},tableForm:{sortBy:"",limit:10,offset:0,sortOrder:"DESC"}}),config:{enabled:!!E}});t.useEffect(()=>{g||f||(a((null!=A&&A.totalCount?null==A?void 0:A.totalCount:0)+(null!=_&&_.totalCount?null==_?void 0:_.totalCount:0)),d((null==A?void 0:A.nearingSlaCount)||0+(null==_?void 0:_.nearingSlaCount)||0))},[A,_]),t.useEffect(()=>{"/digit-ui/employee"===c.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[c.pathname]);const S=t.useMemo(()=>({Icon:l.createElement(o.OBPSIconSolidBg,null),moduleName:s("MODULE_OBPS"),kpis:[{count:g||f?"":e,label:s("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:g||f?"":r,label:s("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:f?"":null==_?void 0:_.totalCount,label:s("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),link:"/digit-ui/employee/obps/stakeholder-inbox",field:"STAKEHOLDER"},{count:g?"":null==A?void 0:A.totalCount,label:s("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/employee/obps/inbox",field:"BPA"},{label:s("ES_COMMON_SEARCH_APPLICATION"),link:"/digit-ui/employee/obps/search/application"}]}),[g,f,_,A,e,r]);return m||(S.links=S.links.filter(e=>"STAKEHOLDER"!==e.field)),E||(S.links=S.links.filter(e=>"BPA"!==e.field)),E||m?l.createElement(o.EmployeeModuleCard,S):null},BPACitizenHomeScreen:e=>{var a,r,d,s;const c=Digit.UserService.getUser(),p=null==c||null===(a=c.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code),v=Digit.ULBService.getStateId(),[m,E]=t.useState(!1),{data:f,isLoading:_}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping"),[g,A]=t.useState([]),S=Digit.ULBService.getStateId(),{t:h}=n.useTranslation(),b=i.useLocation(),[y,C,T]=Digit.Hooks.useSessionStorage("BPA_HOME_CREATE",{}),{data:D,isLoading:P}=Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]),[I,N]=t.useState(null),[L,B]=t.useState("-"),[O,R]=t.useState({applicationStatus:[]});window.Digit.Utils.browser.isMobile();const[x,w]=t.useState(0),[M,k]=t.useState(window.Digit.Utils.browser.isMobile()?50:10),[F,U]=t.useState([{id:"createdTime",sortOrder:"DESC"}]),{isLoading:H,data:W}=Digit.Hooks.obps.useArchitectInbox({tenantId:v,moduleName:"bpa-services",businessService:["BPA_LOW","BPA","BPA_OC"],filters:{searchForm:u({},O),tableForm:{sortBy:null==F||null===(d=F[0])||void 0===d?void 0:d.id,limit:M,offset:x,sortOrder:null==F||null===(s=F[0])||void 0===s?void 0:s.sortOrder},filterForm:{moduleName:"bpa-services",businessService:[],applicationStatus:null==O?void 0:O.applicationStatus,locality:[],assignee:"ASSIGNED_TO_ALL"}},config:{},withEDCRData:!1}),{isLoading:j,data:{totalCount:z}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:v,filters:{filterForm:{},searchForm:{},tableForm:{limit:10,offset:0}}});if(t.useEffect(()=>{"/digit-ui/citizen/obps/home"===b.pathname&&(Digit.SessionStorage.del("OBPS.INBOX"),Digit.SessionStorage.del("STAKEHOLDER.INBOX"))},[b.pathname]),t.useEffect(()=>{H||B((null==W?void 0:W.totalCount)||0)},[W]),t.useEffect(()=>{if(!_){var e,t;let l=[];null==f||null===(e=f.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);let i=!1;null==n||n.map(e=>{null!=p&&p.includes(e)&&!i&&(i=!0)}),i?E(!0):(E(!1),N({key:"true",message:h("BPA_LOGIN_HOME_VALIDATION_MESSAGE_LABEL")}))}},[_]),t.useEffect(()=>{var e,t;if(!P&&(null==D||null===(e=D.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0){var l,n;let e=[];null==D||null===(l=D.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(t=>{var l,n,i;e.push({link:(null==t||null===(l=t.flow)||void 0===l?void 0:l.toLowerCase())+"/"+(null==t||null===(n=t.applicationType)||void 0===n?void 0:n.toLowerCase())+"/"+(null==t||null===(i=t.serviceType)||void 0===i?void 0:i.toLowerCase())+"/docs-required",i18nKey:h("BPA_HOME_"+(null==t?void 0:t.applicationType)+"_"+(null==t?void 0:t.serviceType)+"_LABEL"),state:{linkData:t},linkState:!0})}),A(e)}},[!P]),t.useEffect(()=>{T()},[]),Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK"),I)return l.createElement(o.Toast,{error:!0,label:h(null==I?void 0:I.message),isDleteBtn:!0,onClose:()=>{window.location.replace("/digit-ui/citizen/all-services"),N(null)}});if(_||!m||H)return l.createElement(o.Loader,null);const Y=[{Icon:l.createElement(o.BPAHomeIcon,null),moduleName:h("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),name:"employeeCard",isCitizen:!0,kpis:[{count:!H&&!j&&L&&z?L+z:"-",label:h("BPA_PDF_TOTAL"),link:"/digit-ui/citizen/obps/bpa/inbox"}],links:[{count:H?"-":L,label:h("ES_COMMON_OBPS_INBOX_LABEL"),link:"/digit-ui/citizen/obps/bpa/inbox"},{count:j?"-":z,label:h("ES_COMMON_EDCR_INBOX_LABEL"),link:"/digit-ui/citizen/obps/edcr/inbox"}],className:"CitizenHomeCard",styles:{padding:"0px",minWidth:"90%",minHeight:"90%"}},{title:h("ACTION_TEST_EDCR_SCRUTINY"),Icon:l.createElement(o.EDCRIcon,{className:"fill-path-primary-main"}),links:[{link:"edcrscrutiny/apply",i18nKey:h("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"edcrscrutiny/oc-apply",i18nKey:h("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}],styles:{minWidth:"90%",minHeight:"90%"}},{title:h("ACTION_TEST_BPA_STAKE_HOLDER_HOME"),Icon:l.createElement(o.BPAIcon,{className:"fill-path-primary-main"}),links:g,styles:{minWidth:"90%",minHeight:"90%"}}],G=l.createElement("div",{className:"mainContent"},Y.map(e=>l.createElement("div",null,"employeeCard"===e.name?l.createElement(o.EmployeeModuleCard,e):l.createElement(o.CitizenHomeCard,{header:e.title,links:e.links,Icon:()=>e.Icon,styles:null==e?void 0:e.styles}))));return sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!1)),G},EDCRForm:e=>{var n,a,r,d,s,c;let{t:p,config:v,onSelect:m,formData:E,ownerIndex:f=0,isShowToast:_,isSubmitBtnDisable:g,setIsShowToast:A}=e;i.useLocation(),Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),[h,b]=t.useState([]),[y,C]=t.useState(null==E||null===(n=E.Scrutiny)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.applicantName),[T,D]=t.useState(null==E||null===(r=E.Scrutiny)||void 0===r||null===(d=r[0])||void 0===d?void 0:d.tenantIdData),[P,I]=t.useState(()=>{var e,t,l;return(null==E||null===(e=E.Scrutiny)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.proofIdentity)||void 0===l?void 0:l.fileStoreId)||null}),[N,L]=t.useState(null==E||null===(s=E.owners)||void 0===s||null===(c=s.documents)||void 0===c?void 0:c.proofIdentity),[B,O]=t.useState(null),[R,x]=t.useState(""),[w,M]=t.useState(null),k=i.useHistory(),{isLoading:F,data:U}=Digit.Hooks.obps.useMDMS(S,"tenant",["citymodule"]);return t.useEffect(()=>{var e,t,l,n;if((null==U||null===(e=U.tenant)||void 0===e||null===(t=e.citymodule)||void 0===t?void 0:t.length)>0){var i,o,a,r,u,d,s;const e=null==U||null===(i=U.tenant)||void 0===i||null===(o=i.citymodule)||void 0===o?void 0:o.filter(e=>"BPAAPPLY"==e.code);null==e||null===(a=e[0])||void 0===a||null===(r=a.tenants)||void 0===r||r.forEach(e=>{var t;e.i18nKey="TENANT_TENANTS_"+mt(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),".","_")}),Array.isArray(null==e||null===(u=e[0])||void 0===u?void 0:u.tenants)&&(null==e||null===(d=e[0])||void 0===d||d.tenants.reverse());let t=(l=null==e||null===(s=e[0])||void 0===s?void 0:s.tenants,n=p,l.sort((e,t)=>n(e.code).localeCompare(n(t.code))));b(t)}},[U]),t.useEffect(()=>{(R||_)&&(C(""),D(""),I(null),L(""),x("")),_&&k.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null!=_&&_.label?null==_?void 0:_.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[R,_,g]),F||g?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:p,config:v,onSelect:()=>{const e={};e.tenantId=T,e.applicantName=y,e.file=N,m(v.key,e)},onSkip:()=>{x("NEED TO DELETE")},isDisabled:!T||!y||!N||g,onAdd:function(){x("NEED TO DELETE")},isMultipleAllow:!0},l.createElement(o.CardLabel,null,p("EDCR_SCRUTINY_CITY")+" *"),l.createElement(o.Dropdown,{t:p,isMandatory:!1,option:h,selected:T,optionKey:"i18nKey",select:function(e){D(e)},uploadMessage:R}),l.createElement(o.CardLabel,null,p("EDCR_SCRUTINY_NAME_LABEL")+" *"),l.createElement(o.TextInput,u({isMandatory:!1,optionKey:"i18nKey",t:p,name:"applicantName",onChange:function(e){C(e.target.value)},uploadMessage:R,value:y},{isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:p("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,p("BPA_PLAN_DIAGRAM_LABEL")+" *"),l.createElement(o.UploadFile,{id:"edcr-doc",extraStyleName:"propertyCreate",onUpload:function(e){I(e.target.files[0]),L(e.target.files[0])},onDelete:()=>{I(null),L("")},message:P?"1 "+p("PT_ACTION_FILEUPLOADED"):p("ES_NO_FILE_SELECTED_LABEL"),error:B,uploadMessage:R}),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}},p("EDCR_UPLOAD_FILE_LIMITS_LABEL")),_&&l.createElement(o.Toast,{error:_.key,label:p(_.label),onClose:()=>A(null),isDleteBtn:!0}))},BasicDetails:e=>{var i,a,r,u,d,s,c,p,v,m,E,f;let{formData:_,onSelect:g,config:A}=e;const[S,h]=t.useState(null),[b,y]=t.useState((null==_||null===(i=_.data)||void 0===i?void 0:i.edcrDetails)||null),[C,T]=t.useState(null==_||null===(a=_.data)||void 0===a?void 0:a.scrutinyNumber),[D,P]=t.useState(!(null==_||null===(r=_.data)||void 0===r||!r.scrutinyNumber)),{t:I}=n.useTranslation(),N=Digit.ULBService.getStateId(),L=window.Digit.Utils.browser.isMobile(),{data:B}=Digit.Hooks.obps.useMDMS(N,"BPA",["RiskTypeComputation"]),O=Digit.Utils.obps.calculateRiskType(null==B||null===(u=B.BPA)||void 0===u?void 0:u.RiskTypeComputation,null==b||null===(d=b.planDetail)||void 0===d||null===(s=d.plot)||void 0===s?void 0:s.area,null==b||null===(c=b.planDetail)||void 0===c?void 0:c.blocks);let R=sessionStorage.getItem("isEDCRDisable");if(R=JSON.parse(R),R){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&b||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),function(){try{Promise.resolve(xt(null==C?void 0:C.edcrNumber,N)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}catch(e){return Promise.reject(e)}}())}return l.createElement("div",null,S&&l.createElement(o.Toast,{error:!0,label:I(""+(null==S?void 0:S.message)),onClose:()=>{h(null)},isDleteBtn:!0}),l.createElement(zl,null),l.createElement("div",{className:L?"obps-search":"",style:L?{}:{margin:"8px"}},l.createElement(o.Label,null,I("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{return Promise.resolve(function(){if("Enter"===e.key){if(null==C||!C.edcrNumber)return;return Promise.resolve(xt(null==C?void 0:C.edcrNumber,N)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}}())}catch(e){return Promise.reject(e)}},onChange:e=>T({edcrNumber:e.target.value}),value:null==C?void 0:C.edcrNumber,signature:!0,signatureImg:!R&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!R&&null!=C&&C.edcrNumber?()=>function(e){try{return Promise.resolve(xt(null==C?void 0:C.edcrNumber,N)).then(function(e){"ERROR"==(null==e?void 0:e.type)&&(h({message:null==e?void 0:e.message}),y(null)),null!=e&&e.edcrNumber&&(y(e),h(null))})}catch(e){return Promise.reject(e)}}():null}),disable:R,style:{marginBottom:"10px"}})),b&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,I("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,I("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:I("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=b&&b.applicationDate?Ml(new Date(null==b?void 0:b.applicationDate),"dd/MM/yyyy"):null==b?void 0:b.applicationDate}),l.createElement(o.Row,{className:"border-none",label:I("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:I("WF_BPA_"+(null==b?void 0:b.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:I("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:I(null==b?void 0:b.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:I("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==b||null===(p=b.planDetail)||void 0===p||null===(v=p.planInformation)||void 0===v?void 0:v.occupancy}),l.createElement(o.Row,{className:"border-none",label:I("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:I("WF_BPA_"+O)}),l.createElement(o.Row,{className:"border-none",label:I("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==b||null===(m=b.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.applicantName})),O?l.createElement(o.SubmitBar,{label:I("CS_COMMON_NEXT"),onSubmit:e=>{var t,l,n,i,o,a,r,u;g(null==A?void 0:A.key,{scrutinyNumber:C,applicantName:null==b||null===(t=b.planDetail)||void 0===t||null===(l=t.planInformation)||void 0===l?void 0:l.applicantName,occupancyType:null==b||null===(n=b.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.occupancy,applicationType:null==b?void 0:b.appliactionType,serviceType:null==b?void 0:b.applicationSubType,applicationDate:null==b?void 0:b.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==B||null===(o=B.BPA)||void 0===o?void 0:o.RiskTypeComputation,null==b||null===(a=b.planDetail)||void 0===a||null===(r=a.plot)||void 0===r?void 0:r.area,null==b||null===(u=b.planDetail)||void 0===u?void 0:u.blocks),edcrDetails:b})},disabled:!(null!=C&&null!==(f=C.edcrNumber)&&void 0!==f&&f.length)}):l.createElement(o.Loader,null)))},DocsRequired:e=>{var a,r;let{onSelect:u}=e;const{t:d}=n.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),[p,v]=(i.useHistory(),i.useParams(),t.useState([])),[m,E]=t.useState([]),{data:f,isLoading:_}=Digit.Hooks.obps.useMDMS(c,"BPA","DocumentTypes"),{data:g}=Digit.Hooks.obps.useMDMS(c,"common-masters",["DocumentType"]),A=(Digit.Hooks.obps.useMDMS(c,"BPA",["RiskTypeComputation"]),Digit.UserService.getUser()),S={0:{tenantId:c},1:{id:null==A||null===(a=A.info)||void 0===a?void 0:a.id}},{data:h}=Digit.Hooks.obps.useBPAREGSearch(s,S),b=window.location.href.includes("ocbpa");sessionStorage.removeItem("clickOnBPAApplyAfterEDCR");const{data:y,isLoading:C}=Digit.Hooks.obps.useMDMS(c,"BPA",["homePageUrlLinks"]);return t.useEffect(()=>{let e,t="",l=!0;for(let m=0;m<(null==h||null===(n=h.Licenses)||void 0===n?void 0:n.length);m++){var n,i,o,a,r,u,d,s,c,p,v;"APPROVED"===(null==h||null===(i=h.Licenses)||void 0===i||null===(o=i[m])||void 0===o?void 0:o.status)&&l&&(l=!1,t=(null==h||null===(a=h.Licenses)||void 0===a||null===(r=a[m])||void 0===r||null===(u=r.tradeLicenseDetail)||void 0===u||null===(d=u.tradeUnits)||void 0===d||null===(s=d[0])||void 0===s||null===(c=s.tradeType)||void 0===c?void 0:c.split(".")[0])||"ARCHITECT",sessionStorage.setItem("BPA_ARCHITECT_NAME",JSON.stringify(t)),e=null==h||null===(p=h.Licenses)||void 0===p||null===(v=p[m])||void 0===v?void 0:v.tradeLicenseDetail.additionalDetail.isSelfCertificationRequired,sessionStorage.setItem("isSelfCertificationRequired",JSON.stringify(e)))}},[h]),t.useEffect(()=>{if(!C){var e,t;const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];null==y||null===(e=y.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t||t.map(e=>{(null==i?void 0:i.toUpperCase())===(null==e?void 0:e.applicationType)&&(null==n?void 0:n.toUpperCase())===(null==e?void 0:e.serviceType)&&E({flow:null==e?void 0:e.flow,applicationType:null==e?void 0:e.applicationType,serviceType:null==e?void 0:e.serviceType})})}},[!C]),t.useEffect(()=>{if(!_){let e=[],t=[];const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];for(let t=0;t<f.length;t++)e[f[t].applicationType]||e[f[t].ServiceType]||(e[f[t].applicationType]=f[t]);Object.values(e).map(e=>{var l;(null==e?void 0:e.applicationType)==(null==i?void 0:i.toUpperCase())&&(null==e?void 0:e.ServiceType)==(null==n?void 0:n.toUpperCase())&&t.push(null==e?void 0:e.docTypes),null==t||null===(l=t[0])||void 0===l||l.forEach(e=>{var t,l;let n=e.code;e.dropdownData=[],null==g||null===(t=g["common-masters"])||void 0===t||null===(l=t.DocumentType)||void 0===l||l.forEach(t=>{let l=t.code.slice(0,n.length);n===l&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))})}),v(t)})}},[!_]),_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,d(b?"BPA_OOCUPANCY_CERTIFICATE_APP_LABEL":"OBPS_NEW_BUILDING_PERMIT")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},d("OBPS_NEW_BUILDING_PERMIT_DESCRIPTION")),_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==p||null===(r=p[0])||void 0===r?void 0:r.map((e,t)=>{var n;return l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+d(null==e?void 0:e.code.replace(".","_"))))),l.createElement("div",{style:{marginBottom:"16px"}},null==e||null===(n=e.dropdownData)||void 0===n?void 0:n.map((t,n)=>{var i;return(null==e||null===(i=e.dropdownData)||void 0===i?void 0:i.length)!==n+1?l.createElement("span",null,d(null==t?void 0:t.i18nKey)+", "):l.createElement("span",null,""+d(null==t?void 0:t.i18nKey))})))})),l.createElement(o.SubmitBar,{label:d("CS_COMMON_NEXT"),onSubmit:()=>{if(null!==JSON.parse(sessionStorage.getItem("BPAintermediateValue"))){let e=JSON.parse(sessionStorage.getItem("BPAintermediateValue"));sessionStorage.setItem("BPAintermediateValue",null),u("",e)}else u("uiFlow",m)}})),l.createElement(o.CitizenInfoLabel,{info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},PlotDetails:e=>{var i,a,r,d,s,c,p,v,m,E;let{formData:f,onSelect:_,config:g}=e;const{t:A}=n.useTranslation(),[S,h]=t.useState(""),[b,y]=t.useState(""),[C,T]=t.useState(""),D=(Digit.ULBService.getCurrentTenantId(),null==f||null===(i=f.uiFlow)||void 0===i?void 0:i.flow),P=Digit.ULBService.getStateId();let[I,N]=t.useState(!1);t.useEffect(()=>{"BPA"===D&&N(!0)},[D]);const{data:L,isLoading:B}=Digit.Hooks.obps.useScrutinyDetails(P,null==f||null===(a=f.data)||void 0===a?void 0:a.scrutinyNumber);return B?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(zl,{flow:"OCBPA"===D?"OCBPA":""}),l.createElement(o.FormStep,{config:g,onSelect:e=>{_(null==g?void 0:g.key,u({},e))},childrenAtTheBottom:!1,t:A,_defaultValues:null==f?void 0:f.data,onSkip:()=>_(),onChange:function(e){"boundaryWallLength"==e.target.name&&0==isNaN(parseInt(e.target.value))?N(!1):"boundaryWallLength"==e.target.name&&1==isNaN(parseInt(e.target.value))&&N(!0)},isDisabled:I},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:A("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=L&&null!==(r=L.planDetail)&&void 0!==r&&null!==(d=r.planInformation)&&void 0!==d&&d.plotArea?(null==L||null===(s=L.planDetail)||void 0===s||null===(c=s.planInformation)||void 0===c?void 0:c.plotArea)+" "+A("BPA_SQ_FT_LABEL"):"NA"}),l.createElement(o.Row,{className:"border-none",label:A("BPA_PLOT_NUMBER_LABEL"),text:null==L||null===(p=L.planDetail)||void 0===p||null===(v=p.planInformation)||void 0===v?void 0:v.plotNo}),l.createElement(o.Row,{className:"border-none",label:A("BPA_KHATHA_NUMBER_LABEL"),text:null==L||null===(m=L.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.khataNo}))))},ScrutinyDetails:e=>{var a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w;let{onSelect:M,formData:k,config:F}=e;const{t:U}=n.useTranslation(),[H,W]=(i.useHistory(),t.useState([])),[j,z]=t.useState((null==k?void 0:k.subOccupancy)||(null==k||null===(a=k.landInfo)||void 0===a?void 0:a.unit)||{}),[Y,G]=t.useState([]),[K,V]=t.useState([]);let q=Digit.UserService.getUser();const X=(null==q||null===(r=q.info)||void 0===r?void 0:r.permanentCity)||Digit.ULBService.getCurrentTenantId(),J=null==k||null===(u=k.uiFlow)||void 0===u?void 0:u.flow,[Z,$]=t.useState(null),Q=Digit.ULBService.getStateId(),{isMdmsLoading:ee,data:te}=Digit.Hooks.obps.useMDMS(Q,"BPA",["SubOccupancyType"]),{data:le}=Digit.Hooks.obps.useScrutinyDetails(X,null==k||null===(d=k.data)||void 0===d?void 0:d.scrutinyNumber,{enabled:!0});function ne(e){var t,l;let n=[];return null==e||null===(t=e.building)||void 0===t||null===(l=t.floors)||void 0===l||l.map(e=>{var t,l,i,o,a,r,u,d;n.push({Floor:U("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:U(""+(null===(t=e.occupancies)||void 0===t||null===(l=t[0])||void 0===l?void 0:l.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:U("BPA_FLOOR_NAME_"+e.number)})}),n}function ie(){var e,t;let l=[];return null==te||null===(e=te.BPA)||void 0===e||null===(t=e.SubOccupancyType)||void 0===t||t.map(e=>{var t;l.push({code:e.code,name:e.name,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+mt(null==e||null===(t=e.code)||void 0===t?void 0:t.toUpperCase(),"-","_")})}),Digit.Utils.locale.sortDropdownNames(l,"i18nKey",U)}const oe=e=>{let{label:t,jumpTo:a}=e;const{t:r}=n.useTranslation();return i.useHistory(),l.createElement(o.LinkButton,{label:r(t),onClick:function(){location.href=a}})},ae=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],re=e=>{const t=e;return(e,l,n)=>e[t]},ue=t.useMemo(()=>null==ae?void 0:ae.map(e=>({Header:U(""+e.name),accessor:re(e.id),id:e.id})));function de(e){var t,l,n,i,o;let a=null==k||null===(t=k.data)||void 0===t||null===(l=t.bpaData)||void 0===l||null===(n=l.bpaApprovalResponse)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.landInfo)||void 0===o?void 0:o.unit,r="";if((null==a?void 0:a.length)>0){var u,d;let t=null===(u=a[e])||void 0===u||null===(d=u.usageCategory)||void 0===d?void 0:d.split(",");null!=t&&t.length&&(r=(null==t?void 0:t.map(e=>e?""+U("BPA_SUBOCCUPANCYTYPE_"+mt(null==e?void 0:e.toUpperCase(),"-","_")):"NA")).join(", "))}return r||"NA"}return ee?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:"OCBPA"===J?2:1,flow:"OCBPA"===J?"OCBPA":""}),l.createElement(o.FormStep,{t:U,config:F,onSelect:()=>{if("OCBPA"===J)if(null!=k&&k.id)M("",k,"",!0);else{var e,t,l,n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C;let T={};T.edcrNumber=null!=k&&null!==(e=k.edcrNumber)&&void 0!==e&&e.edcrNumber?null==k||null===(t=k.edcrNumber)||void 0===t?void 0:t.edcrNumber:null==k||null===(l=k.data)||void 0===l||null===(n=l.scrutinyNumber)||void 0===n?void 0:n.edcrNumber,T.riskType=null==k||null===(i=k.data)||void 0===i?void 0:i.riskType,T.applicationType=null==k||null===(o=k.data)||void 0===o?void 0:o.applicationType,T.serviceType=null==k||null===(a=k.data)||void 0===a?void 0:a.serviceType;const D=Digit.UserService.getUser(),P=null==D||null===(r=D.info)||void 0===r?void 0:r.uuid;T.tenantId=null==k||null===(u=k.data)||void 0===u||null===(d=u.bpaData)||void 0===d||null===(s=d.bpaApprovalResponse)||void 0===s||null===(c=s[0])||void 0===c||null===(p=c.landInfo)||void 0===p?void 0:p.tenantId,T.workflow={action:"INITIATE",assignes:[null==D||null===(v=D.info)||void 0===v?void 0:v.uuid]},T.accountId=P,T.documents=null,T.additionalDetails={},null!=k&&null!==(m=k.data)&&void 0!==m&&m.holdingNumber&&(T.additionalDetails.holdingNo=null==k||null===(E=k.data)||void 0===E?void 0:E.holdingNumber),null!=k&&null!==(f=k.data)&&void 0!==f&&f.registrationDetails&&(T.additionalDetails.registrationDetails=null==k||null===(_=k.data)||void 0===_?void 0:_.registrationDetails),null!=k&&null!==(g=k.data)&&void 0!==g&&g.applicationType&&(T.additionalDetails.applicationType=null==k||null===(A=k.data)||void 0===A?void 0:A.applicationType),null!=k&&null!==(S=k.data)&&void 0!==S&&S.serviceType&&(T.additionalDetails.serviceType=null==k||null===(h=k.data)||void 0===h?void 0:h.serviceType),T.landInfo=(null==k||null===(b=k.data)||void 0===b||null===(y=b.bpaData)||void 0===y||null===(C=y.bpaApprovalResponse)||void 0===C?void 0:C[0].landInfo)||{};let I=sessionStorage.getItem("BPA_ARCHITECT_NAME"),N=I?JSON.parse(I):"ARCHITECT";T.additionalDetails.typeOfArchitect=N,Digit.OBPSService.create({BPA:T},X).then((e,t)=>{var l;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(e.BPA[0].data=k.data,e.BPA[0].uiFlow=null==k?void 0:k.uiFlow,M("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;$({key:"true",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?void 0:n.message)||null})})}else M(F.key,j)},onSkip:()=>M()},l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",style:{border:"none"},label:U("OCBPA"===J?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_NO_LABEL"),text:null==le?void 0:le.edcrNumber,labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),l.createElement(o.Row,{className:"border-none",label:U("BPA_UPLOADED_PLAN_DIAGRAM"),text:l.createElement(oe,{label:U("BPA_UPLOADED_PLAN_DXF"),jumpTo:null==le?void 0:le.updatedDxfFile})}),l.createElement(o.Row,{className:"border-none",label:U("BPA_SCRUNTINY_REPORT_OUTPUT"),text:l.createElement(oe,{label:U("BPA_SCRUTINY_REPORT_PDF"),jumpTo:null==le?void 0:le.planReport})})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("OCBPA"===J?"BPA_ACTUAL_BUILDING_EXTRACT_HEADER":"BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:U("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=le&&null!==(s=le.planDetail)&&void 0!==s&&null!==(c=s.blocks)&&void 0!==c&&null!==(p=c[0])&&void 0!==p&&null!==(v=p.building)&&void 0!==v&&v.totalBuitUpArea?(null==le||null===(m=le.planDetail)||void 0===m||null===(E=m.blocks)||void 0===E||null===(f=E[0])||void 0===f||null===(_=f.building)||void 0===_?void 0:_.totalBuitUpArea)+" "+U("BPA_SQ_MTRS_LABEL"):U("NA")}),l.createElement(o.Row,{className:"border-none",label:U("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==le||null===(g=le.planDetail)||void 0===g||null===(A=g.blocks)||void 0===A||null===(S=A[0])||void 0===S||null===(h=S.building)||void 0===h?void 0:h.totalFloors}),l.createElement(o.Row,{className:"border-none",label:U("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:null!=le&&null!==(b=le.planDetail)&&void 0!==b&&null!==(y=b.blocks)&&void 0!==y&&null!==(C=y[0])&&void 0!==C&&null!==(T=C.building)&&void 0!==T&&T.declaredBuildingHeight?(null==le||null===(D=le.planDetail)||void 0===D||null===(P=D.blocks)||void 0===P||null===(I=P[0])||void 0===I||null===(N=I.building)||void 0===N?void 0:N.declaredBuildingHeight)+" "+U("BPA_MTRS_LABEL"):U("NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_OCC_SUBOCC_HEADER")),null==le||null===(L=le.planDetail)||void 0===L||null===(B=L.blocks)||void 0===B?void 0:B.map((e,t)=>{var n;return l.createElement("div",{key:t,style:{marginTop:"20px"}},l.createElement(o.CardSubHeader,{style:{fontSize:"18px"}},U("BPA_BLOCK_SUBHEADER")," ",t+1),"OCBPA"!==J?l.createElement(o.CardSectionHeader,{style:{fontWeight:"normal"},className:"card-label-smaller"},U("BPA_SUB_OCCUPANCY_LABEL")):null,"OCBPA"!==J?l.createElement(o.MultiSelectDropdown,{BlockNumber:e.number,className:"form-field",isMandatory:!0,defaultUnit:"Selected",selected:j["Block_"+e.number],options:ie(),onSelect:t=>((e,t,l)=>{let n=j,i=[];e&&(null==e||e.map(e=>{i.push(null==e?void 0:e[1])})),n["Block_"+l]=i,W(i),z(n)})(t,0,e.number),isOBPSMultiple:!0,optionsKey:"i18nKey",ServerStyle:{width:"100%",overflowX:"hidden"},t:U}):null,"OCBPA"!==J?l.createElement("div",{className:"tag-container"},j["Block_"+e.number]&&j["Block_"+e.number].length>0&&(null===(n=j["Block_"+e.number])||void 0===n?void 0:n.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:""+U(t.i18nKey),onClick:()=>((e,t,l)=>{let n=j["Block_"+l].filter((t,l)=>l!==e);W(n);let i=j;i["Block_"+l]=n,z(i)})(n,0,e.number)})))):null,"OCBPA"!==J?j["Block_"+e.number]&&j["Block_"+e.number].length>0&&l.createElement(o.LinkButton,{style:{textAlign:"left"},label:"Clear All",onClick:()=>(e=>{let t=[],l=j;l["Block_"+e]=t,W(t),z(l)})(e.number)}):null,l.createElement("div",{style:{marginTop:"20px"}},"OCBPA"===J?l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+U("BPA_SUB_OCCUPANCY_LABEL"),text:de(t)})):null,l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:U,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:ne(e),columns:ue,getCellProps:e=>({style:{}})}))))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{label:U("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=le&&null!==(O=le.planDetail)&&void 0!==O&&null!==(R=O.planInformation)&&void 0!==R&&R.demolitionArea?(null==le||null===(x=le.planDetail)||void 0===x||null===(w=x.planInformation)||void 0===w?void 0:w.demolitionArea)+" "+U("BPA_SQ_MTRS_LABEL"):U("CS_NA")}))),Z&&l.createElement(o.Toast,{error:!0,label:U(null==Z?void 0:Z.message),isDleteBtn:!0,onClose:()=>{$(null)}}))},OwnerDetails:e=>{var n,i,a,r,d,s,c,p;let{t:v,config:m,onSelect:E,formData:f}=e,_={};sessionStorage.removeItem("currentPincode");let g=window.location.href.includes("edit-application"),A=window.location.href.includes("renew-trade");Digit.ULBService.getCurrentTenantId();const S=Digit.ULBService.getStateId(),[h,b]=t.useState(!g&&!A),[y,C]=t.useState([]),[T,D]=t.useState([]),[P,I]=t.useState(null==f||null===(n=f.owners)||void 0===n?void 0:n.ownershipCategory),[N,L]=t.useState((null==f||null===(i=f.owners)||void 0===i?void 0:i.name)||""),[B,O]=t.useState(!1),[R,x]=t.useState(null==f||null===(a=f.owners)||void 0===a?void 0:a.gender),[w,M]=t.useState((null==f||null===(r=f.owners)||void 0===r?void 0:r.mobileNumber)||""),[k,F]=t.useState((null==f||null===(d=f.owners)||void 0===d?void 0:d.emailId)||""),[U,H]=t.useState(null),[W,j]=t.useState(!1);Digit.Utils.browser.isMobile();const z=!(null==P||!P.code.includes("MULTIPLEOWNERS"));null==f||null===(s=f.owners)||void 0===s||null===(c=s.owners)||void 0===c||c.forEach(e=>{"false"==e.isPrimaryOwner&&(e.isPrimaryOwner=!1)});const[Y,G]=t.useState((null==f?void 0:f.owners)&&(null==f||null===(p=f.owners)||void 0===p?void 0:p.owners)||[{name:"",gender:"",mobileNumber:null,isPrimaryOwner:!0}]);t.useEffect(()=>{var e=0;Y.map(t=>{null!=t&&t.isPrimaryOwner&&(e=1),b(!(null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&t.gender))}),h||!P||null!=P&&P.code.includes("SINGLEOWNER")||b(1!=e)},[Y]),t.useEffect(()=>{const e=pt(Y);P&&!z&&(null==e?void 0:e.length)>1&&G([u({},e[0],{isPrimaryOwner:!0})])},[P]);const{isLoading:K,data:V}=Digit.Hooks.obps.useMDMS(S,"common-masters",["OwnerShipCategory"]),{data:q}=Digit.Hooks.obps.useMDMS(S,"common-masters",["GenderType"]);t.useEffect(()=>{var e;const t=null==V||null===(e=V["common-masters"])||void 0===e?void 0:e.OwnerShipCategory;if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>{var t;return null==e||null===(t=e.code)||void 0===t?void 0:t.includes("INDIVIDUAL")});e.forEach(e=>{e.i18nKey="COMMON_MASTERS_OWNERSHIPCATEGORY_"+mt(null==e?void 0:e.code,".","_")}),C(e)}},[V]),t.useEffect(()=>{var e;const t=(null==q||null===(e=q["common-masters"])||void 0===e?void 0:e.GenderType)||[];if(t&&(null==t?void 0:t.length)>0){const e=t.filter(e=>e.active);e.forEach(e=>{e.i18nKey="COMMON_GENDER_"+e.code}),D(e)}},[q]);const[X,J]=t.useState(null);return l.createElement("div",null,l.createElement(zl,{currentStep:2}),l.createElement(o.FormStep,{config:m,onSelect:function(){try{return J(null),Promise.resolve(function(e,t){try{let e=!1,t=[];return t=null==Y?void 0:Y.map((e,t)=>{var l;return Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==Y||null===(l=Y[t])||void 0===l?void 0:l.mobileNumber},{}).then(e=>e)}),Promise.resolve(Promise.all(t)).then(function(l){var n;t=l;let i=[],o=!1;return t&&(null===(n=t)||void 0===n?void 0:n.length)>0&&t.map(t=>{var l,n,a,r,u,d;o=null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n||null===(a=n.roles)||void 0===a||null===(r=a.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===r?void 0:r[0],Y.find(e=>{var l,n,i,a,r,u;return!(null!=e&&e.uuid&&!o)&&((null==e?void 0:e.name)===(null==t||null===(l=t.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.name)&&(null==e?void 0:e.mobileNumber)===(null==t||null===(i=t.user)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.mobileNumber)||(null==e?void 0:e.mobileNumber)===(null==t||null===(r=t.user)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.mobileNumber)&&o)})&&(e=!0,i.push(null==t||null===(u=t.user)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.mobileNumber))}),(null==i?void 0:i.length)>0&&H({key:"true",error:!0,message:v("BPA_OWNER_VALIDATION_1")+" "+(null==i?void 0:i.join(", "))+" "+v("BPA_OWNER_VALIDATION_2")}),1!=e})}catch(e){return Promise.reject(e)}}()).then(function(e){if(e)if(1==z&&1==Y.length)window.scrollTo(0,0),J("BPA_ERROR_MULTIPLE_OWNER");else{let e;e=u({},f.owners,{owners:Y,ownershipCategory:P}),E(m.key,e)}})}catch(e){return Promise.reject(e)}},onSkip:()=>E(),t:v,isDisabled:h||function(){let e=0;return Y&&(null==Y||Y.map(t=>{var l;1===e||null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&null!==(l=t.gender)&&void 0!==l&&l.code||(e=1)})),0!=e}()||!P||W,forcedError:v(X)},K?l.createElement(o.Loader,null):l.createElement("div",{style:{marginBottom:"10px"}},l.createElement("div",null,l.createElement(o.CardLabel,null,v("BPA_TYPE_OF_OWNER_LABEL")+" *"),l.createElement(o.RadioButtons,{isMandatory:m.isMandatory,options:y,selectedOption:P,optionsKey:"i18nKey",onSelect:function(e){I(e)},value:P,labelKey:"PT_OWNERSHIP",isDependent:!0})),Y.map((e,t)=>l.createElement("div",{key:e+"-"+t},l.createElement("div",{style:{border:"solid",borderRadius:"5px",padding:"10px",paddingTop:"20px",marginTop:"10px",borderColor:"#f3f3f3",background:"#FAFAFA"}},l.createElement(o.CardLabel,{style:{marginBottom:"-15px"}},v("CORE_COMMON_MOBILE_NUMBER")+" *"),z&&l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"5px"},fill:1!=Y.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>function(e){const t=[...Y];1!=t.length&&(t.splice(e,1),1==t.length&&(t[0]=u({},t[0],{isPrimaryOwner:!0})),G(t))}(t)}),l.createElement("div",{style:{marginTop:"30px"}},l.createElement("div",{className:"field-container"},l.createElement("div",{style:{position:"relative",zIndex:"100",left:"35px",marginTop:"-24.5px",marginLeft:"-25px"}},"+91"),l.createElement(o.TextInput,u({style:{background:"#FAFAFA",padding:"0px 35px"},type:"text",t:v,isMandatory:!1,optionKey:"i18nKey",name:"mobileNumber",value:e.mobileNumber,onChange:e=>function(e,t){let l=[...Y];l[e].mobileNumber=t.target.value,M(t.target.value),G(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e)},_={isRequired:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:v("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"35px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>function(e,t){try{var l,n,i,o;const t=pt(Y),a=(null==t||null===(l=t[e])||void 0===l?void 0:l.mobileNumber)||"";if(H(null),!a.match(vt("MobileNo")))return H({key:"true",error:!0,message:"ERR_MOBILE_NUMBER_INCORRECT"}),Promise.resolve();if(a===(null==t||null===(n=t[e])||void 0===n?void 0:n.userName)&&"BPA_ARCHITECT"!==(null===(i=ownerRoleCheck)||void 0===i?void 0:i.code)&&"BPA_SUPERVISOR"!==(null===(o=ownerRoleCheck)||void 0===o?void 0:o.code))return H({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED_TOGGLE_MSG"}),Promise.resolve();const r=t.findIndex(e=>e.userName===a);return Promise.resolve(function(l,n){var i;if(!(r>-1&&"BPA_ARCHITECT"!==(null===(l=ownerRoleCheck)||void 0===l?void 0:l.code)&&"BPA_SUPERVISOR"!==(null===(n=ownerRoleCheck)||void 0===n?void 0:n.code)))return Promise.resolve(Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==Y||null===(i=Y[e])||void 0===i?void 0:i.mobileNumber},{})).then(function(l){var n,i,o,a,r;let u=null==l||null===(n=l.user)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.roles)||void 0===o||null===(a=o.filter(e=>"BPA_ARCHITECT"===e.code||"BPA_SUPERVISOR"===e.code))||void 0===a?void 0:a[0];if(0===(null==l||null===(r=l.user)||void 0===r?void 0:r.length))H({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"});else{var d,s,c,p,v;const n=null==l||null===(d=l.user)||void 0===d?void 0:d[0];n.gender=n.gender?{code:n.gender,active:!0,i18nKey:"COMMON_GENDER_"+n.gender}:"",null!=n&&n.dob&&(n.dob=Tt(null==n?void 0:n.dob)),null!=n&&n.createdDate&&(n.createdDate=Nt(null==n?void 0:n.createdDate),n.lastModifiedDate=Nt(null==n?void 0:n.lastModifiedDate),n.pwdExpiryDate=Nt(null==n?void 0:n.pwdExpiryDate));let i=[...t];var m;i[e]&&(i[e]=n,i[e].isPrimaryOwner=(null===(m=Y[e])||void 0===m?void 0:m.isPrimaryOwner)||!1),G(i),null!==(s=i[e])&&void 0!==s&&s.mobileNumber&&null!==(c=i[e])&&void 0!==c&&c.name&&null!==(p=i[e])&&void 0!==p&&null!==(v=p.gender)&&void 0!==v&&v.code?b(!0):b(!1),u&&(b(!1),setownerRoleCheck(u),H({key:"true",error:!0,message:"BPA_OWNER_VALIDATION_"+(null==u?void 0:u.code)}))}});H({key:"true",error:!0,message:"ERR_OWNER_ALREADY_ADDED"})}())}catch(e){return Promise.reject(e)}}(t)}," ",l.createElement(o.SearchIcon,null)," "))),l.createElement(o.CardLabel,null,v("CORE_COMMON_NAME")+" *"),l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:v,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:e.name,onChange:e=>function(e,t){let l=[...Y];l[e].name=t.target.value,L(t.target.value),G(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e)},_={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:v("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,v("BPA_APPLICANT_GENDER_LABEL")+" *"),l.createElement(o.RadioOrSelect,{name:"gender",options:T,selectedOption:e.gender,optionKey:"i18nKey",onSelect:e=>function(e,t){let l=[...Y];l[e].gender=t,x(t),G(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e),t:v}),l.createElement(o.CardLabel,null,""+v("CORE_EMAIL_ID")),l.createElement(o.TextInput,u({style:{background:"#FAFAFA"},t:v,type:"emailId",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:e.emailId,onChange:e=>function(e,t){let l=[...Y];l[e].emailId=t.target.value,F(t.target.value),G(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&b(!1)}(t,e)},_={pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"emailId",title:v("TL_EMAIL_ID_ERROR_MESSAGE")})),z&&l.createElement(o.CheckBox,{label:v("BPA_IS_PRIMARY_OWNER_LABEL"),onChange:e=>function(e,t){let l=[...Y];l.map(e=>{e.isPrimaryOwner=!1}),l[e].isPrimaryOwner=!z||t.target.checked,O(t.target.checked),G(l)}(t,e),value:e.isPrimaryOwner,checked:e.isPrimaryOwner,style:{paddingTop:"10px"}})))),z?l.createElement("div",null,l.createElement("div",{style:{display:"flex",paddingBottom:"15px",color:"#FF8C00"}},l.createElement("button",{type:"button",style:{paddingTop:"10px"},onClick:()=>function(){const e=[...Y];e.push({name:"",gender:"",mobileNumber:null,isPrimaryOwner:!1}),G(e),b(!0)}()},v("BPA_ADD_OWNER")))):null)),U&&l.createElement(o.Toast,{error:null==U?void 0:U.error,warning:null==U?void 0:U.warning,label:v(null==U?void 0:U.message),isDleteBtn:!0,onClose:()=>{H(null)}}))},DocumentDetails:e=>{var n,i;let{t:a,config:r,onSelect:d,formData:s}=e;const c=Digit.ULBService.getStateId(),[p,v]=t.useState((null==s||null===(n=s.documents)||void 0===n?void 0:n.documents)||[]),[m,E]=t.useState(null),[f,_]=t.useState(!0),[g,A]=t.useState(!1),S=null==s||null===(i=s.uiFlow)||void 0===i?void 0:i.flow,h=pt((null==s?void 0:s.PrevStateDocuments)||[]),{data:b,isLoading:y}=Digit.Hooks.obps.useBPATaxDocuments(c,s,h||[]);return t.useEffect(()=>{const e=b.filter(e=>e.required).map(e=>e.code),t=e.filter(e=>p.reduce((t,l)=>{var n,i,o,a;return e==(null==l||null===(n=l.documentType)||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i[0])+"."+(null==l||null===(o=l.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1])||t},!1));_(!(t.length==e.length&&p.length>0))},[p,g]),l.createElement("div",null,l.createElement(zl,{currentStep:"OCBPA"===S?3:2,flow:"OCBPA"===S?"OCBPA":""}),y?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e,t=s.documents,l=[];b&&b.map(e=>{p&&p.filter(t=>e.code===mt(null==t?void 0:t.additionalDetails.category,"_",".")).map(e=>{l.push(e)})}),e=u({},t,{documents:l}),d(r.key,e)},onSkip:()=>d(),isDisabled:!window.location.href.includes("editApplication")&&!window.location.href.includes("sendbacktocitizen")&&f,onAdd:function(){}},null==b?void 0:b.map((e,t)=>l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"600px",minWidth:"280px",marginBottom:"15px",paddingTop:"15px"}},l.createElement(Gl,{key:t,document:e,t:a,error:m,setError:E,setDocuments:v,documents:p,setCheckRequiredFields:A,formData:s,beforeUploadDocuments:h||[]}))),m&&l.createElement(o.Toast,{label:m,onClose:()=>E(null),error:!0})),(window.location.href.includes("/bpa/building_plan_scrutiny/new_construction")||window.location.href.includes("/ocbpa/building_oc_plan_scrutiny/new_construction"))&&null!=s&&s.applicationNo?l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:a("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==s?void 0:s.applicationNo)+" "+a("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"}):"")},NOCDetails:e=>{var n,i;let{t:a,config:r,onSelect:d,formData:s}=e;Digit.ULBService.getCurrentTenantId();const c=Digit.ULBService.getStateId(),[p,v]=t.useState((null==s||null===(n=s.nocDocuments)||void 0===n?void 0:n.nocDocuments)||[]),[m,E]=t.useState(null),[f,_]=t.useState([]),[g,A]=t.useState(!0),[S,h]=t.useState(!1);let[b,y]=t.useState(null!=s&&s.PrevStateNocDocuments?pt(null==s?void 0:s.PrevStateNocDocuments):[]);const C=null==s||null===(i=s.uiFlow)||void 0===i?void 0:i.flow,[T,D]=t.useState(null==s?void 0:s.applicationNo),[P,I]=t.useState([]),[N,L]=t.useState([]),[B,O]=t.useState([]),{data:R}=Digit.Hooks.obps.useNocDetails(null==s?void 0:s.tenantId,{sourceRefId:T}),{isLoading:x,data:w}=Digit.Hooks.obps.useMDMS(c,"NOC",["DocumentTypeMapping"]),{data:M}=Digit.Hooks.obps.useMDMS(c,"common-masters",["DocumentType"]),{data:k,isLoading:F}=Digit.Hooks.useDocumentSearch(b,{enabled:(null==b?void 0:b.length)>0});return t.useEffect(()=>{var e,t;(null==k||null===(e=k.pdfFiles)||void 0===e?void 0:e.length)>0&&(null==k||null===(t=k.pdfFiles)||void 0===t||t.forEach(e=>e.title=null==e?void 0:e.documentType),y(null==k?void 0:k.pdfFiles))},[null==k?void 0:k.pdfFiles]),t.useEffect(()=>{I(R)},[R]),t.useEffect(()=>{var e;L(null==w||null===(e=w.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[w]),t.useEffect(()=>{var e;O(null==M||null===(e=M["common-masters"])||void 0===e?void 0:e.DocumentType)},[M]),t.useEffect(()=>{if(null!=P&&P.length&&null!=N&&N.length){let e=[];P.map(t=>{var l,n;const i=N.filter(e=>e.applicationType===t.applicationType&&e.nocType===t.nocType);null!=i&&null!==(l=i[0])&&void 0!==l&&null!==(n=l.docTypes)&&void 0!==n&&n[0]&&(i[0].docTypes[0].nocType=i[0].nocType,i[0].docTypes[0].additionalDetails={submissionDetails:t.additionalDetails,applicationStatus:t.applicationStatus,appNumberLink:t.applicationNo,nocNo:t.nocNo},e.push(i[0].docTypes[0]))});let t=[];e&&e.length>0&&e.map(e=>{let l=e.documentType;e.dropdownData=[],e.uploadedDocuments=[],B&&B.forEach(t=>{let n=t.code.slice(0,l.length);l===n&&(e.hasDropdown=!0,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],b.map(t=>{var n,i;l===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(i=t.documentType)||void 0===i?void 0:i.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),t.push(e)}),t.forEach(e=>{e.code=e.documentType,e.dropdownData.forEach(e=>{e.i18nKey=e.code})}),_(t)}},[P,N,B,b]),l.createElement("div",null,l.createElement(zl,{currentStep:3,flow:"OCBPA"===C?"OCBPA":""}),x?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e;e=u({},s.nocDocuments,{nocDocuments:p,NocDetails:P,nocTaxDocuments:f}),d(r.key,e)},onSkip:()=>{let e;e=u({},s.nocDocuments,{nocDocuments:p,NocDetails:P,nocTaxDocuments:f}),d(r.key,e)},onAdd:function(){}},null==f?void 0:f.map((e,t)=>l.createElement(Vl,{key:t,document:e,t:a,error:m,setError:E,setNocDocuments:v,nocDocuments:p,setCheckRequiredFields:h,formData:s,beforeUploadNocDocuments:b,pdfLoading:F})),m&&l.createElement(o.Toast,{label:m,onClose:()=>E(null),error:!0})))},NOCNumber:e=>{let{t:n,config:i,onSelect:a,formData:r}=e;const[d,s]=t.useState(null),c=Digit.ULBService.getCurrentTenantId();function p(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}function v(e){let t={};return e.map((e,l)=>{t["Block_"+e.floorNo]=e.id}),t}return l.createElement("div",null,l.createElement(zl,{currentStep:3}),l.createElement(o.FormStep,{t:n,config:i,onSelect:()=>{let e,t=r.owners;if(e=u({},t),null!=r&&r.id)a(i.key,e);else{var l,n,o,s,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j,z,Y,G,K,V,q,X,J,Z;let i=null==r||null===(l=r.owners)||void 0===l?void 0:l.ownershipCategory,$=[];null===(n=e)||void 0===n||null===(o=n.owners)||void 0===o||o.map(e=>{$.push(u({},e,{active:!0,name:e.name,emailId:e.emailId,mobileNumber:e.mobileNumber,isPrimaryOwner:e.isPrimaryOwner,gender:e.gender.code,fatherOrHusbandName:"NAME"}))});let Q={};Q.edcrNumber=null!=r&&null!==(s=r.edcrNumber)&&void 0!==s&&s.edcrNumber?null==r||null===(m=r.edcrNumber)||void 0===m?void 0:m.edcrNumber:null==r||null===(E=r.data)||void 0===E||null===(f=E.scrutinyNumber)||void 0===f?void 0:f.edcrNumber,Q.riskType=null==r||null===(_=r.data)||void 0===_?void 0:_.riskType,Q.applicationType=null==r||null===(g=r.data)||void 0===g?void 0:g.applicationType,Q.serviceType=null==r||null===(A=r.data)||void 0===A?void 0:A.serviceType;const ee=Digit.UserService.getUser(),te=null==ee||null===(S=ee.info)||void 0===S?void 0:S.uuid;Q.tenantId=null==r||null===(h=r.address)||void 0===h||null===(b=h.city)||void 0===b?void 0:b.code,Q.workflow={action:"INITIATE",assignes:[null==ee||null===(y=ee.info)||void 0===y?void 0:y.uuid]},Q.accountId=te,Q.documents=null,Q.additionalDetails={GISPlaceName:null==r||null===(C=r.address)||void 0===C?void 0:C.placeName},Q.additionalDetails.boundaryWallLength=(null==r||null===(T=r.data)||void 0===T?void 0:T.boundaryWallLength)||"NA",Q.additionalDetails.area=(null==r?void 0:r.data.edcrDetails.planDetail.planInformation.plotArea).toString()||"NA",Q.additionalDetails.height=(null==r?void 0:r.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString()||"NA",Q.additionalDetails.usage=(null==r?void 0:r.data.occupancyType)||"NA",Q.additionalDetails.builtUpArea=(null==r?void 0:r.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(),Q.additionalDetails.nocNumber=d,null!=r&&null!==(D=r.data)&&void 0!==D&&D.holdingNumber&&(Q.additionalDetails.holdingNo=null==r||null===(P=r.data)||void 0===P?void 0:P.holdingNumber),null!=r&&null!==(I=r.data)&&void 0!==I&&I.registrationDetails&&(Q.additionalDetails.registrationDetails=null==r||null===(N=r.data)||void 0===N?void 0:N.registrationDetails),null!=r&&null!==(L=r.data)&&void 0!==L&&L.applicationType&&(Q.additionalDetails.applicationType=null==r||null===(B=r.data)||void 0===B?void 0:B.applicationType),null!=r&&null!==(O=r.data)&&void 0!==O&&O.serviceType&&(Q.additionalDetails.serviceType=null==r||null===(R=r.data)||void 0===R?void 0:R.serviceType),Q.landInfo={},Q.landInfo.address={},null!=r&&null!==(x=r.address)&&void 0!==x&&null!==(w=x.city)&&void 0!==w&&w.code&&(Q.landInfo.address.city=null==r||null===(M=r.address)||void 0===M||null===(k=M.city)||void 0===k?void 0:k.code),null!=r&&null!==(F=r.address)&&void 0!==F&&null!==(U=F.locality)&&void 0!==U&&U.code&&(Q.landInfo.address.locality={code:null==r||null===(H=r.address)||void 0===H||null===(W=H.locality)||void 0===W?void 0:W.code}),null!=r&&null!==(j=r.address)&&void 0!==j&&j.pincode&&(Q.landInfo.address.pincode=null==r||null===(z=r.address)||void 0===z?void 0:z.pincode),null!=r&&null!==(Y=r.address)&&void 0!==Y&&Y.landmark&&(Q.landInfo.address.landmark=null==r||null===(G=r.address)||void 0===G?void 0:G.landmark),null!=r&&null!==(K=r.address)&&void 0!==K&&K.street&&(Q.landInfo.address.street=null==r||null===(V=r.address)||void 0===V?void 0:V.street),null!=r&&null!==(q=r.address)&&void 0!==q&&q.geoLocation&&(Q.landInfo.address.geoLocation=null==r||null===(X=r.address)||void 0===X?void 0:X.geoLocation),Q.landInfo.owners=$,Q.landInfo.ownershipCategory=i.code,Q.landInfo.tenantId=null==r||null===(J=r.address)||void 0===J||null===(Z=J.city)||void 0===Z?void 0:Z.code,Q.landInfo.unit=function(e){var t,l,n;const i=null==e?void 0:e.subOccupancy,o=(null==e||null===(t=e.data)||void 0===t||null===(l=t.edcrDetails)||void 0===l||null===(n=l.planDetail)||void 0===n?void 0:n.blocks)||[];let a=[];return i&&Object.entries(i).map((e,t)=>{var l,n,i,r,u,d;a.push({blockIndex:t,floorNo:e[0].split("_")[1],unitType:"Block",occupancyType:(null==o||null===(l=o[t])||void 0===l||null===(n=l.building)||void 0===n||null===(i=n.occupancies)||void 0===i||null===(r=i[0])||void 0===r||null===(u=r.typeHelper)||void 0===u||null===(d=u.type)||void 0===d?void 0:d.code)||"A",usageCategory:p(e[1])})}),a}(r);let le=sessionStorage.getItem("BPA_ARCHITECT_NAME"),ne=le?JSON.parse(le):"ARCHITECT";Q.additionalDetails.typeOfArchitect=ne;let ie=sessionStorage.getItem("isSelfCertificationRequired");"undefined"===ie&&(ie="false"),Q.additionalDetails.isSelfCertificationRequired=ie.toString(),!0!==ie||"Residential"!==(null==r?void 0:r.data.occupancyType)||"ARCHITECT"!=ne&&"ENGINEER"!=ne&&"DESIGNER"!=ne&&"SUPERVISOR"!=ne?Digit.OBPSService.create({BPA:Q},c).then((e,l)=>{var n,o,d,s,c,p,m,E,f,_,g,A;(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&(null==e||null===(o=e.BPA)||void 0===o||null===(d=o[0])||void 0===d||null===(s=d.landInfo)||void 0===s||null===(c=s.owners)||void 0===c||c.forEach(e=>{e.gender={code:e.gender,active:!0,i18nKey:"COMMON_GENDER_"+e.gender}}),e.BPA[0].owners=u({},t,{owners:null==e||null===(p=e.BPA)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.landInfo)||void 0===E?void 0:E.owners,ownershipCategory:i}),e.BPA[0].address=null==e||null===(f=e.BPA)||void 0===f||null===(_=f[0])||void 0===_||null===(g=_.landInfo)||void 0===g?void 0:g.address,e.BPA[0].address.city=r.address.city,e.BPA[0].address.locality=r.address.locality,e.BPA[0].placeName=null==r||null===(A=r.address)||void 0===A?void 0:A.placeName,e.BPA[0].data=r.data,e.BPA[0].BlockIds=v(e.BPA[0].landInfo.unit),e.BPA[0].subOccupancy=null==r?void 0:r.subOccupancy,e.BPA[0].uiFlow=null==r?void 0:r.uiFlow,a("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;setShowToast({key:"true",error:!0,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?void 0:n.message})}):(null==r?void 0:r.data.edcrDetails.planDetail.blocks[0].building.buildingHeight)>15?alert("Height should not be more than 15 metres"):("ARCHITECT"==ne||"ENGINEER"==ne)&&(null==r?void 0:r.data.edcrDetails.planDetail.planInformation.plotArea)>500?alert("Architect/Engineer can apply for area less then 500 sq. yards. in self declaration"):("DESIGNER"==ne||"SUPERVISOR"==ne)&&(null==r?void 0:r.data.edcrDetails.planDetail.planInformation.plotArea)>250?alert("Designer/Supervisor can apply for area less then 500 sq. yards. in self declaration"):Digit.OBPSService.create({BPA:Q},c).then((e,l)=>{var n,o,d,s,c,p,m,E,f,_,g,A;(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)>0&&(null==e||null===(o=e.BPA)||void 0===o||null===(d=o[0])||void 0===d||null===(s=d.landInfo)||void 0===s||null===(c=s.owners)||void 0===c||c.forEach(e=>{e.gender={code:e.gender,active:!0,i18nKey:"COMMON_GENDER_"+e.gender}}),e.BPA[0].owners=u({},t,{owners:null==e||null===(p=e.BPA)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.landInfo)||void 0===E?void 0:E.owners,ownershipCategory:i}),e.BPA[0].address=null==e||null===(f=e.BPA)||void 0===f||null===(_=f[0])||void 0===_||null===(g=_.landInfo)||void 0===g?void 0:g.address,e.BPA[0].address.city=r.address.city,e.BPA[0].address.locality=r.address.locality,e.BPA[0].placeName=null==r||null===(A=r.address)||void 0===A?void 0:A.placeName,e.BPA[0].data=r.data,e.BPA[0].BlockIds=v(e.BPA[0].landInfo.unit),e.BPA[0].subOccupancy=null==r?void 0:r.subOccupancy,e.BPA[0].uiFlow=null==r?void 0:r.uiFlow,a("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;setShowToast({key:"true",error:!0,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?void 0:n.message})})}},isDisabled:!d,onChange:function(e){s(e.target.value)}},l.createElement("span",{onClick:function(){console.log("inside_search")},style:{alignSelf:"flex-start",marginBottom:"5px",backgroundColor:"maroon",border:"1px solid marron",color:"white",padding:"5px 10px",borderRadius:"3px",cursor:"pointer"}},"SEARCH NOC")))},LocationDetails:e=>{var n,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w;let{t:M,config:k,onSelect:F,userType:U,formData:H,ownerIndex:W=0}=e,j=JSON.parse(sessionStorage.getItem("Digit_OBPS_PT")),z=JSON.parse(sessionStorage.getItem("currentCity"))||{},Y=sessionStorage.getItem("currentPincode");JSON.parse(sessionStorage.getItem("currentLocality"));const G=Digit.Hooks.obps.useTenants(),K=(i.useLocation(),Digit.ULBService.getCurrentTenantId()),[V,q]=(Digit.ULBService.getStateId(),t.useState(null)),[X,J]=t.useState(!1),[Z,$]=t.useState(Y||(null===(n=H)||void 0===n||null===(a=n.address)||void 0===a?void 0:a.pincode)||(null==j||null===(r=j.address)||void 0===r?void 0:r.pincode)||""),[Q,ee]=t.useState((null===(d=H)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.geoLocation)||""),[te,le]=t.useState(null===(c=H)||void 0===c||null===(p=c.Scrutiny)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.tenantIdData),[ne,ie]=t.useState(()=>{var e,t,l;return(null===(e=H)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.city)||z||(null==j||null===(l=j.address)||void 0===l?void 0:l.pincode)||null}),[oe,ae]=t.useState((null===(m=H)||void 0===m||null===(E=m.address)||void 0===E?void 0:E.street)||(null==j||null===(f=j.address)||void 0===f?void 0:f.street)||""),[re,ue]=t.useState((null===(_=H)||void 0===_||null===(g=_.address)||void 0===g?void 0:g.landmark)||(null===(A=H)||void 0===A||null===(S=A.address)||void 0===S?void 0:S.Landmark)||(null==j||null===(h=j.address)||void 0===h?void 0:h.landmark)||""),[de,se]=t.useState((null===(b=H)||void 0===b||null===(y=b.address)||void 0===y?void 0:y.placeName)||(null===(C=H)||void 0===C?void 0:C.placeName)||""),[ce,pe]=t.useState(),[ve,me]=t.useState((null==j||null===(T=j.address)||void 0===T?void 0:T.locality)||(null===(D=H)||void 0===D||null===(P=D.address)||void 0===P?void 0:P.locality)||null);let[Ee,fe]=t.useState(G),_e=null===(I=H)||void 0===I||null===(N=I.data)||void 0===N||null===(L=N.edcrDetails)||void 0===L?void 0:L.tenantId;H={address:u({},null===(B=H)||void 0===B?void 0:B.address)};const ge=window.Digit.Utils.browser.isMobile();t.useEffect(()=>{var e;if(!ne||!ce)if(Ee=U&&"employee"===U?G.filter(e=>e.code===K):Z?G.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==Number(Z))}):G,fe(Ee),0==(null===(e=Ee)||void 0===e?void 0:e.length))q("BPA_PIN_NOT_VALID_ERROR");else if(1==Ee.length){var t;(null===(t=Ee)||void 0===t?void 0:t[0].code)!=(null!=ne&&ne.code?null==ne?void 0:ne.code:ne||"")&&q("BPA_PIN_NOT_VALID_ERROR")}},[Z]),t.useEffect(()=>{Ee.map((e,t)=>{e.code===_e&&(ie(e),sessionStorage.setItem("currentCity",JSON.stringify(e)))})},[Ee,null===(O=H)||void 0===O?void 0:O.data]),t.useEffect(()=>{var e;Ee&&1===Ee.length&&(null===(e=Ee)||void 0===e?void 0:e[0].code)===(null==ne?void 0:ne.code)&&(ie(Ee[0]),sessionStorage.setItem("currentCity",JSON.stringify(Ee[0])))},[Ee]);const{data:Ae}=Digit.Hooks.useBoundaryLocalities(null==ne?void 0:ne.code,"revenue",{enabled:!!ne},M);let Se=window.location.href.includes("editApplication"),he=window.location.href.includes("sendbacktocitizen");function be(e){q(null),""!==("object"==typeof e&&null!==e?e.target.value:e)&&(("object"==typeof e&&null!==e?e.target.value:e).match(/^[1-9][0-9]{5}$/)||q("BPA_PIN_NOT_VALID_ERROR")),H.address.pincode="object"==typeof e&&null!==e?e.target.value:e,$("object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentPincode","object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),me(null),pe(null)}return t.useEffect(()=>{var e,t;if(null!=j&&null!==(e=j.address)&&void 0!==e&&e.locality)me(null==j||null===(t=j.address)||void 0===t?void 0:t.locality);else if(ne&&Ae&&!V){var l,n,i,o,a,r,u,d;let e=Ae,t=[];var s,c;console.log("fetchedLocalities",Ae),null!==(l=H)&&void 0!==l&&null!==(n=l.address)&&void 0!==n&&n.locality&&(null===(i=H)||void 0===i||null===(o=i.address)||void 0===o||null===(a=o.locality)||void 0===a?void 0:a.code)===(null==ve?void 0:ve.code)&&me(H.address.locality),(null!==(r=H)&&void 0!==r&&null!==(u=r.address)&&void 0!==u&&u.pincode||Z)&&!V&&(t=e.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==Z)}),(null===(s=H)||void 0===s||null===(c=s.address)||void 0===c||!c.locality)&&t.length<=0&&me()),(!ce||t.length>0&&ce.length!==t.length||t.length<=0&&ce&&ce.length!==e.length)&&(console.log("filteredLocalityList",t),pe(()=>t.length>0?t:e)),1===t.length&&(null==ve||ve&&(null===(d=t[0])||void 0===d?void 0:d.code)!==(null==ve?void 0:ve.code))&&(me(t[0]),sessionStorage.setItem("currLocality",JSON.stringify(t[0])))}},[ne,null===(R=H)||void 0===R?void 0:R.pincode,Ae,Z,Q]),l.createElement("div",null,!X&&l.createElement(zl,null),X&&l.createElement(ql,{t:M,onSelect:F,formData:H,handleRemove:()=>{J(!X)},onSave:function(e,t,l){be(t),sessionStorage.setItem("currentPincode",t),ee(e),se(l),J(!1),q(null)}}),!X&&l.createElement(o.FormStep,{t:M,config:k,onSelect:()=>{const e={};e.pincode=Z,e.city=ne,e.locality=ve,e.street=oe,e.landmark=re,e.geoLocation=Q,e.placeName=de,F(k.key,e)},isDisabled:!ne||!ve||V,isMultipleAllow:!0,forcedError:M(V)},l.createElement(o.CardLabel,null,""+M("BPA_GIS_LABEL")),l.createElement("div",{style:{}},l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:M,name:"gis",value:Se||he?null!==Q.latitude?Q.latitude+", "+Q.longitude:"":de,onChange:function(e){H.address.geoLocation="object"==typeof e&&null!==e?e.target.value:e,ee("object"==typeof e&&null!==e?e.target.value:e),se("object"==typeof e&&null!==e?e.target.value:e),sessionStorage.setItem("currentPincode",""),sessionStorage.setItem("currentCity",JSON.stringify({})),sessionStorage.setItem("currLocality",JSON.stringify({})),$(""),me(null)}}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:ge?{float:"right",position:"relative",bottom:"35px",marginTop:"-20px",marginRight:"5px"}:{position:"relative",left:"515px",bottom:"35px",marginTop:"-20px"},width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 7C8.79 7 7 8.79 7 11C7 13.21 8.79 15 11 15C13.21 15 15 13.21 15 11C15 8.79 13.21 7 11 7ZM19.94 10C19.48 5.83 16.17 2.52 12 2.06V0H10V2.06C5.83 2.52 2.52 5.83 2.06 10H0V12H2.06C2.52 16.17 5.83 19.48 10 19.94V22H12V19.94C16.17 19.48 19.48 16.17 19.94 12H22V10H19.94ZM11 18C7.13 18 4 14.87 4 11C4 7.13 7.13 4 11 4C14.87 4 18 7.13 18 11C18 14.87 14.87 18 11 18Z",fill:"#505A5F"})))),style:{},onClick:e=>{J(!X)}})),l.createElement(o.CardLabel,null,""+M("BPA_DETAILS_PIN_LABEL")),!X&&l.createElement(o.TextInput,{isMandatory:!1,optionKey:"i18nKey",type:"text",t:M,name:"pincode",onChange:be,value:Z,disabled:!(null==j||!j.address)}),l.createElement(o.CardLabel,null,M("BPA_CITY_LABEL")+"*"),!X&&l.createElement(o.RadioOrSelect,{options:Ee.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:ne,optionKey:"code",onSelect:function(e){me(null),pe(null),ie(e),sessionStorage.setItem("currentCity",JSON.stringify(e)),H.address.city=e},t:M,isDependent:!0,disabled:!(null==j||!j.address)}),l.createElement("span",{className:"form-pt-dropdown-only"},l.createElement(o.CardLabel,null,M("BPA_LOC_MOHALLA_LABEL")+"*"),X||!ne||!ce||null!=j&&j.address?l.createElement(o.TextInput,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:k.isMandatory,value:null==j||null===(x=j.address)||void 0===x||null===(w=x.locality)||void 0===w?void 0:w.name,optionKey:"i18nkey",t:M,isDependent:!0,labelKey:mt(null==ne?void 0:ne.code,".","_").toUpperCase()+"_REVENUE",disabled:!(null==j||!j.address)}):l.createElement(o.RadioOrSelect,{optionCardStyles:{maxHeight:"20vmax",overflow:"scroll"},isMandatory:k.isMandatory,options:ce.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:ve,optionKey:"i18nkey",onSelect:function(e){var t,l;null!==(t=H)&&void 0!==t&&null!==(l=t.address)&&void 0!==l&&l.locality&&(H.address.locality=e),me(e),sessionStorage.setItem("currLocality",JSON.stringify(e))},t:M,isDependent:!0,labelKey:mt(null==ne?void 0:ne.code,".","_").toUpperCase()+"_REVENUE"})),l.createElement(o.CardLabel,null,""+M("BPA_DETAILS_SRT_NAME_LABEL")),!X&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:M,name:"street",onChange:function(e){ae(e.target.value)},value:oe,disabled:!(null==j||!j.address)}),l.createElement(o.CardLabel,null,""+M("ES_NEW_APPLICATION_LOCATION_LANDMARK")),!X&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:M,name:"landmark",onChange:function(e){ue(e.target.value)},value:re,disabled:!(null==j||!j.address)})))},GIS:ql,OCEDCRDocsRequired:e=>{let{onSelect:i}=e;const{t:a}=n.useTranslation(),r=[{code:"BPA_PERMIT_NUMBER_OC_SCRUTINY_LABEL"},{code:"BPA_PERMIT_DATE_LABEL"},{code:"BPA_OC_PLAN_DXF_FILE"}];return l.createElement(t.Fragment,null,l.createElement(o.Card,null,l.createElement(o.CardHeader,null,a("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},a("OBPS_OCEDCR_BUILDING_PERMIT_DESCRIPTION")),l.createElement(t.Fragment,null,null==r?void 0:r.map((e,t)=>l.createElement(o.CardLabel,{style:{fontWeight:700},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",null,t+1+"."," "),l.createElement("div",null," "+a(null==e?void 0:e.code.replace(".","_"))))))),l.createElement(o.SubmitBar,{label:a("CS_COMMON_NEXT"),onSubmit:()=>{i()}})),l.createElement(o.CitizenInfoLabel,{info:a("CS_FILE_APPLICATION_INFO_LABEL"),text:a("OBPS_OC_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"}))},OCeDCRScrutiny:e=>{var n,i,a,r,d,s,c;let{t:p,config:v,onSelect:m,formData:E,ownerIndex:f=0}=e;const _=Digit.ULBService.getCurrentTenantId(),[g,A]=(Digit.ULBService.getStateId(),t.useState(null==E||null===(n=E.ScrutinyDetails)||void 0===n?void 0:n.ocPermitNumber)),[S,h]=t.useState(null==E||null===(i=E.ScrutinyDetails)||void 0===i?void 0:i.ocPermitdate),[b,y]=t.useState(null==E?void 0:E.ScrutinyDetails),[C,T]=t.useState(null);let D={};function P(){}const I=()=>{},N=()=>{const e={};e.file=file,m(v.key,e)};return l.createElement("div",null,l.createElement(o.FormStep,{t:p,config:v,onSelect:N,onSkip:I,isDisabled:!g,onAdd:P,isMultipleAllow:!0},l.createElement(o.CardCaption,null,""+p("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardHeader,null,""+p("BPA_OC_EDCR_SCRUTINY_LABEL")),l.createElement(o.CardText,null,""+p("BPA_PROVIDE_BPN_AND_BPD_APP_LABEL")),l.createElement(o.CardLabel,null,p("EDCR_BUILDING_PERMIT_NUM_LABEL")+" *"),l.createElement(o.TextInput,u({isMandatory:!1,optionKey:"i18nKey",t:p,name:"permitNumber",onChange:function(e){A(e.target.value)},value:g},D={isRequired:!0,pattern:vt("Name"),title:p("BPA_INVALID_NAME")})),l.createElement(o.CardLabel,null,p("EDCR_BUILDING_PERMIT_DATE_LABEL")+" *"),l.createElement(o.DatePicker,{date:S,name:"permitDate",onChange:function(e){h(e)}}),l.createElement("div",{onClick:function(){try{y({}),T(null);let e={permitDate:Tt(S),approvalNo:g};return Digit.OBPSService.BPASearch(_,e).then((e,t)=>{var l,n;if((null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0){var i,o,a,r,u,d;const t=null==e||null===(i=e.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber,l=null==e||null===(a=e.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId;S===(e=>{if(e){const t=new Date(e);let l=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return l=(l>9?"":"0")+l,n=(n>9?"":"0")+n,i+"-"+l+"-"+n}return null})(null==e||null===(u=e.BPA)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.approvalDate)?Digit.OBPSService.scrutinyDetails(l,{edcrNumber:t}).then(t=>{var n,i;Digit.WorkflowService.getAllApplication(l,{businessIds:null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.applicationNo,history:!0}).then((l,n)=>{var i,o,a,r,u;const d=null==l||null===(i=l.ProcessInstances)||void 0===i?void 0:i[(null==l||null===(o=l.ProcessInstances)||void 0===o?void 0:o.length)-1],s=(null==d||null===(a=d.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name)||"";if((null==t||null===(u=t.edcrDetail)||void 0===u?void 0:u.length)>0){var c,p,v,m,E,f;const l=null==e||null===(c=e.BPA)||void 0===c||null===(p=c[0])||void 0===p||null===(v=p.landInfo)||void 0===v||null===(m=v.owners)||void 0===m?void 0:m.filter(e=>e.isPrimaryOwner&&"false"!=e.isPrimaryOwner);t.edcrDetail[0].applicantName=null==l||null===(E=l[0])||void 0===E?void 0:E.name,t.edcrDetail[0].ocPermitNumber=g,t.edcrDetail[0].ocPermitdate=S,t.edcrDetail[0].appliedBy=s,y(null==t||null===(f=t.edcrDetail)||void 0===f?void 0:f[0])}}).catch(e=>{var t,l,n;T({key:"error",error:!0,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?void 0:n.message)||null})})}).catch(e=>{var t,l,n;T({key:"error",error:!0,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?void 0:n.message)||null})}):T({key:"error",warning:!0,message:p("ERR_FILL_EDCR_PERMIT_INCORRECT_DATE")})}else 0==(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)&&T({key:"error",error:!0,message:p("BPA_NO_REC_FOUND_LABEL")})}).catch(e=>{var t,l,n;T({key:"error",error:!0,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?void 0:n.message)||null})}),Promise.resolve()}catch(e){return Promise.reject(e)}}},l.createElement(o.SubmitBar,{label:p("ACTION_TEST_BPA_STAKE_HOLDER_SEARCH"),disabled:!g||!S})),C&&l.createElement(o.Toast,{error:null==C?void 0:C.error,warning:null==C?void 0:C.warning,label:p(null==C?void 0:C.message),isDleteBtn:!0,onClose:()=>{T(null)}})),null!=b&&b.edcrNumber?l.createElement(o.FormStep,{t:p,config:v,onSelect:N,onSkip:I,isDisabled:!g,onAdd:P,isMultipleAllow:!0},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+p("REPORT_FSM_RESULT_APPLICANTNAME"),text:p(null==b?void 0:b.applicantName),className:"border-none"}),l.createElement(o.Row,{label:""+p("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:p(null==b?void 0:b.applicationSubType),className:"border-none"}),l.createElement(o.Row,{label:""+p("EDCR_TOTAL_BUILD_UP_AREA_LABEL"),text:p(null==b||null===(a=b.planDetail)||void 0===a||null===(r=a.virtualBuilding)||void 0===r?void 0:r.totalBuitUpArea),className:"border-none"}),l.createElement(o.Row,{label:""+p("EDCR_BUILDING_HEIGHT_LABEL"),text:p(null==b||null===(d=b.planDetail)||void 0===d||null===(s=d.blocks[0])||void 0===s||null===(c=s.building)||void 0===c?void 0:c.buildingHeight),className:"border-none"}),l.createElement(o.Row,{label:""+p("BPA_ARCHITECT_NAME_LABEL"),text:p(null==b?void 0:b.appliedBy),className:"border-none"})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+p("BPA_PERMIT_EDCR_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+p("BPA_EDCR_NO_LABEL"),text:p(null==b?void 0:b.edcrNumber),className:"border-none"})),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+p("BPA_UPLOADED_PLAN_DIAGRAM_LABEL")),l.createElement("a",{target:"_",href:null==b?void 0:b.updatedDxfFile,style:{minWidth:"160px",marginRight:"20px"},key:null==b?void 0:b.updatedDxfFile},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},p("BPA_UPLOADED_PLAN_DXF"))),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+p("BPA_SCRUTINY_REPORT_OUTPUT_LABEL")),l.createElement("a",{target:"_",href:null==b?void 0:b.planReport,style:{minWidth:"160px",marginRight:"20px"},key:null==b?void 0:b.planReport},l.createElement(o.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",fontSize:"14px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},p("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("div",{onClick:()=>{m(v.key,b)}},l.createElement(o.SubmitBar,{label:p("BPA_PROCEED_OC_SCRUTINY_LABEL")}))):null)},OCUploadPlanDiagram:e=>{var n;let{t:a,config:r,onSelect:u,formData:d,ownerIndex:s=0,isShowToast:c,isSubmitBtnDisable:p,setIsShowToast:v}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const[m,E]=t.useState(()=>{var e;return(null==d||null===(e=d.uploadData)||void 0===e?void 0:e.file)||null}),[f,_]=t.useState(null==d||null===(n=d.uploadData)||void 0===n?void 0:n.file),[g,A]=t.useState(""),S=i.useHistory();return t.useEffect(()=>{(g||c)&&(E(null),_(""),A("")),c&&S.push("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null!=c&&c.label?null==c?void 0:c.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[g,c,p]),p?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{const e={};e.file=f,u(r.key,e,!0,!0)},onSkip:()=>{},isDisabled:!f||p,onAdd:function(){},isMultipleAllow:!0},l.createElement(o.CardLabel,null,a("BPA_OC_PLAN_DIAGRAM_DXF")+" *"),l.createElement(o.UploadFile,{id:"oc-doc",extraStyleName:"propertyCreate",onUpload:function(e){E(e.target.files[0]),_(e.target.files[0])},onDelete:()=>{E(null),_("")},message:m?"1 "+a("PT_ACTION_FILEUPLOADED"):a("ES_NO_FILE_SELECTED_LABEL"),uploadMessage:g}),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),c&&l.createElement(o.Toast,{error:c.key,label:a(c.label),onClose:()=>v(null),isDleteBtn:!0}))},StakeholderDocsRequired:e=>{var a,r,u,d;let{onSelect:s}=e;const{t:c}=n.useTranslation(),p=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:m,isLoading:E}=(i.useHistory(),Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping"));let f=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),t.useEffect(()=>{p&&Digit.LocalizationService.getLocale({modules:["rainmaker-bpareg"],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+p})},[p]),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:f?"OpenlinkContainer":""},l.createElement(o.Card,null,l.createElement(o.CardHeader,null,c("BPA_NEW_BUILDING_HEADER")),l.createElement(o.CardText,{style:{color:"#0B0C0C",marginTop:"12px",fontSize:"16px",fontWeight:"400",lineHeight:"24px"}},c("BPA_NEW_BUILDING_PERMIT_DESCRIPTION")),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==m||null===(a=m.StakeholderRegistraition)||void 0===a||null===(r=a.TradeTypetoRoleMapping)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.docTypes)||void 0===d?void 0:d.map((e,t)=>l.createElement("div",null,l.createElement("div",{style:{fontWeight:700,marginBottom:"8px"},key:t},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}},t+1+"."," "),l.createElement("div",null," "+c("BPAREG_HEADER_"+(null==e?void 0:e.code.replace(".","_")))))),l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{display:"flex"}},l.createElement("div",{style:{minWidth:"20px"}}),null!=e&&e.info?l.createElement("div",{style:{color:"#505A5F",fontSize:"16px"}},""+c(null==e?void 0:e.info.replace(".","_"))):null))))),l.createElement(o.SubmitBar,{label:c("CS_COMMON_NEXT"),onSubmit:s})),l.createElement(o.CitizenInfoLabel,{info:c("CS_FILE_APPLICATION_INFO_LABEL"),text:c("OBPS_DOCS_FILE_SIZE"),className:"info-banner-wrap-citizen-override"})))},LicenseType:e=>{var n,i,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h;let{t:b,config:y,onSelect:C,formData:T}=e;null!==JSON.parse(sessionStorage.getItem("BPAREGintermediateValue"))?(T=JSON.parse(sessionStorage.getItem("BPAREGintermediateValue")),sessionStorage.setItem("BPAREGintermediateValue",null)):T=T,null===(n=window.location.href)||void 0===n||n.split("/").pop(),Digit.ULBService.getCurrentTenantId();const D=Digit.ULBService.getStateId(),[P,I]=t.useState(null),[N,L]=t.useState((null===(i=T)||void 0===i||null===(a=i.LicneseType)||void 0===a?void 0:a.LicenseType)||(null===(r=T)||void 0===r||null===(u=r.formData)||void 0===u||null===(d=u.LicneseType)||void 0===d?void 0:d.LicenseType)||""),[B,O]=t.useState((null===(s=T)||void 0===s||null===(c=s.LicneseType)||void 0===c?void 0:c.ArchitectNo)||(null===(p=T)||void 0===p||null===(v=p.formData)||void 0===v||null===(m=v.LicneseType)||void 0===m?void 0:m.ArchitectNo)||null),{data:R}=Digit.Hooks.obps.useQualificationTypes(D),{data:x}=Digit.Hooks.obps.useMDMS(D,"StakeholderRegistraition","TradeTypetoRoleMapping"),{data:w}=Digit.Hooks.useCustomMDMS(D,"StakeholderRegistraition",[{name:"TradeTypetoRoleMapping"}]),M=null==w||null===(E=w.StakeholderRegistraition)||void 0===E?void 0:E.TradeTypetoRoleMapping;let k=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[F,U]=t.useState((null===(f=T)||void 0===f?void 0:f.selfCertification)||(null===(_=T)||void 0===_||null===(g=_.formData)||void 0===g?void 0:g.selfCertification)||null);console.log("OBPS_Formdata",T);const[H,W]=t.useState("");function j(){let e=[];return null==M||M.forEach(t=>{if("true"===(null==t?void 0:t.isActive)){var l;console.log("item=====",t);const n="TRADELICENSE_TRADETYPE_"+(null==t||null===(l=t.tradeType)||void 0===l?void 0:l.split(".")[0]);e.some(e=>e.i18nKey===n)||e.push({role:t.role,i18nKey:n,tradeType:t.tradeType,code:null==t?void 0:t.code})}}),console.log("list",e),e}function z(e){let t=null;console.log("qualification",e),"B-Arch"==e.name?t=j().find(e=>e.i18nKey.includes("ARCHITECT")):"BE/B-Tech"==e.name?t=j().find(e=>e.i18nKey.includes("ENGINEER")):"Diploma in Civil Engineering/Architect"==e.name?t=j().find(e=>e.i18nKey.includes("SUPERVISOR")):"Town and Country Planning"==e.name&&(t=j().find(e=>e.i18nKey.includes("TOWNPLANNER"))),t&&L(t)}return k&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{P&&z(P)},[P]),console.log("qualificationTypeFinfing",P),t.useEffect(()=>{var e,t,l,n;if(console.log("selectedQualificationType 1",R,null===(e=T)||void 0===e||null===(t=e.LicneseType)||void 0===t?void 0:t.qualificationType,R),null!==(l=T)&&void 0!==l&&null!==(n=l.LicneseType)&&void 0!==n&&n.qualificationType&&R&&!P){var i,o;const e=R.find(e=>{var t,l;return e.name===(null===(t=T)||void 0===t||null===(l=t.LicneseType)||void 0===l?void 0:l.qualificationType)});I(e),console.log("selectedQualificationType",e,null===(i=T)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.qualificationType,R)}},[]),console.log("License Type List",j()),console.log("formData in LicenseType",T),l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},l.createElement("div",{style:{flex:1,marginRight:"20px"}},l.createElement("div",{className:k?"OpenlinkContainer":""},k&&l.createElement(o.BackButton,{style:{border:"none"}},b("CS_COMMON_BACK")),l.createElement(zl,{currentStep:1,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{t:b,config:y,onSelect:function(){var e,t,l,n;if(""===H)if(null!=N&&N.i18nKey.includes("ARCHITECT")&&""===B)W("Invalid Council Number format! Format should be: CA<YEAR><5 DIGITS> (Year between 1972-2025) Example: CA/2023/12345");else if(null!=N&&N.i18nKey.includes("TOWNPLANNER")&&""===B)W("Invalid AITP/FITP Number format! Format should be: AITP<YEAR><4 DIGITS> (Year between 1972-2025) Example: FITP/2023/1234 or AITP/2023/1234");else if(null!==(e=T)&&void 0!==e&&e.result&&null!==(t=T)&&void 0!==t&&null!==(l=t.result)&&void 0!==l&&null!==(n=l.Licenses[0])&&void 0!==n&&n.id){var i;let e=null===(i=T)||void 0===i?void 0:i.formData;e.LicneseType.LicenseType=N,e.LicneseType.ArchitectNo=B,e.LicneseType.selfCertification=F||!1,e.qualificationType=null==P?void 0:P.name,C("",T)}else C(y.key,{LicenseType:N,ArchitectNo:B,selfCertification:F,qualificationType:null==P?void 0:P.name})},onSkip:()=>C(),isDisabled:N&&null!=N&&N.i18nKey.includes("ARCHITECT")?!N||!B:!N},l.createElement(o.CardLabel,null,"Qualification*"),l.createElement("div",{className:"form-pt-dropdown-only"},l.createElement(o.Dropdown,{t:b,optionKey:"name",isMandatory:y.isMandatory,option:R||[],selected:P,select:e=>{!function(e){I(e),z(e),L(null),O(null)}(e)}})),l.createElement(o.CardLabel,null,b("BPA_LICENSE_TYPE"),"*"),l.createElement("div",{className:"form-pt-dropdown-only"},x&&l.createElement(o.Dropdown,{t:b,optionKey:"code",isMandatory:y.isMandatory,option:j()||{},selected:N,select:function(e){L(e)},disable:!0})),N&&(null==N?void 0:N.i18nKey.includes("ARCHITECT"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,b("BPA_COUNCIL_NUMBER")+"*"),l.createElement(o.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:B,onChange:function(e){const t=e.target.value.trim();O(t),/^CA\/(19[7-9][2-9]|20[0-9][0-9]|202[0-5])\/\d{5}$/.test(t)||""===t?W(""):W("Invalid Council Number format! Format should be: CA<YEAR><5 DIGITS> (Year between 1972-2025) Example: CA/2023/12345")},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),H&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},H)),N&&(null==N?void 0:N.i18nKey.includes("TOWNPLANNER"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,b("ASSOCIATE_OR_FELLOW_NUMBER")+"*"),l.createElement(o.TextInput,{t:b,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:B,onChange:function(e){const t=e.target.value.trim();O(t),/^(AITP|FITP)\/(19[7-9][2-9]|20[0-9][0-9]|202[0-5])\/\d{4}$/.test(t)||""===t?W(""):W("Invalid AITP/FITP Number format! Format should be: AITP<YEAR><4 DIGITS> (Year between 1972-2025) Example: FITP/2023/1234 or AITP/2023/1234")},onKeyPress:e=>{"Enter"===e.key&&e.preventDefault()}}),H&&l.createElement("div",{style:{color:"#d32f2f",fontSize:"12px",marginTop:"4px",marginBottom:"12px"}},H)),N&&((null==N?void 0:N.i18nKey.includes("ARCHITECT"))||(null==N?void 0:N.i18nKey.includes("_ENGINEER"))||(null==N?void 0:N.i18nKey.includes("SUPERVISOR")))&&l.createElement("div",null,l.createElement(o.CheckBox,{label:null!=N&&N.i18nKey.includes("ARCHITECT")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ARCHITECT)]":null!=N&&N.i18nKey.includes("_ENGINEER")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ENGINEER)]":null!=N&&N.i18nKey.includes("SUPERVISOR")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY DESIGNER)]":"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY SUPERVISOR)]",onChange:function(e){U(e.target.checked)},value:F,checked:F||!1,style:{marginBottom:"40px"}}))),l.createElement("div",{style:{flex:"0 0 30%",border:"1px solid #dcdcdc",backgroundColor:"#f9f9f9",borderRadius:"8px",padding:"20px",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",marginTop:"20px"}},l.createElement("h1",{style:{fontSize:"22px",fontWeight:"600",color:"#333",marginBottom:"10px",textAlign:"center",textTransform:"uppercase",letterSpacing:"1px"}},"Competencies"),l.createElement("ul",{style:{fontSize:"16px",color:"#555",lineHeight:"1.6",textAlign:"justify",margin:"0",paddingLeft:"20px"}},N&&(null===(A=hn[null==N||null===(h=N.i18nKey)||void 0===h?void 0:h.split("_").pop()])||void 0===A||null===(S=A.split("\n"))||void 0===S?void 0:S.map((e,t)=>l.createElement("li",{key:t,style:{marginBottom:"8px"}},e.trim()))))))))},LicenseDetails:e=>{var n,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O;let{t:R,config:x,onSelect:w,formData:M}=e;i.useLocation();const k=Digit.UserService.getUser();let F={};const U=Digit.ULBService.getCurrentTenantId();let H=window.location.href.includes("openlink");const W=null==k||null===(n=k.info)||void 0===n?void 0:n.uuid,{data:j,isLoading:z}=Digit.Hooks.useUserSearch(U,{uuid:[W]},{},{enabled:!!W}),[Y,G]=t.useState((H?"":null==k||null===(a=k.info)||void 0===a?void 0:a.name)||(null==M||null===(r=M.LicneseDetails)||void 0===r?void 0:r.name)||(null==M||null===(d=M.formData)||void 0===d||null===(s=d.LicneseDetails)||void 0===s?void 0:s.name)||""),[K,V]=t.useState(()=>{var e,t,l;const n=((null==M||null===(e=M.LicneseDetails)||void 0===e?void 0:e.name)||(null==M||null===(t=M.formData)||void 0===t||null===(l=t.LicneseDetails)||void 0===l?void 0:l.name)||"").trim().split(" ");return n.length>1?n[n.length-1]:""}),[q,X]=t.useState(""),[J,Z]=t.useState(""),[$,Q]=t.useState(""),[ee,te]=t.useState(!0),[le,ne]=t.useState((null==M||null===(c=M.LicneseDetails)||void 0===c?void 0:c.dateOfBirth)||""),[ie,oe]=t.useState((H?"":null==k||null===(p=k.info)||void 0===p?void 0:p.emailId)||(null==M||null===(v=M.LicneseDetails)||void 0===v?void 0:v.email)||(null==M||null===(m=M.formData)||void 0===m||null===(E=m.LicneseDetails)||void 0===E?void 0:E.email)||""),[ae,re]=t.useState((!H&&j?{i18nKey:"COMMON_GENDER_"+(null==j||null===(f=j.user)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.gender),code:null==j||null===(g=j.user)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.gender,value:null==j||null===(S=j.user)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.gender}:"")||(null==M||null===(b=M.LicneseDetails)||void 0===b?void 0:b.gender)||(null==M||null===(y=M.formData)||void 0===y||null===(C=y.LicneseDetails)||void 0===C?void 0:C.gender)),[ue,de]=t.useState((H?"":null==k||null===(T=k.info)||void 0===T?void 0:T.mobileNumber)||(null==M||null===(D=M.LicneseDetails)||void 0===D?void 0:D.mobileNumber)||(null==M||null===(P=M.formData)||void 0===P||null===(I=P.LicneseDetails)||void 0===I?void 0:I.mobileNumber)||""),[se,ce]=t.useState((null==M||null===(N=M.LicneseDetails)||void 0===N?void 0:N.PanNumber)||(null==M||null===(L=M.formData)||void 0===L||null===(B=L.LicneseDetails)||void 0===B?void 0:B.PanNumber)||"");t.useEffect(()=>{var e,t,l,n,i,o,a,r;null!=ae&&ae.code||null==j||null===(e=j.user)||void 0===e||null===(t=e[0])||void 0===t||!t.gender||H||re({i18nKey:"COMMON_GENDER_"+(null==j||null===(l=j.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.gender),code:null==j||null===(i=j.user)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.gender,value:null==j||null===(a=j.user)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.gender})},[j]);const pe=Digit.ULBService.getStateId();Digit.Utils.browser.isMobile(),H&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{isLoading:ve,data:me}=Digit.Hooks.obps.useMDMS(pe,"common-masters",["GenderType"]);let Ee=[];return me&&me["common-masters"].GenderType.filter(e=>e.active).map(e=>{Ee.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),z?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:H?"OpenlinkContainer":""},H&&l.createElement(o.BackButton,{style:{border:"none"}},R("CS_COMMON_BACK")),l.createElement(zl,{currentStep:1,flow:"STAKEHOLDER"}),ve&&z?l.createElement(o.Loader,null):l.createElement(o.FormStep,{config:x,onSelect:()=>{var e,t;const l=new Date,n=new Date(le);let i=l.getFullYear()-n.getFullYear();const o=l.getMonth()-n.getMonth();if((o<0||0===o&&l.getDate()<n.getDate())&&i--,null!=M&&M.result&&null!=M&&null!==(e=M.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==M?void 0:M.formData;e.LicneseDetails.name=Y,e.LicneseDetails.mobileNumber=ue,e.LicneseDetails.gender=ae,e.LicneseDetails.email=ie,e.LicneseDetails.PanNumber=se,w("",M)}else w(x.key,{name:Y,mobileNumber:ue,gender:ae,email:ie,PanNumber:se,dateOfBirth:le});i<18&&alert(R("You must be at least 18 years old to proceed"))},onSkip:()=>w(),t:R,isDisabled:!(Y&&ue&&ae&&le)},l.createElement("div",null,l.createElement(o.CardLabel,null,"Firstname*"),l.createElement(o.TextInput,u({t:R,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:Y,onChange:function(e){G(e.target.value)},disable:!(!Y||H)},F={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:R("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,"Middle name"),l.createElement(o.TextInput,u({t:R,type:"text",isMandatory:!1,name:"Mname",value:q,onChange:function(e){X(e.target.value)}},F={isRequired:!1,pattern:"^[a-zA-Z ]*$",type:"text",title:R("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,"Lastname*"),l.createElement(o.TextInput,u({t:R,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Lname",value:K,onChange:function(e){V(e.target.value)}},F={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:R("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,"Date of Birth*"),l.createElement(o.DatePicker,{date:le,onChange:function(e){const t=new Date,l=new Date(e);let n=t.getFullYear()-l.getFullYear();const i=t.getMonth()-l.getMonth();(i<0||0===i&&t.getDate()<l.getDate())&&n--,n<18?alert(R("You must be at least 18 years old. Please enter a valid date of birth.")):ne(e)},min:"1900-01-01",max:(new Date).toISOString().split("T")[0],isRequired:!0}),l.createElement(o.CardLabel,null,R("BPA_APPLICANT_GENDER_LABEL")+"*"),l.createElement(o.RadioButtons,{t:R,options:Ee,optionsKey:"code",name:"gender",value:ae,selectedOption:ae,onSelect:function(e){re(e)},isDependent:!0,labelKey:"COMMON_GENDER",disable:!(!ae||H)}),l.createElement(o.CardLabel,null,R("BPA_OWNER_MOBILE_NO_LABEL")+"*"),l.createElement(o.MobileNumber,{value:ue,name:"mobileNumber",onChange:e=>{de({value:e}.value)},disable:!(!ue||H),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:R("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.CardLabel,null,R("BPA_APPLICANT_EMAIL_LABEL")),l.createElement(o.TextInput,{t:R,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:ie,onChange:function(e){oe(e.target.value)},disable:!(null==k||null===(O=k.info)||void 0===O||!O.emailId||H),required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:R("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")})))))},CorrospondenceAddress:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const[s,c]=t.useState((null==d?void 0:d.Correspondenceaddress)||(null==d||null===(n=d.formData)||void 0===n?void 0:n.Correspondenceaddress)||""),[p,v]=t.useState((null==d?void 0:d.isAddressSame)||(null==d||null===(i=d.formData)||void 0===i?void 0:i.isAddressSame)||!1),[m,E]=t.useState(null),[f,_]=t.useState(null),[g,A]=t.useState(!1),S=Digit.ULBService.getCurrentTenantId(),h=Digit.ULBService.getStateId();let b=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),b&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),l.createElement(l.Fragment,null,l.createElement("div",{className:b?"OpenlinkContainer":""},b&&l.createElement(o.BackButton,{style:{border:"none"}},a("CS_COMMON_BACK")),l.createElement(zl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:r,onSelect:()=>{var e,t;if(null!=d&&d.result&&null!=d&&null!==(e=d.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id)d.Correspondenceaddress=s,d.isAddressSame=p,u("",d,"",!0);else{var l,n,i,o,a,r,c,v,m,f,g,b;A(!0);let e={Licenses:[{tradeLicenseDetail:{owners:[{gender:null==d||null===(l=d.LicneseDetails)||void 0===l||null===(n=l.gender)||void 0===n?void 0:n.code,mobileNumber:null==d||null===(i=d.LicneseDetails)||void 0===i?void 0:i.mobileNumber,name:null==d||null===(o=d.LicneseDetails)||void 0===o?void 0:o.name,dob:null,emailId:null==d||null===(a=d.LicneseDetails)||void 0===a?void 0:a.email,permanentAddress:null==d||null===(r=d.LicneseDetails)||void 0===r?void 0:r.PermanentAddress,correspondenceAddress:s,pan:null==d||null===(c=d.LicneseDetails)||void 0===c?void 0:c.PanNumber}],subOwnerShipCategory:"INDIVIDUAL",tradeUnits:[{tradeType:null==d||null===(v=d.LicneseType)||void 0===v||null===(m=v.LicenseType)||void 0===m?void 0:m.tradeType}],additionalDetail:{counsilForArchNo:null==d||null===(f=d.LicneseType)||void 0===f?void 0:f.ArchitectNo,isSelfCertificationRequired:null!=d&&null!==(g=d.LicneseType)&&void 0!==g&&g.selfCertification?null==d||null===(b=d.LicneseType)||void 0===b?void 0:b.selfCertification:null},address:{city:"",landmark:"",pincode:""},institution:null,applicationDocuments:null},licenseType:"PERMANENT",businessService:"BPAREG",tenantId:h,action:"NOWORKFLOW"}]};Digit.OBPSService.BPAREGCreate(e,S).then((e,t)=>{A(!1),u("",{result:e,formData:d,Correspondenceaddress:s,isAddressSame:p},"",!0)}).catch(e=>{var t,l,n;A(!1),_({key:"error"}),E((null==e||null===(t=e.response)||void 0===t||null===(l=t.data)||void 0===l||null===(n=l.Errors[0])||void 0===n?void 0:n.message)||null)})}},onSkip:()=>u(),t:a,isDisabled:g},l.createElement(o.CheckBox,{label:a("BPA_SAME_AS_PERMANENT_ADDRESS"),onChange:e=>{var t,l,n,i;0==p?(v(!0),c(null!=d&&null!==(t=d.LicneseDetails)&&void 0!==t&&t.PermanentAddress?null==d||null===(l=d.LicneseDetails)||void 0===l?void 0:l.PermanentAddress:null==d||null===(n=d.formData)||void 0===n||null===(i=n.LicneseDetails)||void 0===i?void 0:i.PermanentAddress)):(Array.from(document.querySelectorAll("input")).forEach(e=>e.value=""),v(!1),c(""))},checked:p,style:{paddingBottom:"10px",paddingTop:"10px"}}),l.createElement(o.CardLabel,null,""+a("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL")),l.createElement(o.TextArea,{t:a,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"Correspondenceaddress",onChange:function(e){c(e.target.value)},value:s,disable:p}))),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),f&&l.createElement(o.Toast,{error:"error"===(null==f?void 0:f.key),label:m,isDleteBtn:!0,onClose:()=>{_(null),E(null)}}))},PermanentAddress:e=>{var n,i,a,r,d,s,c,p,v,m,E;let{t:f,config:_,onSelect:g,formData:A}=e,S={};const[h,b]=t.useState((null==A||null===(n=A.LicneseDetails)||void 0===n?void 0:n.PermanentAddress)||(null==A||null===(i=A.formData)||void 0===i||null===(a=i.LicneseDetails)||void 0===a?void 0:a.PermanentAddress)),y=Digit.ULBService.getCurrentTenantId();console.log("tenantId",y),Digit.ULBService.getStateId();let C=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[T,D]=t.useState((null==A||null===(r=A.LicneseDetails)||void 0===r?void 0:r.Pincode)||(null==A||null===(d=A.formData)||void 0===d||null===(s=d.LicneseDetails)||void 0===s?void 0:s.Pincode)||""),[P,I]=t.useState(""),[N,L]=t.useState((null==A||null===(c=A.LicneseDetails)||void 0===c?void 0:c.Ulb)||(null==A||null===(p=A.formData)||void 0===p||null===(v=p.LicneseDetails)||void 0===v?void 0:v.Ulb)||[]);console.log("formData",A);const B=Digit.SessionStorage.get("OBPS_TENANTS").map(e=>e.name);return t.useEffect(()=>{var e,t;if("BPA_ARCHITECT"==(null==A||null===(e=A.LicneseType)||void 0===e||null===(t=e.LicenseType)||void 0===t?void 0:t.role)){const e=B.map(e=>({ulbname:e}));L(e),console.log("Initial ULBs for BPA_ARCHITECT:",e)}},[null==A||null===(m=A.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.role]),C&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),t.useEffect(()=>{},[N]),l.createElement(l.Fragment,null,l.createElement("div",{className:C?"OpenlinkContainer":""},C&&l.createElement(o.BackButton,{style:{border:"none"}},f("CS_COMMON_BACK")),l.createElement(zl,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:_,onSelect:()=>{var e,t;if(null!=A&&A.result&&null!=A&&null!==(e=A.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==A?void 0:A.formData;console.log("data",e),e.LicneseDetails.PermanentAddress=h,e.LicneseDetails.Ulb=N,e.LicneseDetails.Pincode=T,g("",A)}else g(_.key,{PermanentAddress:h,Pincode:T,Ulb:N})},onSkip:()=>g(),t:f,isDisabled:!h},l.createElement(o.CardLabel,null,f("BPA_PERMANANT_ADDRESS_LABEL")+"*"),l.createElement(o.TextArea,{t:f,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"PermanentAddress",onChange:function(e){b(e.target.value)},value:h}),l.createElement(o.CardLabel,null,"Pincode*"),l.createElement(o.TextInput,u({t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"Pcode",minLength:"6",value:T,onChange:function(e){const t=e.target.value;/^[0-9]*$/.test(t)&&t.length<=6&&D(t)}},S={isRequired:!0,pattern:"^[0-9]{6}$",type:"number",title:f("Please enter a valid 6-digit pincode.")})),l.createElement(o.CardLabel,null,"ULB*"),l.createElement(o.MultiSelectDropdown,{options:B.map(e=>({ulbname:e})),optionsKey:"ulbname",onSelect:e=>function(e){var t,l;const n=e.map(e=>e[1]);if("BPA_ARCHITECT"==(null==A||null===(t=A.LicneseType)||void 0===t||null===(l=t.LicenseType)||void 0===l?void 0:l.role)){const e=B.map(e=>({ulbname:e}));n.length<e.length?(L(n),console.log("Updated ULBs for BPA_ARCHITECT after deselection:",n)):(L(e),console.log("All ULBs selected for BPA_ARCHITECT:",e))}else L(n),console.log("Selected ULB Types:",n)}(e),defaultLabel:f("Select ULBs"),defaultUnit:f("ULBs"),selected:N}))))},StakeholderDocuments:e=>{var n,i,a,r;let{t:d,config:s,onSelect:c,formData:p}=e;Digit.ULBService.getCurrentTenantId();const v=Digit.ULBService.getStateId(),[m,E]=t.useState((null==p||null===(n=p.documents)||void 0===n?void 0:n.documents)||[]),[f,_]=t.useState(null),[g,A]=t.useState([]),[S,h]=t.useState(!0),[b,y]=t.useState(!1),C=!!Digit.Utils.browser.isMobile();let T=window.location.href.includes("/openlink/");T&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{data:D,isLoading:P}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping");return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=D&&null!==(e=D.StakeholderRegistraition)&&void 0!==e&&e.TradeTypetoRoleMapping&&(i=null==D||null===(o=D.StakeholderRegistraition)||void 0===o||null===(a=o.TradeTypetoRoleMapping)||void 0===a?void 0:a.filter(e=>{var t,l,n;return e.tradeType===(null==p||null===(t=p.formData)||void 0===t||null===(l=t.LicneseType)||void 0===l||null===(n=l.LicenseType)||void 0===n?void 0:n.tradeType)}));let r=[];null===(t=i)||void 0===t||null===(l=t[0])||void 0===l||null===(n=l.docTypes)||void 0===n||n.forEach(e=>{r.push(e)}),A(r)},[!P]),t.useEffect(()=>{let e=0;g.map(t=>{let l=!1;m.map(e=>{t.required&&null!==e&&e&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(l=!0)}),!l&&t.required&&(e+=1)}),h("0"!=e&&0!=e||!(m.length>0))},[m,b]),l.createElement("div",null,l.createElement("div",{className:T?"OpenlinkContainer":""},T&&l.createElement(o.BackButton,{style:{border:"none"}},d("CS_COMMON_BACK")),l.createElement(zl,{currentStep:3,flow:"STAKEHOLDER"}),P?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:d,config:s,onSelect:()=>{let e,t=p.documents,l=[];g&&m&&null!==m&&g.map((e,t)=>{let n=m.find(t=>t&&null!==t&&t.documentType===e.code);n&&l.push(n)}),e=u({},t,{documents:l}),c(s.key,e)},onSkip:()=>c(),isDisabled:S,onAdd:function(){},cardStyle:{paddingRight:"16px"}},null==g?void 0:g.map((e,t)=>l.createElement(bn,{key:t,document:e,t:d,error:f,setError:_,setDocuments:E,documents:m,setCheckRequiredFields:y,isCitizenUrl:C})),f&&l.createElement(o.Toast,{label:f,isDleteBtn:!0,onClose:()=>_(null),error:!0})),!(null!=p&&p.initiationFlow)&&l.createElement(o.CitizenInfoLabel,{info:d("CS_FILE_APPLICATION_INFO_LABEL"),text:d("BPA_APPLICATION_NUMBER_LABEL")+" "+(null==p||null===(i=p.result)||void 0===i||null===(a=i.Licenses)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.applicationNumber)+" "+d("BPA_DOCS_INFORMATION"),className:"info-banner-wrap-citizen-override"})))},OCBasicDetails:e=>{var i,a,r,u,d,c,p,v,m,E,f,_,g,A,S,h;let{formData:b,onSelect:y,config:C}=e;const[T,D]=t.useState(null),[P,I]=t.useState(null==b||null===(i=b.data)||void 0===i?void 0:i.scrutinyNumber),N=window.Digit.Utils.browser.isMobile(),[L,B]=t.useState(!(null==b||null===(a=b.data)||void 0===a||!a.scrutinyNumber)),{t:O}=n.useTranslation(),R=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[x,w]=t.useState((null==b||null===(r=b.data)||void 0===r?void 0:r.bpaData)||{}),[M,k]=t.useState((null==b||null===(u=b.data)||void 0===u?void 0:u.edcrDetails)||null),[F,U]=t.useState(!1),{isMdmsLoading:H,data:W}=Digit.Hooks.obps.useMDMS(R,"BPA",["RiskTypeComputation"]);Digit.Utils.obps.calculateRiskType(null==W||null===(d=W.BPA)||void 0===d?void 0:d.RiskTypeComputation,null==M||null===(c=M.planDetail)||void 0===c||null===(p=c.plot)||void 0===p?void 0:p.area,null==M||null===(v=M.planDetail)||void 0===v?void 0:v.blocks),t.useEffect(()=>{},T);const j=function(){try{return k(null),w(null),U(!0),Promise.resolve(function(e,t){return Promise.resolve(function(e,t){try{return Promise.resolve(s(function(){return Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:e}))},function(e){var t,l;return null!=e&&null!==(t=e.response)&&void 0!==t&&t.statusText?null==e||null===(l=e.response)||void 0===l?void 0:l.statusText:"BPA_INTERNAL_SERVER_ERROR"}))}catch(e){return Promise.reject(e)}}(e,t)).then(function(l){var n,i,o,a;return null!=l&&null!==(n=l.edcrDetail)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.edcrNumber?Promise.resolve(Digit.OBPSService.BPASearch(t,{approvalNo:null==l||null===(o=l.edcrDetail)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.permitNumber})).then(function(n){var i,o,a,r;const u=null==n||null===(i=n.BPA)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.edcrNumber;return t=null==n||null===(a=n.BPA)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId,Promise.resolve(Digit.OBPSService.scrutinyDetails(t,{edcrNumber:u})).then(function(i){return Promise.resolve(Digit.OBPSService.BPASearch(t,{edcrNumber:e})).then(function(e){var t,o,a,r,u;return null!=l&&null!==(t=l.edcrDetail)&&void 0!==t&&null!==(o=t[0])&&void 0!==o&&o.edcrNumber?null!=l&&null!==(a=l.edcrDetail)&&void 0!==a&&null!==(r=a[0])&&void 0!==r&&r.edcrNumber?{ocEdcrDetails:null==l||null===(u=l.edcrDetail)||void 0===u?void 0:u[0],otherDetails:{bpaApprovalResponse:null==n?void 0:n.BPA,edcrDetails:null==i?void 0:i.edcrDetail,bpaResponse:null==e?void 0:e.BPA}}:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}})})}):{type:"ERROR",message:l||"BPA_NO_RECORD_FOUND"}})}(null==P?void 0:P.edcrNumber,R)).then(function(e){var t,l,n;U(!1),"ERROR"==(null==e?void 0:e.type)&&(D({key:"true",message:null==e?void 0:e.message}),k(null),w(null));let i=null==e?void 0:e.otherDetails,o=null==e?void 0:e.ocEdcrDetails;if(i&&o&&null!=o&&o.tenantId&&null!=i&&null!==(t=i.edcrDetails)&&void 0!==t&&null!==(l=t[0])&&void 0!==l&&l.tenantId){var a,r,u,d,s,c,p,v,m,E;if((null==i||null===(a=i.edcrDetails)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.tenantId)!=(null==o?void 0:o.tenantId))return void D({key:"true",message:"BPA_INVALID_PERMIT_CITY"});if((null==i||null===(u=i.bpaApprovalResponse)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.edcrNumber)===(null==o?void 0:o.edcrNumber)&&("REJECTED"!=(null==i||null===(s=i.bpaResponse)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.status)&&"PERMIT REVOCATION"!=(null==i||null===(p=i.bpaResponse)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.status)||"INITIATED"!=(null==i||null===(m=i.bpaResponse)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.status)))return void D({key:"true",message:"APPLICATION_NUMBER_ALREADY_EXISTS"});sessionStorage.setItem("checkForProcced",JSON.stringify(!1)),D(null),k(M)}null!=e&&null!==(n=e.ocEdcrDetails)&&void 0!==n&&n.edcrNumber&&(k(null==e?void 0:e.ocEdcrDetails),w(null==e?void 0:e.otherDetails),D(null))})}catch(e){return Promise.reject(e)}};let z=sessionStorage.getItem("isEDCRDisable");z=JSON.parse(z),t.useEffect(()=>{if(z){let e=sessionStorage.getItem("isEDCRAPIType");e=!!e&&JSON.parse(e),e&&M||(sessionStorage.setItem("isEDCRAPIType",JSON.stringify(!0)),Promise.resolve(j()).then(function(){}))}},[]);const Y=e=>{let t=!1;if(x&&M){var l,n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g;const e=(null==x||null===(l=x.edcrDetails)||void 0===l?void 0:l[0])||{},A=M||{},S=null==A||null===(n=A.planDetail)||void 0===n||null===(i=n.planInformation)||void 0===i?void 0:i.khataNo,h=null==e||null===(o=e.planDetail)||void 0===o||null===(a=o.planInformation)||void 0===a?void 0:a.khataNo,b=null==A||null===(r=A.planDetail)||void 0===r||null===(u=r.planInformation)||void 0===u?void 0:u.plotNo,y=null==e||null===(d=e.planDetail)||void 0===d||null===(s=d.planInformation)||void 0===s?void 0:s.plotNo,C={LOW:0,MEDIUM:1,HIGH:2},T=Digit.Utils.obps.calculateRiskType(null==W||null===(c=W.BPA)||void 0===c?void 0:c.RiskTypeComputation,null==A||null===(p=A.planDetail)||void 0===p||null===(v=p.plot)||void 0===v?void 0:v.area,null==M||null===(m=M.planDetail)||void 0===m?void 0:m.blocks),P=Digit.Utils.obps.calculateRiskType(null==W||null===(E=W.BPA)||void 0===E?void 0:E.RiskTypeComputation,null==e||null===(f=e.planDetail)||void 0===f||null===(_=f.plot)||void 0===_?void 0:_.area,null==M||null===(g=M.planDetail)||void 0===g?void 0:g.blocks);if(S&&h&&b&&y){if(b!=y||S!=h)return S!=h&&b==y?(t=!1,D({key:"true",message:"Khata number from permit order XXXX(permit order number) is not matching with the khata number from occupancy certificate. You cannot proceed with the application"})):b!=y&&S==h?(t=!1,D({key:"true",message:"Plot number from permit order XXXX(permit order number) is not matching with the Plot number from occupancy certificate. You cannot proceed with the application"})):b!=y&&S!=h&&(t=!1,D({key:"true",message:"Khata No and plot No from permit order XXXX(permit order number) is not matching with the Khata No and plot No from occupancy certificate. You cannot proceed with the application"})),!1;t=!0}C[P]<C[T]?(t=!1,D({key:"true",message:O("BPA_RISK_TYPE_VALIDATION_ERROR"),labelName:"The Risk type from permit order XXXX(permit order number) to occupancy certificate application is changed from Low to high .You cannot proceed with the application."})):C[P]>C[T]?(t=JSON.parse(sessionStorage.getItem("checkForProcced")),D({warning:"true",message:O("BPA_RISK_TYPE_VALIDATION_WARNING"),labelName:"The Risk type in permit order XXXX is high where as the risk type in occupancy is Low , do you want to continue"})):t=!0}var A,S,h,b,T,I,N,L;t&&y(null==C?void 0:C.key,{scrutinyNumber:P,applicantName:null==M||null===(A=M.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.applicantName,occupancyType:null==M||null===(h=M.planDetail)||void 0===h||null===(b=h.planInformation)||void 0===b?void 0:b.occupancy,applicationType:null==M?void 0:M.appliactionType,serviceType:null==M?void 0:M.applicationSubType,applicationDate:null==M?void 0:M.applicationDate,riskType:Digit.Utils.obps.calculateRiskType(null==W||null===(T=W.BPA)||void 0===T?void 0:T.RiskTypeComputation,null==M||null===(I=M.planDetail)||void 0===I||null===(N=I.plot)||void 0===N?void 0:N.area,null==M||null===(L=M.planDetail)||void 0===L?void 0:L.blocks),bpaData:x,edcrDetails:M})};return H?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement(zl,{currentStep:1,flow:"OCBPA"}),l.createElement("div",{className:N?"obps-search":"",style:N?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},l.createElement(o.Label,null,O("OBPS_SEARCH_EDCR_NUMBER")),l.createElement(o.TextInput,{className:"searchInput",onKeyPress:function(e){try{const t=function(t){if(null!=P&&null!==(t=P.edcrNumber)&&void 0!==t&&t.startsWith("OC")){const t=function(){if("Enter"===e.key)return Promise.resolve(j()).then(function(){})}();if(t&&t.then)return t.then(function(){})}else D({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onChange:e=>I({edcrNumber:e.target.value}),value:null==P?void 0:P.edcrNumber,signature:!0,signatureImg:!z&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!z&&null!=P&&P.edcrNumber?()=>function(e){try{const e=function(e){if(null!=P&&null!==(e=P.edcrNumber)&&void 0!==e&&e.startsWith("OC"))return Promise.resolve(j()).then(function(){});D({key:"true",message:O("BPA_INVALID_OCEDCR_NO"),labelName:"Please enter the valid OCeDCR Number."})}();return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}():null}),disable:L,style:{marginBottom:"10px"}})),F?l.createElement(o.Loader,null):null,M&&l.createElement(o.Card,null,l.createElement(o.CardCaption,null,O("BPA_SCRUTINY_DETAILS")),l.createElement(o.CardHeader,null,O("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:null!=M&&M.applicationDate?Ml(new Date(null==M?void 0:M.applicationDate),"dd/MM/yyyy"):null==M?void 0:M.applicationDate}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:O("WF_BPA_"+(null==M?void 0:M.appliactionType))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:O(null==M?void 0:M.applicationSubType)}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==M||null===(m=M.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.occupancy}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:O("WF_BPA_"+Digit.Utils.obps.calculateRiskType(null==W||null===(f=W.BPA)||void 0===f?void 0:f.RiskTypeComputation,null==M||null===(_=M.planDetail)||void 0===_||null===(g=_.plot)||void 0===g?void 0:g.area,null==M||null===(A=M.planDetail)||void 0===A?void 0:A.blocks))}),l.createElement(o.Row,{className:"border-none",label:O("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==M||null===(S=M.planDetail)||void 0===S||null===(h=S.planInformation)||void 0===h?void 0:h.applicantName})),l.createElement(o.SubmitBar,{label:O("CS_COMMON_NEXT"),onSubmit:Y})),T&&l.createElement(o.Toast,{error:!(null==T||!T.key),warning:!(null==T||!T.warning),label:O(null==T?void 0:T.message),isDleteBtn:!0,onClose:()=>{D(null)},onNo:()=>{D(null)},onYes:()=>{sessionStorage.setItem("checkForProcced",JSON.stringify(!0)),Y()},isWarningButtons:!0}))},OBPSSearchApplication:e=>{var n,r,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C;let{t:T,onSubmit:D,data:P,error:I,searchData:N,isLoading:L,Count:B,setparamerror:O}=e;const[R,x]=t.useState(null),w=sessionStorage.getItem("Digit.citizen.userRequestObject"),M=w?JSON.parse(w):{},k=null==M||null===(n=M.value)||void 0===n?void 0:n.info,F=null==M||null===(r=M.value)||void 0===r||null===(s=r.info)||void 0===s?void 0:s.mobileNumber,{register:U,control:H,handleSubmit:W,setValue:j,getValues:z,reset:Y,formState:G}=a.useForm({defaultValues:u({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?F:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==k||null===(c=k.roles)||void 0===c||null===(p=c.filter(e=>e.code.includes("BPAREG_")))||void 0===p?void 0:p.length)<=0&&(null==k||null===(v=k.roles)||void 0===v?void 0:v.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==k||null===(m=k.roles)||void 0===m||null===(E=m.filter(e=>e.code.includes("BPAREG_")))||void 0===E?void 0:E.length)>0&&(null==k||null===(f=k.roles)||void 0===f?void 0:f.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==k||null===(_=k.roles)||void 0===_||null===(g=_.filter(e=>e.code.includes("BPAREG_")))||void 0===g?void 0:g.length)<=0&&(null==k||null===(A=k.roles)||void 0===A?void 0:A.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==k||null===(S=k.roles)||void 0===S||null===(h=S.filter(e=>e.code.includes("BPAREG_")))||void 0===h?void 0:h.length)>0&&(null==k||null===(b=k.roles)||void 0===b?void 0:b.filter(e=>e.code.includes("BPA_")||e.code.includes("CITIZEN")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}},N)});t.useEffect(()=>{U("offset",0),U("limit",10),U("sortBy","commencementDate"),U("sortOrder","DESC")},[U]),l.useEffect(()=>{var e,t,l,n,i,o,a,r,d,s,c,p,v,m;G.isSubmitSuccessful&&Y(u({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?null===(e=Digit.UserService.getUser())||void 0===e||null===(t=e.info)||void 0===t?void 0:t.mobileNumber:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==k||null===(l=k.roles)||void 0===l||null===(n=l.filter(e=>e.code.includes("BPAREG_")))||void 0===n?void 0:n.length)<=0&&(null==k||null===(i=k.roles)||void 0===i?void 0:i.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==k||null===(o=k.roles)||void 0===o||null===(a=o.filter(e=>e.code.includes("BPAREG_")))||void 0===a?void 0:a.length)>0&&(null==k||null===(r=k.roles)||void 0===r?void 0:r.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?{code:"BPA_STAKEHOLDER_REGISTRATION",i18nKey:"WF_BPA_BPA_STAKEHOLDER_REGISTRATION"}:{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"},serviceType:(null==k||null===(d=k.roles)||void 0===d||null===(s=d.filter(e=>e.code.includes("BPAREG_")))||void 0===s?void 0:s.length)<=0&&(null==k||null===(c=k.roles)||void 0===c?void 0:c.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)>0?{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}:(null==k||null===(p=k.roles)||void 0===p||null===(v=p.filter(e=>e.code.includes("BPAREG_")))||void 0===v?void 0:v.length)>0&&(null==k||null===(m=k.roles)||void 0===m?void 0:m.filter(e=>e.code.includes("BPA_")||e.code.includes("citizen")).length)<=0?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"}},N,{isSubmitSuccessful:!1}))},[G]);const K=(e=>{let{t:n}=e;const o=e=>{let t="BPAREG"===e?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(t="BPAREG"===e?"stakeholder":"bpa"),t},a=e=>l.createElement("span",{className:"cell-text"},e);return t.useMemo(()=>[{Header:n("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/"+(o(t.original.businessService)||"--")+"/"+(t.original.applicationNo||t.original.applicationNumber):"/digit-ui/employee/obps/"+(o(t.original.businessService)||"--")+"/"+(t.original.applicationNo||t.original.applicationNumber)},t.original.applicationNo||t.original.applicationNumber)))}},{Header:n("BPA_COMMON_TABLE_COL_APP_DATE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l;return a(null!=e&&null!==(t=e.auditDetails)&&void 0!==t&&t.createdTime?Dt(null==e||null===(l=e.auditDetails)||void 0===l?void 0:l.createdTime):"")}},{Header:n("BPA_SEARCH_APPLICATION_TYPE_LABEL"),disableSortBy:!0,accessor:"applicationType",Cell:e=>{var t,i,o,a,r,u;let{row:d}=e;return l.createElement("div",null,l.createElement("span",{className:"cell-text"},null!==(t=d.original)&&void 0!==t&&null!==(i=t.additionalDetails)&&void 0!==i&&i.applicationType?n("WF_BPA_"+(null===(o=d.original)||void 0===o||null===(a=o.additionalDetails)||void 0===a?void 0:a.applicationType)):null!==(r=d.original)&&void 0!==r&&r.businessService?n("BPA_APPLICATIONTYPE_"+(null==d||null===(u=d.original)||void 0===u?void 0:u.businessService)):"-"))}},{Header:n("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),disableSortBy:!0,accessor:e=>{var t,l,i,o,r;return a(n((null===(t=e.additionalDetails)||void 0===t?void 0:t.serviceType)||n("TRADELICENSE_TRADETYPE_"+(null==e||null===(l=e.tradeLicenseDetail)||void 0===l||null===(i=l.tradeUnits)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.tradeType)||void 0===r?void 0:r.split(".")[0]))||"-"))}},{Header:n("BPA_CURRENT_OWNER_HEAD"),accessor:e=>a((null==e?void 0:e.assignee)||"-"),disableSortBy:!0},{Header:n("BPA_STATUS_LABEL"),accessor:e=>a(n((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||"NA")),disableSortBy:!0}],[])})({t:T}),[V,q]=t.useState(z("offset")/z("limit"));t.useEffect(()=>{""!==I&&(O(""),x({key:!0,label:I}))},[I]);const X=t.useCallback(e=>{0!==e.length&&(j("sortBy",e.id),j("sortOrder",e.desc?"DESC":"ASC"))},[]);function J(){j("offset",z("offset")-z("limit")),W(D)()}t.useEffect(()=>{null!=z("offset")&&null!=z("limit")&&q(z("offset")/z("limit"))},[z("offset"),z("limit")]);const Z=window.Digit.Utils.browser.isMobile(),$={formState:G,Controller:a.Controller,register:U,control:H,t:T,reset:Y,previousPage:J},Q=e=>{var t;const l="BPAREG"==(null==P||null===(t=P[0])||void 0===t?void 0:t.businessService)?"BPAREG":e;let n="BPAREG"===l?"search/application/stakeholder":"search/application/bpa";return window.location.href.includes("/citizen")&&(n="BPAREG"===l?"stakeholder":"bpa"),n},ee=t.useMemo(()=>null==P?void 0:P.map(e=>{var t,l,n,i,o,a,r,u;return{[T("BPA_APPLICATION_NUMBER_LABEL")]:e.applicationNo||e.applicationNumber,[T("BPA_COMMON_TABLE_COL_APP_DATE_LABEL")]:Dt(null===(t=e.auditDetails)||void 0===t?void 0:t.createdTime)||"",[T("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:null!=e&&null!==(l=e.additionalDetails)&&void 0!==l&&l.applicationType?T("WF_BPA_"+(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.applicationType)):T(null!=e&&e.businessService?"BPA_APPLICATIONTYPE_"+(null==e?void 0:e.businessService):"CS_NA"),[T("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")]:T((null===(i=e.additionalDetails)||void 0===i?void 0:i.serviceType)||T("TRADELICENSE_TRADETYPE_"+(null==e||null===(o=e.tradeLicenseDetail)||void 0===o||null===(a=o.tradeUnits)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.tradeType)||void 0===u?void 0:u.split(".")[0]))||T("CS_NA")),[T("BPA_CURRENT_OWNER_HEAD")]:(null==e?void 0:e.assignee)||T("CS_NA"),[T("BPA_STATUS_LABEL")]:T((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||T("CS_NA"))}}),[P]);if(Z){var te,le;const[e,n]=t.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),i=()=>{n({type:"remove"})},a=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:i},l.createElement(o.CloseSvg,null)),r=e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:i}=e,r=d(e,kt);const{closeMobilePopupModal:s}=r;switch(n){case"SearchFormComponent":return l.createElement(t.Fragment,null,l.createElement(o.SearchForm,r,l.createElement(a,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,T("ES_COMMON_SEARCH_APPLICATION"),":")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",padding:"20px 0px",color:"#00000099"}},l.createElement("label",null,T("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(Mt,u({},i,{closeMobilePopupModal:s}))));default:return l.createElement("span",null)}},s=t.useCallback(e=>{let{currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l}=e,n=d(e,Ft);return r(u({currentlyActiveMobileModal:t,searchFormFieldsComponentProps:l},n))},[e]);return L?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},l.createElement(o.SearchAction,{text:T("ES_COMMON_SEARCH_APPLICATION"),handleActionClick:()=>n({type:"set",payload:"SearchFormComponent"})})),e?l.createElement(o.PopUp,null,l.createElement(s,{onSubmit:e=>{n({type:"remove"}),D(e)},handleSubmit:W,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:$,currentlyActiveMobileModal:e,closeMobilePopupModal:i})):null,null!=P&&null!==(te=P[0])&&void 0!==te&&te.display?l.createElement(o.Card,{style:{marginTop:20}},T(null==P||null===(le=P[0])||void 0===le?void 0:le.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(o.DetailsCard,{data:ee,isTwoDynamicPrefix:!0,linkPrefix:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/":"/digit-ui/employee/obps/",getRedirectionLink:Q,serviceRequestIdKey:"applicationNo"}))}return l.createElement(l.Fragment,null,l.createElement(o.Header,null,T("ES_COMMON_SEARCH_APPLICATION")),window.location.href.includes("citizen/obps/search/application")&&l.createElement("div",{style:{background:"#ffffff",paddingLeft:"25px",paddingTop:"10px",color:"#00000099"}},l.createElement("label",null,T("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(o.SearchForm,{onSubmit:D,handleSubmit:W},l.createElement(Mt,$)),!L&&null!=P&&null!==(y=P[0])&&void 0!==y&&y.display?l.createElement(o.Card,{style:{marginTop:20}},T(null==P||null===(C=P[0])||void 0===C?void 0:C.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):R?"":L?l.createElement(o.Loader,null):l.createElement(o.Table,{t:T,data:P,columns:K,getCellProps:e=>({style:{minWidth:e.column.Header===T("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){j("limit",Number(e.target.value)),W(D)()},currentPage:V,onNextPage:function(){j("offset",z("offset")+z("limit")),W(D)()},onPrevPage:J,pageSizeLimit:z("limit"),onSort:X,totalRecords:B,disableSort:!1,onLastPage:()=>{j("offset",B&&10*Math.ceil(B/10)-z("limit")),W(D)()},onFirstPage:()=>{j("offset",0),W(D)()},sortParams:[{id:z("sortBy"),desc:"DESC"===z("sortOrder")}]}),R&&l.createElement(o.Toast,{warning:"BPA_ADD_MORE_PARAM_STAKEHOLDER"==R.label,error:"BPA_ADD_MORE_PARAM_STAKEHOLDER"!=R.label&&R.key,label:T(R.label),isDleteBtn:!0,onClose:()=>{x(null)}}))},InspectionReport:e=>{let{config:a,onSelect:r,userType:d,formData:s,setError:c,formState:p,clearErrors:v}=e;const{t:m}=n.useTranslation(),{pathname:E}=i.useLocation(),f=E.includes("/modify-application/"),[_,g]=t.useState((null==s?void 0:s.FieldReports)||[Nn()]),[A,S]=t.useState({index:-1,type:""}),h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[b,y]=t.useState([]),[C,T]=t.useState([]),[D,P]=t.useState([]),[I,N]=t.useState([]),[L,B]=t.useState([]),[O,R]=t.useState([]),[x,w]=t.useState(!1),[M,k]=t.useState((null==s?void 0:s.tradedetils1)||[]);let F=window.location.href.includes("tl/renew-application-details");window.location.href.includes("tl/renew-application-details")&&(F=!0);const{data:U,isLoading:H}=Digit.Hooks.tl.useTradeLicenseMDMS(h,"TradeLicense","TradeUnits","[?(@.type=='TL')]"),{data:W}=Digit.Hooks.obps.useMDMS(h,"BPA",["CheckList"]);t.useEffect(()=>{const e=_.map(e=>e);r(null==a?void 0:a.key,e),sessionStorage.setItem("INSPECTION_DATA",JSON.stringify(e))},[_]),t.useEffect(()=>{r("tradedetils1",M)},[M]),t.useEffect(()=>{let e=[],t=[];W&&W.BPA.CheckList.map(l=>{"LOW"===(null==l?void 0:l.RiskType)&&"FIELDINSPECTION_PENDING"===(null==l?void 0:l.WFState)&&(e=[...l.questions],t=[...l.docTypes])}),B(t),N(e)},[W]);const j={focusIndex:A,allFieldReport:_,setFocusIndex:S,removeUnit:e=>{g(t=>t.filter(t=>t.key!=e.key))},formData:s,formState:p,setFieldReports:g,t:m,setError:c,clearErrors:v,config:a,onSelect:r,userType:d,tradeCategoryValues:C,tradeTypeOptionsList:D,setTradeTypeOptionsList:P,tradeTypeMdmsData:b,tradeSubTypeOptionsList:O,setTradeSubTypeOptionsList:R,setTradeTypeMdmsData:y,setTradeCategoryValues:T,tradeMdmsData:U,isErrors:x,setIsErrors:w,previousLicenseDetails:M,setPreviousLicenseDetails:k,isLoading:H,bpaDocs:W,type:"LOW",questionList:I,setquestionList:N,documentList:L};return f?l.createElement(l.Fragment,null):l.createElement("div",null,l.createElement(l.Fragment,null,_&&_.map((e,t)=>l.createElement(Ln,u({key:e.key,index:t,unit:e},j)))),l.createElement(o.LinkButton,{label:m("BPA_ADD_FIELD_INSPECTION"),onClick:()=>{const e=Nn();g(t=>[...t,e])},style:{color:"#a82227",width:"fit-content"}}))},BPAInbox:Fl,StakeholderInbox:e=>{let{parentRoute:r}=e;const{t:d}=n.useTranslation(),s=Digit.ULBService.getStateId(),c={},p={moduleName:"BPAREG",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL"},v={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("STAKEHOLDER.INBOX"),E=t.useMemo(()=>m||{filterForm:p,searchForm:c,tableForm:v},[Object.values((null==m?void 0:m.filterForm)||{}),Object.values((null==m?void 0:m.searchForm)||{}),Object.values((null==m?void 0:m.tableForm)||{})]),[f,_]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",u({},e,{searchForm:t.data})),u({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",u({},e,{filterForm:t.data})),u({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("STAKEHOLDER.INBOX",u({},e,{tableForm:t.data})),u({},e,{tableForm:t.data})}},E),{data:g,isLoading:A}=Digit.Hooks.useBoundaryLocalities(s,"revenue",{},d),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:s,filters:u({},f)}),C={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:d("BPA_SEARCH_PAGE_TITLE"),link:"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},T=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Wl,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),D=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Hl,{statuses:b,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==f?void 0:f.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),P={SearchFormFields:T,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:u({},v)}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==f?void 0:f.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),_({action:"mutateSearchForm",data:c})}},I={FilterFormFields:D,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:u({},v)}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==f?void 0:f.filterForm,resetFilterFormDefaultValues:p,onFilterFormReset:e=>{e("moduleName","BPAREG"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),_({action:"mutateFilterForm",data:p})}},N=(e=>{var o,a,r,d;let{parentRoute:s,onPageSizeChange:c,formState:p,totalCount:v,table:m,dispatch:E,onSortingByData:f}=e;const{t:_}=n.useTranslation(),g=t.useMemo(()=>[{Header:_("BPA_APPLICATION_NUMBER_LABEL"),accessor:"applicationNo",Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement(i.Link,{to:s+"/stakeholder-inbox/stakeholder/"+t.original.applicationId},l.createElement("span",{className:"link"},t.original.applicationId)))}},{Header:_("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"applicationDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Ml(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:_("EVENTS_STATUS_LABEL"),accessor:e=>_("WF_"+(null==e?void 0:e.businessService)+"_"+(null==e?void 0:e.status))},{Header:_("WF_INBOX_HEADER_CURRENT_OWNER"),accessor:e=>null==e?void 0:e.owner},{Header:_("ES_INBOX_SLA_DAYS_REMAINING"),accessor:e=>(e=>l.createElement("span","Active"===e||e>0?{className:"sla-cell-success"}:{className:"sla-cell-error"},e))(null==e?void 0:e.sla)}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),disableSort:!1,autoSort:!1,manualPagination:!0,initSortI:"applicationDate",onPageSizeChange:c,currentPage:(null===(o=p.tableForm)||void 0===o?void 0:o.offset)/(null===(a=p.tableForm)||void 0===a?void 0:a.limit),onNextPage:()=>{var e,t;return E({action:"mutateTableForm",data:u({},p.tableForm,{offset:parseInt(null===(e=p.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=p.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return E({action:"mutateTableForm",data:u({},p.tableForm,{offset:parseInt(null===(e=p.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=p.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(r=p.tableForm)||void 0===r?void 0:r.limit,onSort:f,totalRecords:v,onSearch:null==p||null===(d=p.searchForm)||void 0===d?void 0:d.message,onLastPage:()=>{var e;return E({action:"mutateTableForm",data:u({},p.tableForm,{offset:10*Math.ceil(v/10)-parseInt(null===(e=p.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>E({action:"mutateTableForm",data:u({},p.tableForm,{offset:0})}),data:m,columns:g}})(u({},{parentRoute:r,onPageSizeChange:e=>{_({action:"mutateTableForm",data:u({},f.tableForm,{limit:e.target.value})})},formState:f,totalCount:y,table:h,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";f.tableForm.sortBy===t&&f.tableForm.sortOrder===n||_({action:"mutateTableForm",data:u({},f.tableForm,{sortBy:t,sortOrder:l?"DESC":"ASC"})})}}})),L=(e=>{let{parentRoute:t,table:i}=e;const{t:r}=n.useTranslation();return{data:null==i?void 0:i.map(e=>{let{applicationId:t,date:l,businessService:n,status:i,owner:o,sla:a}=e;return{[r("BPA_APPLICATION_NUMBER_LABEL")]:t,[r("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:Ml(new Date(l),"dd/MM/yyyy"),[r("EVENTS_STATUS_LABEL")]:r("WF_"+n+"_"+i),[r("WF_INBOX_HEADER_CURRENT_OWNER")]:o,[r("ES_INBOX_SLA_DAYS_REMAINING")]:a}}),linkPrefix:t+"/stakeholder-inbox/stakeholder/",serviceRequestIdKey:r("BPA_APPLICATION_NUMBER_LABEL"),MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_COMMON_SORT_BY_DESC"},{code:"ASC",i18nKey:"ES_COMMON_SORT_BY_ASC"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({parentRoute:r,table:h}),B={onMobileSortOrderData:e=>{const{sortOrder:t}=e;_({action:"mutateTableForm",data:u({},f.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==f?void 0:f.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:v})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,d("ES_COMMON_INBOX"),y?l.createElement("p",{className:"inbox-count"},y):null),Digit.Utils.browser.isMobile()&&l.createElement("div",{style:{marginLeft:"12px"}},l.createElement(i.Link,{to:window.location.href.includes("/citizen")?"/digit-ui/citizen/obps/search/application":"/digit-ui/employee/obps/search/application"},l.createElement("span",{className:"link"},d("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,u({isInboxLoading:S,PropsForInboxLinks:C},P,I,B,{propsForInboxTable:N,propsForInboxMobileCards:L,formState:f})))},StakeholderCheckPage:e=>{var t,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j;let{onSubmit:z,value:Y}=e;const{t:G}=n.useTranslation(),K=i.useHistory();i.useRouteMatch();let V=Digit.UserService.getUser();const q=V&&null!=V&&V.info&&null!=V&&null!==(t=V.info)&&void 0!==t&&t.permanentCity?null==V||null===(a=V.info)||void 0===a?void 0:a.permanentCity:Digit.ULBService.getCurrentTenantId(),X=Digit.ULBService.getStateId();let J=window.location.href.includes("/openlink/");const Z=window.Digit.Utils.browser.isMobile();Digit.Utils.browser.isMobile(),J&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{result:$,formData:Q,documents:ee}=Y;let te=null==Y||null===(r=Y.result)||void 0===r?void 0:r.Licenses[0].applicationNumber;const le={consumerCode:te},{data:ne}=Digit.Hooks.obps.useBPAREGgetbill(u({businessService:"BPAREG"},le,{tenantId:X||q.split(".")[0]}),{enabled:!!te,retry:!1});let ie=J?"/digit-ui/citizen/obps/openlink/stakeholder/apply":"/digit-ui/citizen/obps/stakeholder/apply";function oe(e){K.push(e)}return l.createElement(l.Fragment,null,l.createElement("div",{className:J?"OpenlinkContainer":""},l.createElement("div",null,J&&l.createElement(o.BackButton,{style:{border:"none"}},G("CS_COMMON_BACK")),l.createElement(zl,{currentStep:4,flow:"STAKEHOLDER"}),l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},G("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICATION_NUMBER_LABEL"),text:null!=$&&null!==(d=$.Licenses)&&void 0!==d&&null!==(s=d[0])&&void 0!==s&&s.applicationNumber?null==$||null===(c=$.Licenses)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.applicationNumber:""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>oe(ie+"/provide-license-type")}),l.createElement(o.Row,{className:"border-none",label:G("BPA_LICENSE_TYPE"),textStyle:{paddingLeft:"12px"},text:G(null==Q||null===(v=Q.LicneseType)||void 0===v||null===(m=v.LicenseType)||void 0===m?void 0:m.i18nKey)}),(null==Q||null===(E=Q.LicneseType)||void 0===E||null===(f=E.LicenseType)||void 0===f?void 0:f.i18nKey.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:G("BPA_COUNCIL_NUMBER"),text:null==Q||null===(_=Q.LicneseType)||void 0===_?void 0:_.ArchitectNo}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSE_DET_CAPTION")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>oe(ie+"/license-details")}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_NAME_LABEL"),textStyle:{paddingLeft:"12px"},text:G(null==Q||null===(g=Q.LicneseDetails)||void 0===g?void 0:g.name)}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_GENDER_LABEL"),text:G(null==Q||null===(A=Q.LicneseDetails)||void 0===A?void 0:A.gender.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:G("BPA_OWNER_MOBILE_NO_LABEL"),text:null==Q||null===(S=Q.LicneseDetails)||void 0===S?void 0:S.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_EMAIL_LABEL"),text:(null==Q||null===(h=Q.LicneseDetails)||void 0===h?void 0:h.email)||G("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:G("BPA_APPLICANT_PAN_NO"),text:(null==Q||null===(b=Q.LicneseDetails)||void 0===b?void 0:b.PanNumber)||G("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_LICENSEE_PERMANENT_LABEL"))),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>oe(ie+"/Permanent-address")}),l.createElement(o.CardText,{style:Z?{color:"black"}:{color:"black",fontSize:"16px"}},G(null==Q||null===(y=Q.LicneseDetails)||void 0===y?void 0:y.PermanentAddress)))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement("div",{style:{marginRight:"24px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_COMMUNICATION_ADDRESS_HEADER_DETAILS"))),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>oe(ie+"/correspondence-address")}),l.createElement(o.CardText,{style:Z?{color:"black"}:{color:"black",fontSize:"16px"}},G(null==Y?void 0:Y.Correspondenceaddress)))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_DOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-15px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>oe(ie+"/stakeholder-document-details")}),null==ee?void 0:ee.documents.map((e,t)=>{var n,i;return l.createElement("div",{key:t},l.createElement(o.CardSectionHeader,{styles:{fontSize:"18px"}},G("BPAREG_HEADER_"+(null==e||null===(n=e.documentType)||void 0===n?void 0:n.replace(".","_")))),null!=e&&e.info?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px"}},""+G(null==e?void 0:e.info)):null,l.createElement(o.StatusTable,null,l.createElement(sn,{value:Y,Code:null==e?void 0:e.documentType,index:t,isNOC:!1,svgStyles:{},isStakeHolder:!0}),(null==ee||null===(i=ee.documents)||void 0===i?void 0:i.length)!=t+1?l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==ne||null===(C=ne.billResponse)||void 0===C||null===(T=C.Bill[0])||void 0===T||null===(D=T.billDetails[0])||void 0===D?void 0:D.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:G(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)||G("CS_NA")}))),l.createElement(o.Row,{className:"border-none",label:G("BPA_COMMON_TOTAL_AMT"),text:"₹ "+(null==ne||null===(P=ne.billResponse)||void 0===P||null===(I=P.Bill)||void 0===I||null===(N=I[0])||void 0===N||null===(L=N.billDetails[0])||void 0===L?void 0:L.amount)||G("CS_NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},G("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",null==ne||null===(B=ne.billResponse)||void 0===B||null===(O=B.Bill)||void 0===O||null===(R=O[0])||void 0===R||null===(x=R.billDetails[0])||void 0===x?void 0:x.amount),l.createElement(o.SubmitBar,{label:G("CS_COMMON_SUBMIT"),onSubmit:z,disabled:"number"!=typeof(null==ne||null===(w=ne.billResponse)||void 0===w||null===(M=w.Bill)||void 0===M||null===(k=M[0])||void 0===k||null===(F=k.billDetails[0])||void 0===F?void 0:F.amount)||(null==ne||null===(U=ne.billResponse)||void 0===U||null===(H=U.Bill)||void 0===H||null===(W=H[0])||void 0===W||null===(j=W.billDetails[0])||void 0===j?void 0:j.amount)<0})))))},BPACheckPage:e=>{var a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W;let{onSubmit:j,value:z}=e;const[Y,G]=t.useState(),[K,V]=t.useState(),[q,X]=t.useState(),[J,Z]=t.useState(),[$,Q]=t.useState(),[ee,te]=t.useState(),[le,ne]=t.useState(),{t:ie}=n.useTranslation();i.useHistory(),i.useRouteMatch();let oe=Digit.UserService.getUser();const ae=Digit.ULBService.getStateId(),re=(null==oe||null===(a=oe.info)||void 0===a?void 0:a.permanentCity)||(null==z?void 0:z.tenantId)||Digit.ULBService.getCurrentTenantId(),{data:ue}=Digit.Hooks.obps.useMDMS(ae,"BPA",["GaushalaFees","MalbaCharges","LabourCess"]);let de;"BPA_LOW"===z.businessService?de="BPA.LOW_RISK_PERMIT_FEE":"BPA"===z.businessService&&(de="BPA.NC_APP_FEE");const{data:se,address:ce,owners:pe,nocDocuments:ve,documents:me,additionalDetails:Ee,subOccupancy:fe,PrevStateDocuments:_e,PrevStateNocDocuments:ge,applicationNo:Ae}=z,Se=window.location.href.includes("editApplication");t.useEffect(()=>{var e,t,l,n,i,o,a;console.log("mdmsData",ue,sessionStorage.getItem("plotArea"),typeof sessionStorage.getItem("plotArea"));let r=parseInt(sessionStorage.getItem("plotArea"));const u=r>909?(null==ue||null===(e=ue.BPA)||void 0===e?void 0:e.LabourCess[1].rate)*r:0,d=null==ue||null===(t=ue.BPA)||void 0===t?void 0:t.GaushalaFees[0].rate,s=r<=500?null==ue||null===(l=ue.BPA)||void 0===l?void 0:l.MalbaCharges[0].rate:r>500&&r<=1e3?null==ue||null===(n=ue.BPA)||void 0===n||null===(i=n.MalbaCharges)||void 0===i?void 0:i[1].rate:(null==ue||null===(o=ue.BPA)||void 0===o?void 0:o.MalbaCharges[2].rate)||500;sessionStorage.setItem("Malbafees",s),sessionStorage.setItem("WaterCharges",s/2),sessionStorage.setItem("GaushalaFees",d),sessionStorage.setItem("LabourCess",u),Q(d),Z(u),te(s),ne(s/2),console.log("mdmsData",ue,null==ue||null===(a=ue.MalbaCharges)||void 0===a?void 0:a.BPA[1].rate,r)},[ue]);let he=[];null==_e||_e.map(e=>{he.push(u({},e,{module:"OBPS"}))}),null==me||null===(r=me.documents)||void 0===r||r.map(e=>{he.push(u({},e,{module:"OBPS"}))}),null==ge||ge.map(e=>{he.push(u({},e,{module:"NOC"}))}),null==ve||null===(d=ve.nocDocuments)||void 0===d||d.map(e=>{he.push(u({},e,{module:"NOC"}))});const{data:be,isLoading:ye}=Digit.Hooks.useDocumentSearch(he,{enabled:(null==he?void 0:he.length)>0});let Ce=[],Te=[];var De;(null==be||null===(s=be.pdfFiles)||void 0===s?void 0:s.length)>0&&(null==be||null===(De=be.pdfFiles)||void 0===De||De.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Ce.push(e),"NOC"==(null==e?void 0:e.module)&&Te.push(e)}));const{data:Pe,isLoading:Ie}=Digit.Hooks.obps.useScrutinyDetails(re,null==z||null===(c=z.data)||void 0===c?void 0:c.scrutinyNumber,{enabled:!(null==z||null===(p=z.data)||void 0===p||!p.scrutinyNumber)});let Ne=null==z?void 0:z.applicationNo;const Le={consumerCode:Ne},{data:Be}=Digit.Hooks.useFetchBillsForBuissnessService(u({businessService:de},Le,{tenantId:re}),{enabled:!!Ne,retry:!1});z.additionalDetails.P1charges=null==Be?void 0:Be.Bill[0].billDetails[0].amount;const Oe=window.location.href.includes("sendbacktocitizen");let Re="/digit-ui/citizen/obps/bpa/"+(null==Ee?void 0:Ee.applicationType.toLowerCase())+"/"+(null==Ee?void 0:Ee.serviceType.toLowerCase());Se&&(Re="/digit-ui/citizen/obps/editApplication/bpa/"+(null==z?void 0:z.tenantId)+"/"+(null==z?void 0:z.applicationNo)),Oe&&(Re="/digit-ui/citizen/obps/sendbacktocitizen/bpa/"+(null==z?void 0:z.tenantId)+"/"+(null==z?void 0:z.applicationNo));const xe=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],we=e=>{const t=e;return(e,l,n)=>e[t]},Me=t.useMemo(()=>xe.map(e=>({Header:ie(""+e.name),accessor:we(e.id),id:e.id})));function ke(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:ie("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:ie(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:ie("BPA_FLOOR_NAME_"+e.number)})}),l}function Fe(e){location.href=e}function Ue(e){let t=[];return fe&&fe["Block_"+(e+1)]&&fe["Block_"+(e+1)].map(e=>{var l;t.push(""+ie(mt(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_")))}),null!=t&&t.length?t.join(", "):"NA"}return ye||Ie?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:4}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},ie("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ie("BPA_APPLICATION_NUMBER_LABEL"),text:Ae||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ie("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ie("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Dt(Number(null==se?void 0:se.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:ie("WF_BPA_"+(null==se?void 0:se.applicationType))}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:ie(null==se?void 0:se.serviceType)}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==se?void 0:se.occupancyType}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:ie("WF_BPA_"+(null==se?void 0:se.riskType))}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==se?void 0:se.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ie("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Fe(Re+"/plot-details")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:ie("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=Pe&&null!==(v=Pe.planDetail)&&void 0!==v&&null!==(m=v.planInformation)&&void 0!==m&&m.plotArea?(null==Pe||null===(E=Pe.planDetail)||void 0===E||null===(f=E.planInformation)||void 0===f?void 0:f.plotArea)+" "+ie("BPA_SQ_FT_LABEL"):ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_PLOT_NUMBER_LABEL"),text:(null==Pe||null===(_=Pe.planDetail)||void 0===_||null===(g=_.planInformation)||void 0===g?void 0:g.plotNo)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_KHATHA_NUMBER_LABEL"),text:(null==Pe||null===(A=Pe.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.khataNo)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_HOLDING_NUMBER_LABEL"),text:(null==se?void 0:se.holdingNumber)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==se?void 0:se.registrationDetails)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_BOUNDARY_WALL_LENGTH_LABEL"),text:(null==se?void 0:se.boundaryWallLength)||ie("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,ie("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ie("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ie("BPA_EDCR_NO_LABEL"),text:null==se||null===(h=se.scrutinyNumber)||void 0===h?void 0:h.edcrNumber}),l.createElement(o.CardSubHeader,null,ie("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Fe(null==Pe?void 0:Pe.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ie("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,ie("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Fe(null==Pe?void 0:Pe.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},ie("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ie("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ie("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:(null==Pe||null===(b=Pe.planDetail)||void 0===b||null===(y=b.blocks)||void 0===y||null===(C=y[0])||void 0===C||null===(T=C.building)||void 0===T?void 0:T.totalBuitUpArea)+" "+ie("BPA_SQ_MTRS_LABEL")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==Pe||null===(D=Pe.planDetail)||void 0===D||null===(P=D.blocks)||void 0===P||null===(I=P[0])||void 0===I||null===(N=I.building)||void 0===N?void 0:N.totalFloors}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:(null==Pe||null===(L=Pe.planDetail)||void 0===L||null===(B=L.blocks)||void 0===B||null===(O=B[0])||void 0===O||null===(R=O.building)||void 0===R?void 0:R.declaredBuildingHeight)+" "+ie("BPA_MTRS_LABEL")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ie("BPA_OCC_SUBOCC_HEADER")),null==Pe||null===(x=Pe.planDetail)||void 0===x?void 0:x.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==Pe||null===(n=Pe.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px",fontSize:"18px"}},ie("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:ie("BPA_SUB_OCCUPANCY_LABEL"),text:""===Ue(t)?ie("CS_NA"):Ue(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:ie,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:ke(e),columns:Me,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},ie("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:ie("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=Pe&&null!==(w=Pe.planDetail)&&void 0!==w&&null!==(M=w.planInformation)&&void 0!==M&&M.demolitionArea?(null==Pe||null===(k=Pe.planDetail)||void 0===k||null===(F=k.planInformation)||void 0===F?void 0:F.demolitionArea)+" "+ie("BPA_SQ_MTRS_LABEL"):ie("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ie("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Fe(Re+"/location")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:ie("BPA_DETAILS_PIN_LABEL"),text:(null==ce?void 0:ce.pincode)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_CITY_LABEL"),text:(null==ce||null===(U=ce.city)||void 0===U?void 0:U.name)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_LOC_MOHALLA_LABEL"),text:(null==ce||null===(H=ce.locality)||void 0===H?void 0:H.name)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==ce?void 0:ce.street)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==ce?void 0:ce.landmark)||ie("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ie("BPA_APPLICANT_DETAILS_HEADER")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Fe(Re+"/owner-details")}),(null==pe?void 0:pe.owners)&&(null==pe?void 0:pe.owners.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==pe||null===(n=pe.owners)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},pe.owners.length>1&&l.createElement(o.CardSubHeader,null,ie("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:0==t&&1==pe.owners.length?{paddingLeft:"12px"}:{},label:ie("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_APPLICANT_GENDER_LABEL"),text:ie(null==e||null===(i=e.gender)||void 0===i?void 0:i.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:ie("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:ie("CORE_COMMON_EMAIL_ID"),text:(null==e?void 0:e.emailId)||ie("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+(null==e?void 0:e.isPrimaryOwner)})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ie("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Fe(Re+"/document-details")}),l.createElement(Yl,{documents:wt(Ce),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,ie("BPA_NOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Fe(Re+"/noc-details")}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_NOC_NUMBER"),text:null==z||null===(W=z.additionalDetails)||void 0===W?void 0:W.nocNumber}),ve&&(null==ve?void 0:ve.NocDetails.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:"noc-"+t,style:(null==ve||null===(n=ve.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+ie("BPA_"+(null==e?void 0:e.nocType)+"_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:ie("BPA_"+(null==e?void 0:e.nocType)+"_LABEL"),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_NOC_STATUS"),text:ie(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),null!=e&&null!==(i=e.additionalDetails)&&void 0!==i&&i.SubmittedOn?l.createElement(o.Row,{className:"border-none",label:""+ie("BPA_NOC_SUBMISSION_DATE"),text:null!=e&&null!==(a=e.additionalDetails)&&void 0!==a&&a.SubmittedOn?Dt(Number(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.SubmittedOn)):"NA"}):null,null!=e&&e.nocNo?l.createElement(o.Row,{className:"border-none",label:""+ie("BPA_APPROVAL_NUMBER_LABEL"),text:(null==e?void 0:e.nocNo)||"NA"}):null,"APPROVED"===(null==e?void 0:e.applicationStatus)||"REJECTED"===(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"===(null==e?void 0:e.applicationStatus)||"AUTO_REJECTED"===(null==e?void 0:e.applicationStatus)?l.createElement(o.Row,{className:"border-none",label:""+ie("BPA_APPROVED_REJECTED_ON_LABEL"),text:Dt(Number(null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModifiedTime))}):null,l.createElement(o.Row,{className:"border-none",label:ie("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Yl,{documents:wt(null==Te?void 0:Te.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,ie("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,null,ie("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ie("BPA_COMMON_P1_AMT"),text:"₹ "+(null==Be?void 0:Be.Bill[0].billDetails[0].amount)}),l.createElement(o.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:ie("BPA_COMMON_MALBA_AMT"),text:"₹ "+ee}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_COMMON_LABOUR_AMT"),text:"₹ "+J}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_COMMON_WATER_AMT"),text:"₹ "+le}),l.createElement(o.Row,{className:"border-none",label:ie("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+$}),l.createElement(o.CardSubHeader,null,ie("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,ie("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:Y,onChange:e=>{G(e.target.value),sessionStorage.setItem("development",e.target.value)}}),l.createElement(o.CardLabel,null,ie("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:K,onChange:e=>{V(e.target.value),sessionStorage.setItem("otherCharges",e.target.value)}}),l.createElement(o.CardLabel,null,ie("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:ie,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"email",value:q,onChange:e=>{X(e.target.value),sessionStorage.setItem("lessAdjusment",e.target.value)}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.SubmitBar,{label:ie("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:j,disabled:!Y||!K||!q,id:!0})))},OCBPACheckPage:e=>{var a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j,z,Y,G,K,V,q,X,J;let{onSubmit:Z,value:$}=e;const{t:Q}=n.useTranslation();i.useHistory(),i.useRouteMatch();let ee,te=Digit.UserService.getUser();"BPA_LOW"===$.businessService?ee="BPA.LOW_RISK_PERMIT_FEE":"BPA"===$.businessService?ee="BPA.NC_APP_FEE":"BPA_OC"===$.businessService&&(ee="BPA.NC_OC_APP_FEE");const{data:le,nocDocuments:ne,documents:ie,additionalDetails:oe,PrevStateDocuments:ae,PrevStateNocDocuments:re,applicationNo:ue,uiFlow:de}=$,se=(null==te||null===(a=te.info)||void 0===a?void 0:a.permanentCity)||(null==$?void 0:$.tenantId)||Digit.ULBService.getCurrentTenantId();let ce=window.location.href.includes("editApplication"),pe=[];null==ae||ae.map(e=>{pe.push(u({},e,{module:"OBPS"}))}),null==ie||null===(r=ie.documents)||void 0===r||r.map(e=>{pe.push(u({},e,{module:"OBPS"}))}),null==re||re.map(e=>{pe.push(u({},e,{module:"NOC"}))}),null==ne||null===(d=ne.nocDocuments)||void 0===d||d.map(e=>{pe.push(u({},e,{module:"NOC"}))});const{data:ve,isLoading:me}=Digit.Hooks.useDocumentSearch(pe,{enabled:(null==pe?void 0:pe.length)>0});let Ee=[],fe=[];var _e;(null==ve||null===(s=ve.pdfFiles)||void 0===s?void 0:s.length)>0&&(null==ve||null===(_e=ve.pdfFiles)||void 0===_e||_e.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Ee.push(e),"NOC"==(null==e?void 0:e.module)&&fe.push(e)}));const{data:ge,isLoading:Ae}=Digit.Hooks.obps.useScrutinyDetails(se,null==$||null===(c=$.data)||void 0===c?void 0:c.scrutinyNumber,{enabled:!(null==$||null===(p=$.data)||void 0===p||!p.scrutinyNumber)});let Se=null==$?void 0:$.applicationNo;const he={consumerCode:Se},{data:be}=Digit.Hooks.useFetchBillsForBuissnessService(u({businessService:ee},he,{tenantId:se||(null==$?void 0:$.tenantId)}),{enabled:!!Se,retry:!1});let ye=ce?"/digit-ui/citizen/obps/editApplication/ocbpa/"+(null==$?void 0:$.tenantId)+"/"+(null==$?void 0:$.applicationNo):"/digit-ui/citizen/obps/ocbpa/"+(null==oe?void 0:oe.applicationType.toLowerCase())+"/"+(null==oe?void 0:oe.serviceType.toLowerCase());const Ce=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],Te=e=>{const t=e;return(e,l,n)=>e[t]},De=t.useMemo(()=>Ce.map(e=>({Header:Q(""+e.name),accessor:Te(e.id),id:e.id})));function Pe(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:Q("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:Q(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:Q("BPA_FLOOR_NAME_"+e.number)})}),l}function Ie(e){var t,l,n,i;let o=null==le||null===(t=le.bpaData)||void 0===t||null===(l=t.bpaApprovalResponse)||void 0===l||null===(n=l[0])||void 0===n||null===(i=n.landInfo)||void 0===i?void 0:i.unit,a="";if((null==o?void 0:o.length)>0){var r,u;let t=null===(r=o[e])||void 0===r||null===(u=r.usageCategory)||void 0===u?void 0:u.split(",");null!=t&&t.length&&(a=t.map(e=>e?""+Q("BPA_SUBOCCUPANCYTYPE_"+mt(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return a||"NA"}function Ne(e){location.href=e}return me||Ae?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:4,flow:"OCBPA"===(null==de?void 0:de.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},Q("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Q("BPA_APPLICATION_NUMBER_LABEL"),text:ue||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Q("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Dt(Number(null==le?void 0:le.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:Q("WF_BPA_"+(null==le?void 0:le.applicationType))}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:Q(null==le?void 0:le.serviceType)}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==le?void 0:le.occupancyType}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:Q("WF_BPA_"+(null==le?void 0:le.riskType))}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==le?void 0:le.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Q("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(ye+"/plot-details")}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=ge&&null!==(v=ge.planDetail)&&void 0!==v&&null!==(m=v.planInformation)&&void 0!==m&&m.plotArea?(null==ge||null===(E=ge.planDetail)||void 0===E||null===(f=E.planInformation)||void 0===f?void 0:f.plotArea)+" "+Q("BPA_SQ_FT_LABEL"):Q("CS_NA"),textStyle:{paddingLeft:"12px"}}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_PLOT_NUMBER_LABEL"),text:(null==ge||null===(_=ge.planDetail)||void 0===_||null===(g=_.planInformation)||void 0===g?void 0:g.plotNo)||Q("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_KHATHA_NUMBER_LABEL"),text:(null==ge||null===(A=ge.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.khataNo)||Q("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_HOLDING_NUMBER_LABEL"),text:(null==le?void 0:le.holdingNumber)||Q("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==le?void 0:le.registrationDetails)||Q("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,""+Q("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,""+Q("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_OC_EDCR_NO_LABEL"),text:null==le||null===(h=le.scrutinyNumber)||void 0===h?void 0:h.edcrNumber}),l.createElement(o.CardSubHeader,null,Q("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Ne(null==ge?void 0:ge.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Q("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,Q("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>Ne(null==ge?void 0:ge.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Q("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Q("BPA_ACTUAL_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=ge&&null!==(b=ge.planDetail)&&void 0!==b&&null!==(y=b.blocks)&&void 0!==y&&null!==(C=y[0])&&void 0!==C&&null!==(T=C.building)&&void 0!==T&&T.totalBuitUpArea?(null==ge||null===(D=ge.planDetail)||void 0===D||null===(P=D.blocks)||void 0===P||null===(I=P[0])||void 0===I||null===(N=I.building)||void 0===N?void 0:N.totalBuitUpArea)+" "+Q("BPA_SQ_MTRS_LABEL"):Q("NA")}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==ge||null===(L=ge.planDetail)||void 0===L||null===(B=L.blocks)||void 0===B||null===(O=B[0])||void 0===O||null===(R=O.building)||void 0===R?void 0:R.totalFloors}),l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:(null==ge||null===(x=ge.planDetail)||void 0===x||null===(w=x.blocks)||void 0===w||null===(M=w[0])||void 0===M||null===(k=M.building)||void 0===k?void 0:k.declaredBuildingHeight)+" "+Q("BPA_MTRS_LABEL")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Q("BPA_OCC_SUBOCC_HEADER")),null==ge||null===(F=ge.planDetail)||void 0===F?void 0:F.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==ge||null===(n=ge.planDetail)||void 0===n||null===(i=n.blocks)||void 0===i?void 0:i.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},""+Q("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+Q("BPA_SUB_OCCUPANCY_LABEL"),text:Ie(t)})),l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:Q,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:Pe(e),columns:De,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,""+Q("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=ge&&null!==(U=ge.planDetail)&&void 0!==U&&null!==(H=U.planInformation)&&void 0!==H&&H.demolitionArea?(null==ge||null===(W=ge.planDetail)||void 0===W||null===(j=W.planInformation)||void 0===j?void 0:j.demolitionArea)+" "+Q("BPA_SQ_MTRS_LABEL"):Q("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Q("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(ye+"/document-details")}),l.createElement(Yl,{documents:wt(Ee),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Q("BPA_NOC_DETAILS_SUMMARY")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>Ne(ye+"/noc-details")}),ne&&(null==ne?void 0:ne.NocDetails.map((e,t)=>{var n,i,a,r,u;return l.createElement("div",{key:t,style:(null==ne||null===(n=ne.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+Q("BPA_"+(null==e?void 0:e.nocType)+"_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Q("BPA_"+(null==e?void 0:e.nocType)+"_LABEL"),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:Q("BPA_NOC_STATUS"),text:Q(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),null!=e&&null!==(i=e.additionalDetails)&&void 0!==i&&i.SubmittedOn?l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_NOC_SUBMISSION_DATE"),text:null!=e&&null!==(a=e.additionalDetails)&&void 0!==a&&a.SubmittedOn?Dt(Number(null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.SubmittedOn)):"NA"}):null,null!=e&&e.nocNo?l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_APPROVAL_NUMBER_LABEL"),text:(null==e?void 0:e.nocNo)||"NA"}):null,"APPROVED"===(null==e?void 0:e.applicationStatus)||"REJECTED"===(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"===(null==e?void 0:e.applicationStatus)||"AUTO_REJECTED"===(null==e?void 0:e.applicationStatus)?l.createElement(o.Row,{className:"border-none",label:""+Q("BPA_APPROVED_REJECTED_ON_LABEL"),text:Dt(Number(null==e||null===(u=e.auditDetails)||void 0===u?void 0:u.lastModifiedTime))}):null,l.createElement(o.Row,{className:"border-none",label:Q("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Yl,{documents:wt(null==fe?void 0:fe.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))})))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,""+Q("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==be||null===(z=be.Bill[0])||void 0===z||null===(Y=z.billDetails[0])||void 0===Y?void 0:Y.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:""+Q(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:Q("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==be||null===(G=be.Bill)||void 0===G||null===(K=G[0])||void 0===K||null===(V=K.billDetails[0])||void 0===V?void 0:V.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,Q("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==be||null===(q=be.Bill)||void 0===q||null===(X=q[0])||void 0===X||null===(J=X.billDetails[0])||void 0===J?void 0:J.amount)||"0"),l.createElement(o.SubmitBar,{label:Q("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:Z})))},OCBPASendBackCheckPage:e=>{var a,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j,z,Y,G,K,V,q,X,J,Z,$,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,pe,ve,me,Ee,fe,_e;let{value:ge}=e;const{t:Ae}=n.useTranslation(),Se=i.useHistory();i.useRouteMatch();let he,be=Digit.UserService.getUser();const ye=null==be||null===(a=be.info)||void 0===a?void 0:a.permanentCity,[Ce,Te]=t.useState(null),[De,Pe]=t.useState(!1),[Ie,Ne]=t.useState(null),Le=null==ge||null===(d=ge.data)||void 0===d?void 0:d.edcrDetails,Be=r.useQueryClient(),{data:Oe,address:Re,owners:xe,nocDocuments:we,documents:Me,subOccupancy:ke,PrevStateDocuments:Fe,PrevStateNocDocuments:Ue,applicationNo:He}=ge;let We="/digit-ui/citizen/obps/sendbacktocitizen/"+("BPA_OC"==ge.businessService?"ocbpa":"bpa")+"/"+(null==ge?void 0:ge.tenantId)+"/"+(null==ge?void 0:ge.applicationNo);"OCBPA"===(null==ge||null===(s=ge.uiFlow)||void 0===s?void 0:s.flow)&&(We="/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/"+(null==ge?void 0:ge.tenantId)+"/"+(null==ge?void 0:ge.applicationNo)),he="BPA_LOW"===ge.businessService?"BPA.LOW_RISK_PERMIT_FEE":"BPA"===ge.businessService?"BPA.NC_APP_FEE":"BPA.NC_OC_APP_FEE";let je=[];null==Fe||Fe.map(e=>{je.push(u({},e,{module:"OBPS"}))}),null==Me||null===(c=Me.documents)||void 0===c||c.map(e=>{je.push(u({},e,{module:"OBPS"}))}),null==Ue||Ue.map(e=>{je.push(u({},e,{module:"NOC"}))}),null==we||null===(p=we.nocDocuments)||void 0===p||p.map(e=>{je.push(u({},e,{module:"NOC"}))});const{data:ze,isLoading:Ye}=Digit.Hooks.useDocumentSearch(je,{enabled:(null==je?void 0:je.length)>0});let Ge=[],Ke=[];var Ve;(null==ze||null===(v=ze.pdfFiles)||void 0===v?void 0:v.length)>0&&(null==ze||null===(Ve=ze.pdfFiles)||void 0===Ve||Ve.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Ge.push(e),"NOC"==(null==e?void 0:e.module)&&Ke.push(e)}));const{data:qe,isLoading:Xe}=Digit.Hooks.useRecieptSearch({tenantId:null==ge?void 0:ge.tenantId,businessService:he,consumerCodes:null==ge?void 0:ge.applicationNo},{enabled:!!(null!=ge&&ge.applicationNo&&he&&null!=ge&&ge.tenantId)}),Je=Digit.Hooks.obps.useObpsAPI(null==ge?void 0:ge.tenantId,!1),Ze=Digit.Hooks.useWorkflowDetails({tenantId:null==ge?void 0:ge.tenantId,id:null==ge?void 0:ge.applicationNo,moduleCode:"OBPS",config:{enabled:!(null==ge||!ge.applicationNo||null==ge||!ge.tenantId)}}),$e=()=>{Ne(null)},Qe=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],et=e=>{const t=e;return(e,l,n)=>e[t]},tt=t.useMemo(()=>Qe.map(e=>({Header:Ae(""+e.name),accessor:et(e.id),id:e.id})));function lt(e){var t;let l=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,n,i,o,a,r,u,d;l.push({Floor:Ae("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:Ae(""+(null===(t=e.occupancies)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.type)),BuildupArea:null===(i=e.occupancies)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.builtUpArea,FloorArea:(null===(a=e.occupancies)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.CarpetArea)||0,key:Ae("BPA_FLOOR_NAME_"+e.number)})}),l}function nt(e){location.href=e}function it(e){let t="";return ke["Block_"+(e+1)]&&ke["Block_"+(e+1)].map(e=>{var l;t+=Ae(mt(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_"))+", "}),t}return t.useEffect(()=>{switch(Ce){case"FORWARD":Pe(!0)}},[Ce]),Ye||Xe?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(zl,{currentStep:4,flow:"OCBPA"===(null==ge||null===(m=ge.uiFlow)||void 0===m?void 0:m.flow)?"OCBPA":""}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},Ae("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_APPLICATION_NUMBER_LABEL"),text:He||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Dt(Number(null==Oe?void 0:Oe.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:Ae("WF_BPA_"+(null==Oe?void 0:Oe.applicationType))}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:Ae(null==Oe?void 0:Oe.serviceType)}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==Oe?void 0:Oe.occupancyType}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:Ae("WF_BPA_"+(null==Oe?void 0:Oe.riskType))}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),text:null==Oe?void 0:Oe.applicantName}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_PLOT_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=Le&&null!==(E=Le.planDetail)&&void 0!==E&&null!==(f=E.planInformation)&&void 0!==f&&f.plotArea?(null==Le||null===(_=Le.planDetail)||void 0===_||null===(g=_.planInformation)||void 0===g?void 0:g.plotArea)+" "+Ae("BPA_SQ_FT_LABEL"):Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_PLOT_NUMBER_LABEL"),text:(null==Le||null===(A=Le.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.plotNo)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_KHATHA_NUMBER_LABEL"),text:(null==Le||null===(h=Le.planDetail)||void 0===h||null===(b=h.planInformation)||void 0===b?void 0:b.khataNo)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_HOLDING_NUMBER_LABEL"),text:(null==Oe?void 0:Oe.holdingNumber)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==Oe?void 0:Oe.registrationDetails)||Ae("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,null,Ae("OCBPA"===(null==ge||null===(y=ge.uiFlow)||void 0===y?void 0:y.flow)?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:Ae("BPA_EDCR_NO_LABEL"),text:(null==Oe||null===(C=Oe.scrutinyNumber)||void 0===C?void 0:C.edcrNumber)||Ae("CS_NA")}),l.createElement(o.CardSubHeader,null,Ae("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>nt(null==Le?void 0:Le.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Ae("BPA_UPLOADED_PLAN_DXF")),l.createElement(o.CardSubHeader,null,Ae("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>nt(null==Le?void 0:Le.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},Ae("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,"OCBPA"===(null==ge||null===(T=ge.uiFlow)||void 0===T?void 0:T.flow)?Ae("BPA_ACTUAL_BUILDING_EXTRACT_HEADER"):Ae("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=Le&&null!==(D=Le.planDetail)&&void 0!==D&&null!==(P=D.blocks)&&void 0!==P&&null!==(I=P[0])&&void 0!==I&&null!==(N=I.building)&&void 0!==N&&N.totalBuitUpArea?(null==Le||null===(L=Le.planDetail)||void 0===L||null===(B=L.blocks)||void 0===B||null===(O=B[0])||void 0===O||null===(R=O.building)||void 0===R?void 0:R.totalBuitUpArea)+" "+Ae("BPA_SQ_MTRS_LABEL"):Ae("NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==Le||null===(x=Le.planDetail)||void 0===x||null===(w=x.blocks)||void 0===w||null===(M=w[0])||void 0===M||null===(k=M.building)||void 0===k?void 0:k.totalFloors}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:(null==Le||null===(F=Le.planDetail)||void 0===F||null===(U=F.blocks)||void 0===U||null===(H=U[0])||void 0===H||null===(W=H.building)||void 0===W?void 0:W.declaredBuildingHeight)+" "+Ae("BPA_MTRS_LABEL")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,Ae("BPA_OCC_SUBOCC_HEADER")),null==Le||null===(j=Le.planDetail)||void 0===j?void 0:j.blocks.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.CardSubHeader,{style:{marginTop:"15px"}},Ae("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:Ae("BPA_SUB_OCCUPANCY_LABEL"),text:""===it(t)?Ae("CS_NA"):it(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:Ae,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:lt(e),columns:tt,getCellProps:e=>({style:{}})})))),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,null,Ae("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:Ae("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=Le&&null!==(z=Le.planDetail)&&void 0!==z&&null!==(Y=z.planInformation)&&void 0!==Y&&Y.demolitionArea?(null==Le||null===(G=Le.planDetail)||void 0===G||null===(K=G.planInformation)||void 0===K?void 0:K.demolitionArea)+" "+Ae("BPA_SQ_MTRS_LABEL")+" ":Ae("CS_NA")}))),"OCBPA"!==(null==ge||null===(V=ge.uiFlow)||void 0===V?void 0:V.flow)?l.createElement("div",null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_DETAILS_PIN_LABEL"),text:(null==Re?void 0:Re.pincode)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_CITY_LABEL"),text:(null==Re||null===(q=Re.city)||void 0===q?void 0:q.name)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_LOC_MOHALLA_LABEL"),text:(null==Re||null===(X=Re.locality)||void 0===X?void 0:X.name)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==Re?void 0:Re.street)||Ae("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Ae("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==Re?void 0:Re.landmark)||Ae("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_APPLICANT_DETAILS_HEADER")),(null==xe?void 0:xe.owners)&&(null==xe?void 0:xe.owners.map((e,t)=>{var n;return l.createElement("div",{key:t},xe.owners.length>1&&l.createElement(o.CardSubHeader,null,Ae("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_APPLICANT_GENDER_LABEL"),text:Ae(null==e||null===(n=e.gender)||void 0===n?void 0:n.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:Ae("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_IS_PRIMARY_OWNER_LABEL"),text:""+(null==e?void 0:e.isPrimaryOwner)})))})))):null,l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,Ae("BPA_DOCUMENT_DETAILS_LABEL")),l.createElement(o.LinkButton,{label:l.createElement(o.EditIcon,{style:{marginTop:"-10px",float:"right",position:"relative",bottom:"32px"}}),style:{width:"100px",display:"inline"},onClick:()=>nt(We+"/document-details")}),l.createElement(Yl,{documents:wt(Ge),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,Ae("BPA_NOC_DETAILS_SUMMARY")),we&&(null==we?void 0:we.NocDetails.map((e,t)=>{var n;return l.createElement("div",{key:t,style:(null==we||null===(n=we.NocDetails)||void 0===n?void 0:n.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}:{}},l.createElement(o.CardSectionHeader,{style:{marginBottom:"24px"}},""+Ae("BPA_"+(null==e?void 0:e.nocType)+"_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Ae("BPA_"+(null==e?void 0:e.nocType)+"_LABEL"),text:null==e?void 0:e.applicationNo}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_NOC_STATUS"),text:Ae(""+(null==e?void 0:e.applicationStatus)),textStyle:"APPROVED"==(null==e?void 0:e.applicationStatus)||"AUTO_APPROVED"==(null==e?void 0:e.applicationStatus)?{color:"#00703C"}:{color:"#D4351C"}}),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_DOCUMENT_DETAILS_LABEL"),text:""}),l.createElement(Yl,{documents:wt(null==Ke?void 0:Ke.filter(t=>{var l,n,i;return null==t||null===(l=t.documentType)||void 0===l?void 0:l.includes(null==e||null===(n=e.nocType)||void 0===n||null===(i=n.split("_"))||void 0===i?void 0:i[0])}),!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardSubHeader,null,Ae("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,null==qe||null===(J=qe.Payments)||void 0===J||null===(Z=J[0])||void 0===Z||null===($=Z.paymentDetails)||void 0===$||null===(Q=$[0])||void 0===Q||null===(ee=Q.bill)||void 0===ee||null===(te=ee.billDetails)||void 0===te||null===(le=te[0])||void 0===le?void 0:le.billAccountDetails.map((e,t)=>l.createElement("div",{key:t},l.createElement(o.Row,{className:"border-none",label:Ae(""+e.taxHeadCode),text:"₹ "+(null==e?void 0:e.amount)}))),l.createElement(o.Row,{className:"border-none",label:Ae("BPA_COMMON_TOTAL_AMT"),text:"₹ "+((null==qe||null===(ne=qe.Payments)||void 0===ne||null===(ie=ne[0])||void 0===ie||null===(oe=ie.paymentDetails)||void 0===oe||null===(ae=oe[0])||void 0===ae||null===(re=ae.bill)||void 0===re||null===(ue=re.billDetails)||void 0===ue||null===(de=ue[0])||void 0===de?void 0:de.amount)||"0")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardHeader,null,Ae("BPA_COMMON_TOTAL_AMT")),l.createElement(o.CardHeader,null,"₹ ",(null==qe||null===(se=qe.Payments)||void 0===se||null===(ce=se[0])||void 0===ce||null===(pe=ce.paymentDetails)||void 0===pe||null===(ve=pe[0])||void 0===ve||null===(me=ve.bill)||void 0===me||null===(Ee=me.billDetails)||void 0===Ee||null===(fe=Ee[0])||void 0===fe?void 0:fe.amount)||"0"),l.createElement(o.SubmitBar,{label:Ae("BPA_COMMON_BUTTON_SUBMIT"),onSubmit:function(e){Te("FORWARD"),Pe(!0)}})),De?l.createElement(dn,{t:Ae,action:Ce,tenantId:ye,id:null==ge?void 0:ge.applicationNo,closeModal:()=>{Te(null),Pe(!1)},submitAction:e=>{var t;let l=pt(ge);l.assignee=[];const n="OCBPA"===(null==ge||null===(t=ge.uiFlow)||void 0===t?void 0:t.flow),i=yt(l,n,!0);Je.mutate({BPA:u({},null==i?void 0:i.BPA,{workflow:e})},{onError:(e,t)=>{var l,n,i;Pe(!1),Ne({key:"error",action:(null==e||null===(l=e.response)||void 0===l||null===(n=l.data)||void 0===n||null===(i=n.Errors[0])||void 0===i?void 0:i.message)||e}),setTimeout($e,5e3)},onSuccess:(e,t)=>{Pe(!1),Ne({key:"success",action:Ce}),setTimeout($e,5e3),Be.invalidateQueries("BPA_DETAILS_PAGE"),Be.invalidateQueries("workFlowDetails"),Se.replace("/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/"+(null==ge?void 0:ge.tenantId)+"/"+(null==ge?void 0:ge.applicationNo)+"/acknowledgement",{data:null==ge?void 0:ge.applicationNo})}})},actionData:null==Ze||null===(_e=Ze.data)||void 0===_e?void 0:_e.timeline}):null,Ie&&l.createElement(o.Toast,{error:"error"===Ie.key,label:Ae("success"===Ie.key?"ES_OBPS_"+Ie.action+"_UPDATE_SUCCESS":Ie.action),onClose:$e}))},EDCRAcknowledgement:e=>{var a,r,u,d,s,c,p;const{t:v}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var f;if(t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:v(null==e||null===(f=e.data)||void 0===f?void 0:f.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0));const _=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[g,A]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:b}=(window.Digit.Utils.browser.isMobile(),Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]));Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!b&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==_?void 0:_.appliactionType)&&(null==e?void 0:e.serviceType)===(null==_?void 0:_.applicationSubType)&&A({linkData:e,edcrNumber:null==_?void 0:_.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(_.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==_.status?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==_?void 0:_.edcrNumber,info:v("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")+" - "+(null==_?void 0:_.applicationNumber)),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/"+(null==g||null===(d=g.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase())+"/"+(null==_||null===(c=_.appliactionType)||void 0===c?void 0:c.toLowerCase())+"/"+(null==_||null===(p=_.applicationSubType)||void 0===p?void 0:p.toLowerCase())+"/docs-required",state:g},replace:!0},l.createElement(o.SubmitBar,{label:v("BPA_APPLY_FOR_BPA_LABEL"),onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}),l.createElement(o.CardText,{className:"button-sub-text",style:{fontSize:"14px",lineHeight:"16px",textAlign:"center",margin:"0px",marginTop:"4px",fontWeight:"400",color:"#0B0C0C"}},v("BPA_FOR_NEW_CONSTRUCTION_LABEL"))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:v("CORE_COMMON_GO_TO_HOME")}))))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")+" - "+(null==_?void 0:_.applicationNumber)),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")})))))},OCEDCRAcknowledgement:e=>{var a,r,u,d,s,c,p;const{t:v}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var f;if(t.useEffect(()=>{var t;"ERROR"!=(null==e||null===(t=e.data)||void 0===t?void 0:t.type)||m||E(!0)},[null==e||null===(a=e.data)||void 0===a?void 0:a.data]),"ERROR"==(null==e||null===(r=e.data)||void 0===r?void 0:r.type))return l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("CS_BPA_APPLICATION_FAILED"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:v(null==e||null===(f=e.data)||void 0===f?void 0:f.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("isPermitApplication",!0);const _=null==e||null===(u=e.data)||void 0===u?void 0:u[0],[g,A]=t.useState({}),S=Digit.ULBService.getStateId(),{data:h,isLoading:b}=Digit.Hooks.obps.useMDMS(S,"BPA",["homePageUrlLinks"]);Digit.Hooks.obps.useMDMS(S,"BPA",["RiskTypeComputation"]),t.useEffect(()=>{var e,t,l,n;!b&&(null==h||null===(e=h.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0&&(null==h||null===(l=h.BPA)||void 0===l||null===(n=l.homePageUrlLinks)||void 0===n||n.map(e=>{(null==e?void 0:e.applicationType)===(null==_?void 0:_.appliactionType)&&(null==e?void 0:e.serviceType)===(null==_?void 0:_.applicationSubType)&&A({linkData:e,edcrNumber:null==_?void 0:_.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(_.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==(null==_?void 0:_.status)?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("BPA_OC_EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==_?void 0:_.edcrNumber,info:v("EDCR_SCRUTINY_NUMBER_LABEL"),successful:!0,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")+" - "+(null==_?void 0:_.applicationNumber)),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"0px 10px"}},l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/obps/"+(null==g||null===(d=g.linkData)||void 0===d||null===(s=d.flow)||void 0===s?void 0:s.toLowerCase())+"/"+(null==_||null===(c=_.appliactionType)||void 0===c?void 0:c.toLowerCase())+"/"+(null==_||null===(p=_.applicationSubType)||void 0===p?void 0:p.toLowerCase())+"/docs-required",state:g},replace:!0},l.createElement(o.SubmitBar,{label:v("BPA_APPLY_OC_FOR_BPA_LABEL"),className:"oc-aknowledgement-screen",onSubmit:()=>sessionStorage.setItem("clickOnBPAApplyAfterEDCR",!0)}))),l.createElement("div",{style:{marginTop:"12px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:v("CORE_COMMON_GO_TO_HOME")})))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:v("BPA_OC_EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_LABEL"),applicationNumber:"",info:"",successful:!1,infoStyles:{fontSize:"18px",lineHeight:"21px",fontWeight:"bold",textAlign:"center",padding:"0px 15px"},applicationNumberStyles:{fontSize:"24px",lineHeight:"28px",fontWeight:"bold",marginTop:"10px"},style:{width:"100%",padding:"10px"}}),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},v("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")+" - "+(null==_?void 0:_.applicationNumber)),l.createElement("div",{className:"primary-label-btn d-grid",style:{marginLeft:"unset",marginBottom:"10px",padding:"0px 8px"},onClick:y},l.createElement("svg",{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M19.3334 8H14V0H6.00002V8H0.666687L10 17.3333L19.3334 8ZM0.666687 20V22.6667H19.3334V20H0.666687Z",fill:"#a82227"})),v("EDCR_DOWNLOAD_SCRUTINY_REPORT_LABEL")),l.createElement("div",{style:{padding:"10px",paddingBottom:"10px",paddingLeft:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:v("CORE_COMMON_GO_TO_HOME")})))))},BPAAcknowledgement:e=>{var a,r,u,d,s,c;let{data:p,onSuccess:v}=e;const{t:m}=n.useTranslation(),E=Digit.ULBService.getCurrentTenantId(),f=Digit.Hooks.obps.useObpsAPI(null!=p&&null!==(a=p.address)&&void 0!==a&&a.city?null===(r=p.address)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.code:E,!0),_=Digit.Hooks.obps.useObpsAPI(null!=p&&null!==(d=p.address)&&void 0!==d&&d.city?null===(s=p.address)||void 0===s||null===(c=s.city)||void 0===c?void 0:c.code:E,!1),{data:g}=Digit.Hooks.useStore.getInitData(),{tenants:A}=g||{};return t.useEffect(()=>{try{var e,t,l,n;let i=null!=p&&null!==(e=p.address)&&void 0!==e&&e.city?null===(t=p.address)||void 0===t||null===(l=t.city)||void 0===l?void 0:l.code:E;p.tenantId=i;let o={};null==p||null===(n=p.nocDocuments)||void 0===n||n.NocDetails.map(e=>{o=ft(e,p),f.mutate(o,{onSuccess:v})}),o=yt(p),_.mutate(o,{onSuccess:v}),sessionStorage.removeItem("Malbafees"),sessionStorage.removeItem("WaterCharges"),sessionStorage.removeItem("GaushalaFees"),sessionStorage.removeItem("LabourCess"),sessionStorage.removeItem("otherCharges"),sessionStorage.removeItem("lessAdjusment"),sessionStorage.removeItem("development")}catch(e){}},[]),_.isLoading||_.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(Ta,{t:m,data:_.data,isSuccess:_.isSuccess,isLoading:_.isIdle||_.isLoading}),_.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,p;const v=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA",E=null==v?void 0:v.status;return"BPA_LOW"==m&&(m="BPA"),e("BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)?"BPA_SUBMIT_SUB_HEADER_"+m+"_"+(null==v||null===(r=v.workflow)||void 0===r?void 0:r.action)+"_"+(null!=v&&null!==(u=v.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==v||null===(d=v.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT")+"_"+mt(E," ","_").toUpperCase():"BPA_SUB_HEADER_"+m+"_"+(null==v||null===(s=v.workflow)||void 0===s?void 0:s.action)+"_"+(null!=v&&null!==(c=v.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==v||null===(p=v.additionalDetails)||void 0===p?void 0:p.typeOfArchitect:"ARCHITECT")+"_"+mt(E," ","_").toUpperCase())})(m,_.data)),!_.isSuccess&&l.createElement(o.CardText,null,m("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:m("CORE_COMMON_GO_TO_HOME")})),_.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:m("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=p,t=A.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j,z,Y,G,K,V,q,X,J,Z,$,Q,ee,te,le,ne,ie,oe,ae,re,ue,de;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:l(null==t?void 0:t.i18nKey)+" "+(se=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),se.toLowerCase().split(" ").map(Uo).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_BUILD_PERMIT_APPLICATION"),applicationNumber:(null==e?void 0:e.applicationNo)||"NA",details:[{title:l("BPA_BASIC_DETAILS_TITLE"),values:[{title:(null==e?void 0:e.businessService)!==l("BPA_OC")?l("BPA_EDCR_NO_LABEL"):l("BPA_OC_EDCR_NO_LABEL"),value:(null==e?void 0:e.edcrNumber)||"NA"},{title:l("BPA_BASIC_DETAILS_APP_DATE_LABEL"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.createdTime,"dd/MM/yyyy")||"NA"},{title:l("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),value:l("WF_BPA_"+(null==e||null===(o=e.data)||void 0===o||null===(a=o.edcrDetails)||void 0===a?void 0:a.appliactionType))||"NA"},{title:l("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),value:l(""+(null==e||null===(r=e.data)||void 0===r||null===(u=r.edcrDetails)||void 0===u?void 0:u.applicationSubType))||"NA"},{title:l("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),value:null==e||null===(d=e.data)||void 0===d||null===(s=d.edcrDetails)||void 0===s||null===(c=s.planDetail)||void 0===c||null===(p=c.planInformation)||void 0===p?void 0:p.occupancy},{title:l("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),value:l("WF_BPA_"+(null==e?void 0:e.riskType))||"NA"},{title:l("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL"),value:(null==e||null===(v=e.data)||void 0===v||null===(m=v.edcrDetails)||void 0===m||null===(E=m.planDetail)||void 0===E||null===(f=E.planInformation)||void 0===f?void 0:f.applicantName)||"NA"}]},{title:l("BPA_PLOT_DETAILS_TITLE"),values:[{title:l("BPA_BOUNDARY_PLOT_AREA_LABEL"),value:(null==e||null===(_=e.data)||void 0===_||null===(g=_.edcrDetails)||void 0===g||null===(A=g.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.plotArea)+" sq.ft"||"NA"},{title:l("BPA_PLOT_NUMBER_LABEL"),value:(null==e||null===(h=e.data)||void 0===h||null===(b=h.edcrDetails)||void 0===b||null===(y=b.planDetail)||void 0===y||null===(C=y.planInformation)||void 0===C?void 0:C.plotNo)||"NA"},{title:l("BPA_KHATHA_NUMBER_LABEL"),value:(null==e||null===(T=e.data)||void 0===T||null===(D=T.edcrDetails)||void 0===D||null===(P=D.planDetail)||void 0===P||null===(I=P.planInformation)||void 0===I?void 0:I.khataNo)||"NA"},{title:l("BPA_HOLDING_NUMBER_LABEL"),value:(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.holdingNo)||"NA"},{title:l("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),value:(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.registrationDetails)||"NA"},{title:l("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),value:l((null==e||null===(B=e.data)||void 0===B||null===(O=B.edcrDetails)||void 0===O||null===(R=O.planDetail)||void 0===R||null===(x=R.planInformation)||void 0===x?void 0:x.demolitionArea)+" sq.mtrs")||"NA"}]},{title:l("BPA_NOC_DETAILS_SUMMARY"),values:[{title:l("BPA_"+(null==e||null===(w=e.nocDocuments)||void 0===w||null===(M=w.NocDetails[0])||void 0===M?void 0:M.nocType)+"_LABEL"),value:(null==e||null===(k=e.nocDocuments)||void 0===k||null===(F=k.NocDetails[0])||void 0===F?void 0:F.applicationNo)||"NA"},{title:l("BPA_"+(null==e||null===(U=e.nocDocuments)||void 0===U||null===(H=U.NocDetails[1])||void 0===H?void 0:H.nocType)+"_LABEL"),value:(null==e||null===(W=e.nocDocuments)||void 0===W||null===(j=W.NocDetails[1])||void 0===j?void 0:j.applicationNo)||"NA"}]},{title:l("BPA_APPLICANT_DETAILS_HEADER"),values:[{title:l("CORE_COMMON_NAME"),value:(null==e||null===(z=e.landInfo)||void 0===z||null===(Y=z.owners[0])||void 0===Y?void 0:Y.name)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(G=e.landInfo)||void 0===G||null===(K=G.owners[0])||void 0===K?void 0:K.gender)||"NA"},{title:l("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(V=e.landInfo)||void 0===V||null===(q=V.owners[0])||void 0===q?void 0:q.mobileNumber)||"NA"},{title:l("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(X=e.landInfo)||void 0===X||null===(J=X.owners[0])||void 0===J?void 0:J.emailId)||"NA"},{title:l("BPA_IS_PRIMARY_OWNER_LABEL"),value:(null==e||null===(Z=e.landInfo)||void 0===Z||null===($=Z.owners[0])||void 0===$?void 0:$.isPrimaryOwner)||"NA"}]},{title:l("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS"),values:[{title:l("BPA_DETAILS_PIN_LABEL"),value:(null==e||null===(Q=e.landInfo)||void 0===Q||null===(ee=Q.address)||void 0===ee?void 0:ee.pincode)||"NA"},{title:l("BPA_CITY_LABEL"),value:(null==e||null===(te=e.landInfo)||void 0===te||null===(le=te.address)||void 0===le?void 0:le.city)||"NA"},{title:l("BPA_LOC_MOHALLA_LABEL"),value:(null==e||null===(ne=e.landInfo)||void 0===ne||null===(ie=ne.address)||void 0===ie||null===(oe=ie.locality)||void 0===oe?void 0:oe.name)||"NA"},{title:l("BPA_DETAILS_SRT_NAME_LABEL"),value:(null==e||null===(ae=e.landInfo)||void 0===ae||null===(re=ae.address)||void 0===re?void 0:re.street)||"NA"},{title:l("ES_NEW_APPLICATION_LOCATION_LANDMARK"),value:(null==e||null===(ue=e.landInfo)||void 0===ue||null===(de=ue.address)||void 0===de?void 0:de.landmark)||"NA"}]}]})}catch(e){return Promise.reject(e)}var se}(e,t,m)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})))},OCBPAAcknowledgement:e=>{let{data:a,onSuccess:r}=e;const{t:u}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!0),c=Digit.Hooks.obps.useObpsAPI(null!=a&&a.tenantId?null==a?void 0:a.tenantId:d,!1);return Digit.Hooks.useStore.getInitData(),t.useEffect(()=>{try{var e;a.tenantId=null==a?void 0:a.tenantId;let t={};null==a||null===(e=a.nocDocuments)||void 0===e||e.NocDetails.map(e=>{t=ft(e,a),s.mutate(t,{onSuccess:r})}),t=yt(a,!0),c.mutate(t,{onSuccess:r})}catch(e){}},[]),c.isLoading||c.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(Ia,{t:u,data:c.data,isSuccess:c.isSuccess,isLoading:c.isIdle||c.isLoading}),c.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,p;const v=null==t||null===(l=t.BPA)||void 0===l?void 0:l[0];let m=null!=t&&null!==(n=t.BPA)&&void 0!==n&&null!==(i=n[0])&&void 0!==i&&i.businessService?null==t||null===(o=t.BPA)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.businessService:"BPA",E=null==v?void 0:v.status;return"BPA_LOW"==m&&(m="BPA"),"BPA_SUBMIT_APP"==(sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null)&&e("BPA_SUBMIT_SUB_HEADER_"+m+"_"+(null==v||null===(r=v.workflow)||void 0===r?void 0:r.action)+"_"+(null!=v&&null!==(u=v.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==v||null===(d=v.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT")+"_"+mt(E," ","_").toUpperCase()),e("BPA_SUB_HEADER_"+m+"_"+(null==v||null===(s=v.workflow)||void 0===s?void 0:s.action)+"_"+(null!=v&&null!==(c=v.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==v||null===(p=v.additionalDetails)||void 0===p?void 0:p.typeOfArchitect:"ARCHITECT")+"_"+mt(E," ","_").toUpperCase())})(u,c.data)),!c.isSuccess&&l.createElement(o.CardText,null,u(Digit.Utils.locale.getTransformedLocale(c.error.message))),l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:u("CORE_COMMON_GO_TO_HOME")})))},OCSendBackAcknowledgement:e=>{var t,a,r;const u=null==e?void 0:e.data,{t:d}=n.useTranslation();let s=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null,c=null!=u&&u.businessService?null==u?void 0:u.businessService:"BPA",p=null==u?void 0:u.status,v=null!=u&&null!==(t=u.workflow)&&void 0!==t&&t.action?null==u||null===(a=u.workflow)||void 0===a?void 0:a.action:"VERIFY_FORWARD",m=null==u||null===(r=u.additionalDetails)||void 0===r?void 0:r.typeOfArchitect;return"BPA_LOW"==c&&(c="BPA"),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.Banner,{message:d("BPA_SUBMIT_APP"==s?"BPA_SUBMIT_HEADER_"+c+"_"+v+"_"+mt(p," ","_").toUpperCase():"BPA_HEADER_"+c+"_"+v+"_"+mt(p," ","_").toUpperCase()),applicationNumber:null==u?void 0:u.applicationNo,info:d("BPA"==c?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:!0,style:{padding:"10px"},headerStyles:{fontSize:"32px"}}),l.createElement(o.CardText,null,d("BPA_SUBMIT_APP"==s?"BPA_SUBMIT_SUB_HEADER_"+c+"_"+v+"_"+(m||"ARCHITECT")+"_"+mt(p," ","_").toUpperCase():"BPA_SUB_HEADER_"+c+"_"+v+"_"+(m||"ARCHITECT")+"_"+mt(p," ","_").toUpperCase())),l.createElement("div",{style:{marginTop:"12px",padding:"10px"}},l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.SubmitBar,{label:d("CORE_COMMON_GO_TO_HOME")})))))},StakeholderAcknowledgement:e=>{var a,r,d,s,c,p,v,m,E,f;let{data:_,onSuccess:g}=e;const{t:A}=n.useTranslation(),{id:S}=i.useParams(),h=Digit.ULBService.getCurrentTenantId(),b=Digit.Hooks.obps.useStakeholderAPI(null!=_&&null!==(a=_.address)&&void 0!==a&&a.city?null===(r=_.address)||void 0===r||null===(d=r.city)||void 0===d?void 0:d.code:h,!0),{data:y}=Digit.Hooks.useStore.getInitData(),{tenants:C}=y||{};let T=window.location.href.includes("openlink");Digit.Utils.browser.isMobile();const D=(null==b||null===(s=b.data)||void 0===s||null===(c=s.Licenses)||void 0===c||null===(p=c[0])||void 0===p||null===(v=p.tradeLicenseDetail)||void 0===v||null===(m=v.tradeUnits)||void 0===m||null===(E=m[0])||void 0===E||null===(f=E.tradeType)||void 0===f?void 0:f.split(".")[0])||"ARCHITECT";t.useEffect(()=>{try{var e,t,l,n;let i=null!=_&&null!==(e=_.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.tenantId?null==_||null===(l=_.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tenantId:i;_.tenantId=i;let o={};o=(e=>{var t,l,n,i,o,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j;return{Licenses:[u({},null==e||null===(t=e.result)||void 0===t?void 0:t.Licenses[0],{action:"APPLY",tradeLicenseDetail:u({},null==e||null===(l=e.result)||void 0===l||null===(n=l.Licenses[0])||void 0===n?void 0:n.tradeLicenseDetail,{additionalDetail:{counsilForArchNo:null==e||null===(i=e.formData)||void 0===i||null===(o=i.LicneseType)||void 0===o?void 0:o.ArchitectNo,isSelfCertificationRequired:null==e||null===(a=e.formData)||void 0===a||null===(r=a.LicneseType)||void 0===r?void 0:r.selfCertification},tradeUnits:[u({},null==e||null===(d=e.result)||void 0===d||null===(s=d.Licenses[0])||void 0===s||null===(c=s.tradeLicenseDetail)||void 0===c||null===(p=c.tradeUnits)||void 0===p?void 0:p[0],{tradeType:null==e||null===(v=e.formData)||void 0===v||null===(m=v.LicneseType)||void 0===m||null===(E=m.LicenseType)||void 0===E?void 0:E.tradeType,id:null==e||null===(f=e.result)||void 0===f||null===(_=f.Licenses[0])||void 0===_||null===(g=_.tradeLicenseDetail)||void 0===g||null===(A=g.tradeUnits)||void 0===A||null===(S=A[0])||void 0===S?void 0:S.id})],owners:[u({},null==e||null===(h=e.result)||void 0===h||null===(b=h.Licenses[0])||void 0===b||null===(y=b.tradeLicenseDetail)||void 0===y||null===(C=y.owners)||void 0===C?void 0:C[0],{gender:null==e||null===(T=e.formData)||void 0===T||null===(D=T.LicneseDetails)||void 0===D||null===(P=D.gender)||void 0===P?void 0:P.code,mobileNumber:null==e||null===(I=e.formData)||void 0===I||null===(N=I.LicneseDetails)||void 0===N?void 0:N.mobileNumber,name:null==e||null===(L=e.formData)||void 0===L||null===(B=L.LicneseDetails)||void 0===B?void 0:B.name,dob:null,emailId:null==e||null===(O=e.formData)||void 0===O||null===(R=O.LicneseDetails)||void 0===R?void 0:R.email,permanentAddress:null==e||null===(x=e.formData)||void 0===x||null===(w=x.LicneseDetails)||void 0===w?void 0:w.PermanentAddress,correspondenceAddress:null==e?void 0:e.Correspondenceaddress,pan:null==e||null===(M=e.formData)||void 0===M||null===(k=M.LicneseDetails)||void 0===k?void 0:k.PanNumber,uuid:null==e||null===(F=e.result)||void 0===F||null===(U=F.Licenses[0])||void 0===U||null===(H=U.tradeLicenseDetail)||void 0===H||null===(W=H.owners)||void 0===W||null===(j=W[0])||void 0===j?void 0:j.uuid})],applicationDocuments:Ct(e)})})]}})(_),b.mutate(o,{onSuccess:g})}catch(e){}},[]);const P=null==h?void 0:h.split(".")[0],{data:I}=(Digit.Hooks.useWorkflowDetails({tenantId:null==h?void 0:h.split(".")[0],id:S,moduleCode:"BPAREG"}),Digit.Hooks.obps.useLicenseDetails(P,{applicationNumber:S,tenantId:P},{}));return b.isLoading||b.isIdle?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:T?"OpenlinkContainer":""},T&&l.createElement(o.BackButton,{style:{border:"none"}},A("CS_COMMON_BACK")),l.createElement(o.Card,null,l.createElement(Ba,{t:A,data:b.data,isSuccess:b.isSuccess,isLoading:b.isIdle||b.isLoading}),b.isSuccess&&l.createElement(o.CardText,null,""+A("TRADELICENSE_TRADETYPE_"+D)+A("CS_FILE_STAKEHOLDER_RESPONSE")),!b.isSuccess&&l.createElement(o.CardText,null,A("CS_FILE_PROPERTY_FAILED_RESPONSE")),b.isSuccess&&!T&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen/payment/collect/"+b.data.Licenses[0].businessService+"/"+b.data.Licenses[0].applicationNumber+"/"+b.data.Licenses[0].tenantId+"?tenantId="+b.data.Licenses[0].tenantId,state:{tenantId:b.data.Licenses[0].tenantId}}},l.createElement(o.SubmitBar,{label:A("COMMON_MAKE_PAYMENT")})),b.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:A("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=I,t=C.find(t=>t.code===e.tenantId);return Promise.resolve(function(e,t,l){try{var n,i,o,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R;return Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:l(null==t?void 0:t.i18nKey)+" "+(x=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),x.toLowerCase().split(" ").map(Na).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:l("NEW_STAKEHOLDER_REGISTRATION"),applicationNumber:(null==e||null===(i=e.applicationData)||void 0===i?void 0:i.applicationNumber)||"NA",details:[{title:l("CS_APPLICATION_DETAILS"),values:[{title:l("REGISTRATION_FILED_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(o=e.applicationData)||void 0===o||null===(a=o.auditDetails)||void 0===a?void 0:a.createdTime,"dd/MM/yyyy")||"NA"}]},{title:l("BPA_LICENSE_DETAILS_LABEL"),values:[{title:l("BPA_LICENSE_TYPE"),value:(null==e||null===(r=e.applicationDetails)||void 0===r||null===(u=r[1])||void 0===u||null===(d=u.values[0])||void 0===d?void 0:d.value)||"NA"},{title:l("BPA_COUNCIL_OF_ARCH_NO_LABEL"),value:(null==e||null===(s=e.applicationDetails)||void 0===s||null===(c=s[1])||void 0===c||null===(p=c.values[1])||void 0===p?void 0:p.value)||"NA"},{title:l("LICENSE_TYPE"),value:(null==e||null===(v=e.applicationData)||void 0===v?void 0:v.licenseType)||"NA"}]},{title:l("BPA_LICENSEE_DETAILS_HEADER_OWNER_INFO"),values:[{title:l("BPA_APPLICANT_NAME_LABEL"),value:(null==e||null===(m=e.applicationData)||void 0===m||null===(E=m.tradeLicenseDetail)||void 0===E||null===(f=E.owners)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.name)||"NA"},{title:l("BPA_OWNER_MOBILE_NO_LABEL"),value:(null==e||null===(g=e.applicationData)||void 0===g||null===(A=g.tradeLicenseDetail)||void 0===A||null===(S=A.owners)||void 0===S||null===(h=S[0])||void 0===h?void 0:h.mobileNumber)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(b=e.applicationDetails)||void 0===b||null===(y=b[2])||void 0===y||null===(C=y.values[1])||void 0===C?void 0:C.value)||"NA"},{title:l("BPA_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(T=e.applicationDetails)||void 0===T||null===(D=T[2])||void 0===D||null===(P=D.values[3])||void 0===P?void 0:P.value)||"NA"}]},{title:l("BPA_ADDRESS_LABEL"),values:[{title:l("BPA_PERMANANT_ADDRESS_LABEL"),value:(null==e||null===(I=e.applicationDetails)||void 0===I||null===(N=I[3])||void 0===N||null===(L=N.values[0])||void 0===L?void 0:L.value)||"NA"},{title:l("BPA_APPLICANT_CORRESPONDENCE_ADDRESS_LABEL"),value:(null==e||null===(B=e.applicationDetails)||void 0===B||null===(O=B[4])||void 0===O||null===(R=O.values[0])||void 0===R?void 0:R.value)||"NA"}]}]})}catch(e){return Promise.reject(e)}var x}(e,t,A)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),!T&&l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:A("CORE_COMMON_GO_TO_HOME")})),b.isSuccess&&T&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:A("BPA_COMMON_PROCEED_NEXT")})))))},ObpsCreateEDCR:e=>{var o,a,d,s;const c=r.useQueryClient(),p=i.useRouteMatch(),{t:v}=n.useTranslation(),m=(i.useLocation(),i.useHistory());let E=[];const[f,_,g]=Digit.Hooks.useSessionStorage("EDCR_CREATE",{}),[A,S]=t.useState(null),[h,b]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const y=Digit.ULBService.getStateId();let{data:C}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(y,[]);function T(e,t,l,n){var i,o,a;b(!0);const r=Digit.UserService.getUser();let d={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{id:null==r||null===(i=r.info)||void 0===i?void 0:i.uuid,tenantId:null==r||null===(o=r.info)||void 0===o?void 0:o.tenantId}}};const s=null==t?void 0:t.applicantName,c=null==t?void 0:t.file,p=null==t||null===(a=t.tenantId)||void 0===a?void 0:a.code,v=Et();d=u({},d,{tenantId:p}),d=u({},d,{transactionNumber:v}),d=u({},d,{applicantName:s}),d=u({},d,{appliactionType:"BUILDING_PLAN_SCRUTINY"}),d=u({},d,{applicationSubType:"NEW_CONSTRUCTION"});let E=new FormData;E.append("edcrRequest",JSON.stringify(d)),E.append("planFile",c),Digit.EDCRService.create({data:E},p).then((e,t)=>{var l,n,i,o,a,r;b(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(console.log("result?.data",null==e?void 0:e.data),sessionStorage.setItem("plotArea",(null==e||null===(n=e.data)||void 0===n||null===(i=n.edcrDetail[0].planDetail)||void 0===i||null===(o=i.plot)||void 0===o?void 0:o.area)||0),_(null==e||null===(a=e.data)||void 0===a?void 0:a.edcrDetail),m.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null==e||null===(r=e.data)||void 0===r?void 0:r.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;_({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),b(!1),S({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}const D=()=>{},P=()=>{};C=null!==(o=C)&&void 0!==o&&o.EdcrConfig?null===(a=C)||void 0===a?void 0:a.EdcrConfig:Xl,C.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="home";const I=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("EDCRAcknowledgement");return l.createElement(i.Switch,null,E.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:T,onSkip:D,t:v,formData:f,onAdd:P,isShowToast:A,isSubmitBtnDisable:h,setIsShowToast:S}))}),l.createElement(i.Route,{path:p.path+"/acknowledgement"},l.createElement(I,{data:f,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),c.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:p.path+"/"+E.indexRoute})))},ObpsCreateOCEDCR:e=>{var o,a,d,s;const c=r.useQueryClient(),p=i.useRouteMatch(),{t:v}=n.useTranslation(),{pathname:m}=i.useLocation(),{path:E}=i.useRouteMatch(),f=i.useHistory();let _=[];const[g,A,S]=Digit.Hooks.useSessionStorage("OC_EDCR_CREATE",{}),[h,b]=t.useState(null),[y,C]=t.useState(!1);Digit.SessionStorage.set("EDCR_BACK","IS_EDCR_BACK");const T=Digit.ULBService.getStateId();let{data:D}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(T,[]);const P=(e,t,l,n)=>{n?function(e,t,l,n){var i,o,a,r,d,s,c,p;C(!0);const v=g,m=Digit.UserService.getUser();let E={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{id:null==m||null===(i=m.info)||void 0===i?void 0:i.uuid,tenantId:null==m||null===(o=m.info)||void 0===o?void 0:o.tenantId}}};const _=Et(),S=null==v||null===(a=v.ScrutinyDetails)||void 0===a?void 0:a.edcrNumber,h=null==v||null===(r=v.ScrutinyDetails)||void 0===r?void 0:r.tenantId,y=null==v||null===(d=v.ScrutinyDetails)||void 0===d?void 0:d.applicantName,T=Tt(null==v||null===(s=v.ScrutinyDetails)||void 0===s?void 0:s.ocPermitdate),D=null==v||null===(c=v.ScrutinyDetails)||void 0===c?void 0:c.ocPermitNumber,P=null==v||null===(p=v.ScrutinyDetails)||void 0===p?void 0:p.edcrNumber,I=null==t?void 0:t.file;E=u({},E,{transactionNumber:_}),E=u({},E,{edcrNumber:S}),E=u({},E,{tenantId:h}),E=u({},E,{applicantName:y}),E=u({},E,{appliactionType:"BUILDING_OC_PLAN_SCRUTINY"}),E=u({},E,{applicationSubType:"NEW_CONSTRUCTION"}),E=u({},E,{permitDate:T}),E=u({},E,{permitNumber:D}),E=u({},E,{comparisonEdcrNumber:P});let N=new FormData;N.append("edcrRequest",JSON.stringify(E)),N.append("planFile",I),Digit.EDCRService.create({data:N},h).then((e,t)=>{var l,n,i;C(!1),null!=e&&null!==(l=e.data)&&void 0!==l&&l.edcrDetail&&(A(null==e||null===(n=e.data)||void 0===n?void 0:n.edcrDetail),f.replace("/digit-ui/citizen/obps/edcrscrutiny/oc-apply/acknowledgement",{data:null==e||null===(i=e.data)||void 0===i?void 0:i.edcrDetail}))}).catch(e=>{var t,l,n,i,o,a,r,u;A({data:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&l.errorCode?null==e||null===(n=e.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.errorCode:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"}),C(!1),b({key:!0,label:null!=e&&null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.errorCode?null==e||null===(r=e.response)||void 0===r||null===(u=r.data)||void 0===u?void 0:u.errorCode:"BPA_INTERNAL_SERVER_ERROR"})})}(0,t):A(u({},g,{[e]:u({},g[e],t)})),l||(e=>{const t=m.split("/").pop(),{nextStep:l}=_.find(e=>e.route===t);let n=f.push;if(null===l)return n(E+"/check");n(E+"/"+l)})()},I=()=>{},N=()=>{};D=null!==(o=D)&&void 0!==o&&o.OCEdcrConfig?null===(a=D)||void 0===a?void 0:a.OCEdcrConfig:Jl,D.forEach(e=>{_=_.concat(e.body.filter(e=>!e.hideInCitizen))}),_.indexRoute="docs-required";const L=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("OCEDCRAcknowledgement");return l.createElement(i.Switch,null,_.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:P,onSkip:I,t:v,formData:g,onAdd:N,isShowToast:h,isSubmitBtnDisable:y,setIsShowToast:b}))}),l.createElement(i.Route,{path:p.path+"/acknowledgement"},l.createElement(L,{data:g,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),c.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:p.path+"/"+_.indexRoute})))},ObpsNewBuildingPermit:()=>{var e,o,a,d,s,c;const p=r.useQueryClient(),{t:v}=n.useTranslation(),{pathname:m,state:E}=(i.useRouteMatch(),i.useLocation()),f=i.useRouteMatch(),_=i.useHistory();i.useLocation(),Digit.SessionStorage.set("OBPS_PT","true"),sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[g,A,S]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=E&&E.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==E?void 0:E.edcrNumber}}}:{}),h=Digit.ULBService.getStateId();let{data:b}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(h,[]);const y=(e,t,l,n)=>{A(n?t:""===e?u({},t):u({},g,{[e]:u({},g[e],t)})),(e=>{const t=m.split("/").pop(),{nextStep:l}=$l.find(e=>e.route===t);let n=_.push;if(null===l)return n(Ql(f.path,f.params)+"/check");n(Ql(f.path,f.params)+"/"+l)})()},C=()=>{};let T=[];b=null!==(e=b)&&void 0!==e&&e.BuildingPermitConfig?null===(o=b)||void 0===o?void 0:o.BuildingPermitConfig:Zl,b.forEach(e=>{T=T.concat(e.body.filter(e=>!e.hideInCitizen))}),T.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(S(),sessionStorage.setItem("isPermitApplication",!1))},[]);const D=null===(a=Digit)||void 0===a||null===(d=a.ComponentRegistryService)||void 0===d?void 0:d.getComponent("BPACheckPage"),P=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("BPAAcknowledgement");return l.createElement(i.Switch,null,$l.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:Ql(f.path,f.params)+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:y,onSkip:C,t:v,formData:g}))}),l.createElement(i.Route,{path:Ql(f.path,f.params)+"/check"},l.createElement(D,{onSubmit:function(){try{return _.push(Ql(f.path,f.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:g})),l.createElement(i.Route,{path:Ql(f.path,f.params)+"/acknowledgement"},l.createElement(P,{data:g,onSuccess:()=>{p.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:Ql(f.path,f.params)+"/"+T.indexRoute})))},ObpsOCBuildingPermit:()=>{var e,o,a,d,s,c;const p=r.useQueryClient(),{t:v}=n.useTranslation(),{pathname:m,state:E}=(i.useRouteMatch(),i.useLocation()),f=i.useHistory(),_=i.useRouteMatch();sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[g,A,S]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=E&&E.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==E?void 0:E.edcrNumber}}}:{}),h=Digit.ULBService.getStateId();let{data:b}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(h,[]);const y=(e,t,l,n)=>{A(n?t:""===e?u({},t):u({},g,{[e]:u({},g[e],t)})),(e=>{const t=m.split("/").pop(),{nextStep:l}=T.find(e=>e.route===t);let n=f.push;if(null===l)return n(tn(_.path,_.params)+"/check");n(tn(_.path,_.params)+"/"+l)})()},C=()=>{};let T=[];b=null!==(e=b)&&void 0!==e&&e.OCBuildingPermitConfig?null===(o=b)||void 0===o?void 0:o.OCBuildingPermitConfig:en,b.forEach(e=>{T=T.concat(e.body.filter(e=>!e.hideInCitizen))}),T.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(S(),sessionStorage.setItem("isPermitApplication",!1))},[]);const D=null===(a=Digit)||void 0===a||null===(d=a.ComponentRegistryService)||void 0===d?void 0:d.getComponent("OCBPACheckPage"),P=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("OCBPAAcknowledgement");return l.createElement(i.Switch,null,T.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:tn(_.path,_.params)+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:y,onSkip:C,t:v,formData:g}))}),l.createElement(i.Route,{path:tn(_.path,_.params)+"/check"},l.createElement(D,{onSubmit:function(){try{return f.push(tn(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:g})),l.createElement(i.Route,{path:tn(_.path,_.params)+"/acknowledgement"},l.createElement(P,{data:g,onSuccess:()=>{p.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:tn(_.path,_.params)+"/"+T.indexRoute})))},ObpsStakeholderRegistration:()=>{var e,o,a,d,s,c;const p=r.useQueryClient(),{t:v}=n.useTranslation(),{path:m}=i.useRouteMatch(),{pathname:E,state:f}=i.useLocation(),_=i.useHistory(),[g,A,S]=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=f&&f.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==f?void 0:f.edcrNumber}}}:{})),h=Digit.ULBService.getStateId();let{data:b}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(h,[]);const y=(e,t,l,n)=>{A(n?t:""===e?u({},t):u({},g,{[e]:u({},g[e],t)})),(e=>{const t=E.split("/").pop(),{nextStep:l}=T.find(e=>e.route===t);let n=_.push;if(null===l)return n(m+"/check");n(m+"/"+l)})()},C=()=>{};let T=[];b=null!==(e=b)&&void 0!==e&&e.StakeholderConfig?null===(o=b)||void 0===o?void 0:o.StakeholderConfig:ln,b.forEach(e=>{T=T.concat(e.body.filter(e=>!e.hideInCitizen))}),T.indexRoute="stakeholder-docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(S(),sessionStorage.setItem("isPermitApplication",!1))},[]);const D=null===(a=Digit)||void 0===a||null===(d=a.ComponentRegistryService)||void 0===d?void 0:d.getComponent("StakeholderCheckPage"),P=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("StakeholderAcknowledgement");return console.log("formData in StakeholderRegistration",g),console.log("config in StakeholderRegistration",T),l.createElement(i.Switch,null,T.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:m+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:y,onSkip:C,t:v,formData:g}))}),l.createElement(i.Route,{path:m+"/check"},l.createElement(D,{onSubmit:function(){try{return _.push(m+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:g})),l.createElement(i.Route,{path:m+"/acknowledgement"},l.createElement(P,{data:g,onSuccess:()=>{S(),p.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:m+"/"+T.indexRoute})))},ObpsCitizenBpaApplicationDetail:()=>{var e,a,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L;const B=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{let e=new Date;se.applicationData.additionalDetails.runDate=Tt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let i=u({},null==se?void 0:se.applicationData,{edcrDetail:[u({},null==se?void 0:se.edcrDetails)]});return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[i]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,o;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),i.applicationType=null==se||null===(n=se.applicationData)||void 0===n||null===(o=n.additionalDetails)||void 0===o?void 0:o.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:u({},i)})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?Ot(new Blob([e.data],{type:"application/pdf"})):Bt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},O=function(e){let{tenantId:t,payments:l}=e;d(e,En);try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const i=function(){if(null==l||!l.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},l)]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==l?void 0:l.fileStoreId]}}();return Promise.resolve(i&&i.then?i.then(n):n())}catch(e){return Promise.reject(e)}},{id:R}=i.useParams(),{t:x}=n.useTranslation(),w=Digit.ULBService.getCurrentTenantId(),M=Digit.ULBService.getStateId(),k=window.Digit.Utils.browser.isMobile(),F=r.useQueryClient(),[U,H]=t.useState(null),[W,j]=t.useState(!1),[z,Y]=t.useState(!1),[G,K]=t.useState(!1),[V,q]=t.useState(!1),[X,J]=t.useState(null),[Z,$]=t.useState(!1),[Q,ee]=t.useState(!1),[te,le]=t.useState(!1),[ne,ie]=t.useState(!1);sessionStorage.removeItem("BPA_SUBMIT_APP"),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!1));const oe=i.useHistory();sessionStorage.setItem("bpaApplicationDetails",!1);let ae=!1;const{data:re}=Digit.Hooks.obps.useMDMS(M,"StakeholderRegistraition","TradeTypetoRoleMapping"),{isLoading:ue,data:de}=Digit.Hooks.obps.useMDMS(M,"BPA",["DocTypeMapping"]),{data:se,isLoading:ce}=Digit.Hooks.obps.useBPADetailsPage(w,{applicationNo:R}),{data:pe}=Digit.Hooks.obps.useMDMS(w.split(".")[0],"BPA",["RiskTypeComputation"]),ve=Digit.Hooks.obps.useObpsAPI(null==se||null===(e=se.applicationData)||void 0===e?void 0:e.tenantId,!1);let me=Digit.Hooks.useWorkflowDetails({tenantId:null==se||null===(a=se.applicationData)||void 0===a?void 0:a.tenantId,id:R,moduleCode:"OBPS",config:{enabled:!!se}});t.useEffect(()=>{if(!ue&&!ce){var e;let v=[];if(null!=de&&null!==(e=de.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,d,s,c,p;v=null==de||null===(t=de.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==se||null===(t=se.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==se||null===(l=se.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==se||null===(i=se.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==se||null===(n=se.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,m=[];v&&(null===(d=v)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.docTypes)&&(null===(c=v)||void 0===c||null===(p=c[0])||void 0===p||p.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{m.push(e)})}));const E=null==se?void 0:se.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?u({},e,{additionalDetails:{obpsDocuments:[{title:"",values:m}]}}):e);se.applicationDetails=[...E]}}},[de,se]),t.useEffect(()=>{var e,t;"CITIZEN_APPROVAL_INPROCESS"==(null==se||null===(e=se.applicationData)||void 0===e?void 0:e.status)||"INPROGRESS"==(null==se||null===(t=se.applicationData)||void 0===t?void 0:t.status)?ee(!0):ee(!1)},[se]);const Ee=(e,t)=>e?t?e:x(e):x("NA");t.useEffect(()=>{switch(X){case"APPROVE":case"SEND_TO_ARCHITECT":case"APPLY":case"SKIP_PAYMENT":K(!0)}},[X]);const fe=()=>{H(null)};function _e(e){var t;let l="BPA_OC"==(null==se||null===(t=se.applicationData)||void 0===t?void 0:t.businessService)?"ocbpa":"bpa";var n,i,o,a,r,u,d;"FORWARD"===e&&oe.replace("/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/"+(null==se||null===(n=se.applicationData)||void 0===n?void 0:n.tenantId)+"/"+(null==se||null===(i=se.applicationData)||void 0===i?void 0:i.applicationNo)+"/check",{data:null==se?void 0:se.applicationData,edcrDetails:null==se?void 0:se.edcrDetails}),"PAY"===e&&window.location.assign(window.location.origin+"/digit-ui/citizen/payment/collect/"+Lt(null==se?void 0:se.businessService,null==se?void 0:se.applicationStatus)+"/"+R+"/"+(null==se?void 0:se.tenantId)+"?tenantId="+(null==se?void 0:se.tenantId)),"SEND_TO_CITIZEN"===e&&((null===(o=me)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.processInstances)||void 0===r?void 0:r.length)>2?window.location.replace("/digit-ui/citizen/obps/editApplication/"+l+"/"+(null==se||null===(u=se.applicationData)||void 0===u?void 0:u.tenantId)+"/"+(null==se||null===(d=se.applicationData)||void 0===d?void 0:d.applicationNo)):_t(null==se?void 0:se.applicationData,pe,oe,x)),J(e),Y(!1)}function ge(){return!!Q&&(ae?!ae:!W)}const Ae=e=>{le(!0),ve.mutate({BPA:u({},null==se?void 0:se.applicationData,{workflow:e})},{onError:(e,t)=>{var l,n,i,o,a,r;le(!1),K(!1),H({key:"error",action:null!=e&&null!==(l=e.response)&&void 0!==l&&null!==(n=l.data)&&void 0!==n&&null!==(i=n.Errors[0])&&void 0!==i&&i.message?null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a||null===(r=a.Errors[0])||void 0===r?void 0:r.message:e}),setTimeout(fe,5e3)},onSuccess:(e,t)=>{le(!1),oe.replace("/digit-ui/citizen/obps/response",{data:e}),K(!1),H({key:"success",action:X}),setTimeout(fe,5e3),F.invalidateQueries("BPA_DETAILS_PAGE"),F.invalidateQueries("workFlowDetails")}})};if((null===(s=me)||void 0===s||null===(c=s.data)||void 0===c||null===(p=c.nextActions)||void 0===p?void 0:p.length)>0&&"CITIZEN_APPROVAL_INPROCESS"==(null==se||null===(v=se.applicationData)||void 0===v?void 0:v.status)){var Se,he,be;const e=Digit.UserService.getUser(),t=null==e||null===(Se=e.info)||void 0===Se?void 0:Se.roles;var ye,Ce,Te;if("CITIZEN_APPROVAL_INPROCESS"==(null==se||null===(he=se.applicationData)||void 0===he?void 0:he.status))me.data.nextActions=1==(null==t?void 0:t.length)&&"CITIZEN"==(null==t||null===(ye=t[0])||void 0===ye?void 0:ye.code)?null===(Ce=me)||void 0===Ce||null===(Te=Ce.data)||void 0===Te?void 0:Te.nextActions:[];else if("INPROGRESS"==(null==se||null===(be=se.applicationData)||void 0===be?void 0:be.status)){var De,Pe;let e=!1;null==re||null===(De=re.StakeholderRegistraition)||void 0===De||null===(Pe=De.TradeTypetoRoleMapping)||void 0===Pe||Pe.map(e=>{var t;null==e||null===(t=e.role)||void 0===t||t.map(e=>{roles.push(e)})});const l=roles.filter((e,t,l)=>l.indexOf(e)===t);var Ie,Ne;(null==t?void 0:t.length)>1&&t.forEach(t=>{l.includes(t.code)&&(e=!0)}),me.data.nextActions=e?null===(Ie=me)||void 0===Ie||null===(Ne=Ie.data)||void 0===Ne?void 0:Ne.nextActions:[]}}if("SEND_BACK_TO_CITIZEN"===(null===(m=me)||void 0===m||null===(E=m.data)||void 0===E||null===(f=E.processInstances)||void 0===f||null===(_=f[0])||void 0===_?void 0:_.action)){var Le;W&&j(!0),ae=!0;const e=Digit.UserService.getUser(),t=null==e||null===(Le=e.info)||void 0===Le?void 0:Le.roles;var Be,Oe;1!==(null==t?void 0:t.length)&&(me=u({},me,{data:u({},null===(Be=me)||void 0===Be?void 0:Be.data,{actionState:{nextActions:[]}}),data:u({},null===(Oe=me)||void 0===Oe?void 0:Oe.data,{nextActions:[]})}))}if(ce||te)return l.createElement(o.Loader,null);let Re=[];var xe,we,Me,ke,Fe,Ue,He,We,je,ze,Ye,Ge,Ke;if((null==se||null===(g=se.collectionBillDetails)||void 0===g?void 0:g.length)>0&&pt(null==se?void 0:se.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&Re.push({order:1,label:x("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return O({tenantId:null==se||null===(t=se.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==se||null===(l=se.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&Re.push({order:2,label:x("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return O({tenantId:null==se||null===(t=se.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==se||null===(l=se.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&Re.push({order:1,label:x("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return O({tenantId:null==se||null===(t=se.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==se||null===(l=se.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&Re.push({order:1,label:x("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return O({tenantId:null==se||null===(t=se.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==se||null===(l=se.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&Re.push({order:2,label:x("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return O({tenantId:null==se||null===(t=se.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==se||null===(l=se.applicationData)||void 0===l?void 0:l.applicationNo})}})}),se&&"BPA_LOW"===(null==se||null===(A=se.applicationData)||void 0===A?void 0:A.businessService)&&(null==se||null===(S=se.collectionBillDetails)||void 0===S?void 0:S.length)>0)(null==se||null===(xe=se.applicationData)||void 0===xe||!xe.status.includes("REVOCATION"))&&Re.push({order:3,label:x("BPA_PERMIT_ORDER"),onClick:()=>{var e;return B({tenantId:null==se||null===(e=se.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==se||null===(we=se.applicationData)||void 0===we?void 0:we.status.includes("REVOCATION"))&&Re.push({order:3,label:x("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t}=e;d(e,mn);try{let e=u({},null==se?void 0:se.applicationData);return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).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")})})}catch(e){return Promise.reject(e)}}({tenantId:null==se||null===(e=se.applicationData)||void 0===e?void 0:e.tenantId})}});else if(se&&"BPA"===(null==se||null===(h=se.applicationData)||void 0===h?void 0:h.businessService)&&(null==se||null===(b=se.collectionBillDetails)||void 0===b?void 0:b.length)>0){var Ve;"APPROVED"===(null==se||null===(Ve=se.applicationData)||void 0===Ve?void 0:Ve.status)&&Re.push({order:3,label:x("BPA_PERMIT_ORDER"),onClick:()=>{var e;return B({tenantId:null==se||null===(e=se.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var qe;"APPROVED"===(null==se||null===(qe=se.applicationData)||void 0===qe?void 0:qe.status)&&Re.push({order:3,label:x("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return B({tenantId:null==se||null===(e=se.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=se&&se.comparisionReport&&Re.push({order:4,label:x("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==se||null===(e=se.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),Re.sort(function(e,t){return e.order-t.order}),(null===(y=me)||void 0===y||null===(C=y.data)||void 0===C||null===(T=C.nextActions)||void 0===T?void 0:T.length)>0&&(me.data.nextActions=null===(Me=me)||void 0===Me||null===(ke=Me.data)||void 0===ke||null===(Fe=ke.nextActions)||void 0===Fe?void 0:Fe.filter(e=>"INITIATE"!==e.action),me.data.nextActions=null===(Ue=me)||void 0===Ue||null===(He=Ue.data)||void 0===He||null===(We=He.nextActions)||void 0===We?void 0:We.filter(e=>"ADHOC"!==e.action),me.data.nextActions=null===(je=me)||void 0===je||null===(ze=je.data)||void 0===ze||null===(Ye=ze.nextActions)||void 0===Ye?void 0:Ye.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==se||null===(D=se.applicationDetails)||void 0===D?void 0:D.length)>0&&(se.applicationDetails=(null==se||null===(Ge=se.applicationDetails)||void 0===Ge?void 0:Ge.length)>0&&(null==se||null===(Ke=se.applicationDetails)||void 0===Ke?void 0:Ke.filter(e=>0!==Object.keys(e).length)));const Xe=null==se||null===(P=se.applicationDetails)||void 0===P?void 0:P.filter(e=>0!==Object.keys(e).length);return(null==Xe?void 0:Xe.length)>0&&(se.applicationDetails=Xe),l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},x("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",{style:{display:"flex",alignItems:"center",color:"#A52A2A"}},l.createElement(o.LinkButton,{label:x("VIEW_TIMELINE"),onClick:()=>{const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"}),ie(!0)}})),Re&&Re.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>$(!Z),displayOptions:Z,options:Re})),null==se||null===(I=se.applicationDetails)||void 0===I?void 0:I.filter(e=>Object.keys(e).length>0).map((e,n,a)=>{var r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,w,M,F,U,H,G,K,X,J,Z,$,ee,te,le,ne,ie,oe,re,ue,de,ce,pe,ve,fe,Ae,Se,he,be,ye,Ce,Te,De,Pe,Ie,Ne;return l.createElement("div",null,null!=e&&e.isNotAllowed?null:l.createElement(o.Card,{key:n,style:null!=e&&null!==(r=e.additionalDetails)&&void 0!==r&&r.fiReport||""!==(null==e?void 0:e.title)?{}:{marginTop:"-30px"}},null!=e&&e.isTitleVisible?null:l.createElement(o.CardSubHeader,{style:{fontSize:"24px"}},x(null==e?void 0:e.title)),l.createElement("div",{style:null!=e&&e.isBackGroundColor?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},l.createElement(o.StatusTable,null,null!=e&&e.isCommon&&(null==e||null===(u=e.values)||void 0===u?void 0:u.length)>0?null==e||null===(d=e.values)||void 0===d?void 0:d.map(e=>l.createElement(o.Row,null!=e&&e.isUnit?{className:"border-none",label:x(null==e?void 0:e.title),text:null!=e&&e.value?Ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+x(null==e?void 0:e.isUnit):x("CS_NA")}:null!=e&&e.isLink?{className:"border-none",label:x(null==e?void 0:e.title),text:l.createElement("div",null,l.createElement(i.Link,{to:null==e?void 0:e.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e?void 0:e.value)))}:{className:"border-none",label:x(null==e?void 0:e.title),text:Ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||x("CS_NA")})):null,(null==e||!e.isFeeDetails)&&(null==e||null===(s=e.additionalDetails)||void 0===s||null===(c=s.values)||void 0===c?void 0:c.length)>0?null==e||null===(p=e.additionalDetails)||void 0===p||null===(v=p.values)||void 0===v?void 0:v.map(t=>l.createElement("div",null,null!=e&&e.isTitleRepeat||null!=t&&t.isHeader||null!=t&&t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:x(null==t?void 0:t.title),textStyle:"Paid"===(null==t?void 0:t.value)?{color:"darkgreen"}:"Unpaid"===(null==t?void 0:t.value)?{color:"red"}:{},text:null!=t&&t.value?Ee(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated):x("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:x(null==t?void 0:t.title),text:null!=t&&t.value?Ee(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated)+" "+x(null==t?void 0:t.isUnit):x("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isHeader?null:l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},x(null==t?void 0:t.title)))):null,null!=e&&e.isSubOccupancyTable&&null!=e&&null!==(m=e.additionalDetails)&&void 0!==m&&m.subOccupancyTableDetails?l.createElement(cn,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==se?void 0:se.applicationData}):null,null!=e&&e.isScrutinyDetails&&(null==e||null===(E=e.additionalDetails)||void 0===E||null===(f=E.scruntinyDetails)||void 0===f?void 0:f.length)>0?null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.scruntinyDetails.map(e=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:x(null==e?void 0:e.title)}),l.createElement(o.LinkButton,{onClick:()=>{location.href=null==e?void 0:e.value},label:l.createElement(o.PDFSvg,null)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},x(null==e?void 0:e.text)))):null,null!=e&&e.isOwnerDetails&&(null==e||null===(g=e.additionalDetails)||void 0===g||null===(A=g.owners)||void 0===A?void 0:A.length)>0?null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.owners.map((t,n)=>{var i,a,r,u;return l.createElement("div",{key:n,style:(null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.owners)||void 0===a?void 0:a.length)>1?{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}:{}},(null==e||null===(r=e.additionalDetails)||void 0===r||null===(u=r.owners)||void 0===u?void 0:u.length)>1?l.createElement(o.Row,{className:"border-none",label:x("Owner")+" - "+(n+1)}):null,null==t?void 0:t.values.map(e=>l.createElement(o.Row,{className:"border-none",label:x(null==e?void 0:e.title),text:Ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||x("CS_NA")})))}):null,(null==e?void 0:e.isDocumentDetails)&&(null==e||null===(h=e.additionalDetails)||void 0===h||null===(b=h.obpsDocuments)||void 0===b||null===(y=b[0])||void 0===y?void 0:y.values)&&l.createElement("div",{style:{marginTop:"-8px"}},l.createElement(Yl,{documents:wt(null==e||null===(C=e.additionalDetails)||void 0===C||null===(T=C.obpsDocuments)||void 0===T||null===(D=T[0])||void 0===D?void 0:D.values),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"20px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})),null!=e&&e.isFieldInspection&&(null==se||null===(P=se.applicationData)||void 0===P||null===(I=P.additionalDetails)||void 0===I||null===(N=I.fieldinspection_pending)||void 0===N?void 0:N.length)>0?l.createElement(pn,{isCitizen:!0,fiReport:null==se||null===(L=se.applicationData)||void 0===L||null===(B=L.additionalDetails)||void 0===B?void 0:B.fieldinspection_pending}):null,(null==e||null===(O=e.additionalDetails)||void 0===O||null===(w=O.noc)||void 0===w?void 0:w.length)>0?null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.noc.map((t,n)=>{var i,a,r,u,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,w,M,k,F,U,H,W,j,z,Y,G,K,V;return l.createElement("div",{key:n,style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"960px",minWidth:"280px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:x("BPA_"+(null==e||null===(i=e.additionalDetails)||void 0===i||null===(a=i.data)||void 0===a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px"}}),l.createElement(o.Row,{className:"border-none",label:x(""+(null==e||null===(r=e.values)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.title)),textStyle:{marginLeft:"10px"},text:Ee(null==e||null===(d=e.values)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.value,null==e||null===(c=e.values)||void 0===c||null===(p=c[0])||void 0===p?void 0:p.isNotTranslated)}),l.createElement(o.Row,{className:"border-none",label:x(""+(null==e||null===(v=e.values)||void 0===v||null===(m=v[1])||void 0===m?void 0:m.title)),textStyle:"APPROVED"==(null==e||null===(E=e.values)||void 0===E||null===(f=E[1])||void 0===f?void 0:f.value)||"AUTO_APPROVED"==(null==e||null===(_=e.values)||void 0===_||null===(g=_[1])||void 0===g?void 0:g.value)?{marginLeft:"10px",color:"#00703C"}:{marginLeft:"10px",color:"#D4351C"},text:Ee(null==e||null===(A=e.values)||void 0===A||null===(S=A[1])||void 0===S?void 0:S.value,null==e||null===(h=e.values)||void 0===h||null===(b=h[1])||void 0===b?void 0:b.isNotTranslated)}),null!=e&&null!==(y=e.values)&&void 0!==y&&null!==(C=y[2])&&void 0!==C&&C.value?l.createElement(o.Row,{className:"border-none",label:x(""+(null==e||null===(T=e.values)||void 0===T||null===(D=T[2])||void 0===D?void 0:D.title)),textStyle:{marginLeft:"10px"},text:Ee(null==e||null===(P=e.values)||void 0===P||null===(I=P[2])||void 0===I?void 0:I.value,null==e||null===(N=e.values)||void 0===N||null===(L=N[2])||void 0===L?void 0:L.isNotTranslated)}):null,null!=e&&null!==(B=e.values)&&void 0!==B&&null!==(O=B[3])&&void 0!==O&&O.value?l.createElement(o.Row,{className:"border-none",label:x(""+(null==e||null===(R=e.values)||void 0===R||null===(w=R[3])||void 0===w?void 0:w.title)),textStyle:{marginLeft:"10px"},text:Ee(null==e||null===(M=e.values)||void 0===M||null===(k=M[3])||void 0===k?void 0:k.value,null==e||null===(F=e.values)||void 0===F||null===(U=F[3])||void 0===U?void 0:U.isNotTranslated)}):null,null!=e&&null!==(H=e.values)&&void 0!==H&&null!==(W=H[3])&&void 0!==W&&W.value?l.createElement(o.Row,{className:"border-none",label:x(""+(null==e||null===(j=e.values)||void 0===j||null===(z=j[4])||void 0===z?void 0:z.title)),textStyle:{marginLeft:"10px"},text:Ee(null==e||null===(Y=e.values)||void 0===Y||null===(G=Y[4])||void 0===G?void 0:G.value,null==e||null===(K=e.values)||void 0===K||null===(V=K[4])||void 0===V?void 0:V.isNotTranslated)}):null,l.createElement(o.Row,{className:"border-none",label:x(""+(null==t?void 0:t.title))})),l.createElement(o.StatusTable,null,null!=t&&t.values?l.createElement(Yl,{documents:wt(null==t?void 0:t.values,!0),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}):l.createElement("div",null,l.createElement(o.CardText,null,x("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}):null,(null==e||!e.isTitleVisible)&&(null==e||null===(F=e.additionalDetails)||void 0===F||null===(U=F.permit)||void 0===U?void 0:U.length)>0?null==e||null===(H=e.additionalDetails)||void 0===H||null===(G=H.permit)||void 0===G?void 0:G.map(e=>l.createElement(o.CardText,null,null==e?void 0:e.title)):null,(null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&l.createElement(vn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:[]})))),n===a.length-1&&l.createElement(o.Card,null,l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(nn,{application:null==se?void 0:se.applicationData,id:R}),!(null!==(X=me)&&void 0!==X&&X.isLoading)&&(null===(J=me)||void 0===J||null===(Z=J.data)||void 0===Z||null===($=Z.nextActions)||void 0===$?void 0:$.length)>0&&!ae&&Q&&l.createElement(o.CheckBox,{styles:{margin:"20px 0 40px",paddingTop:"10px"},checked:W,label:l.createElement("div",null,l.createElement("span",null,x("BPA_I_AGREE_THE_LABEL")+" "),l.createElement("span",{style:{color:"#a82227",cursor:"pointer"},onClick:()=>q(!V)},x("BPA_TERMS_AND_CONDITIONS_LABEL"))),onChange:()=>{j(!W),W&&Y(!W)}})),!(null!==(ee=me)&&void 0!==ee&&ee.isLoading)&&(null===(te=me)||void 0===te||null===(le=te.data)||void 0===le||null===(ne=le.nextActions)||void 0===ne?void 0:ne.length)>1&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},z&&null!==(ie=me)&&void 0!==ie&&null!==(oe=ie.data)&&void 0!==oe&&oe.nextActions?l.createElement(o.Menu,{localeKeyPrefix:"WF_BPA",options:null===(re=me)||void 0===re||null===(ue=re.data)||void 0===ue?void 0:ue.nextActions.map(e=>e.action),t:x,onSelect:_e}):null,l.createElement(o.SubmitBar,{disabled:ge(),label:x("ES_COMMON_TAKE_ACTION"),onSubmit:()=>Y(!z)}))),!(null!==(de=me)&&void 0!==de&&de.isLoading)&&1==(null===(ce=me)||void 0===ce||null===(pe=ce.data)||void 0===pe||null===(ve=pe.nextActions)||void 0===ve?void 0:ve.length)&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:k?"19px":"initial"},className:ge()?"submit-bar-disabled":"submit-bar",disabled:ge(),name:null===(fe=me)||void 0===fe||null===(Ae=fe.data)||void 0===Ae||null===(Se=Ae.nextActions)||void 0===Se||null===(he=Se[0])||void 0===he?void 0:he.action,value:null===(be=me)||void 0===be||null===(ye=be.data)||void 0===ye||null===(Ce=ye.nextActions)||void 0===Ce||null===(Te=Ce[0])||void 0===Te?void 0:Te.action,onClick:e=>{_e(e.target.value)}},x("WF_BPA_"+(null===(De=me)||void 0===De||null===(Pe=De.data)||void 0===Pe||null===(Ie=Pe.nextActions)||void 0===Ie||null===(Ne=Ie[0])||void 0===Ne?void 0:Ne.action))))))))}),V?l.createElement(dn,{t:x,action:"TERMS_AND_CONDITIONS",tenantId:w,id:R,closeModal:()=>{q(!1)},submitAction:Ae,applicationData:(null==se?void 0:se.applicationData)||{}}):null,G?l.createElement(dn,{t:x,action:X,tenantId:w,id:R,closeModal:()=>{J(null),K(!1)},submitAction:Ae,actionData:null===(N=me)||void 0===N||null===(L=N.data)||void 0===L?void 0:L.timeline}):null,U&&l.createElement(o.Toast,{error:"error"===U.key,label:x("success"===U.key?"ES_OBPS_"+U.action+"_UPDATE_SUCCESS":U.action),onClose:fe,style:{zIndex:"1000"}}))},ObpsBPASendToArchitect:e=>{var a,d,s,c,p,v,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const E=r.useQueryClient(),f=i.useRouteMatch(),{t:_}=n.useTranslation(),{applicationNo:g,tenantId:A}=i.useParams(),{pathname:S}=i.useLocation(),h=i.useHistory();let b=[],y={};const[C,T,D]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),P=Digit.ULBService.getStateId();let{data:I}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(P,[]);const{data:N}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:L,isLoading:B}=Digit.Hooks.obps.useBPASearch(A,{applicationNo:g});let O={edcrNumber:null==L||null===(a=L[0])||void 0===a?void 0:a.edcrNumber};const{data:R,isLoading:x}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),O,{enabled:!!O.edcrNumber});let w=g;const{data:M,isLoading:k}=Digit.Hooks.obps.useNocDetails(A,{sourceRefId:w}),F=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||k||B||x)){y=L?L[0]:{};const e=function(){if(R&&M)return y=L[0],F&&(y.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify(u({},y))),Promise.resolve(function(e,t,l,n,i){try{var o,a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B,O,R,x,w,M,k,F,U,H,W,j;const z=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.BlockIds=(e=>{let t={};return e&&e.map((e,l)=>{t["Block_"+(l+1)]=e.id}),t})(null==e||null===(o=e.landInfo)||void 0===o?void 0:o.unit),e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.address.city={code:null==e||null===(r=e.landInfo)||void 0===r||null===(d=r.address)||void 0===d?void 0:d.city,name:null==e||null===(s=e.landInfo)||void 0===s||null===(c=s.address)||void 0===c||null===(p=c.city)||void 0===p?void 0:p.split(".")[1]},e.address.locality=u({},null==e||null===(v=e.landInfo)||void 0===v||null===(m=v.address)||void 0===m?void 0:m.locality,{i18nkey:null==e||null===(E=e.landInfo)||void 0===E||null===(f=E.address)||void 0===f||null===(_=f.locality)||void 0===_?void 0:_.name}),e.data={applicantName:null==t||null===(g=t.planDetail)||void 0===g||null===(A=g.planInformation)||void 0===A?void 0:A.applicantName,applicationDate:null==e||null===(S=e.auditDetails)||void 0===S?void 0:S.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.holdingNo,boundaryWallLength:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.boundaryWallLength,occupancyType:null==t||null===(y=t.planDetail)||void 0===y||null===(C=y.planInformation)||void 0===C?void 0:C.occupancy,registrationDetails:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(D=l.BPA)||void 0===D?void 0:D.RiskTypeComputation,null==t||null===(P=t.planDetail)||void 0===P||null===(I=P.plot)||void 0===I?void 0:I.area,null==t||null===(N=t.planDetail)||void 0===N?void 0:N.blocks),serviceType:(null==e||null===(L=e.additionalDetails)||void 0===L?void 0:L.serviceType)||(null==t?void 0:t.applicationSubType),scrutinyNumber:{edcrNumber:null==e?void 0:e.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let Y=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{Y.push(e)})}),e.PrevStateNocDocuments=Y,e.nocDocuments={NocDetails:n,nocDocuments:[]},null==e||e.landInfo.owners.map((e,t)=>{e.gender={active:!0,code:e.gender,i18nKey:"COMMON_GENDER_"+e.gender}}),e.owners={owners:null==e||null===(B=e.landInfo)||void 0===B?void 0:B.owners,ownershipCategory:{active:!0,code:null==e||null===(O=e.landInfo)||void 0===O?void 0:O.ownershipCategory,i18nKey:"COMMON_MASTERS_OWNERSHIPCATEGORY_"+(null==e||null===(R=e.landInfo)||void 0===R?void 0:R.ownershipCategory.replaceAll(".","_"))}},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(x=l.BPA)||void 0===x?void 0:x.RiskTypeComputation,null==t||null===(w=t.planDetail)||void 0===w||null===(M=w.plot)||void 0===M?void 0:M.area,null==t||null===(k=t.planDetail)||void 0===k?void 0:k.blocks),e.subOccupancy=z(null==e||null===(F=e.landInfo)||void 0===F?void 0:F.unit),e.uiFlow={flow:null==e||null===(U=e.businessService)||void 0===U||null===(H=U.split("."))||void 0===H?void 0:H[0],applicationType:(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(y,R,N,M,_)).then(function(e){T(u({},C,e))})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[L,R,N,M]);const U=(e,t,l,n)=>{T(n?t:u({},C,{[e]:u({},C[e],t)})),(e=>{var t;const l=null==S||null===(t=S.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=b.find(e=>e.route===l);let i=h.push;if(null===n)return i(fn(f.path,f.params)+"/check");i(fn(f.path,f.params)+"/"+n)})()},H=()=>{};I=null!==(d=I)&&void 0!==d&&d.BuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.BuildingPermitConfig:Zl,I.forEach(e=>{b=b.concat(e.body.filter(e=>!e.hideInCitizen))}),b.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(D(),sessionStorage.setItem("isPermitApplication",!1))},[]);const W=null===(c=Digit)||void 0===c||null===(p=c.ComponentRegistryService)||void 0===p?void 0:p.getComponent("BPACheckPage"),j=null===(v=Digit)||void 0===v||null===(m=v.ComponentRegistryService)||void 0===m?void 0:m.getComponent("BPAAcknowledgement");return k||B||x?l.createElement(o.Loader,null):l.createElement(i.Switch,null,b.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:fn(f.path,f.params)+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:U,onSkip:H,t:_,formData:C}))}),l.createElement(i.Route,{path:fn(f.path,f.params)+"/check"},l.createElement(W,{onSubmit:function(){try{return h.push(fn(f.path,f.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:C})),l.createElement(i.Route,{path:fn(f.path,f.params)+"/acknowledgement"},l.createElement(j,{data:C,onSuccess:()=>{E.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,R&&l.createElement(i.Redirect,{to:fn(f.path,f.params)+"/"+b.indexRoute})))},ObpsOCSendToArchitect:e=>{var a,d,s,c,p,v,m,E;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const f=r.useQueryClient(),_=i.useRouteMatch(),{t:g}=n.useTranslation(),{applicationNo:A,tenantId:S}=i.useParams(),{pathname:h}=i.useLocation(),b=i.useHistory();let y=[],C={};const[T,D,P]=Digit.Hooks.useSessionStorage("OC_BUILDING_PERMIT_EDITFLOW",{}),I=Digit.ULBService.getStateId();let{data:N}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(I,[]);const{data:L}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:B,isLoading:O}=Digit.Hooks.obps.useBPASearch(S,{applicationNo:A});let R={edcrNumber:null==B||null===(a=B[0])||void 0===a?void 0:a.edcrNumber};const{data:x,isLoading:w}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),R,{enabled:!(null==B||null===(d=B[0])||void 0===d||!d.edcrNumber)});let M=null==x?void 0:x.permitNumber;const{data:k}=Digit.Hooks.obps.useOCEdcrSearch(S,{approvalNo:M},{enabled:!(!M||null==x||!x.permitNumber)},R);let F=A;const{data:U,isLoading:H}=Digit.Hooks.obps.useNocDetails(S,{sourceRefId:F}),W=window.location.href.includes("editApplication");JSON.parse(sessionStorage.getItem("tl-trade")),t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||H||O||w)){C=B?B[0]:{};const e=function(){if(x&&k)return C=B[0],W&&(C.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify(u({},C))),Promise.resolve(function(e,t,l,n,i,o){try{var a,r,d,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N;const L=e=>{let t=[],l=[],n={};return e&&e.map((e,o)=>{var a;t=null!=e&&e.usageCategory?null==e||null===(a=e.usageCategory)||void 0===a?void 0:a.split(","):[],l=[],t&&t.map((e,t)=>{l.push({code:e,i18nKey:"BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"),name:i("BPA_SUBOCCUPANCYTYPE_"+e.replaceAll(".","_"))})}),l&&(n["Block_"+(o+1)]=l)}),n};e.address=null==e||null===(a=e.landInfo)||void 0===a?void 0:a.address,e.additionalDetails=u({},null==e?void 0:e.additionalDetails,{applicationType:null==t?void 0:t.appliactionType,holdingNo:null==e||null===(r=e.additionalDetails)||void 0===r?void 0:r.holdingNo,landId:null==e||null===(d=e.landInfo)||void 0===d?void 0:d.id,serviceType:(null==e||null===(s=e.additionalDetails)||void 0===s?void 0:s.serviceType)||(null==t?void 0:t.applicationSubType)}),e.data={applicantName:null==t||null===(c=t.planDetail)||void 0===c||null===(p=c.planInformation)||void 0===p?void 0:p.applicantName,applicationDate:null==e||null===(v=e.auditDetails)||void 0===v?void 0:v.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.holdingNo,bpaData:o,occupancyType:null==t||null===(E=t.planDetail)||void 0===E||null===(f=E.planInformation)||void 0===f?void 0:f.occupancy,registrationDetails:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(g=l.BPA)||void 0===g?void 0:g.RiskTypeComputation,null==t||null===(A=t.planDetail)||void 0===A||null===(S=A.plot)||void 0===S?void 0:S.area,null==t||null===(h=t.planDetail)||void 0===h?void 0:h.blocks),serviceType:(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.serviceType)||(null==t?void 0:t.applicationSubType),edcrDetails:t,scrutinyNumber:{edcrNumber:null==t?void 0:t.edcrNumber}},e.PrevStateDocuments=null==e?void 0:e.documents,e.documents={documents:[]};let B=[];return n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{B.push(e)})}),e.PrevStateNocDocuments=B,e.nocDocuments={NocDetails:n,nocDocuments:[]},e.riskType=Digit.Utils.obps.calculateRiskType(null==l||null===(y=l.BPA)||void 0===y?void 0:y.RiskTypeComputation,null==t||null===(C=t.planDetail)||void 0===C||null===(T=C.plot)||void 0===T?void 0:T.area,null==t||null===(D=t.planDetail)||void 0===D?void 0:D.blocks),e.subOccupancy=L(null==e||null===(P=e.landInfo)||void 0===P?void 0:P.unit),e.uiFlow={flow:"OCBPA",applicationType:(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.applicationType)||(null==t?void 0:t.appliactionType),serviceType:(null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.serviceType)||(null==t?void 0:t.applicationSubType)},sessionStorage.setItem("BPA_IS_ALREADY_WENT_OFF_DETAILS",JSON.stringify(!0)),Promise.resolve(e)}catch(e){return Promise.reject(e)}}(C,x,L,U,g,k)).then(function(e){D(u({},T,e))})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[B,x,L,U,k]);const j=(e,t,l,n)=>{D(n?t:u({},T,{[e]:u({},T[e],t)})),(e=>{var t;const l=null==h||null===(t=h.split("/"))||void 0===t?void 0:t.pop(),{nextStep:n}=y.find(e=>e.route===l);let i=b.push;if(null===n)return i(_n(_.path,_.params)+"/check");i(_n(_.path,_.params)+"/"+n)})()},z=()=>{};N=null!==(s=N)&&void 0!==s&&s.OCBuildingPermitConfig?null===(c=N)||void 0===c?void 0:c.OCBuildingPermitConfig:en,N.forEach(e=>{y=y.concat(e.body.filter(e=>!e.hideInCitizen))}),y.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(P(),sessionStorage.setItem("isPermitApplication",!1))},[]);const Y=null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPACheckPage"),G=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("OCBPAAcknowledgement");return H||O||w?l.createElement(o.Loader,null):l.createElement(i.Switch,null,y.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:_n(_.path,_.params)+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:j,onSkip:z,t:g,formData:T}))}),l.createElement(i.Route,{path:_n(_.path,_.params)+"/check"},l.createElement(Y,{onSubmit:function(){try{return b.push(_n(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:T})),l.createElement(i.Route,{path:_n(_.path,_.params)+"/acknowledgement"},l.createElement(G,{data:T,onSuccess:()=>{f.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,x&&k&&l.createElement(i.Redirect,{to:_n(_.path,_.params)+"/"+y.indexRoute})))},ObpsBPASendBackToCitizen:e=>{var a,d,s,c,p,v,m,E;const{t:f}=n.useTranslation(),_=r.useQueryClient(),g=i.useRouteMatch(),{pathname:A}=i.useLocation(),S=i.useHistory(),h=Digit.ULBService.getStateId(),{applicationNo:b,tenantId:y}=i.useParams();sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));let C=[],T={};const[D,P,I]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),N=Digit.ULBService.getStateId();let{data:L}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(N,[]);const{data:B}=Digit.Hooks.obps.useMDMS(h,"BPA",["RiskTypeComputation"]),{data:O,isLoading:R}=Digit.Hooks.obps.useBPASearch(y,{applicationNo:b});let x={edcrNumber:null==O||null===(a=O[0])||void 0===a?void 0:a.edcrNumber},w=b;const{data:M,isLoading:k}=Digit.Hooks.obps.useScrutinyDetails(h,x,{enabled:!(null==O||null===(d=O[0])||void 0===d||!d.edcrNumber)}),{data:F,isLoading:U}=Digit.Hooks.obps.useNocDetails(y,{sourceRefId:w}),H=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||U||R||k)){T=O?O[0]:{};const e=function(){if(O&&T&&M&&B&&F)return T=O[0],H&&(T.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify(u({},T))),Promise.resolve(Pt(T,M,B,F,f)).then(function(e){P(u({},D,e))})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[O,M,B,F]);const W=(e,t,l,n)=>{P(n?t:u({},D,{[e]:u({},D[e],t)})),(e=>{const t=A.split("/").pop(),{nextStep:l}=C.find(e=>e.route===t);let n=S.push;if(null===l)return n(It(g.path,g.params)+"/check");n(It(g.path,g.params)+"/"+l)})()},j=()=>{};L=null!==(s=L)&&void 0!==s&&s.BuildingPermitConfig?null===(c=L)||void 0===c?void 0:c.BuildingPermitConfig:Zl,L.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(I(),sessionStorage.setItem("isPermitApplication",!1))},[]);const z=null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),Y=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("OCSendBackAcknowledgement");return U||R||k?l.createElement(o.Loader,null):l.createElement(i.Switch,null,C.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:It(g.path,g.params)+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:j,t:f,formData:D}))}),l.createElement(i.Route,{path:It(g.path,g.params)+"/check"},l.createElement(z,{onSubmit:function(){try{return S.push(It(g.path,g.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:D})),l.createElement(i.Route,{path:It(g.path,g.params)+"/acknowledgement"},l.createElement(Y,{data:D,onSuccess:()=>{_.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:It(g.path,g.params)+"/"+C.indexRoute})))},ObpsOCSendBackToCitizen:e=>{var a,d,s,c,p,v,m,E;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const{t:f}=n.useTranslation(),_=r.useQueryClient(),g=i.useRouteMatch(),{pathname:A}=i.useLocation(),S=i.useHistory(),h=Digit.ULBService.getStateId(),{applicationNo:b,tenantId:y}=i.useParams();let C=[],T={};const[D,P,I]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),N=Digit.ULBService.getStateId();let{data:L}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(N,[]);const{isMdmsLoading:B,data:O}=Digit.Hooks.obps.useMDMS(h,"BPA",["RiskTypeComputation","homePageUrlLinks"]),{data:R,isLoading:x}=Digit.Hooks.obps.useBPASearch(y,{applicationNo:b});let w={edcrNumber:null==R||null===(a=R[0])||void 0===a?void 0:a.edcrNumber},M=b;const{data:k,isLoading:F}=Digit.Hooks.obps.useScrutinyDetails(h,w,{enabled:!(null==R||null===(d=R[0])||void 0===d||!d.edcrNumber)}),{data:U,isLoading:H}=Digit.Hooks.obps.useNocDetails(y,{sourceRefId:M}),W=window.location.href.includes("editApplication");t.useEffect(function(){try{let e=sessionStorage.getItem("BPA_IS_ALREADY_WENT_OFF_DETAILS");e=!e||JSON.parse(e);const t=function(){if(!(e||H||x||F||B)){T=R?R[0]:{};const e=function(){if(R&&T&&k&&O&&U)return T=R[0],W&&(T.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify(u({},T))),Promise.resolve(Pt(T,k,O,U,f)).then(function(e){P(u({},D,e))})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[R,k,O,U]);const j=(e,t,l,n)=>{P(n?t:u({},D,{[e]:u({},D[e],t)})),(e=>{const t=A.split("/").pop(),{nextStep:l}=C.find(e=>e.route===t);let n=S.push;if(null===l)return n(It(g.path,g.params)+"/check");n(It(g.path,g.params)+"/"+l)})()},z=()=>{};L=null!==(s=L)&&void 0!==s&&s.OCBuildingPermitConfig?null===(c=L)||void 0===c?void 0:c.OCBuildingPermitConfig:en,L.forEach(e=>{C=C.concat(e.body.filter(e=>!e.hideInCitizen))}),C.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(I(),sessionStorage.setItem("isPermitApplication",!1))},[]);const Y=null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),G=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("OCSendBackAcknowledgement");return H||x||F?l.createElement(o.Loader,null):l.createElement(i.Switch,null,C.map((e,t)=>{const{component:n,texts:o,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(i.Route,{path:It(g.path,g.params)+"/"+e.route,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:j,onSkip:z,t:f,formData:D}))}),l.createElement(i.Route,{path:It(g.path,g.params)+"/check"},l.createElement(Y,{onSubmit:function(){return Promise.resolve()},value:D})),l.createElement(i.Route,{path:It(g.path,g.params)+"/acknowledgement"},l.createElement(G,{data:D,onSuccess:()=>{_.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:It(g.path,g.params)+"/"+C.indexRoute})))},ObpsEdcrInbox:e=>{let{parentRoute:i}=e;window.scroll(0,0);const{t:r}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),s={},c={appliactionType:"",status:""},p={sortBy:"createdDate",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},v=Digit.SessionStorage.get("EDCR.INBOX"),m=t.useMemo(()=>"IS_EDCR_BACK"===Digit.SessionStorage.get("EDCR_BACK")?{filterForm:c,searchForm:s,tableForm:p}:v||{filterForm:c,searchForm:s,tableForm:p},[Object.values((null==v?void 0:v.filterForm)||{}),Object.values((null==v?void 0:v.searchForm)||{}),Object.values((null==v?void 0:v.tableForm)||{})]),[E,f]=t.useReducer(function(e,t){switch(t.action){case"mutateSearchForm":return Digit.SessionStorage.set("EDCR.INBOX",u({},e,{searchForm:t.data})),u({},e,{searchForm:t.data});case"mutateFilterForm":return Digit.SessionStorage.set("EDCR.INBOX",u({},e,{filterForm:t.data})),u({},e,{filterForm:t.data});case"mutateTableForm":return Digit.SessionStorage.set("EDCR.INBOX",u({},e,{tableForm:t.data})),u({},e,{tableForm:t.data})}},m),{isLoading:_,data:{table:g,totalCount:A}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:d,filters:u({},E)}),S={logoIcon:l.createElement(o.CaseIcon,null),headerText:"ACTION_TEST_EDCR_SCRUTINY",links:[{link:"/digit-ui/citizen/obps/edcrscrutiny/apply",text:r("BPA_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")},{link:"/digit-ui/citizen/obps/edcrscrutiny/oc-apply",text:r("BPA_OC_PLAN_SCRUTINY_FOR_NEW_CONSTRUCTION_LABEL")}]},h=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(An,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),b=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(gn,{isInboxLoading:_,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:o})},[_]),y={SearchFormFields:h,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:u({},p)}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:s,onSearchFormReset:e=>{e("edcrNumber",null),e("applicationNumber",null),f({action:"mutateSearchForm",data:s})}},C={FilterFormFields:b,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:u({},p)}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:c,onFilterFormReset:e=>{e("status",""),e("appliactionType",""),f({action:"mutateFilterForm",data:c})}},T=(e=>{var i,o,a,r;let{onPageSizeChange:d,formState:s,totalCount:c,table:p,dispatch:v,onSortingByData:m}=e;const{t:E}=n.useTranslation(),f=t.useMemo(()=>[{Header:E("EDCR_COMMON_TABLE_APPL_NO"),disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:""},t.original.applicationId))}},{Header:E("CS_APPLICATION_DETAILS_APPLICATION_DATE"),accessor:"createdDate",Cell:e=>{var t,n;let{row:i}=e;return null!==(t=i.original)&&void 0!==t&&t.date?(e=>l.createElement("span",{className:"cell-text styled-cell"},e))(Ml(new Date(null===(n=i.original)||void 0===n?void 0:n.date),"dd/MM/yyyy")):""}},{Header:E("EDCR_COMMON_TABLE_CITY_LABEL"),accessor:e=>E(null==e?void 0:e.locality),disableSortBy:!0},{Header:E("EDCR_COMMON_TABLE_APPL_NAME"),accessor:e=>null==e?void 0:e.owner,disableSortBy:!0},{Header:E("EDCR_COMMON_TABLE_SCRUTINY_NO"),disableSortBy:!0,Cell:e=>{var t;let{row:n}=e;return l.createElement("div",null,"null"!==(null===(t=n.original)||void 0===t?void 0:t.edcrNumber)?l.createElement("span",{className:""},n.original.edcrNumber):"NA")}},{Header:E("EDCR_COMMON_TABLE_COL_STATUS"),accessor:e=>(e=>l.createElement("span","Accepted"===e?{className:"sla-cell-success ",style:{background:"none",padding:"unset"}}:{className:"sla-cell-error",style:{background:"none",padding:"unset"}},e))(null==e?void 0:e.status),disableSortBy:!0},{Header:E("PT_COMMON_TABLE_COL_ACTION_LABEL"),Cell:e=>{let{row:t}=e;return l.createElement(Sn,{dowloadOptions:[{label:E("BPA_UPLOADED_PLAN_DXF"),onClick:()=>window.open(""+t.original.dxfFileurl)},{label:E("EDCR_SCUTINY_REPORT"),onClick:()=>window.open(""+t.original.planReportUrl)}]})},disableSortBy:!0}]);return{getCellProps:e=>({style:{padding:"20px 18px",fontSize:"16px"}}),className:"table edcr-citizen-inbox",disableSort:!1,autoSort:!1,manualPagination:!0,initSortId:"createdDate",onPageSizeChange:d,currentPage:(null===(i=s.tableForm)||void 0===i?void 0:i.offset)/(null===(o=s.tableForm)||void 0===o?void 0:o.limit),onNextPage:()=>{var e,t;return v({action:"mutateTableForm",data:u({},s.tableForm,{offset:parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.offset)+parseInt(null===(t=s.tableForm)||void 0===t?void 0:t.limit)})})},onPrevPage:()=>{var e,t;return v({action:"mutateTableForm",data:u({},s.tableForm,{offset:parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.offset)-parseInt(null===(t=s.tableForm)||void 0===t?void 0:t.limit)})})},pageSizeLimit:null===(a=s.tableForm)||void 0===a?void 0:a.limit,onSort:m,totalRecords:c,onSearch:null==s||null===(r=s.searchForm)||void 0===r?void 0:r.message,onLastPage:()=>{var e;return v({action:"mutateTableForm",data:u({},s.tableForm,{offset:10*Math.ceil(c/10)-parseInt(null===(e=s.tableForm)||void 0===e?void 0:e.limit)})})},onFirstPage:()=>v({action:"mutateTableForm",data:u({},s.tableForm,{offset:0})}),data:p,columns:f}})(u({},{parentRoute:i,onPageSizeChange:e=>{f({action:"mutateTableForm",data:u({},E.tableForm,{limit:e.target.value})})},formState:E,totalCount:A,table:g,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===n||f({action:"mutateTableForm",data:u({},E.tableForm,{sortBy:t,sortOrder:l?"DESC":"ASC"})})}}})),D=(e=>{let{table:t}=e;const{t:i}=n.useTranslation();return{data:null==t?void 0:t.map(e=>{let{applicationId:t,edcrNumber:n,date:o,planReportUrl:a,dxfFileurl:r,locality:u,status:d,owner:s}=e;return{[i("EDCR_COMMON_TABLE_APPL_NO")]:t,[i("CS_APPLICATION_DETAILS_APPLICATION_DATE")]:o?Ml(new Date(o),"dd/MM/yyyy"):"NA",[i("EDCR_COMMON_TABLE_CITY_LABEL")]:i(u),[i("EDCR_COMMON_TABLE_APPL_NAME")]:s,[i("EDCR_COMMON_TABLE_SCRUTINY_NO")]:n,[i("EDCR_COMMON_TABLE_COL_STATUS")]:l.createElement("span","Accepted"===d?{className:"sla-cell-success ",style:{background:"none",padding:"0px"}}:{className:"sla-cell-error",style:{background:"none",padding:"0px"}},d),[i("BPA_UPLOADED_PLAN_DXF")]:l.createElement("a",{href:""+r},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD"))),[i("EDCR_SCUTINY_REPORT")]:l.createElement("a",{href:""+a},l.createElement("span",{className:"link"},i("BPA_DOWNLOAD")))}}),isTwoDynamicPrefix:!0,getRedirectionLink:()=>{},handleClickEnabled:!1,serviceRequestIdKey:"applicationNo",MobileSortFormValues:()=>{const e=[{code:"DESC",i18nKey:"ES_INBOX_DATE_LATEST_FIRST"},{code:"ASC",i18nKey:"ES_INBOX_DATE_LATEST_LAST"}],{control:t}=a.useFormContext();return l.createElement(o.SearchField,null,l.createElement(a.Controller,{name:"sortOrder",control:t,render:t=>{let{onChange:n,value:i}=t;return l.createElement(o.RadioButtons,{onSelect:e=>{n(e.code)},selectedOption:e.filter(e=>e.code===i)[0],optionsKey:"i18nKey",name:"sortOrder",options:e})}}))}}})({table:g}),P={onMobileSortOrderData:e=>{const{sortOrder:t}=e;f({action:"mutateTableForm",data:u({},E.tableForm,{sortOrder:t})})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,r("ES_COMMON_INBOX"),A?l.createElement("p",{className:"inbox-count"},A):null),l.createElement(o.InboxComposer,u({isInboxLoading:_,PropsForInboxLinks:S},y,C,P,{propsForInboxTable:T,propsForInboxMobileCards:D,formState:E})))},ObpsEmpApplicationDetail:()=>{var e,a,r,u,d,s,c;const{id:p}=i.useParams(),{t:v}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),E=null==m?void 0:m.split(".")[0],[f,_]=t.useState(null),[g,A]=t.useState(!1),{isLoading:S,data:h}=Digit.Hooks.obps.useLicenseDetails(E,{applicationNumber:p,tenantId:E},{}),b=window.Digit.Utils.browser.isMobile(),[y,C]=t.useState(!1),{mutate:T}=Digit.Hooks.obps.useBPAREGApplicationActions(m),D=Digit.Hooks.useWorkflowDetails({tenantId:null==m?void 0:m.split(".")[0],id:p,moduleCode:"BPAREG"});let P=[];return console.log("applicationDetails",h),(null==h||null===(e=h.payments)||void 0===e?void 0:e.length)>0&&P.push({label:v("TL_RECEIPT"),onClick:()=>{var e,t;return Rt(0,null==h||null===(e=h.applicationData)||void 0===e?void 0:e.applicationNumber,null==h||null===(t=h.applicationData)||void 0===t?void 0:t.tenantId,null==h?void 0:h.payments)}}),l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details"},l.createElement(o.Header,null,v("CS_TITLE_APPLICATION_DETAILS")),(null==D||null===(a=D.data)||void 0===a||null===(r=a.timeline)||void 0===r?void 0:r.length)>0&&l.createElement("div",{style:{color:"#A52A2A"}},l.createElement(o.LinkButton,{label:v("VIEW_TIMELINE"),onClick:()=>{C(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}})),(null==h||null===(u=h.payments)||void 0===u?void 0:u.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>A(!g),displayOptions:g,options:P,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(Qi,{applicationDetails:h,isLoading:S,id:"timeline",isDataLoading:S,applicationData:null==h?void 0:h.applicationData,mutate:T,workflowDetails:D,businessService:null!=D&&null!==(d=D.data)&&void 0!==d&&d.applicationBusinessService?null==D||null===(s=D.data)||void 0===s?void 0:s.applicationBusinessService:null==h||null===(c=h.applicationData)||void 0===c?void 0:c.businessService,moduleCode:"BPAREG",showToast:f,setShowToast:_,ActionBarStyle:b?{}:{paddingRight:"50px"},MenuStyle:b?{}:{right:"50px"},closeToast:()=>{_(null)},timelineStatusPrefix:"WF_NEWTL_"}))},ObpsEmployeeBpaApplicationDetail:()=>{var e,a,r,s,c,p,v,m,E,f,_,g,A,S,h,b,y,C,T,D,P,I,N,L,B;const O=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{let e=new Date;ae.applicationData.additionalDetails.runDate=Tt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let i=u({},null==ae?void 0:ae.applicationData,{edcrDetail:[u({},null==ae?void 0:ae.edcrDetails)]});return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[i]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,o;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),i.applicationType=null==ae||null===(n=ae.applicationData)||void 0===n||null===(o=n.additionalDetails)||void 0===o?void 0:o.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:u({},i)})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?Ot(new Blob([e.data],{type:"application/pdf"})):Bt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},R=function(e){let{tenantId:t,payments:l}=e;d(e,Fo);try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var l;window.open(t[null===(l=e)||void 0===l?void 0:l.filestoreIds[0]],"_blank")})}let e=null;const i=function(){if(null==l||!l.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},l)]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==l?void 0:l.fileStoreId]}}();return Promise.resolve(i&&i.then?i.then(n):n())}catch(e){return Promise.reject(e)}},{id:x}=i.useParams(),{t:w}=n.useTranslation(),M=Digit.ULBService.getCurrentTenantId(),[k,F]=t.useState(null),[U,H]=t.useState(!1),[W,j,z]=(i.useHistory(),Digit.Hooks.useSessionStorage("store-data",null)),[Y,G,K]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[V,q,X]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{}),[J,Z]=t.useState(null),$=Digit.ULBService.getStateId(),Q=window.Digit.Utils.browser.isMobile(),{isLoading:ee,data:te}=Digit.Hooks.obps.useMDMS($,"BPA",["DocTypeMapping"]),[le,ne]=t.useState(!1);let{data:ie}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig($,[]);const{data:oe}=Digit.Hooks.obps.useMDMS($,"BPA",["RiskTypeComputation"]),{data:ae={},isLoading:re}=Digit.Hooks.obps.useBPADetailsPage(M,{applicationNo:x});t.useEffect(()=>{if(!ee&&!re){var e;let v=[];if(null!=te&&null!==(e=te.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,d,s,c,p;v=null==te||null===(t=te.BPA)||void 0===t||null===(l=t.DocTypeMapping)||void 0===l?void 0:l.filter(e=>{var t,l,n,i,o;return"INPROGRESS"==e.WFState&&e.RiskType==(null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==ae||null===(l=ae.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==ae||null===(i=ae.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==ae||null===(n=ae.applicationDetails)||void 0===n||null===(i=n.filter(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title)[0])||void 0===i||null===(o=i.additionalDetails)||void 0===o||null===(a=o.obpsDocuments)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.values,m=[];v&&(null===(d=v)||void 0===d||null===(s=d[0])||void 0===s?void 0:s.docTypes)&&(null===(c=v)||void 0===c||null===(p=c[0])||void 0===p||p.docTypes.map(t=>{e&&e.filter(e=>t.code===e.documentType.slice(0,e.documentType.lastIndexOf("."))).map(e=>{m.push(e)})}));const E=ae.applicationDetails&&ae.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?u({},e,{additionalDetails:{obpsDocuments:[{title:"",values:m}]}}):e);ae.applicationDetails=E&&E.length>0?[...E]:null==ae?void 0:ae.applicationDetails}}},[te,ae]);const[de,se]=t.useState(!1),{mutate:ce}=Digit.Hooks.obps.useApplicationActions(M),pe=Digit.Hooks.obps.useObpsAPI(M,!0);let ve="";sessionStorage.setItem("bpaApplicationDetails",!0),t.useEffect(()=>{G(!1),X()},[]);let me=null!=ie&&ie.InspectionReportConfig?null==ie?void 0:ie.InspectionReportConfig:eo,fe=Digit.Hooks.useWorkflowDetails({tenantId:M,id:x,moduleCode:"BPA"});var _e,ge,Ae,Se,he,be,ye,Ce,Te;fe&&fe.data&&!fe.isLoading&&(fe.data.initialActionState=(null==fe||null===(_e=fe.data)||void 0===_e?void 0:_e.initialActionState)||u({},null==fe||null===(ge=fe.data)||void 0===ge?void 0:ge.actionState)||{},fe.data.actionState=u({},fe.data)),null!=oe&&null!==(e=oe.BPA)&&void 0!==e&&e.RiskTypeComputation&&null!=ae&&ae.edcrDetails&&(ve=Digit.Utils.obps.calculateRiskType(null==oe||null===(Ae=oe.BPA)||void 0===Ae?void 0:Ae.RiskTypeComputation,null==ae||null===(Se=ae.edcrDetails)||void 0===Se||null===(he=Se.planDetail)||void 0===he||null===(be=he.plot)||void 0===be?void 0:be.area,null==ae||null===(ye=ae.edcrDetails)||void 0===ye||null===(Ce=ye.planDetail)||void 0===Ce?void 0:Ce.blocks),null==ae||null===(Te=ae.applicationDetails)||void 0===Te||Te.map(e=>{var t;null!=e&&e.isInsert&&(null===(t=e.values)||void 0===t||t.forEach(e=>{null!=e&&e.isInsert&&(e.value="WF_BPA_"+ve)}))}));const Ie=Digit.UserService.getUser(),Ne=null==Ie||null===(a=Ie.info)||void 0===a?void 0:a.roles.filter(e=>{if("CEMP"==e.code&&e.tenantId===M||"CITIZEN"==e.code)return!0});if((null==fe||null===(r=fe.data)||void 0===r||null===(s=r.processInstances)||void 0===s?void 0:s.length)>0){var Le,Be,Oe;let e=[];e=null===(Le=go(null==fe||null===(Be=fe.data)||void 0===Be?void 0:Be.processInstances[0],"nextActions",[]))||void 0===Le?void 0:Le.filter(e=>"ADHOC"!=e.action);let t=(xe=["action"],we=["desc"],null==(Re=e)?[]:(ue(xe)||(xe=null==xe?[]:[xe]),ue(we=we)||(we=null==we?[]:[we]),function(e,t,l){t=t.length?po(t,function(e){return ue(e)?function(t){return _o(t,1===e.length?e[0]:e)}:e}):[xo];var n=-1;return t=po(t,Ee(wo)),function(e,t){var n=e.length;for(e.sort(function(e,t){return function(e,t,l){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,r=l.length;++n<a;){var u=Mo(i[n],o[n]);if(u)return n>=r?u:u*("desc"==l[n]?-1:1)}return e.index-t.index}(e,t,l)});n--;)e[n]=e[n].value;return e}(function(e,t){var l=-1,n=De(e)?Array(e.length):[];return function(e,t){if(null==e)return e;if(!De(e))return function(e,t){return e&&function(e,t,l){for(var n=-1,i=Object(e),o=l(e),a=o.length;a--;){var r=o[++n];if(!1===t(i[r],r,i))break}return e}(e,t,Pe)}(e,t);for(var l=e.length,n=-1,i=Object(e);++n<l&&!1!==t(i[n]););}(e,function(e,i,o){n[++l]=t(e)}),n}(e,function(e,l,i){return{criteria:po(t,function(t){return t(e)}),index:++n,value:e}}))}(Re,xe,we)));t&&0!=(null==t?void 0:t.length)||null==fe||null===(Oe=fe.data)||void 0===Oe||!Oe.actionState||(fe.data.actionState.nextActions=[])}var Re,xe,we,Me,ke,Fe,Ue,He,We;(null==fe||null===(c=fe.data)||void 0===c||null===(p=c.nextActions)||void 0===p?void 0:p.length)>0&&(fe.data.nextActions=null==fe||null===(Me=fe.data)||void 0===Me||null===(ke=Me.nextActions)||void 0===ke?void 0:ke.filter(e=>"INITIATE"!==e.action),fe.data.nextActions=null==fe||null===(Fe=fe.data)||void 0===Fe||null===(Ue=Fe.nextActions)||void 0===Ue?void 0:Ue.filter(e=>"ADHOC"!==e.action)),Ne&&(null==fe||null===(He=fe.data)||void 0===He||null===(We=He.nextActions)||void 0===We||We.forEach(e=>{var t,l,n;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:Lt(null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.businessService,null==ae||null===(l=ae.applicationData)||void 0===l?void 0:l.status)+"/"+(null==ae||null===(n=ae.applicationData)||void 0===n?void 0:n.applicationNo)+"/"+M+"?tenantId="+M,state:M})}));let je=[];var ze,Ye,Ge,Ke,Ve,qe;if((null==ae||null===(v=ae.collectionBillDetails)||void 0===v?void 0:v.length)>0&&pt(null==ae?void 0:ae.collectionBillDetails).forEach(e=>{var t,l,n,i,o;"BPA.NC_OC_APP_FEE"===(null==e||null===(t=e.paymentDetails[0])||void 0===t?void 0:t.businessService)&&je.push({order:1,label:w("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return R({tenantId:null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ae||null===(l=ae.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_OC_SAN_FEE"===(null==e||null===(l=e.paymentDetails[0])||void 0===l?void 0:l.businessService)&&je.push({order:2,label:w("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return R({tenantId:null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ae||null===(l=ae.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.LOW_RISK_PERMIT_FEE"===(null==e||null===(n=e.paymentDetails[0])||void 0===n?void 0:n.businessService)&&je.push({order:1,label:w("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return R({tenantId:null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ae||null===(l=ae.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_APP_FEE"===(null==e||null===(i=e.paymentDetails[0])||void 0===i?void 0:i.businessService)&&je.push({order:1,label:w("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return R({tenantId:null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ae||null===(l=ae.applicationData)||void 0===l?void 0:l.applicationNo})}}),"BPA.NC_SAN_FEE"===(null==e||null===(o=e.paymentDetails[0])||void 0===o?void 0:o.businessService)&&je.push({order:2,label:w("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return R({tenantId:null==ae||null===(t=ae.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==ae||null===(l=ae.applicationData)||void 0===l?void 0:l.applicationNo})}})}),ae&&"BPA_LOW"===(null==ae||null===(m=ae.applicationData)||void 0===m?void 0:m.businessService)&&(null==ae||null===(E=ae.collectionBillDetails)||void 0===E?void 0:E.length)>0)(null==ae||null===(ze=ae.applicationData)||void 0===ze||!ze.status.includes("REVOCATION"))&&je.push({order:3,label:w("BPA_PERMIT_ORDER"),onClick:()=>{var e;return O({tenantId:null==ae||null===(e=ae.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==ae||null===(Ye=ae.applicationData)||void 0===Ye?void 0:Ye.status.includes("REVOCATION"))&&je.push({order:3,label:w("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t}=e;d(e,ko);try{let e=u({},null==ae?void 0:ae.applicationData);return Promise.resolve(Digit.PaymentService.generatePdf(t,{Bpa:[e]},"bpa-revocation")).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")})})}catch(e){return Promise.reject(e)}}({tenantId:null==ae||null===(e=ae.applicationData)||void 0===e?void 0:e.tenantId})}});else if(ae&&"BPA"===(null==ae||null===(f=ae.applicationData)||void 0===f?void 0:f.businessService)&&(null==ae||null===(_=ae.collectionBillDetails)||void 0===_?void 0:_.length)>0){var Xe;"APPROVED"===(null==ae||null===(Xe=ae.applicationData)||void 0===Xe?void 0:Xe.status)&&je.push({order:3,label:w("BPA_PERMIT_ORDER"),onClick:()=>{var e;return O({tenantId:null==ae||null===(e=ae.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Je;"APPROVED"===(null==ae||null===(Je=ae.applicationData)||void 0===Je?void 0:Je.status)&&je.push({order:3,label:w("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return O({tenantId:null==ae||null===(e=ae.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=ae&&ae.comparisionReport&&ae&&"BPA_OC"===(null==ae||null===(g=ae.applicationData)||void 0===g?void 0:g.businessService)&&je.push({order:4,label:w("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==ae||null===(e=ae.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),je.sort(function(e,t){return e.order-t.order}),(null==fe||null===(A=fe.data)||void 0===A||null===(S=A.nextActions)||void 0===S?void 0:S.length)>0&&(fe.data.nextActions=null==fe||null===(Ge=fe.data)||void 0===Ge||null===(Ke=Ge.nextActions)||void 0===Ke?void 0:Ke.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==fe||null===(h=fe.data)||void 0===h||null===(b=h.nextActions)||void 0===b?void 0:b.length)>0&&(fe.data.nextActions=null==fe||null===(Ve=fe.data)||void 0===Ve||null===(qe=Ve.nextActions)||void 0===qe?void 0:qe.filter(e=>"SKIP_PAYMENT"!==e.action));const Ze=null==ae||null===(y=ae.applicationDetails)||void 0===y?void 0:y.filter(e=>0!==Object.keys(e).length);return ae.applicationDetails=Ze,l.createElement(t.Fragment,null,l.createElement("div",{className:"employee-main-application-details"},l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(o.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},w("CS_TITLE_APPLICATION_DETAILS")),l.createElement(o.LinkButton,{label:w("VIEW_TIMELINE"),onClick:()=>{ne(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}),je&&je.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>se(!de),displayOptions:de,options:je,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),"FIELDINSPECTION_INPROGRESS"===(null==ae||null===(C=ae.applicationData)||void 0===C?void 0:C.status)&&(null==Ie||null===(T=Ie.info)||void 0===T?void 0:T.roles.filter(e=>"BPA_FIELD_INSPECTOR"===e.code)).length>0&&l.createElement(o.FormComposer,{heading:w(""),isDisabled:!U,config:me.map(e=>{return u({},e,{body:e.body.filter(e=>!e.hideInEmployee),head:(t=e.head,"ES_NEW_APPLICATION_LOCATION_DETAILS"===t?"TL_CHECK_ADDRESS":"ES_NEW_APPLICATION_OWNERSHIP_DETAILS"===t?"TL_OWNERSHIP_DETAILS_HEADER":t)});var t}),fieldStyle:{marginRight:0},submitInForm:!1,defaultValues:{},onFormValueChange:(e,t,l)=>{H(!Object.keys(l.errors).length)},breaklineStyle:{border:"0px"},className:"employeeCard-override",cardClassName:"employeeCard-override"}),l.createElement(Qi,{applicationDetails:ae,isLoading:re,isDataLoading:re,applicationData:null==ae?void 0:ae.applicationData,nocMutation:pe,mutate:ce,id:"timeline",workflowDetails:fe,businessService:null!=fe&&null!==(D=fe.data)&&void 0!==D&&D.applicationBusinessService?null==fe||null===(P=fe.data)||void 0===P?void 0:P.applicationBusinessService:null==ae||null===(I=ae.applicationData)||void 0===I?void 0:I.businessService,moduleCode:"BPA",showToast:k,ActionBarStyle:Q?{}:{paddingRight:"50px"},MenuStyle:Q?{}:{right:"50px"},setShowToast:F,closeToast:()=>{F(null),Z(null)},statusAttribute:"state",timelineStatusPrefix:"WF_"+(null!=fe&&null!==(N=fe.data)&&void 0!==N&&N.applicationBusinessService?null==fe||null===(L=fe.data)||void 0===L?void 0:L.applicationBusinessService:null==ae||null===(B=ae.applicationData)||void 0===B?void 0:B.businessService)+"_"})))}};exports.initOBPSComponents=()=>{Object.entries(Oa).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};