@mseva/digit-ui-module-obps 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -0
- package/package.json +35 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),l=e(t),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=e(require("exif-js")),u=require("react-query"),d=e(require("react-modal"));function s(){return(s=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 c(e,t){try{var l=e()}catch(e){return t(e)}return l&&l.then?l.then(void 0,t):l}function v(e,t){try{var l=e()}catch(e){return t(!0,e)}return l&&l.then?l.then(t.bind(null,!1),t.bind(null,!0)):t(!1,l)}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var p=function(e,t){return e===t||e!=e&&t!=t},m=function(e,t){for(var l=e.length;l--;)if(p(e[l][0],t))return l;return-1},E=Array.prototype.splice;function f(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])}}f.prototype.clear=function(){this.__data__=[],this.size=0},f.prototype.delete=function(e){var t=this.__data__,l=m(t,e);return!(l<0||(l==t.length-1?t.pop():E.call(t,l,1),--this.size,0))},f.prototype.get=function(e){var t=this.__data__,l=m(t,e);return l<0?void 0:t[l][1]},f.prototype.has=function(e){return m(this.__data__,e)>-1},f.prototype.set=function(e,t){var l=this.__data__,n=m(l,e);return n<0?(++this.size,l.push([e,t])):l[n][1]=t,this};var g=f,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(e,t){return e(t={exports:{}},t.exports),t.exports}var h,b="object"==typeof A&&A&&A.Object===Object&&A,y="object"==typeof self&&self&&self.Object===Object&&self,D=b||y||Function("return this")(),C=D.Symbol,T=Object.prototype,P=T.hasOwnProperty,N=T.toString,I=C?C.toStringTag:void 0,L=Object.prototype.toString,B=C?C.toStringTag:void 0,O=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=P.call(e,I),l=e[I];try{e[I]=void 0;var n=!0}catch(e){}var i=N.call(e);return n&&(t?e[I]=l:delete e[I]),i}(e):function(e){return L.call(e)}(e)},R=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},w=function(e){if(!R(e))return!1;var t=O(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},x=D["__core-js_shared__"],M=(h=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+h:"",F=Function.prototype.toString,k=function(e){if(null!=e){try{return F.call(e)}catch(e){}try{return e+""}catch(e){}}return""},U=/^\[object .+?Constructor\]$/,H=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=function(e,t){var l=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!R(e)||(t=e,M&&M in t))&&(w(e)?H:U).test(k(e));var t}(l)?l:void 0},j=W(D,"Map"),$=W(Object,"create"),G=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__=$?$(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($){var l=t[e];return"__lodash_hash_undefined__"===l?void 0:l}return G.call(t,e)?t[e]:void 0},Y.prototype.has=function(e){var t=this.__data__;return $?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]=$&&void 0===t?"__lodash_hash_undefined__":t,this};var K=Y,V=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 q(e){var t=-1,l=null==e?0:e.length;for(this.clear();++t<l;){var n=e[t];this.set(n[0],n[1])}}q.prototype.clear=function(){this.size=0,this.__data__={hash:new K,map:new(j||g),string:new K}},q.prototype.delete=function(e){var t=V(this,e).delete(e);return this.size-=t?1:0,t},q.prototype.get=function(e){return V(this,e).get(e)},q.prototype.has=function(e){return V(this,e).has(e)},q.prototype.set=function(e,t){var l=V(this,e),n=l.size;return l.set(e,t),this.size+=l.size==n?0:1,this};var X=q;function J(e){var t=this.__data__=new g(e);this.size=t.size}J.prototype.clear=function(){this.__data__=new g,this.size=0},J.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},J.prototype.get=function(e){return this.__data__.get(e)},J.prototype.has=function(e){return this.__data__.has(e)},J.prototype.set=function(e,t){var l=this.__data__;if(l instanceof g){var n=l.__data__;if(!j||n.length<199)return n.push([e,t]),this.size=++l.size,this;l=this.__data__=new X(n)}return l.set(e,t),this.size=l.size,this};var Z=J,Q=function(){try{var e=W(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),ee=function(e,t,l){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l},te=Object.prototype.hasOwnProperty,le=function(e,t,l){var n=e[t];te.call(e,t)&&p(n,l)&&(void 0!==l||t in e)||ee(e,t,l)},ne=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?ee(l,r,u):le(l,r,u)}return l},ie=function(e){return null!=e&&"object"==typeof e},oe=function(e){return ie(e)&&"[object Arguments]"==O(e)},ae=Object.prototype,re=ae.hasOwnProperty,ue=ae.propertyIsEnumerable,de=oe(function(){return arguments}())?oe:function(e){return ie(e)&&re.call(e,"callee")&&!ue.call(e,"callee")},se=Array.isArray,ce=function(){return!1},ve=S(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?D.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ce}),pe=/^(?:0|[1-9]\d*)$/,me=function(e,t){var l=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==l||"symbol"!=l&&pe.test(e))&&e>-1&&e%1==0&&e<t},Ee=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},_e={};_e["[object Float32Array]"]=_e["[object Float64Array]"]=_e["[object Int8Array]"]=_e["[object Int16Array]"]=_e["[object Int32Array]"]=_e["[object Uint8Array]"]=_e["[object Uint8ClampedArray]"]=_e["[object Uint16Array]"]=_e["[object Uint32Array]"]=!0,_e["[object Arguments]"]=_e["[object Array]"]=_e["[object ArrayBuffer]"]=_e["[object Boolean]"]=_e["[object DataView]"]=_e["[object Date]"]=_e["[object Error]"]=_e["[object Function]"]=_e["[object Map]"]=_e["[object Number]"]=_e["[object Object]"]=_e["[object RegExp]"]=_e["[object Set]"]=_e["[object String]"]=_e["[object WeakMap]"]=!1;var fe=function(e){return function(t){return e(t)}},ge=S(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l&&b.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Ae=ge&&ge.isTypedArray,Se=Ae?fe(Ae):function(e){return ie(e)&&Ee(e.length)&&!!_e[O(e)]},he=Object.prototype.hasOwnProperty,be=function(e,t){var l=se(e),n=!l&&de(e),i=!l&&!n&&ve(e),o=!l&&!n&&!i&&Se(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&&!he.call(e,d)||a&&("length"==d||i&&("offset"==d||"parent"==d)||o&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||me(d,u))||r.push(d);return r},ye=Object.prototype,De=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)},Ce=function(e,t){return function(l){return e(t(l))}},Te=Ce(Object.keys,Object),Pe=Object.prototype.hasOwnProperty,Ne=function(e){return null!=e&&Ee(e.length)&&!w(e)},Ie=function(e){return Ne(e)?be(e):function(e){if(!De(e))return Te(e);var t=[];for(var l in Object(e))Pe.call(e,l)&&"constructor"!=l&&t.push(l);return t}(e)},Le=Object.prototype.hasOwnProperty,Be=function(e){return Ne(e)?be(e,!0):function(e){if(!R(e))return function(e){var t=[];if(null!=e)for(var l in Object(e))t.push(l);return t}(e);var t=De(e),l=[];for(var n in e)("constructor"!=n||!t&&Le.call(e,n))&&l.push(n);return l}(e)},Oe=S(function(e,t){var l=t&&!t.nodeType&&t,n=l&&e&&!e.nodeType&&e,i=n&&n.exports===l?D.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}}),Re=function(){return[]},we=Object.prototype.propertyIsEnumerable,xe=Object.getOwnPropertySymbols,Me=xe?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];we.call(e,r)&&(a[o++]=r)}return a}(xe(e)))}:Re,Fe=function(e,t){for(var l=-1,n=t.length,i=e.length;++l<n;)e[i+l]=t[l];return e},ke=Ce(Object.getPrototypeOf,Object),Ue=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)Fe(t,Me(e)),e=ke(e);return t}:Re,He=function(e,t,l){var n=t(e);return se(e)?n:Fe(n,l(e))},We=function(e){return He(e,Ie,Me)},je=function(e){return He(e,Be,Ue)},$e=W(D,"DataView"),Ge=W(D,"Promise"),ze=W(D,"Set"),Ye=W(D,"WeakMap"),Ke=k($e),Ve=k(j),qe=k(Ge),Xe=k(ze),Je=k(Ye),Ze=O;($e&&"[object DataView]"!=Ze(new $e(new ArrayBuffer(1)))||j&&"[object Map]"!=Ze(new j)||Ge&&"[object Promise]"!=Ze(Ge.resolve())||ze&&"[object Set]"!=Ze(new ze)||Ye&&"[object WeakMap]"!=Ze(new Ye))&&(Ze=function(e){var t=O(e),l="[object Object]"==t?e.constructor:void 0,n=l?k(l):"";if(n)switch(n){case Ke:return"[object DataView]";case Ve:return"[object Map]";case qe:return"[object Promise]";case Xe:return"[object Set]";case Je:return"[object WeakMap]"}return t});var Qe=Ze,et=Object.prototype.hasOwnProperty,tt=D.Uint8Array,lt=function(e){var t=new e.constructor(e.byteLength);return new tt(t).set(new tt(e)),t},nt=/\w*$/,it=C?C.prototype:void 0,ot=it?it.valueOf:void 0,at=Object.create,rt=function(){function e(){}return function(t){if(!R(t))return{};if(at)return at(t);e.prototype=t;var l=new e;return e.prototype=void 0,l}}(),ut=ge&&ge.isMap,dt=ut?fe(ut):function(e){return ie(e)&&"[object Map]"==Qe(e)},st=ge&&ge.isSet,ct=st?fe(st):function(e){return ie(e)&&"[object Set]"==Qe(e)},vt={};vt["[object Arguments]"]=vt["[object Array]"]=vt["[object ArrayBuffer]"]=vt["[object DataView]"]=vt["[object Boolean]"]=vt["[object Date]"]=vt["[object Float32Array]"]=vt["[object Float64Array]"]=vt["[object Int8Array]"]=vt["[object Int16Array]"]=vt["[object Int32Array]"]=vt["[object Map]"]=vt["[object Number]"]=vt["[object Object]"]=vt["[object RegExp]"]=vt["[object Set]"]=vt["[object String]"]=vt["[object Symbol]"]=vt["[object Uint8Array]"]=vt["[object Uint8ClampedArray]"]=vt["[object Uint16Array]"]=vt["[object Uint32Array]"]=!0,vt["[object Error]"]=vt["[object Function]"]=vt["[object WeakMap]"]=!1;var pt=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(!R(t))return t;var c=se(t);if(c){if(r=function(e){var t=e.length,l=new e.constructor(t);return t&&"string"==typeof e[0]&&et.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 v=Qe(t),p="[object Function]"==v||"[object GeneratorFunction]"==v;if(ve(t))return Oe(t,u);if("[object Object]"==v||"[object Arguments]"==v||p&&!o){if(r=d||p?{}:function(e){return"function"!=typeof e.constructor||De(e)?{}:rt(ke(e))}(t),!u)return d?function(e,t){return ne(e,Ue(e),t)}(t,function(e,t){return e&&ne(t,Be(t),e)}(r,t)):function(e,t){return ne(e,Me(e),t)}(t,function(e,t){return e&&ne(t,Ie(t),e)}(r,t))}else{if(!vt[v])return o?t:{};r=function(e,t,l){var n,i,o=e.constructor;switch(t){case"[object ArrayBuffer]":return lt(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var l=t?lt(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?lt(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,nt.exec(n))).lastIndex=n.lastIndex,i;case"[object Set]":return new o;case"[object Symbol]":return ot?Object(ot.call(e)):{}}}(t,v,u)}}a||(a=new Z);var m=a.get(t);if(m)return m;a.set(t,r),ct(t)?t.forEach(function(i){r.add(e(i,l,n,i,t,a))}):dt(t)&&t.forEach(function(i,o){r.set(o,e(i,l,n,o,t,a))});var E=c?void 0:(s?d?je:We:d?Be:Ie)(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]),le(r,o,e(i,l,n,o,t,a))}),r},mt=function(e){return pt(e,5)};const Et=e=>{switch(e){case"Name":return/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i;case"MobileNo":return/^[6-9]{1}[0-9]{9}$/i}},_t=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},ft=()=>require("uuid/v4")(),gt=(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},At=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,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M;const F=null==i?void 0:i.edcrDetail[0];var k,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(`${_t(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===(v=e.additionalDetails)||void 0===v?void 0:v.GISPlaceName)||"",e.data={scrutinyNumber:{edcrNumber:null==F?void 0:F.edcrNumber},applicantName:null==F||null===(p=F.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.applicantName,applicationDate:null==e||null===(E=e.auditDetails)||void 0===E?void 0:E.createdTime,applicationType:null==F?void 0:F.appliactionType,holdingNumber:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.holdingNo,boundaryWallLength:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.boundaryWallLength,occupancyType:null==F||null===(g=F.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==F||null===(b=F.planDetail)||void 0===b||null===(y=b.plot)||void 0===y?void 0:y.area,null==F||null===(D=F.planDetail)||void 0===D?void 0:D.blocks),serviceType:(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.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===(T=e.landInfo)||void 0===T?void 0:T.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==F||null===(L=F.planDetail)||void 0===L||null===(B=L.plot)||void 0===B?void 0:B.area,null==F||null===(O=F.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===(w=e.businessService)||void 0===w?void 0:w.split(".")[0],applicationType:(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.applicationType)||(null==F?void 0:F.appliactionType),serviceType:(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.serviceType)||(null==F?void 0:F.applicationSubType)},null!=e&&e.businessService.includes("OC")?(sessionStorage.setItem("BPAintermediateValue",JSON.stringify({...e})),l.push(`/digit-ui/citizen/obps/ocbpa/${null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.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)}},St=(e,t)=>{let l=[];const n={documentType:"ARCHITECT.UNDERTAKING",fileStoreId:sessionStorage.getItem("ArchitectConsentdocFilestoreid"),fileStore:sessionStorage.getItem("ArchitectConsentdocFilestoreid")};return e&&e.map(e=>{let t;var n,i,o,a;console.log("ob",e),e.id?(t={documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:e.fileName,fileUrl:"",additionalDetails:{},id:e.id},"SITEPHOTOGRAPH.ONE"===e.documentType&&(t.additionalDetails={latitude:null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.latitude,longitude:null==e||null===(i=e.additionalDetails)||void 0===i?void 0:i.longitude})):(t={documentType:e.documentType,fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:e.fileName,fileUrl:"",additionalDetails:{}},"SITEPHOTOGRAPH.ONE"===e.documentType&&(t.additionalDetails={latitude:null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.latitude,longitude:null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.longitude})),l.push(t)}),l.push(n),l=[...l,...t||[]],l};function ht(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}const bt=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:ht(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:ht(e[1])})})}return l.length>0?l:null==e||null===(t=e.landInfo)||void 0===t?void 0:t.unit},yt=(e,t)=>{var l,n,i;if(t)return e.landInfo.owners;let o=mt(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},Dt=(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)},Ct=function(e,t,l){var n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,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===(_=e.address)||void 0===_||null===(f=_.city)||void 0===f?void 0:f.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===(D=y.city)||void 0===D?void 0:D.code)||(null==e||null===(C=e.landInfo)||void 0===C||null===(T=C.address)||void 0===T?void 0:T.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:ht(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:St(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:Dt(e,t),owners:yt(e,t),unit:bt(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,OTPverfiedTimeSamp:sessionStorage.getItem("otpVerifiedTimestamp"),otherFeesDiscription:sessionStorage.getItem("otherChargesDisc"),lessAdjustmentFeeFiles:JSON.parse(sessionStorage.getItem("uploadedFileLess")),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!==(v=e.data)&&void 0!==v&&v.registrationDetails?null==e||null===(p=e.data)||void 0===p?void 0:p.registrationDetails:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.registrationDetails,architectconsentdocument:{documentType:"Architect Consent Form",fileStoreId:sessionStorage.getItem("ArchitectConsentform"),fileStore:sessionStorage.getItem("ArchitectConsentform")}},applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",occupancyType:"A"}}},Tt=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},Pt=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}},Nt=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()}`},It=function(e,t,l,n,i){try{var o,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,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===(v=t.planDetail)||void 0===v||null===(p=v.planInformation)||void 0===p?void 0:p.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===(_=t.planDetail)||void 0===_||null===(f=_.plot)||void 0===f?void 0:f.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 w=[];null==e||e.documents.map(e=>w.push(e)),e.PrevStateDocuments=mt(w),e.documents={documents:[]};let x=[];n&&n.map((e,t)=>{e.documents&&e.documents.map((e,t)=>{x.push(e)})}),e.PrevStateNocDocuments=x,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===(D=t.planDetail)||void 0===D||null===(C=D.plot)||void 0===C?void 0:C.area,null==t||null===(T=t.planDetail)||void 0===T?void 0:T.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)}},Lt=(e,t)=>(t&&Object.keys(t).map(l=>{e=e.replace(":"+l,t[l])}),e),Bt=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}},Ot=(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},Rt=(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)}},wt=e=>{const t=URL.createObjectURL(e);var l=window.open(t);null!=l&&l.addEventListener("load",e=>{l.focus(),l.print()})},xt=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?wt(new Blob([e.data],{type:"application/pdf"})):Rt(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)}},Mt=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,v,p;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!==(v=l.edcrDetail)&&void 0!==v&&v[0]?null==l||null===(p=l.edcrDetail)||void 0===p?void 0:p[0]:{type:"ERROR",message:"BPA_NO_RECORD_FOUND"}:{type:"ERROR",message:"APPLICATION_NUMBER_ALREADY_EXISTS"}})})}catch(e){return Promise.reject(e)}},Ft=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},kt=e=>{var n,i,r,u,d,s,c;let{formState:v,Controller:p,register:m,control:E,t:_,reset:f,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,D=null==y?void 0:y.mobileNumber,C=a.useWatch({control:E,name:"applicationType"}),T=sessionStorage.getItem("search_application")||"";T&&"undefined"!=T&&(null===(i=JSON.parse(T))||void 0===i?void 0:i.code)!==(null==C?void 0:C.code)&&E.setValue("status",""),sessionStorage.setItem("search_application",JSON.stringify(C));const{applicationTypes:P,ServiceTypes:N}=Digit.Hooks.obps.useServiceTypeFromApplicationType({Applicationtype:(null==C?void 0:C.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 w,x=[],M=[];for(w=0;w<L.length;w++)x[L[w].code]||(x[L[w].code]=!0,M.push(L[w].code));let F,k=[],U=[];for(F=0;F<B.length;F++)k[B[F].code]||(k[B[F].code]=!0,U.push(B[F].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 $=[],G=[],z=[];return M.forEach(e=>$.push({i18nKey:"WF_BPA_"+e,code:e})),U.forEach(e=>G.push({i18nKey:"WF_BPA_"+e,code:e})),j.forEach(e=>z.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)})}),G.forEach(e=>{B.map(t=>{(null==e?void 0:e.code)==(null==t?void 0:t.code)&&(e.i18nKey=t.i18nKey)})}),z.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==C?void 0:C.code)?z:"BUILDING_PLAN_SCRUTINY"===(null==C?void 0:C.code)?$:"BUILDING_OC_PLAN_SCRUTINY"===(null==C?void 0:C.code)?G:[],l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_SEARCH_APPLICATION_NO_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:m({})})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_SEARCH_OWNER_NAME")),l.createElement(o.TextInput,{name:"name",inputRef:m({})})),!window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null,l.createElement("label",null,_("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:_("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:_("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:_("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==v||null===(s=v.errors)||void 0===s||null===(c=s.mobileNumber)||void 0===c?void 0:c.message)),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_SEARCH_APPLICATION_TYPE_LABEL")),l.createElement(p,{control:E,name:"applicationType",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:_})})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")),l.createElement(p,{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:_,isBPAREG:!!(N&&(null==N?void 0:N.length)>0)})})),l.createElement(o.SearchField,null,l.createElement("label",null,_("BPA_APP_FROM_DATE_SEARCH_PARAM")),l.createElement(p,{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,_("BPA_APP_TO_DATE_SEARCH_PARAM")),l.createElement(p,{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,_("BPA_SEARCH_APPLICATION_STATUS_LABEL")),l.createElement(p,{control:E,name:"status",render:e=>l.createElement(o.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:R,optionKey:"i18nKey",t:_})})),window.location.href.includes("citizen/obps/search/application")&&l.createElement(o.SearchField,null),l.createElement(o.SearchField,{className:"submit"},l.createElement(o.SubmitBar,{label:_("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;f({applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?D:"",name:"",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()}},_("ES_COMMON_CLEAR_ALL"))))},Ut=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(),v=i.useLocation(),[p,m]=t.useState((null==d||null===(E=d.roles)||void 0===E||null===(_=E.filter(e=>e.code.includes("BPAREG_")))||void 0===_?void 0:_.length)<=0&&(null==d||null===(f=d.roles)||void 0===f?void 0:f.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,D]=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 C=Digit.ComponentRegistryService.getComponent("OBPSSearchApplication"),[T,P]=t.useState("");let N={},I={};if(p&&p.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:w}=Digit.Hooks.obps.useOBPSSearch(p,h,c,I,N,{enabled:""===T});return l.createElement(C,{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")),D(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:p),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:T,data:!R&&w&&(null==O?void 0:O.length)>0?O:[{display:"ES_COMMON_NO_DATA"}],setparamerror:P})},Ht=()=>{var e,a,r,u;const{t:d}=n.useTranslation(),s=i.useHistory(),[c,v]=t.useState([]),[p,m]=t.useState(!1),E=Digit.ULBService.getCurrentTenantId(),_=sessionStorage.getItem("Digit.citizen.userRequestObject"),f=_?JSON.parse(_):{},g=null==f?void 0:f.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:D,revalidate:C}=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:T}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]);return t.useEffect(()=>()=>{v([]),null==b||b(),null==C||C()},[]),t.useEffect(()=>{if(!h&&!D){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}),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)&&m(!0)}},[h,D,y,S]),h||D?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,v,m,E,_,f,g,A;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===(v=c.tradeUnits)||void 0===v||null===(m=v[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===(_=E.additionalDetail)||void 0===_?void 0:_.counsilForArchNo}),l.createElement(o.KeyNote,{keyValue:d("BPA_APPLICANT_NAME_LABEL"),note:null==e||null===(f=e.tradeLicenseDetail)||void 0===f||null===(g=f.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,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,G,z,Y,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me;let Ee=e,_e={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===(v=Ee.tradeLicenseDetail)||void 0===v||null===(p=v.address)||void 0===p?void 0:p.street)+", ":""}${null!=Ee&&null!==(m=Ee.tradeLicenseDetail)&&void 0!==m&&null!==(E=m.address)&&void 0!==E&&E.landmark?(null==Ee||null===(_=Ee.tradeLicenseDetail)||void 0===_||null===(f=_.address)||void 0===f?void 0:f.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===(D=Ee.tradeLicenseDetail)||void 0===D||null===(C=D.address)||void 0===C?void 0:C.pincode)?""+(null===(T=Ee.tradeLicenseDetail)||void 0===T||null===(P=T.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===(w=Ee.tradeLicenseDetail)||void 0===w||null===(x=w.owners)||void 0===x||null===(M=x[0])||void 0===M?void 0:M.emailId,gender:{code:null==Ee||null===(F=Ee.tradeLicenseDetail)||void 0===F||null===(k=F.owners)||void 0===k||null===(U=k[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===(G=$.owners)||void 0===G||null===(z=G[0])||void 0===z?void 0:z.gender},mobileNumber:null==Ee||null===(Y=Ee.tradeLicenseDetail)||void 0===Y||null===(K=Y.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===(ve=Ee.tradeLicenseDetail)||void 0===ve||null===(pe=ve.owners)||void 0===pe||null===(me=pe[0])||void 0===me?void 0:me.permanentAddress),result:{Licenses:[{...e}]},initiationFlow:!0};sessionStorage.setItem("BPAREGintermediateValue",JSON.stringify(_e)),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"}}),"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,p?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:()=>At(e,T,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")))))},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 i,a,r,u,d;let{data:s,OpenImage:c}=e;const{t:v}=n.useTranslation(),[p,m]=t.useState(!1);return l.createElement("div",null,(null==s?void 0:s.date)&&l.createElement("p",null,null==s?void 0:s.date),l.createElement("p",null,null==s?void 0:s.name),(null==s?void 0:s.mobileNumber)&&l.createElement(o.TelePhone,{mobile:null==s?void 0:s.mobileNumber}),(null==s?void 0:s.source)&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+(null==s||null===(i=s.source)||void 0===i?void 0:i.toUpperCase()))),(null==s?void 0:s.comment)&&l.createElement(Wt,{otherComment:null==s?void 0:s.otherComment,headComment:null==s?void 0:s.comment}),null!=s&&s.wfComment?l.createElement("div",null,null==s||null===(a=s.wfComment)||void 0===a?void 0:a.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!p&&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:()=>{m(!0)},style:{color:"#800000"}},v("View More")):null),p&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{m(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==s||null===(r=s.thumbnailsToShow)||void 0===r||null===(u=r.thumbs)||void 0===u?void 0:u.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(o.DisplayPhotos,{srcs:null==s||null===(d=s.thumbnailsToShow)||void 0===d?void 0:d.thumbs,onClick:(e,t)=>{c(e,t,null==s?void 0:s.thumbnailsToShow)}})):null)},$t=e=>{var a,r,u,d,s;let{id:c,tenantId:v}=e;const{t:p}=n.useTranslation(),[m,E]=t.useState(!1),{isLoading:_,data:f}=Digit.Hooks.useWorkflowDetails({tenantId:v,id:c,moduleCode:"OBPS"});if(_)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:p(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,!_&&l.createElement(t.Fragment,null,(null==f||null===(a=f.timeline)||void 0===a?void 0:a.length)>0&&l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},p("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=f&&f.timeline&&1===(null==f||null===(r=f.timeline)||void 0===r?void 0:r.length)?l.createElement(o.CheckPoint,{isCompleted:!0,label:p((null==f||null===(u=f.timeline[0])||void 0===u?void 0:u.state)&&"WF_ARCHITECT_"+f.timeline[0].state||"NA"),customChild:A(null==f?void 0:f.timeline[0])}):l.createElement(o.ConnectingCheckPoints,null,(null==f?void 0:f.timeline)&&(null==f?void 0:f.timeline.slice(0,m?f.timeline.length:2).map((e,t,n)=>{let i="";var a,r,u,d;return window.location.href.includes("/obps")&&(i=null!=f&&null!==(a=f.timeline[t-1])&&void 0!==a&&null!==(r=a.state)&&void 0!==r&&r.includes("BACK_FROM")||null!=f&&null!==(u=f.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?p(`WF_ARCHITECT_${e.state}${i}`):"NA",customChild:A(e)}))}))),(null==f||null===(d=f.timeline)||void 0===d?void 0:d.length)>2&&l.createElement(o.LinkButton,{label:p(m?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{E(e=>!e)}})),f&&(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==f||null===(t=f.processInstances)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.moduleName}/${null==f||null===(a=f.processInstances)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.businessId}`,state:{tenantId:null==f||null===(u=f.processInstances)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.tenantId}}},l.createElement(o.SubmitBar,{label:p("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:p("CS_APPLICATION_DETAILS_RATE")})))}})(null==f||null===(s=f.nextActions)||void 0===s?void 0:s[0]))},Gt=()=>{var e,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,G;const{id:z}=i.useParams(),{t:Y}=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:z,isEmployee:!1},{}),[de,se]=t.useState(!1);var ce,ve;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:Y("TL_RECEIPT"),onClick:()=>xt(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===(ve=ce.TradeTypetoRoleMapping)||void 0===ve||ve.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(o.Header,{styles:{fontSize:"32px",marginLeft:ne?"0px":"10px"}},Y("BPA_TASK_DETAILS_HEADER")),l.createElement("div",null,(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(o.LinkButton,{label:Y("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{se(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement("div",null,l.createElement(o.Card,null,l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Y("BPA_APPLICATION_NUMBER_LABEL"),text:(null==ae?void 0:ae.applicationNumber)||"NA"}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},Y("BPA_LICENSE_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Y("BPA_LICENSE_TYPE"),text:Y("TRADELICENSE_TRADETYPE_"+(null==ae||null===(c=ae.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(p=v[0])||void 0===p||null===(m=p.tradeType)||void 0===m?void 0:m.split(".")[0]))}),(null==ae||null===(E=ae.tradeLicenseDetail)||void 0===E||null===(_=E.tradeUnits)||void 0===_||null===(f=_[0])||void 0===f?void 0:f.tradeType.includes("ARCHITECT"))&&l.createElement(o.Row,{className:"border-none",label:Y("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"}},Y("BPA_LICENSE_DET_CAPTION")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:Y("BPA_APPLICANT_NAME_LABEL"),text:Y(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:Y("BPA_APPLICANT_GENDER_LABEL"),text:Y(null==ae||null===(y=ae.tradeLicenseDetail)||void 0===y||null===(D=y.owners)||void 0===D||null===(C=D[0])||void 0===C?void 0:C.gender)}),l.createElement(o.Row,{className:"border-none",label:Y("BPA_OWNER_MOBILE_NO_LABEL"),text:null==ae||null===(T=ae.tradeLicenseDetail)||void 0===T||null===(P=T.owners)||void 0===P||null===(N=P[0])||void 0===N?void 0:N.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:Y("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)||Y("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:Y("BPA_APPLICANT_PAN_NO"),text:(null==ae||null===(O=ae.tradeLicenseDetail)||void 0===O||null===(R=O.owners)||void 0===R||null===(w=R[0])||void 0===w?void 0:w.pan)||Y("CS_NA")}))),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},Y("BPA_LICENSEE_PERMANENT_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(x=ae.tradeLicenseDetail)||void 0===x||null===(M=x.owners)||void 0===M||null===(F=M[0])||void 0===F?void 0:F.permanentAddress)||Y("CS_NA")})),l.createElement(o.Card,null,l.createElement(o.CardHeader,{styles:{fontSize:"24px"}},Y("BPA_CORRESPONDANCE_ADDRESS_LABEL")),l.createElement(o.Row,{className:"border-none",text:(null==ae||null===(k=ae.tradeLicenseDetail)||void 0===k||null===(U=k.owners)||void 0===U||null===(H=U[0])||void 0===H?void 0:H.correspondenceAddress)||Y("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"}},Y("BPA_DOC_DETAILS_SUMMARY")),null==ae||null===($=ae.tradeLicenseDetail)||void 0===$||null===(G=$.applicationDocuments)||void 0===G?void 0:G.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"}},Y("BPAREG_HEADER_"+_t(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"}},""+Y(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"}},Y("BPAREG_HEADER_"+_t(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($t,{id:z,tenantId:null==ae?void 0:ae.tenantId})))))},zt=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],[v,p]=t.useState({}),[m,E]=t.useState(!0),_=i.useHistory(),[f,g]=t.useState(""),[A,S]=t.useState(null);let h=null==v?void 0:v.businessService,b=null==v?void 0:v.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(Ot(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),p(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 D=!1;var C,T,P;return!y||null==y||!y.data||null!=y&&y.isLoading||null==y||null===(C=y.data)||void 0===C||null===(T=C.nextActions)||void 0===T||T.forEach(e=>{"PAY"!=e.action||D||(D=!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===(P=c.workflow)||void 0===P?void 0:P.action}_${_t(b," ","_").toUpperCase()}${f||""}`),applicationNumber:null==v?void 0:v.applicationNo,info:d("BPA"==h?"BPA_PERMIT_APPLICATION_NUMBER_LABEL":"BPA_OCCUPANCY_CERTIFICATE_APPLICATION_NUMBER_LABEL"),successful:"PERMIT REVOCATION"!=(null==v?void 0:v.status)&&"REJECTED"!=(null==v?void 0:v.status),style:{padding:"10px"},headerStyles:{fontSize:"32px",wordBreak:"break-word"}}),l.createElement(o.CardText,{style:{paddingBottom:"10px",marginBottom:"10px"}}),"PERMIT REVOCATION"==(null==v?void 0:v.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:[v]},"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==v?void 0:v.status)||"PENDING_FEE"==(null==v?void 0:v.status)||"PENDING_SANC_FEE_PAYMENT"==(null==v?void 0:v.status))&&(null==A?void 0:A.length)>0&&D?l.createElement("div",null,l.createElement(i.Link,{to:{pathname:`/digit-ui/citizen/payment/collect/${Ot(null==v?void 0:v.businessService,null==v?void 0:v.status)}/${null==v?void 0:v.applicationNo}/${null==v?void 0:v.tenantId}?tenantId=${null==v?void 0:v.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==v?void 0:v.status)||"PENDING_FEE"==(null==v?void 0:v.status)||"PENDING_SANC_FEE_PAYMENT"==(null==v?void 0:v.status))&&(null==A?void 0:A.length)>0&&D?l.createElement("div",null,l.createElement(o.SubmitBar,{label:d("WF_BPA_PAY"),onSubmit:()=>{_.push(`/digit-ui/employee/payment/collect/${Ot(null==v?void 0:v.businessService,null==v?void 0:v.status)}/${null==v?void 0:v.applicationNo}/${null==v?void 0:v.tenantId}?tenantId=${null==v?void 0:v.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:()=>{_.push("/digit-ui/employee")},style:{margin:"10px 10px 0px 0px"}})))))},Yt=e=>{let{statuses:i,isInboxLoading:r,controlFilterForm:u,setFilterFormValue:d,filterFormState:s,localitiesForEmployeesCurrentTenant:c,loadingLocalitiesForEmployeesCurrentTenant:v}=e;const{t:p}=n.useTranslation(),m=Digit.ULBService.getCurrentTenantId(),{data:E,isLoading:_}=Digit.Hooks.obps.SearchMdmsTypes.useApplicationTypes(m),f=[{code:"ASSIGNED_TO_ME",name:""+p("ES_INBOX_ASSIGNED_TO_ME")},{code:"ASSIGNED_TO_ALL",name:""+p("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:f.filter(t=>t.code===e.value)[0],optionsKey:"name",name:"assignee",options:f})})),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 v?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("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:p("ES_BPA_ALL_SELECTED"),defaultUnit:p("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=>_?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:"filter-label sub-filter-label",style:{fontSize:"18px",fontWeight:"600"}},p("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"}},p("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"}},p("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=mt(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:`${p(`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)},Kt=e=>{var i,a,r,u;let{registerRef:d,searchFormState:s,searchFieldComponents:c}=e;const{t:v}=n.useTranslation();var p,m,E,_;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,v("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,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),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,v("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,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(p=s.errors)&&void 0!==p&&null!==(m=p.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(_=E.mobileNumber)||void 0===_?void 0:_.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};function Vt(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 qt(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Xt(e){qt(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 Jt(e,t){qt(2,arguments);var l=Xt(e).getTime(),n=Vt(t);return new Date(l+n)}function Zt(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 qt(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function el(e){if(qt(1,arguments),!Qt(e)&&"number"!=typeof e)return!1;var t=Xt(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){qt(2,arguments);var l=Vt(t);return Jt(e,-l)}function vl(e){qt(1,arguments);var t=1,l=Xt(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 pl(e){qt(1,arguments);var t=Xt(e),l=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(l+1,0,4),n.setUTCHours(0,0,0,0);var i=vl(n),o=new Date(0);o.setUTCFullYear(l,0,4),o.setUTCHours(0,0,0,0);var a=vl(o);return t.getTime()>=i.getTime()?l+1:t.getTime()>=a.getTime()?l:l-1}function ml(e){qt(1,arguments);var t=pl(e),l=new Date(0);l.setUTCFullYear(t,0,4),l.setUTCHours(0,0,0,0);var n=vl(l);return n}function El(e,t){qt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:Vt(i),a=null==l.weekStartsOn?o:Vt(l.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var r=Xt(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 _l(e,t){qt(1,arguments);var l=Xt(e),n=l.getUTCFullYear(),i=t||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,r=null==a?1:Vt(a),u=null==i.firstWeekContainsDate?r:Vt(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 v=El(c,t);return l.getTime()>=s.getTime()?n+1:l.getTime()>=v.getTime()?n:n-1}function fl(e,t){qt(1,arguments);var l=t||{},n=l.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:Vt(i),a=null==l.firstWeekContainsDate?o:Vt(l.firstWeekContainsDate),r=_l(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=_l(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(pl(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){qt(1,arguments);var l=Xt(e),n=El(l,t).getTime()-fl(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){qt(1,arguments);var t=Xt(e),l=vl(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){qt(1,arguments);var t=Xt(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 Dl(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 Cl={p:Dl,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}}",Dl(o,t))}},Tl=["D","DD"],Pl=["YY","YYYY"];function Nl(e){return-1!==Tl.indexOf(e)}function Il(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=/^'([^]*?)'?$/,wl=/''/g,xl=/[a-zA-Z]/;function Ml(e,t,l){qt(2,arguments);var n=String(t),i=l||{},o=i.locale||sl,a=o.options&&o.options.firstWeekContainsDate,r=null==a?1:Vt(a),u=null==i.firstWeekContainsDate?r:Vt(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:Vt(d),c=null==i.weekStartsOn?s:Vt(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 v=Xt(e);if(!el(v))throw new RangeError("Invalid time value");var p=Zt(v),m=cl(v,p),E={firstWeekContainsDate:u,weekStartsOn:c,locale:o,_originalDate:v},_=n.match(Ol).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,Cl[t])(e,o.formatLong,E):e}).join("").match(Bl).map(function(l){if("''"===l)return"'";var n=l[0];if("'"===n)return Fl(l);var a=Al[n];if(a)return!i.useAdditionalWeekYearTokens&&Il(l)&&Ll(l,t,e),!i.useAdditionalDayOfYearTokens&&Nl(l)&&Ll(l,t,e),a(m,l,o.localize,E);if(n.match(xl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return l}).join("");return _}function Fl(e){return e.match(Rl)[1].replace(wl,"'")}const kl=e=>{let{parentRoute:r}=e;window.scroll(0,0);const{t:u}=n.useTranslation(),d=Digit.ULBService.getCurrentTenantId(),c={},v={moduleName:"bpa-services",applicationStatus:[],locality:[],assignee:"ASSIGNED_TO_ALL",applicationType:[]},p={sortBy:"",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("OBPS.INBOX"),E=t.useMemo(()=>m||{filterForm:v,searchForm:c,tableForm:p},[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(d,"revenue",{},u),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:d,filters:{..._}}),D={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:u("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"]}]},C=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Kt,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),T=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(Yt,{statuses:b,isInboxLoading:S,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),P={SearchFormFields:C,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),f({action:"mutateSearchForm",data:c})}},N={FilterFormFields:T,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","bpa-services"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),e("applicationType",[]),f({action:"mutateFilterForm",data:v})}},I=(e=>{var o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:v,table:p,dispatch:m,onSortingByData:E}=e;const _=e=>l.createElement("span",{className:"cell-text styled-cell"},e),{t:f}=n.useTranslation(),g=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,l;let{row:n}=e;return null!==(t=n.original)&&void 0!==t&&t.date?_(Ml(new Date(null===(l=n.original)||void 0===l?void 0:l.date),"dd/MM/yyyy")):""}},{Header:f("CS_APPLICATION_DETAILS_SUBMISSION_DATE"),accessor:"submissionDate",Cell:e=>{var t,l;let{row:n}=e;return null!==(t=n.original)&&void 0!==t&&t.submissionDate?_(Ml(new Date(null===(l=n.original)||void 0===l?void 0:l.submissionDate),"dd/MM/yyyy")):"NA"}},{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_OWNER_NAME"),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=>"PENDING_SANC_FEE_PAYMENT"==(null==e?void 0:e.state)?"NA":(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:v,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(v/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:p,columns:g}})({parentRoute:r,onPageSizeChange:e=>{f({action:"mutateTableForm",data:{..._.tableForm,limit:e.target.value}})},formState:_,totalCount:y,table:h,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===n||f({action:"mutateTableForm",data:{..._.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;f({action:"mutateTableForm",data:{..._.tableForm,sortOrder:t}})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,u("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"},u("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,s({isInboxLoading:S,PropsForInboxLinks:D},P,N,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:_})))},Ul=e=>{var t,a,r,u,d,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,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"),w=null===(r=Digit)||void 0===r||null===(u=r.ComponentRegistryService)||void 0===u?void 0:u.getComponent("ObpsCreateEDCR"),x=null===(d=Digit)||void 0===d||null===(c=d.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ObpsCreateOCEDCR"),M=null===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.getComponent("ObpsNewBuildingPermit"),F=null===(m=Digit)||void 0===m||null===(E=m.ComponentRegistryService)||void 0===E?void 0:E.getComponent("ObpsOCBuildingPermit"),k=null===(_=Digit)||void 0===_||null===(f=_.ComponentRegistryService)||void 0===f?void 0:f.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===(D=Digit)||void 0===D||null===(C=D.ComponentRegistryService)||void 0===C?void 0:C.getComponent("ObpsOCSendToArchitect"),$=null===(T=Digit)||void 0===T||null===(P=T.ComponentRegistryService)||void 0===P?void 0:P.getComponent("ObpsBPASendBackToCitizen"),G=null===(N=Digit)||void 0===N||null===(I=N.ComponentRegistryService)||void 0===I?void 0:I.getComponent("ObpsOCSendBackToCitizen"),z="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")&&!z&&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,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/search/obps-application",component:e=>l.createElement(Ut,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/apply",component:w}),l.createElement(o.PrivateRoute,{path:L+"/edcrscrutiny/oc-apply",component:x}),l.createElement(o.PrivateRoute,{path:L+"/bpa/:applicationType/:serviceType",component:M}),l.createElement(o.PrivateRoute,{path:L+"/ocbpa/:applicationType/:serviceType",component:F}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/apply",component:k}),l.createElement(i.Route,{path:L+"/openlink/stakeholder/apply",component:k}),l.createElement(o.PrivateRoute,{path:L+"/my-applications",component:Ht}),l.createElement(o.PrivateRoute,{path:L+"/bpa/inbox",component:e=>l.createElement(kl,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/edcr/inbox",component:e=>l.createElement(U,s({},e,{parentRoute:L}))}),l.createElement(o.PrivateRoute,{path:L+"/stakeholder/:id",component:Gt}),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:G}),l.createElement(o.PrivateRoute,{path:L+"/response",component:zt}))))},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")}],v=Digit.ULBService.getStateId(),{data:p,isLoading:m}=Digit.Hooks.obps.useMDMS(v,"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:p}))})),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:v}=n.useTranslation();var p,m,E,_;return window.Digit.Utils.browser.isMobile()?l.createElement(t.Fragment,null,l.createElement(o.SearchField,null,l.createElement("label",null,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),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,v("BPA_APPLICATION_NUMBER_LABEL")),l.createElement(o.TextInput,{name:"applicationNo",inputRef:d({})})),l.createElement(o.SearchField,null,l.createElement("label",null,v("CORE_COMMON_MOBILE_NUMBER")),l.createElement(o.MobileNumber,{name:"mobileNumber",type:"number",inputRef:d({minLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:v("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:v("CORE_COMMON_MOBILE_ERROR")}})}),null!=s&&null!==(p=s.errors)&&void 0!==p&&null!==(m=p.mobileNumber)&&void 0!==m&&m.message?l.createElement(o.CardLabelError,null,null==s||null===(E=s.errors)||void 0===E||null===(_=E.mobileNumber)||void 0===_?void 0:_.message):null),l.createElement("div",{className:"search-action-wrapper",style:{width:"100%"}},c)))))};let jl=[];const $l=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","COLONY_DETAILS","BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL","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 Gl(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 zl=l.memo(function(e){var n,i,a;let{t:u,document:d,setDocuments:s,documents:c,formData:v,beforeUploadDocuments:p,setIsNextButtonDisabled:m}=e;const E=(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==p?void 0:p.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==d?void 0:d.code)})[0]),_=Digit.ULBService.getStateId(),[f,g]=t.useState(E?{...E,active:!0,code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}:(null==d||null===(n=d.dropdownData)||void 0===n?void 0:n.length)>0?null==d?void 0:d.dropdownData[0]:{}),[A,S]=t.useState(null),[h,b]=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),[y,D]=t.useState([]),[C,T]=t.useState([]),[P,N]=t.useState([]||(null==v||null===(i=v.documents)||void 0===i?void 0:i.documents.filter(e=>e.documentType===f.code))),[I,L]=t.useState(null),[B,O]=t.useState(null);function R(e){return e[0]+e[1]/60+e[2]/3600}t.useEffect(()=>{C.length>0&&null!=f&&f.code&&(s(e=>{if(null===h||null==(null==h?void 0:h.fileStoreId))return e;const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.fileStoreId)!==h.fileStoreId);let l=[];return C&&C.map((e,t)=>{var n,i,o;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("_"),latitude:I,longitude:B,fileName:(null===(n=P[t])||void 0===n?void 0:n.name)||""},documentUid:e.fileStoreId,fileName:(null===(i=P[t])||void 0===i?void 0:i.name)||"",id:c?null===(o=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===o?void 0:o.id:void 0})}),[...t,...l]}),T([])),null!=f&&f.code&&s(e=>{var t;return null===h||null==(null==h?void 0:h.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)!==h.fileStoreId),{documentType:null==f?void 0:f.code,fileStoreId:h.fileStoreId,documentUid:h.fileStoreId,fileName:(null==A?void 0:A.name)||h.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}]})},[h,f]),t.useEffect(()=>{f.code||null===h||T([...C,h])},[h]);const w=t.useMemo(()=>{var e;return v?((null===(e=v.documents)||void 0===e?void 0:e.documents)||v.documents||[]).filter(e=>e.documentType===f.code).map(e=>[e.additionalDetails.fileName,{file:{name:e.additionalDetails.fileName,type:e.documentType},fileStoreId:{fileStoreId:e.fileStoreId,tenantId:_}}]):[]},[v,f.code,_]),x=c.filter(e=>"SITEPHOTOGRAPH.ONE.ONE"===e.documentType);return l.createElement("div",null,l.createElement(o.CardLabel,null,null!=d&&d.required?u(null==d?void 0:d.code)+" *":""+u(null==d?void 0:d.code)),l.createElement(o.Dropdown,{t:u,isMandatory:!1,option:Digit.Utils.locale.sortDropdownNames(null==d?void 0:d.dropdownData,"i18nKey",u),selected:f,optionKey:"i18nKey",select:e=>{if(null!=E&&E.documentType){E.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)}g(e)}}),l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:_,getFormState:function(e){let t,l,n=f.code;if((null==e?void 0:e.length)>0)(function(e){return new Promise(t=>{r.getData(e,function(){const e=r.getTag(this,"GPSLatitude"),l=r.getTag(this,"GPSLongitude");if(e&&l){const n=R(e),i=R(l);t({latitude:n,longitude:i})}else t({latitude:null,longitude:null}),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.code)&&alert("Please Upload a Photo with Location Details")})})})(e[0][1].file).then(i=>{var o,a,r;console.log("Latitude:",i.latitude),console.log("Longitude:",i.longitude),L(i.latitude),O(i.longitude),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.code)&&(null!==i.latitude&&null!==i.longitude?(sessionStorage.setItem("Latitude",i.latitude),sessionStorage.setItem("Longitude",i.longitude)):(sessionStorage.removeItem("Latitude"),sessionStorage.removeItem("Longitude"))),t=Object.fromEntries(e),l=Object.values(t),l=null==v||null===(o=v.documents)||void 0===o||null===(a=o.documents)||void 0===a?void 0:a.filter(e=>e.documentType===f.code),D(l);let u=[];null==e||e.map((e,t)=>{var l,n,o,a;u.push({documentType:null==f?void 0:f.code,additionalDetails:{category:null==f?void 0:f.code.split(".").slice(0,2).join("_"),latitude:i.latitude,longitude:i.longitude,fileName:(null==e?void 0:e[0])||""},fileStoreId:null==e||null===(l=e[1])||void 0===l||null===(n=l.fileStoreId)||void 0===n?void 0:n.fileStoreId,documentUid:null==e||null===(o=e[1].fileStoreId)||void 0===o?void 0:o.fileStoreId,fileName:(null==e?void 0:e[0])||"",id:c?null===(a=c.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===a?void 0:a.id:void 0})});const p=[...c.filter(e=>e.documentType!==n),...u];s(p),null===(r=l)||void 0===r||r.map(e=>{null!=e&&e.file||(e.file={}),e.file.documentType=n,function(e,t){e&&S(e.file),e&&N([...P,e.file])}(e)})}).catch(e=>{console.error("Error extracting geo location:",e)});else if(0==(null==e?void 0:e.length)){const e=[...c.filter(e=>e.documentType!==n)];s(e)}},setuploadedstate:w,t:u,extraStyleName:"OBPS",allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:10,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}),(null==d||null===(a=d.uploadedDocuments)||void 0===a?void 0:a.length)&&l.createElement(Gl,{isSendBackFlow:!0,documents:null==d?void 0:d.uploadedDocuments}),"SITEPHOTOGRAPH.ONE"===(null==d?void 0:d.code)&&((e,t,n,i)=>{const a=sessionStorage.getItem("Latitude")||(null==x||null===(e=x[0])||void 0===e||null===(t=e.additionalDetails)||void 0===t?void 0:t.latitude),r=sessionStorage.getItem("Longitude")||(null==x||null===(n=x[0])||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.longitude);return a&&r?l.createElement("div",null,l.createElement("p",null,"Latitude: ",a),l.createElement("p",null,"Longitude: ",r),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"-500px",marginTop:"-24px",marginRight:"20px",cursor:"pointer"},onClick:()=>window.open(`http://maps.google.com/maps?q=${a},${r}`,"_blank")},l.createElement(o.SearchIcon,null)),m(!1)," "):l.createElement("div",null,l.createElement("p",{style:{color:"red"}},"Please upload a Photo with Location details."),m(!0)," ")})())});function Yl(e){let{documents:i,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=n.useTranslation(),[d,s]=t.useState(()=>[]),[c,v]=(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=>{v(null==e?void 0:e.data)}):null!=d&&d.length&&Digit.UploadServices.Filefetch(d,Digit.ULBService.getStateId()).then(e=>{v(null==e?void 0:e.data)})},[d]);const p=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:p?{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:p?{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 Kl(e){var n,i,a;let{t:r,document:u,setNocDocuments:d,nocDocuments:s,formData:c,beforeUploadNocDocuments:v,pdfLoading:p}=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==v||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)});const m=Digit.ULBService.getStateId(),[E,_]=t.useState(null==u||null===(n=u.dropdownData)||void 0===n?void 0:n[0]),[f,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&&_({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)&&!p&&l.createElement(Gl,{documents:null==u?void 0:u.uploadedDocuments,svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"18px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}}))}const Vl=e=>{var n,i;let{t:a,onSelect:r,formData:u={},handleRemove:d,onSave:s}=e;const[c,v]=t.useState((null==u||null===(n=u.address)||void 0===n?void 0:n.pincode)||""),[p,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:p,onSave:()=>s(p,c,g),onChange:(e,t,l)=>((e,t,l)=>{f(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)}))?(v(e),m(t),A(l)):(f("BPA_COMMON_PINCODE_NOT_SERVICABLE"),v(""),m({}),A(""))})(e,t,l),disabled:""===c,forcedError:a(_),isPlaceRequired:!0,handleRemove:d,Webview:S,isPopUp:!0}))))},ql=[{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"}}]}],Xl=[{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:""}}]}],Jl=[{head:"ES_NEW_APPLICATION_PROPERTY_ASSESSMENT",body:[{route:"docs-required",component:"DocsRequired",key:"data",nextStep:"noc-number"},{route:"noc-number",component:"NOCNumber",nextStep:"basic-details",key:"nocnumber",texts:{headerCaption:"BPA_NOC_NUMBER_DETAILS",header:"",submitBarLabel:"CS_COMMON_NEXT"}},{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_INPUT",type:"text",validation:{pattern:/^[0-9]*$/,title:"Enter in Numbers[0-9]",required:!0},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:null,key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}}]}],Zl=[{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_BOUNDARY_LAND_REG_DETAIL_LABEL",type:"textarea",validation:{},name:"registrationDetails"},{label:"BPA_BOUNDARY_WALL_LENGTH_LABEL_INPUT",type:"text",validation:{pattern:"^[0-9]*$",title:"Enter in Numbers[0-9]",required:!0},name:"boundaryWallLength"},{label:"BPA_WARD_NUMBER_LABEL",type:"text",validation:{pattern:"^[a-zA-Z0-9 ]*$",title:"Special Character are not allowed",required:!0},name:"wardnumber"},{label:"BPA_ZONE_NUMBER_LABEL",type:"text",validation:{pattern:"^[a-zA-Z0-9 ]*$",required:!1},name:"zonenumber"},{label:"BPA_KHASRA_NUMBER_LABEL",type:"text",validation:{pattern:"^[a-zA-Z0-9/]*$",required:!0},name:"khasraNumber"},{label:"BPA_ARCHITECT_ID",type:"text",validation:{pattern:"^[a-zA-Z0-9/]*$",required:!0},name:"architectid"},{label:"BPA_PROPERTY_UID",type:"text",validation:{},name:"propertyuid"},{label:"BPA_NUMBER_OF_BATHS",type:"text",validation:{pattern:"^[0-9]*$",required:!1},name:"bathnumber"},{label:"BPA_NUMBER_OF_KITCHENS",type:"text",validation:{pattern:"^[0-9]*$",required:!1},name:"kitchenNumber"},{label:"BPA_APPROX_INHABITANTS_FOR_ACCOMODATION",type:"text",validation:{pattern:"^[0-9]*$",required:!1},name:"approxinhabitants"},{label:"BPA_DISTANCE_FROM_SEWER",type:"text",validation:{pattern:"^[0-9]*$",required:!1},name:"distancefromsewer"},{label:"BPA_SOURCE_OF_WATER",type:"text",validation:{pattern:"^[a-zA-Z]*$",required:!1},name:"sourceofwater"},{label:"BPA_NUMBER_OF_WATER_CLOSETS",type:"text",validation:{pattern:"^[0-9]*$",required:!1},name:"watercloset"},{label:"BPA_MATERIAL_TO-BE_USED_IN_WALLS",type:"text",validation:{pattern:"^[a-zA-Z]*$",required:!1},name:"materialused"},{label:"BPA_MATERIAL_TO-BE_USED_IN_FLOOR",type:"text",validation:{pattern:"^[a-zA-Z]*$",required:!1},name:"materialusedinfloor"},{label:"BPA_MATERIAL_TO-BE_USED_IN_ROOFS",type:"text",validation:{pattern:"^[a-zA-Z]*$",required:!1},name:"materialusedinroofs"}]},{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:"additional-building-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:"additional-building-details",component:"BPANewBuildingdetails",nextStep:"owner-details",key:"owners",texts:{header:"BPA_ADDITIONAL_BUILDING_DETAILS",submitBarLabel:"CS_COMMON_NEXT"}},{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:null,key:"documents",texts:{headerCaption:"BPA_OWNER_AND_DOCUMENT_DETAILS_LABEL",header:"BPA_DOCUMENT_DETAILS_LABEL",submitBarLabel:"CS_COMMON_NEXT"}}],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(),v=null===(i=e.application)||void 0===i?void 0:i.businessService,{isLoading:p,data:m}=Digit.Hooks.useWorkflowDetails({tenantId:null===(a=e.application)||void 0===a?void 0:a.tenantId,id:e.id,moduleCode:v}),[E,_]=t.useState(!1);function f(e,t,l){var n;window.open(null==l||null===(n=l.fullImage)||void 0===n?void 0:n[0],"_blank")}const g=(e,t,n)=>{var i,o,a,r,u;const d=n[t-1],s={date:null==e||null===(i=e.auditDetails)||void 0===i?void 0:i.lastModified,name:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.name,mobileNumber:null==e||null===(r=e.assignes)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.mobileNumber,wfComment:d?null==d?void 0:d.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(jt,{data:s,OpenImage:f})};return p?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,!p&&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_${v}_${m.timeline[0].state}`||"NA"),customChild:g(null==m?void 0:m.timeline[0],0,m.timeline)}):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_${v}_${e.state}${i}`):"NA",customChild:g(e,t,null==m?void 0:m.timeline)}))}))),(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:()=>{_(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,u;let{t:d,closeModal:s,submitAction:v,action:p,applicationData:m}=e;const[E,_]=t.useState({}),[f,g]=t.useState(null),[A,S]=t.useState(null),[h,b]=t.useState({}),[y,D]=t.useState(null),[C,T]=t.useState(!1),P=!!Digit.Utils.browser.isMobile(),N=e=>{g(e.target.files[0])};return t.useEffect(()=>{switch(p){case"APPROVE":_(on({t:d,action:p,selectFile:N,uploadedFile:A,error:y,isCommentRequired:!1,setUploadedFile:S,file:f,error:y}));break;case"SEND_TO_ARCHITECT":_(on({t:d,action:p,selectFile:N,uploadedFile:A,error:y,setUploadedFile:S,file:f,error:y}));break;case"TERMS_AND_CONDITIONS":T(!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:d,applicationData:m}));break;default:_(on({t:d,action:p,selectFile:N,uploadedFile:A,error:y,isCommentRequired:!1,setUploadedFile:S,file:f,error:y}))}},[p,A,y]),t.useEffect(()=>{!function(){try{D(null);const e=function(){if(f){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(f.size>=5242880)D(d("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=f&&f.type&&!e.test(null==f?void 0:f.type))D(d("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("BPA",f,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):D(d("CS_FILE_UPLOAD_ERROR"))})},function(){D(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)}}()},[f]),l.createElement(o.Modal,{headerBarMain:l.createElement(an,{label:d(null==E||null===(n=E.label)||void 0===n?void 0:n.heading)}),headerBarEnd:l.createElement(un,{onClick:s}),actionCancelLabel:d(null==E||null===(i=E.label)||void 0===i?void 0:i.cancel),actionCancelOnSubmit:s,actionSaveLabel:d(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"==p?{height:"92%",boxSizing:"border-box"}:P?{paddingLeft:"0px"}:{},headerBarMainStyle:"TERMS_AND_CONDITIONS"==p?{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:p};A&&(t.varificationDocuments=[{documentType:"Document - 1",fileName:(null==f?void 0:f.name)||"",fileStoreId:A}]),null!=e&&e.comments||delete e.comments,v({...e,...t})},defaultValues:h,formId:"modal-action"}):null,C?l.createElement("div",{style:{height:"100%"}},l.createElement("div",{style:{height:"95%"}},l.createElement("div",{style:{fontSize:"18px",paddingBottom:"16px",color:"#000000",fontWeight:"700"}},d("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:d("BPA_GO_BACK_LABEL"),onSubmit:s,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:v}=Digit.Hooks.obps.useOBPSDocumentSearch({value:t},{value:t},i,a,r);let p=[];var m,E,_;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=>{p.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=>{p.push(e)})):null!=t&&t.documents?null==t||null===(_=t.documents)||void 0===_||_.documents.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{p.push(e)}):t.filter(e=>(null==e?void 0:e.documentType)===i).map(e=>{p.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"}},p.length>0?l.createElement("div",{style:{display:"flex",justifyContent:"flex-start",flexWrap:"wrap"}},null==p?void 0:p.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}(v.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_"+_t(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:v}=n.useTranslation(),p=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"}],E=e=>{const t=e;return(e,l,n)=>e[t]},_=t.useMemo(()=>m.map(e=>({Header:v(""+e.name),accessor:E(e.id),id:e.id})));function f(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:v("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:v(""+(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:v("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?""+v("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"}},v(null==e?void 0:e.title)):l.createElement(o.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+v(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(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"}},v("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+v("BPA_SUB_OCCUPANCY_LABEL"),text:g(t)})),l.createElement("div",{style:window.location.href.includes("citizen")||p?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:v,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:f(e),columns:_,getCellProps:e=>({style:{}})})))})))};function vn(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(Gl,{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 pn=e=>{var i,a,r,u,d,s,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,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"),[w,x]=t.useState(),[M,F]=t.useState(),[k,U]=t.useState(),H=Digit.ULBService.getStateId(),[W,j]=t.useState(),[$,G]=t.useState(),[z,Y]=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=c(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?Y([...z,{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(z))},[z]),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))}x(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),F(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),Y(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===(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===(s=B.selfCertificationCharges)||void 0===s?void 0:s.BPA_LABOUR_CESS)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==B||null===(v=B.selfCertificationCharges)||void 0===v?void 0:v.BPA_WATER_CHARGES)}),l.createElement(o.Row,{className:"border-none",label:ae("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==B||null===(p=B.selfCertificationCharges)||void 0===p?void 0:p.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:w,disabled:!R,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(x(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)&&(F(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===(_=B.selfCertificationCharges)||void 0===_?void 0:_.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===(f=B.selfCertificationCharges)||void 0===f?void 0:f.BPA_LESS_ADJUSMENT_PLOT)||"",value:k,disabled:!R,onChange:e=>{!function(e){var t,l,n,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(w)?parseFloat(w):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(k)>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){G(e.target.files[0]),V(e.target.files[0])},disabled:!R,onDelete:()=>{G(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(w)?parseFloat(w):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==B||null===(D=B.selfCertificationCharges)||void 0===D?void 0:D.BPA_MALBA_CHARGES)+parseFloat(null==B||null===(C=B.selfCertificationCharges)||void 0===C?void 0:C.BPA_LABOUR_CESS)+parseFloat(null==B||null===(T=B.selfCertificationCharges)||void 0===T?void 0:T.BPA_WATER_CHARGES)+parseFloat(null==B||null===(P=B.selfCertificationCharges)||void 0===P?void 0:P.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(k)?parseFloat(k):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))))))))},mn=e=>{var a,r,u,s,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H;let{showTermsPopup:W,setShowTermsPopup:j,otpVerifiedTimestamp:$}=e;const[G,z]=t.useState(!1),{t:Y}=n.useTranslation(),K=Digit.UserService.getUser(),V=null==K?void 0:K.info.mobileNumber,q=null==K||null===(a=K.info)||void 0===a?void 0:a.emailId,{id:X}=i.useParams(),J=Digit.ULBService.getCurrentTenantId(),{data:Z}=Digit.Hooks.obps.useBPADetailsPage(J,{applicationNo:X});let Q=Digit.Hooks.useWorkflowDetails({tenantId:null==Z||null===(r=Z.applicationData)||void 0===r?void 0:r.tenantId,id:X,moduleCode:"OBPS",config:{enabled:!!Z}});const ee=null==Z||null===(u=Z.applicationData)||void 0===u||null===(s=u.additionalDetails)||void 0===s?void 0:s.ownerName,te=null==Z||null===(p=Z.applicationData)||void 0===p||null===(m=p.landInfo)||void 0===m||null===(E=m.address)||void 0===E?void 0:E.street,le=null==Z||null===(_=Z.applicationData)||void 0===_||null===(f=_.landInfo)||void 0===f||null===(g=f.address)||void 0===g||null===(A=g.locality)||void 0===A?void 0:A.name,[ne,ie]=t.useState(!1),[oe,ae]=t.useState(!1),re=null==Z?void 0:Z.applicationNo,ue=null==Q||null===(S=Q.data)||void 0===S||null===(h=S.timeline)||void 0===h||null===(b=h[0])||void 0===b||null===(y=b.assigner)||void 0===y?void 0:y.name,de=null==Z||null===(D=Z.applicationData)||void 0===D||null===(C=D.additionalDetails)||void 0===C?void 0:C.khasraNumber,se=null==Z||null===(T=Z.applicationData)||void 0===T||null===(P=T.additionalDetails)||void 0===P?void 0:P.UlbName,ce=null==Z||null===(N=Z.applicationData)||void 0===N||null===(I=N.additionalDetails)||void 0===I?void 0:I.District,ve=null==Z||null===(L=Z.applicationData)||void 0===L||null===(B=L.additionalDetails)||void 0===B?void 0:B.wardnumber,pe=null==Z||null===(O=Z.applicationData)||void 0===O||null===(R=O.additionalDetails)||void 0===R?void 0:R.area,me=null==Z||null===(w=Z.applicationData)||void 0===w||null===(x=w.additionalDetails)||void 0===x?void 0:x.architectid,Ee=null==Z||null===(M=Z.applicationData)||void 0===M||null===(F=M.additionalDetails)||void 0===F?void 0:F.typeOfArchitect,_e=$,fe="Municipal Corporation"===(null==Z||null===(k=Z.applicationData)||void 0===k||null===(U=k.additionalDetails)||void 0===U?void 0:U.Ulblisttype)?"Commissioner":"Executive Officer",ge={...null==Z||null===(H=Z.applicationData)||void 0===H?void 0:H.additionalDetails,TimeStamp:sessionStorage.getItem("otpVerifiedTimestampcitizen")},Ae={...Z,applicationData:{...null==Z?void 0:Z.applicationData,additionalDetails:ge}},Se=`\nTo,\n<b>${fe}</b>\n<b>${se}</b> \n\nDear Sir or Madam,\n\nI/We, Shri/Smt/Kum. <b>${ee}</b> under signed owner of land bearing Kh. No. <b>${de}</b> of ULB <b>${se}</b> Area <b>${pe}</b> (Sq.mts.), ward number <b>${ve}</b>, City <b>${ce}</b>\n\nI/We hereby declare that <b>${ue}</b> (<b>${Ee}</b>) Registration Number <b>${me}</b> is appointed by me/us and is authorized to make representation/application with regard to aforesaid construction to any of the authorities.\n\nI/We further declare that I am/We are aware of all the action taken or representation made by the <b>${Ee}</b> authorized by me/us.\n\ni) That I am/We are sole owner of the site.\n\nii) There is no dispute regarding the site and if any dispute arises then I shall be solely responsible for the same.\n\niii) That construction of the building will be undertaken as per the approved building plans and strutural design given by the Structural Engineer.\n\nThat above stated facts are true and the requisite documents have been uploaded with this E-Naksha plan.\n\n\n This Document is Verified By OTP at <b>${_e}\n\n\n Name of Owner - <b>${ee}</b>\n Application Number - <b>${re}</b>\n Address - <b>${te}</b> <b>${le}</b>\n Mobile Number - <b>${V}</b>\n Email - <b>${q}</b>\n \n `,he=e=>[`Name of Owner - <b>${ee}</b>`,`Mobile Number - <b>${V}</b>`,`Address - <b>${te}</b> <b>${le}</b>`,`Application Number - <b>${re}</b>`,`Email - <b>${q}</b>`].includes(e.trim()),be=()=>{j(!1)},ye={modal:{width:"100%",height:"100%",top:"0",position:"relative",backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center"},modalOverlay:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.7)"},modalContent:{backgroundColor:"#FFFFFF",padding:"2rem",borderRadius:"0.5rem",maxWidth:"800px",margin:"auto",fontFamily:"Roboto, serif",overflowX:"hidden",textAlign:"justify",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",maxHeight:"80vh",overflowY:"auto",lineHeight:"2"},heading:{textAlign:"center",fontWeight:"bold",marginBottom:"10px"},subheading:{textAlign:"center",fontWeight:"bold",marginBottom:"20px"},rightAlignedText:{textAlign:"right",whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:"Roboto, serif",lineHeight:"2"}};return l.createElement("div",null,l.createElement(d,{isOpen:W,onRequestClose:be,contentLabel:"Self-Declaration",style:{modal:ye.modal,overlay:ye.modalOverlay,content:ye.modalContent}},l.createElement("div",null,l.createElement("h2",{style:ye.heading},"DECLARATION UNDER SELF-CERTIFICATION SCHEME"),l.createElement("h3",{style:ye.subheading},"(By OWNER)"),l.createElement("div",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",textAlign:"justify",fontFamily:"Roboto, serif"}},Se.split("\n").map((e,t)=>l.createElement(l.Fragment,{key:t},l.createElement("div",{style:he(e)?ye.rightAlignedText:{},dangerouslySetInnerHTML:{__html:e}}),((e,t)=>{const l="This Document is Verified By OTP at "+_e;return"That above stated facts are true and the requisite documents have been uploaded with this E-Naksha plan."===e.trim()&&""===(null==t?void 0:t.trim())||e.trim()===l})(e,Se.split("\n")[t+1])&&l.createElement("div",{style:{marginBottom:"2rem"}})))),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(o.SubmitBar,{label:Y("BPA_CLOSE"),onSubmit:be})),l.createElement("br",null),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement("br",null),l.createElement(o.SubmitBar,{label:Y("BPA_UPLOAD"),onSubmit:function(){try{const e=v(function(){return c(function(){return ie(!0),Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(),{Bpa:[Ae]},"ownerconsent")).then(function(e){var t;(null==e||null===(t=e.filestoreIds[0])||void 0===t?void 0:t.length)>0?(alert("File Uploaded Successfully"),sessionStorage.setItem("CitizenConsentdocFilestoreid",null==e?void 0:e.filestoreIds[0]),ae(!0)):alert("File Upload Failed")})},function(e){alert("Error Uploading PDF:",e)})},function(e,t){if(ie(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:ne||oe})))))},En=(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),fn=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","")}}))})))},gn=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)))))},An=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"}}))};function Sn(e){var n,i,a;let{t:r,document:u,setDocuments:d,error:s,setError:v,documents:p,setCheckRequiredFields:m}=e;const E=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],_=Digit.ULBService.getCurrentTenantId(),[f,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(()=>{d(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{v(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)v(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))v(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return b(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",A,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?b(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)}}()},[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:s}))}const hn=e=>{var t,a,r,u,d,s;const{state:c}=e.location,{t:v}=n.useTranslation(),p=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:v(`BPA_ARCHITECT_${null==m?void 0:m.status}_MAIN_HEAD`),applicationNumber:null==m?void 0:m.applicationNumber,info:v("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"}},v(`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:v("CORE_COMMON_GO_TO_HOME"),onSubmit:()=>{p.push("/digit-ui/employee")}}))))},bn=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})},yn=e=>{let{path:a}=e;const r=i.useLocation(),{t:u}=n.useTranslation(),d=Digit.ComponentRegistryService.getComponent("BPAInbox"),c=Digit.ComponentRegistryService.getComponent("StakeholderInbox"),v=Digit.ComponentRegistryService.getComponent("ObpsEmpApplicationDetail"),p=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/"),_=window.location.href.includes("obps/response")||window.location.href.includes("obps/stakeholder-response");return l.createElement(t.Fragment,null,E||_?null:l.createElement("div",{style:m?{marginLeft:"10px"}:{}},l.createElement(bn,{location:r})),E?l.createElement(o.BackButton,{style:{border:"none",margin:"0",padding:"0"}},u("CS_COMMON_BACK")):null,l.createElement(i.Switch,null,l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox/stakeholder/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application/stakeholder/:id",component:v}),l.createElement(o.PrivateRoute,{path:a+"/search/application/editApplication/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/search/application",component:e=>l.createElement(Ut,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/inbox/editApplication/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/inbox/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/inbox",component:e=>l.createElement(d,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-inbox",component:e=>l.createElement(c,s({},e,{parentRoute:a}))}),l.createElement(o.PrivateRoute,{path:a+"/bpa/:id",component:p}),l.createElement(o.PrivateRoute,{path:a+"/response",component:zt}),l.createElement(o.PrivateRoute,{path:a+"/stakeholder-response",component:hn})))};var Dn=S(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]",v="[object Map]",p="[object Number]",m="[object Object]",E="[object RegExp]",_="[object Set]",f="[object String]",g="[object Symbol]",S="[object WeakMap]",h="[object ArrayBuffer]",b="[object DataView]",y="[object Float32Array]",D="[object Float64Array]",C="[object Int8Array]",T="[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,w=/&(?:amp|lt|gt|quot|#39);/g,x=/[&<>"']/g,M=RegExp(w.source),F=RegExp(x.source),k=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,G=/[\\^$.*+?()[\]{}|]/g,z=RegExp(G.source),Y=/^\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",ve="["+ce+"]",pe="["+se+"]",me="\\d+",Ee="[a-z\\xdf-\\xf6\\xf8-\\xff]",_e="[^\\ud800-\\udfff"+ce+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",fe="\\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+"|"+_e+")",ye="(?:"+he+"|"+_e+")",De="(?:"+pe+"|"+fe+")?",Ce="[\\ufe0e\\ufe0f]?"+De+"(?:\\u200d(?:"+[ge,Ae,Se].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*",Te="(?:"+["[\\u2700-\\u27bf]",Ae,Se].join("|")+")"+Ce,Pe="(?:"+[ge+pe+"?",pe,Ae,Se,"[\\ud800-\\udfff]"].join("|")+")",Ne=RegExp("['’]","g"),Ie=RegExp(pe,"g"),Le=RegExp(fe+"(?="+fe+")|"+Pe+Ce,"g"),Be=RegExp([he+"?"+Ee+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,he,"$"].join("|")+")",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,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,Te].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 ]/,we=["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"],xe=-1,Me={};Me[y]=Me[D]=Me[C]=Me[T]=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[v]=Me[p]=Me[m]=Me[E]=Me[_]=Me[f]=Me[S]=!1;var Fe={};Fe[o]=Fe[a]=Fe[h]=Fe[b]=Fe[r]=Fe[u]=Fe[y]=Fe[D]=Fe[C]=Fe[T]=Fe[P]=Fe[v]=Fe[p]=Fe[m]=Fe[E]=Fe[_]=Fe[f]=Fe[g]=Fe[N]=Fe["[object Uint8ClampedArray]"]=Fe[I]=Fe[L]=!0,Fe[d]=Fe[s]=Fe[S]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,We="object"==typeof A&&A&&A.Object===Object&&A,je="object"==typeof self&&self&&self.Object===Object&&self,$e=We||je||Function("return this")(),Ge=t&&!t.nodeType&&t,ze=Ge&&e&&!e.nodeType&&e,Ye=ze&&ze.exports===Ge,Ke=Ye&&We.process,Ve=function(){try{return ze&&ze.require&&ze.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)&&ft(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 vt(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 pt(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 _t(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 ft(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):_t(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?Dt(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 Dt(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 Ct(e,t){for(var l=-1,n=Array(e);++l<e;)n[l]=t(l);return n}function Tt(e){return e?e.slice(0,Gt(e)+1).replace(Y,""):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&&ft(t,e[l],0)>-1;);return l}function Bt(e,t){for(var l=e.length;l--&&ft(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"}),wt=bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function xt(e){return"\\"+ke[e]}function Mt(e){return Oe.test(e)}function Ft(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l}function kt(e,t){return function(l){return e(t(l))}}function Ut(e,t){for(var l=-1,i=e.length,o=0,a=[];++l<i;){var r=e[l];r!==t&&r!==n||(e[l]=n,a[o++]=l)}return a}function Ht(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l}function Wt(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=[e,e]}),l}function jt(e){return 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 Gt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var zt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var A=(t=null==t?$e:Yt.defaults($e.Object(),t,Yt.pick($e,we))).Array,K=t.Date,se=t.Error,ce=t.Function,ve=t.Math,pe=t.Object,me=t.RegExp,Ee=t.String,_e=t.TypeError,fe=A.prototype,ge=pe.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:""}(),De=ge.toString,Ce=Se.call(pe),Te=$e._,Pe=me("^"+Se.call(he).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=Ye?t.Buffer:void 0,Oe=t.Symbol,ke=t.Uint8Array,We=Le?Le.allocUnsafe:void 0,je=kt(pe.getPrototypeOf,pe),Ge=pe.create,ze=ge.propertyIsEnumerable,Ke=fe.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(pe,"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=ve.ceil,Zt=ve.floor,Qt=pe.getOwnPropertySymbols,el=Le?Le.isBuffer:void 0,tl=t.isFinite,ll=fe.join,nl=kt(pe.keys,pe),il=ve.max,ol=ve.min,al=K.now,rl=t.parseInt,ul=ve.random,dl=fe.reverse,sl=Ji(t,"DataView"),cl=Ji(t,"Map"),vl=Ji(t,"Promise"),pl=Ji(t,"Set"),ml=Ji(t,"WeakMap"),El=Ji(pe,"create"),_l=ml&&new ml,fl={},gl=Po(sl),Al=Po(cl),Sl=Po(vl),hl=Po(pl),bl=Po(ml),yl=Oe?Oe.prototype:void 0,Dl=yl?yl.valueOf:void 0,Cl=yl?yl.toString:void 0;function Tl(e){if(Ga(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(Ge)return Ge(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 wl(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new Rl;++t<l;)this.add(e[t])}function xl(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&&Fa(e),o=!l&&!n&&!i&&Za(e),a=l||n||i||o,r=a?Ct(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 Fl(e){var t=e.length;return t?e[wn(0,t-1)]:void 0}function kl(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))&&zl(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)||zl(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 Gl(e,t){return e&&_i(t,Sr(t),e)}function zl(e,t,l){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:l,writable:!0}):e[t]=l}function Yl(e,t){for(var l=-1,n=t.length,i=A(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,A=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),!A)return Ei(e,d)}else{var R=eo(e),w=R==s||R==c;if(Fa(e))return di(e,A);if(R==m||R==o||w&&!i){if(d=S||w?{}:lo(e),!A)return S?function(e,t){return _i(e,Qi(e),t)}(e,function(e,t){return e&&_i(t,hr(t),e)}(d,e)):function(e,t){return _i(e,Zi(e),t)}(e,Gl(d,e))}else{if(!Fe[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 D:case C:case T:case P:case N:case"[object Uint8ClampedArray]":case I:case L:return ci(e,l);case v:return new n;case p:case f: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 g:return Dl?pe(Dl.call(e)):{}}}(e,R,A)}}a||(a=new xl);var x=a.get(e);if(x)return x;a.set(e,d),qa(e)?e.forEach(function(n){d.add(Vl(n,t,l,n,e,a))}):za(e)&&e.forEach(function(n,i){d.set(i,Vl(n,t,l,i,e,a))});var M=O?void 0:(B?S?Gi:$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=pe(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 _e(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 wl(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 v=d;v--;)if(t[v]===c)continue e;u.push(s)}else o(t,c,n)||u.push(s)}return u}Tl.templateSettings={escape:k,evaluate:U,interpolate:H,variable:"",imports:{_:Tl}},(Tl.prototype=Nl.prototype).constructor=Tl,(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},wl.prototype.add=wl.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},wl.prototype.has=function(e){return this.__data__.has(e)},xl.prototype.clear=function(){this.__data__=new Ol,this.size=0},xl.prototype.delete=function(e){var t=this.__data__,l=t.delete(e);return this.size=t.size,l},xl.prototype.get=function(e){return this.__data__.get(e)},xl.prototype.has=function(e){return this.__data__.has(e)},xl.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[To(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 vn(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in pe(e)?function(e){var t=he.call(e,bt),l=e[bt];try{e[bt]=void 0;var n=!0}catch(e){}var i=De.call(e);return n&&(t?e[bt]=l:delete e[bt]),i}(e):function(e){return De.call(e)}(e)}function pn(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 pe(e)}function _n(e,t,l){for(var n=l?ut:rt,i=e[0].length,o=e.length,a=o,r=A(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 wl(a&&s):void 0}s=e[0];var c=-1,v=r[0];e:for(;++c<i&&d.length<u;){var p=s[c],m=t?t(p):p;if(p=l||0!==p?p:0,!(v?It(v,m):n(d,m,l))){for(a=o;--a;){var E=r[a];if(!(E?It(E,m):n(e[a],m,l)))continue e}v&&v.push(m),d.push(p)}}return d}function fn(e,t,l){var n=null==(e=mo(e,t=oi(t,e)))?e:e[To(Uo(t))];return null==n?void 0:tt(n,e,l)}function gn(e){return Ga(e)&&vn(e)==o}function An(e,t,l,n,i){return e===t||(null==e||null==t||!Ga(e)&&!Ga(t)?e!=e&&t!=t:function(e,t,l,n,i,s){var c=Ra(e),A=Ra(t),S=c?a:eo(e),y=A?a:eo(t),D=(S=S==o?m:S)==m,C=(y=y==o?m:y)==m,T=S==y;if(T&&Fa(e)){if(!Fa(t))return!1;c=!0,D=!1}if(T&&!D)return s||(s=new xl),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 ke(e),new ke(t)));case r:case u:case p:return Ia(+e,+t);case d:return e.name==t.name&&e.message==t.message;case E:case f:return e==t+"";case v:var s=Ft;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 g:if(Dl)return Dl.call(e)==Dl.call(t)}return!1}(e,t,S,l,n,i,s);if(!(1&l)){var P=D&&he.call(e,"__wrapped__"),N=C&&he.call(t,"__wrapped__");if(P||N){var I=P?e.value():e,L=N?t.value():t;return s||(s=new xl),i(I,L,l,n,s)}}return!!T&&(s||(s=new xl),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),v=o.get(t);if(c&&v)return c==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],_=t[s];if(n)var f=a?n(_,E,s,t,e,o):n(E,_,s,e,t,o);if(!(void 0===f?E===_||i(E,_,l,n,o):f)){p=!1;break}m||(m="constructor"==s)}if(p&&!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||(p=!1)}return o.delete(e),o.delete(t),p}(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=pe(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 xl;if(n)var v=n(d,s,u,e,t,c);if(!(void 0===v?An(s,d,3,n,c):v))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?Yr:"object"==typeof e?Ra(e)?Pn(e[0],e[1]):Tn(e):tu(e)}function yn(e){if(!so(e))return nl(e);var t=[];for(var l in pe(e))he.call(e,l)&&"constructor"!=l&&t.push(l);return t}function Dn(e,t){return e<t}function Cn(e,t){var l=-1,n=xa(e)?A(e.length):[];return Zl(e,function(e,i,o){n[++l]=t(e,i,o)}),n}function Tn(e){var t=Xi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(l){return l===e||Sn(l,e,t)}}function Pn(e,t){return ao(e)&&co(t)?vo(To(e),t):function(l){var n=Er(l,e);return void 0===n&&n===t?_r(l,e):An(t,n,3)}}function Nn(e,t,l,n,i){e!==t&&on(t,function(o,a){if(i||(i=new xl),$a(o))!function(e,t,l,n,i,o,a){var r=_o(e,l),u=_o(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 v=Ra(u),p=!v&&Fa(u),m=!v&&!p&&Za(u);s=u,v||p||m?Ra(r)?s=r:Ma(r)?s=Ei(r):p?(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(_o(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}):[Yr];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=vi(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}(Cn(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:ft,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 wn(e,t){return e+Zt(ul()*(t-e+1))}function xn(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(po(e,t,Yr),e+"")}function Fn(e){return Fl(Ir(e))}function kn(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=To(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=_l?function(e,t){return _l.set(e,t),e}:Yr,Wn=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:$r(t),writable:!0})}:Yr;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=A(i);++n<i;)o[n]=e[n+t];return o}function Gn(e,t){var l;return Zl(e,function(e,n,i){return!(l=t(e,n,i))}),!!l}function zn(e,t,l){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!Ja(a)&&(l?a<=t:a<t)?n=o+1:i=o}return i}return Yn(e,t,Yr,l)}function Yn(e,t,l,n){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=l(t))!=t,r=null===t,u=Ja(t),d=void 0===t;i<o;){var s=Zt((i+o)/2),c=l(e[s]),v=void 0!==c,p=null===c,m=c==c,E=Ja(c);if(a)var _=n||m;else _=d?m&&(n||v):r?m&&v&&(n||!p):u?m&&v&&!p&&(n||!E):!p&&!E&&(n?c<=t:c<t);_?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 Cl?Cl.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:xi(e);if(d)return Ht(d);a=!1,i=It,u=new wl}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 v=u.length;v--;)if(u[v]===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[To(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=A(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:Yr}function oi(e,t){return Ra(e)?e:ao(e,t)?[e]:Co(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 ke(t).set(new ke(e)),t}function ci(e,t){var l=t?si(e.buffer):e.buffer;return new e.constructor(l,e.byteOffset,e.length)}function vi(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 pi(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=A(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=A(s+d),v=!n;++i<s;)c[i]=e[i];for(var p=i;++u<d;)c[p+u]=t[u];for(;++a<r;)(v||i<o)&&(c[p+l[a]]=e[i++]);return c}function Ei(e,t){var l=-1,n=e.length;for(t||(t=A(n));++l<n;)t[l]=e[l];return t}function _i(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?zl(l,r,u):Wl(l,r,u)}return l}function fi(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=pe(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(!xa(l))return e(l,n);for(var i=l.length,o=t?i:-1,a=pe(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=pe(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 Di(e){return function(t,l,n){var i=pe(t);if(!xa(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 Ci(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 _e(l);if(o&&!r&&"wrapper"==Yi(a))var r=new Il([],!0)}for(i=r?i:n;++i<n;){var u=Yi(a=t[i]),d="wrapper"==u?zi(a):void 0;r=d&&ro(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?r[Yi(d[0])].apply(r,d[3]):1==a.length&&ro(a)?r[u]():r.thru(a)}return function(){var e=arguments,l=e[0];if(r&&1==e.length&&Ra(l))return r.plant(l).value();for(var i=0,o=n?t[i].apply(this,e):l;++i<n;)o=t[i].call(this,o);return o}})}function Ti(e,t,l,n,i,o,a,r,u,d){var s=128&t,c=1&t,v=2&t,p=24&t,m=512&t,E=v?void 0:yi(e);return function _(){for(var f=arguments.length,g=A(f),S=f;S--;)g[S]=arguments[S];if(p)var h=Ki(_),b=Ot(g,h);if(n&&(g=pi(g,n,i,p)),o&&(g=mi(g,o,a,p)),f-=b,p&&f<d){var y=Ut(g,h);return Ri(e,t,Ti,_.placeholder,l,g,y,r,u,d-f)}var D=c?l:this,C=v?D[e]:e;return f=g.length,r?g=Eo(g,r):m&&f>1&&g.reverse(),s&&u<f&&(g.length=u),this&&this!==$e&&this instanceof _&&(C=E||yi(C)),C.apply(D,g)}}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?xn(t,e):t;var n=xn(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=A(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],v=l.apply(void 0,c);return ro(e)&&fo(v,c),v.placeholder=n,So(v,e,t)}function wi(e){var t=ve[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 xi=pl&&1/Ht(new pl([,-0]))[1]==1/0?function(e){return new pl(e)}:Jr;function Mi(e){return function(t){var l=eo(t);return l==v?Ft(t):l==_?Wt(t):function(e,t){return dt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,o,a,r,u,d){var s=2&t;if(!s&&"function"!=typeof e)throw new _e(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 v=o,p=a;o=a=void 0}var m=s?void 0:zi(e),E=[e,t,i,o,a,v,p,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?pi(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=A(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,Ti,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?Ti.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=A(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:fo)(_,E),e,t)}function ki(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,v=!0,p=2&l?new wl:void 0;for(o.set(e,t),o.set(t,e);++c<r;){var m=e[c],E=t[c];if(n)var _=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==_){if(_)continue;v=!1;break}if(p){if(!pt(t,function(e,t){if(!It(p,t)&&(m===e||i(m,e,l,n,o)))return p.push(t)})){v=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v}function ji(e){return Ao(po(e,void 0,wo),e+"")}function $i(e){return cn(e,Sr,Zi)}function Gi(e){return cn(e,hr,Qi)}var zi=_l?function(e){return _l.get(e)}:Jr;function Yi(e){for(var t=e.name+"",l=fl[t],n=he.call(fl,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(Tl,"placeholder")?Tl:e).placeholder}function Vi(){var e=Tl.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=pe(e),at(Qt(e),function(t){return ze.call(e,t)}))}:iu,Qi=Qt?function(e){for(var t=[];e;)st(t,Zi(e)),e=je(e);return t}:iu,eo=vn;function to(e,t,l){for(var n=-1,i=(t=oi(t,e)).length,o=!1;++n<i;){var a=To(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?xa(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 pe(t)}function ro(e){var t=Yi(e),l=Tl[t];if("function"!=typeof l||!(t in Ll.prototype))return!1;if(e===l)return!0;var n=zi(l);return!!n&&e===n[0]}(sl&&eo(new sl(new ArrayBuffer(1)))!=b||cl&&eo(new cl)!=v||vl&&"[object Promise]"!=eo(vl.resolve())||pl&&eo(new pl)!=_||ml&&eo(new ml)!=S)&&(eo=function(e){var t=vn(e),l=t==m?e.constructor:void 0,n=l?Po(l):"";if(n)switch(n){case gl:return b;case Al:return v;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 vo(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in pe(l))}}function po(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=A(o);++i<o;)a[i]=n[t+i];i=-1;for(var r=A(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 _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fo=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=wn(l,i),a=e[o];e[o]=e[l],e[l]=a}return e.length=t,e}var yo,Do,Co=(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===Do.size&&Do.clear(),e}),Do=yo.cache,yo);function To(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)),_t(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)),_t(e,Vi(t,3),i,!0)}function wo(e){return null!=e&&e.length?nn(e,1):[]}function xo(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]?_n(t):[]}),Fo=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]?_n(l,Vi(t,2)):[]}),ko=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]?_n(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=Yl(e,t);return Rn(e,dt(t,function(e){return io(e,l)?+e:e}).sort(vi)),n});function $o(e){return null==e?e:dl.call(e)}var Go=Mn(function(e){return Xn(nn(e,1,Ma,!0))}),zo=Mn(function(e){var t=Uo(e);return Ma(t)&&(t=void 0),Xn(nn(e,1,Ma,!0),Vi(t,2))}),Yo=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}),Ct(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=Tl(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var na=ji(function(e){var t=e.length,l=t?e[0]:0,n=this.__wrapped__,i=function(t){return Yl(t,e)};return!(t>1||this.__actions__.length)&&n instanceof 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=fi(function(e,t,l){he.call(e,l)?++e[l]:zl(e,l,1)}),oa=Di(Oo),aa=Di(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=fi(function(e,t,l){he.call(e,l)?e[l].push(t):zl(e,l,[t])}),sa=Mn(function(e,t,l){var n=-1,i="function"==typeof t,o=xa(e)?A(e.length):[];return Zl(e,function(e){o[++n]=i?tt(t,e,l):fn(e,t,l)}),o}),ca=fi(function(e,t,l){zl(e,l,t)});function va(e,t){return(Ra(e)?dt:Cn)(e,Vi(t,3))}var pa=fi(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 _a(e,t,l){return t=l?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function fa(e,t){var n;if("function"!=typeof t)throw new _e(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 Fi(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 Fi(t,n,e,l,i)});function Sa(e,t,n){var i,o,a,r,u,d,s=0,c=!1,v=!1,p=!0;if("function"!=typeof e)throw new _e(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(f,t),c?m(e):r}function _(e){var l=e-d;return void 0===d||l>=t||l<0||v&&e-s>=a}function f(){var e=Ea();if(_(e))return g(e);u=go(f,function(e){var l=t-(e-d);return v?ol(l,a-(e-s)):l}(e))}function g(e){return u=void 0,p&&i?m(e):(i=o=void 0,r)}function A(){var e=Ea(),l=_(e);if(i=arguments,o=this,d=e,l){if(void 0===u)return E(d);if(v)return ui(u),u=go(f,t),m(d)}return void 0===u&&(u=go(f,t)),r}return t=or(t)||0,$a(n)&&(c=!!n.leading,a=(v="maxWait"in n)?il(or(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),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 _e(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 Da(e){if("function"!=typeof e)throw new _e(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 Ca=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)})}),Ta=Mn(function(e,t){return Fi(e,32,void 0,t,Ut(t,Ki(Ta)))}),Pa=Mn(function(e,t){return Fi(e,64,void 0,t,Ut(t,Ki(Pa)))}),Na=ji(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var La=Oi(pn),Ba=Oi(function(e,t){return e>=t}),Oa=gn(function(){return arguments}())?gn:function(e){return Ga(e)&&he.call(e,"callee")&&!ze.call(e,"callee")},Ra=A.isArray,wa=qe?Pt(qe):function(e){return Ga(e)&&vn(e)==h};function xa(e){return null!=e&&ja(e.length)&&!Ha(e)}function Ma(e){return Ga(e)&&xa(e)}var Fa=el||ou,ka=Xe?Pt(Xe):function(e){return Ga(e)&&vn(e)==u};function Ua(e){if(!Ga(e))return!1;var t=vn(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=vn(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 Ga(e){return null!=e&&"object"==typeof e}var za=Je?Pt(Je):function(e){return Ga(e)&&eo(e)==v};function Ya(e){return"number"==typeof e||Ga(e)&&vn(e)==p}function Ka(e){if(!Ga(e)||vn(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)==Ce}var Va=Ze?Pt(Ze):function(e){return Ga(e)&&vn(e)==E},qa=Qe?Pt(Qe):function(e){return Ga(e)&&eo(e)==_};function Xa(e){return"string"==typeof e||!Ra(e)&&Ga(e)&&vn(e)==f}function Ja(e){return"symbol"==typeof e||Ga(e)&&vn(e)==g}var Za=et?Pt(et):function(e){return Ga(e)&&ja(e.length)&&!!Me[vn(e)]},Qa=Oi(Dn),er=Oi(function(e,t){return e<=t});function tr(e){if(!e)return[];if(xa(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==v?Ft: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=Tt(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 _i(e,hr(e))}function rr(e){return null==e?"":qn(e)}var ur=gi(function(e,t){if(so(t)||xa(t))_i(t,Sr(t),e);else for(var l in t)he.call(t,l)&&Wl(e,l,t[l])}),dr=gi(function(e,t){_i(t,hr(t),e)}),sr=gi(function(e,t,l,n){_i(t,hr(t),e,n)}),cr=gi(function(e,t,l,n){_i(t,Sr(t),e,n)}),vr=ji(Yl),pr=Mn(function(e,t){e=pe(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 _r(e,t){return null!=e&&to(e,t,En)}var fr=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=l},$r(Yr)),gr=Pi(function(e,t,l){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),he.call(e,t)?e[t].push(l):e[t]=[l]},Vi),Ar=Mn(fn);function Sr(e){return xa(e)?Ml(e):yn(e)}function hr(e){return xa(e)?Ml(e,!0):function(e){if(!$a(e))return function(e){var t=[];if(null!=e)for(var l in pe(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)}),Dr=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}),_i(e,Gi(e),l),n&&(l=Vl(l,7,Hi));for(var i=t.length;i--;)Jn(l,t[i]);return l}),Cr=ji(function(e,t){return null==e?{}:function(e,t){return Bn(e,t,function(t,l){return _r(e,l)})}(e,t)});function Tr(e,t){if(null==e)return{};var l=dt(Gi(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()}),wr=bi(function(e,t,l){return e+(l?" ":"")+t.toLowerCase()}),xr=hi("toLowerCase"),Mr=bi(function(e,t,l){return e+(l?"_":"")+t.toLowerCase()}),Fr=bi(function(e,t,l){return e+(l?" ":"")+Ur(t)}),kr=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=To(t),zl(e,t,ga(e[t],e))}),e});function $r(e){return function(){return e}}var Gr=Ci(),zr=Ci(!0);function Yr(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 fn(l,e,t)}}),qr=Mn(function(e,t){return function(l){return fn(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(pt);function tu(e){return ao(e)?ht(To(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=wi("ceil"),du=Ni(function(e,t){return e/t},1),su=wi("floor"),cu=Ni(function(e,t){return e*t},1),vu=wi("round"),pu=Ni(function(e,t){return e-t},0);return Tl.after=function(e,t){if("function"!=typeof t)throw new _e(l);return e=nr(e),function(){if(--e<1)return t.apply(this,arguments)}},Tl.ary=_a,Tl.assign=ur,Tl.assignIn=dr,Tl.assignInWith=sr,Tl.assignWith=cr,Tl.at=vr,Tl.before=fa,Tl.bind=ga,Tl.bindAll=jr,Tl.bindKey=Aa,Tl.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ra(e)?e:[e]},Tl.chain=ta,Tl.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=A(Jt(n/t));i<n;)a[o++]=$n(e,i,i+=t);return a},Tl.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},Tl.concat=function(){var e=arguments.length;if(!e)return[];for(var t=A(e-1),l=arguments[0],n=e;n--;)t[n-1]=arguments[n];return st(Ra(l)?Ei(l):[l],nn(t,1))},Tl.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 _e(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)}})},Tl.conforms=function(e){return function(e){var t=Sr(e);return function(l){return ql(l,e,t)}}(Vl(e,1))},Tl.constant=$r,Tl.countBy=ia,Tl.create=function(e,t){var l=Pl(e);return null==t?l:Gl(l,t)},Tl.curry=function e(t,l,n){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Tl.curryRight=function e(t,l,n){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,l=n?void 0:l);return i.placeholder=e.placeholder,i},Tl.debounce=Sa,Tl.defaults=pr,Tl.defaultsDeep=mr,Tl.defer=ha,Tl.delay=ba,Tl.difference=Io,Tl.differenceBy=Lo,Tl.differenceWith=Bo,Tl.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):[]},Tl.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):[]},Tl.dropRightWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!0,!0):[]},Tl.dropWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!0):[]},Tl.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)):[]},Tl.filter=function(e,t){return(Ra(e)?at:ln)(e,Vi(t,3))},Tl.flatMap=function(e,t){return nn(va(e,t),1)},Tl.flatMapDeep=function(e,t){return nn(va(e,t),1/0)},Tl.flatMapDepth=function(e,t,l){return l=void 0===l?1:nr(l),nn(va(e,t),l)},Tl.flatten=wo,Tl.flattenDeep=function(e){return null!=e&&e.length?nn(e,1/0):[]},Tl.flattenDepth=function(e,t){return null!=e&&e.length?nn(e,t=void 0===t?1:nr(t)):[]},Tl.flip=function(e){return Fi(e,512)},Tl.flow=Gr,Tl.flowRight=zr,Tl.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},Tl.functions=function(e){return null==e?[]:dn(e,Sr(e))},Tl.functionsIn=function(e){return null==e?[]:dn(e,hr(e))},Tl.groupBy=da,Tl.initial=function(e){return null!=e&&e.length?$n(e,0,-1):[]},Tl.intersection=Mo,Tl.intersectionBy=Fo,Tl.intersectionWith=ko,Tl.invert=fr,Tl.invertBy=gr,Tl.invokeMap=sa,Tl.iteratee=Kr,Tl.keyBy=ca,Tl.keys=Sr,Tl.keysIn=hr,Tl.map=va,Tl.mapKeys=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){zl(l,t(e,n,i),e)}),l},Tl.mapValues=function(e,t){var l={};return t=Vi(t,3),rn(e,function(e,n,i){zl(l,n,t(e,n,i))}),l},Tl.matches=function(e){return Tn(Vl(e,1))},Tl.matchesProperty=function(e,t){return Pn(e,Vl(t,1))},Tl.memoize=ya,Tl.merge=br,Tl.mergeWith=yr,Tl.method=Vr,Tl.methodOf=qr,Tl.mixin=Xr,Tl.negate=Da,Tl.nthArg=function(e){return e=nr(e),Mn(function(t){return In(t,e)})},Tl.omit=Dr,Tl.omitBy=function(e,t){return Tr(e,Da(Vi(t)))},Tl.once=function(e){return fa(2,e)},Tl.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))},Tl.over=Zr,Tl.overArgs=Ca,Tl.overEvery=Qr,Tl.overSome=eu,Tl.partial=Ta,Tl.partialRight=Pa,Tl.partition=pa,Tl.pick=Cr,Tl.pickBy=Tr,Tl.property=tu,Tl.propertyOf=function(e){return function(t){return null==e?void 0:sn(e,t)}},Tl.pull=Ho,Tl.pullAll=Wo,Tl.pullAllBy=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,Vi(l,2)):e},Tl.pullAllWith=function(e,t,l){return e&&e.length&&t&&t.length?On(e,t,void 0,l):e},Tl.pullAt=jo,Tl.range=lu,Tl.rangeRight=nu,Tl.rearg=Na,Tl.reject=function(e,t){return(Ra(e)?at:ln)(e,Da(Vi(t,3)))},Tl.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},Tl.rest=function(e,t){if("function"!=typeof e)throw new _e(l);return Mn(e,t=void 0===t?t:nr(t))},Tl.reverse=$o,Tl.sampleSize=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),(Ra(e)?kl:kn)(e,t)},Tl.set=function(e,t,l){return null==e?e:Un(e,t,l)},Tl.setWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Un(e,t,l,n)},Tl.shuffle=function(e){return(Ra(e)?Ul:jn)(e)},Tl.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)):[]},Tl.sortBy=ma,Tl.sortedUniq=function(e){return e&&e.length?Kn(e):[]},Tl.sortedUniqBy=function(e,t){return e&&e.length?Kn(e,Vi(t,2)):[]},Tl.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):[]},Tl.spread=function(e,t){if("function"!=typeof e)throw new _e(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)})},Tl.tail=function(e){var t=null==e?0:e.length;return t?$n(e,1,t):[]},Tl.take=function(e,t,l){return e&&e.length?$n(e,0,(t=l||void 0===t?1:nr(t))<0?0:t):[]},Tl.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):[]},Tl.takeRightWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3),!1,!0):[]},Tl.takeWhile=function(e,t){return e&&e.length?Qn(e,Vi(t,3)):[]},Tl.tap=function(e,t){return t(e),e},Tl.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new _e(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})},Tl.thru=la,Tl.toArray=tr,Tl.toPairs=Pr,Tl.toPairsIn=Nr,Tl.toPath=function(e){return Ra(e)?dt(e,To):Ja(e)?[e]:Ei(Co(rr(e)))},Tl.toPlainObject=ar,Tl.transform=function(e,t,l){var n=Ra(e),i=n||Fa(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},Tl.unary=function(e){return _a(e,1)},Tl.union=Go,Tl.unionBy=zo,Tl.unionWith=Yo,Tl.uniq=function(e){return e&&e.length?Xn(e):[]},Tl.uniqBy=function(e,t){return e&&e.length?Xn(e,Vi(t,2)):[]},Tl.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xn(e,void 0,t):[]},Tl.unset=function(e,t){return null==e||Jn(e,t)},Tl.unzip=Ko,Tl.unzipWith=Vo,Tl.update=function(e,t,l){return null==e?e:Zn(e,t,ii(l))},Tl.updateWith=function(e,t,l,n){return n="function"==typeof n?n:void 0,null==e?e:Zn(e,t,ii(l),n)},Tl.values=Ir,Tl.valuesIn=function(e){return null==e?[]:Nt(e,hr(e))},Tl.without=qo,Tl.words=Hr,Tl.wrap=function(e,t){return Ta(ii(t),e)},Tl.xor=Xo,Tl.xorBy=Jo,Tl.xorWith=Zo,Tl.zip=Qo,Tl.zipObject=function(e,t){return li(e||[],t||[],Wl)},Tl.zipObjectDeep=function(e,t){return li(e||[],t||[],Un)},Tl.zipWith=ea,Tl.entries=Pr,Tl.entriesIn=Nr,Tl.extend=dr,Tl.extendWith=sr,Xr(Tl,Tl),Tl.add=ru,Tl.attempt=Wr,Tl.camelCase=Lr,Tl.capitalize=Br,Tl.ceil=uu,Tl.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)},Tl.clone=function(e){return Vl(e,4)},Tl.cloneDeep=function(e){return Vl(e,5)},Tl.cloneDeepWith=function(e,t){return Vl(e,5,t="function"==typeof t?t:void 0)},Tl.cloneWith=function(e,t){return Vl(e,4,t="function"==typeof t?t:void 0)},Tl.conformsTo=function(e,t){return null==t||ql(e,t,Sr(t))},Tl.deburr=Or,Tl.defaultTo=function(e,t){return null==e||e!=e?t:e},Tl.divide=du,Tl.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},Tl.eq=Ia,Tl.escape=function(e){return(e=rr(e))&&F.test(e)?e.replace(x,wt):e},Tl.escapeRegExp=function(e){return(e=rr(e))&&z.test(e)?e.replace(G,"\\$&"):e},Tl.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))},Tl.find=oa,Tl.findIndex=Oo,Tl.findKey=function(e,t){return Et(e,Vi(t,3),rn)},Tl.findLast=aa,Tl.findLastIndex=Ro,Tl.findLastKey=function(e,t){return Et(e,Vi(t,3),un)},Tl.floor=su,Tl.forEach=ra,Tl.forEachRight=ua,Tl.forIn=function(e,t){return null==e?e:on(e,Vi(t,3),hr)},Tl.forInRight=function(e,t){return null==e?e:an(e,Vi(t,3),hr)},Tl.forOwn=function(e,t){return e&&rn(e,Vi(t,3))},Tl.forOwnRight=function(e,t){return e&&un(e,Vi(t,3))},Tl.get=Er,Tl.gt=La,Tl.gte=Ba,Tl.has=function(e,t){return null!=e&&to(e,t,mn)},Tl.hasIn=_r,Tl.head=xo,Tl.identity=Yr,Tl.includes=function(e,t,l,n){e=xa(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&&ft(e,t,l)>-1},Tl.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)),ft(e,t,i)},Tl.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)},Tl.invoke=Ar,Tl.isArguments=Oa,Tl.isArray=Ra,Tl.isArrayBuffer=wa,Tl.isArrayLike=xa,Tl.isArrayLikeObject=Ma,Tl.isBoolean=function(e){return!0===e||!1===e||Ga(e)&&vn(e)==r},Tl.isBuffer=Fa,Tl.isDate=ka,Tl.isElement=function(e){return Ga(e)&&1===e.nodeType&&!Ka(e)},Tl.isEmpty=function(e){if(null==e)return!0;if(xa(e)&&(Ra(e)||"string"==typeof e||"function"==typeof e.splice||Fa(e)||Za(e)||Oa(e)))return!e.length;var t=eo(e);if(t==v||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},Tl.isEqual=function(e,t){return An(e,t)},Tl.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},Tl.isError=Ua,Tl.isFinite=function(e){return"number"==typeof e&&tl(e)},Tl.isFunction=Ha,Tl.isInteger=Wa,Tl.isLength=ja,Tl.isMap=za,Tl.isMatch=function(e,t){return e===t||Sn(e,t,Xi(t))},Tl.isMatchWith=function(e,t,l){return l="function"==typeof l?l:void 0,Sn(e,t,Xi(t),l)},Tl.isNaN=function(e){return Ya(e)&&e!=+e},Tl.isNative=function(e){if(uo(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hn(e)},Tl.isNil=function(e){return null==e},Tl.isNull=function(e){return null===e},Tl.isNumber=Ya,Tl.isObject=$a,Tl.isObjectLike=Ga,Tl.isPlainObject=Ka,Tl.isRegExp=Va,Tl.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Tl.isSet=qa,Tl.isString=Xa,Tl.isSymbol=Ja,Tl.isTypedArray=Za,Tl.isUndefined=function(e){return void 0===e},Tl.isWeakMap=function(e){return Ga(e)&&eo(e)==S},Tl.isWeakSet=function(e){return Ga(e)&&"[object WeakSet]"==vn(e)},Tl.join=function(e,t){return null==e?"":ll.call(e,t)},Tl.kebabCase=Rr,Tl.last=Uo,Tl.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):_t(e,At,i,!0)},Tl.lowerCase=wr,Tl.lowerFirst=xr,Tl.lt=Qa,Tl.lte=er,Tl.max=function(e){return e&&e.length?tn(e,Yr,pn):void 0},Tl.maxBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),pn):void 0},Tl.mean=function(e){return St(e,Yr)},Tl.meanBy=function(e,t){return St(e,Vi(t,2))},Tl.min=function(e){return e&&e.length?tn(e,Yr,Dn):void 0},Tl.minBy=function(e,t){return e&&e.length?tn(e,Vi(t,2),Dn):void 0},Tl.stubArray=iu,Tl.stubFalse=ou,Tl.stubObject=function(){return{}},Tl.stubString=function(){return""},Tl.stubTrue=function(){return!0},Tl.multiply=cu,Tl.nth=function(e,t){return e&&e.length?In(e,nr(t)):void 0},Tl.noConflict=function(){return $e._===this&&($e._=Te),this},Tl.noop=Jr,Tl.now=Ea,Tl.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)},Tl.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},Tl.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},Tl.parseInt=function(e,t,l){return l||null==t?t=0:t&&(t=+t),rl(rr(e).replace(Y,""),t||0)},Tl.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 wn(e,t)},Tl.reduce=function(e,t,l){var n=Ra(e)?ct:yt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Zl)},Tl.reduceRight=function(e,t,l){var n=Ra(e)?vt:yt,i=arguments.length<3;return n(e,Vi(t,4),l,i,Ql)},Tl.repeat=function(e,t,l){return t=(l?oo(e,t,l):void 0===t)?1:nr(t),xn(rr(e),t)},Tl.replace=function(){var e=arguments,t=rr(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Tl.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[To(t[n])];void 0===o&&(n=i,o=l),e=Ha(o)?o.call(e):o}return e},Tl.round=vu,Tl.runInContext=e,Tl.sample=function(e){return(Ra(e)?Fl:Fn)(e)},Tl.size=function(e){if(null==e)return 0;if(xa(e))return Xa(e)?jt(e):e.length;var t=eo(e);return t==v||t==_?e.size:yn(e).length},Tl.snakeCase=Mr,Tl.some=function(e,t,l){var n=Ra(e)?pt:Gn;return l&&oo(e,t,l)&&(t=void 0),n(e,Vi(t,3))},Tl.sortedIndex=function(e,t){return zn(e,t)},Tl.sortedIndexBy=function(e,t,l){return Yn(e,t,Vi(l,2))},Tl.sortedIndexOf=function(e,t){var l=null==e?0:e.length;if(l){var n=zn(e,t);if(n<l&&Ia(e[n],t))return n}return-1},Tl.sortedLastIndex=function(e,t){return zn(e,t,!0)},Tl.sortedLastIndexBy=function(e,t,l){return Yn(e,t,Vi(l,2),!0)},Tl.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var l=zn(e,t,!0)-1;if(Ia(e[l],t))return l}return-1},Tl.startCase=Fr,Tl.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},Tl.subtract=pu,Tl.sum=function(e){return e&&e.length?Dt(e,Yr):0},Tl.sumBy=function(e,t){return e&&e.length?Dt(e,Vi(t,2)):0},Tl.template=function(e,t,l){var n=Tl.templateSettings;l&&oo(e,t,l)&&(t=void 0),e=rr(e),t=sr({},t,n,ki);var i,o,a=sr({},t.imports,n.imports,ki),r=Sr(a),u=Nt(a,r),d=0,s=t.interpolate||ue,c="__p += '",v=me((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),p="//# sourceURL="+(he.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xe+"]")+"\n";e.replace(v,function(t,l,n,a,r,u){return n||(n=a),c+=e.slice(d,u).replace(de,xt),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,p+"return "+c).apply(void 0,u)});if(E.source=c,Ua(E))throw E;return E},Tl.times=function(e,t){if((e=nr(e))<1||e>9007199254740991)return[];var l=4294967295,n=ol(e,4294967295);e-=4294967295;for(var i=Ct(n,t=Vi(t));++l<e;)t(l);return i},Tl.toFinite=lr,Tl.toInteger=nr,Tl.toLength=ir,Tl.toLower=function(e){return rr(e).toLowerCase()},Tl.toNumber=or,Tl.toSafeInteger=function(e){return e?Kl(nr(e),-9007199254740991,9007199254740991):0===e?e:0},Tl.toString=rr,Tl.toUpper=function(e){return rr(e).toUpperCase()},Tl.trim=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return Tt(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("")},Tl.trimEnd=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.slice(0,Gt(e)+1);if(!e||!(t=qn(t)))return e;var n=$t(e);return ri(n,0,Bt(n,$t(t))+1).join("")},Tl.trimStart=function(e,t,l){if((e=rr(e))&&(l||void 0===t))return e.replace(Y,"");if(!e||!(t=qn(t)))return e;var n=$t(e);return ri(n,Lt(n,$t(t))).join("")},Tl.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 v=u.lastIndexOf(i);v>-1&&(u=u.slice(0,v))}return u+n},Tl.unescape=function(e){return(e=rr(e))&&M.test(e)?e.replace(w,zt):e},Tl.uniqueId=function(e){var t=++be;return rr(e)+t},Tl.upperCase=kr,Tl.upperFirst=Ur,Tl.each=ra,Tl.eachRight=ua,Tl.first=xo,Xr(Tl,(au={},rn(Tl,function(e,t){he.call(Tl.prototype,t)||(au[t]=e)}),au),{chain:!1}),Tl.VERSION="4.17.21",nt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Tl[e].placeholder=Tl}),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(Yr)},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 fn(l,e,t)})}),Ll.prototype.reject=function(e){return this.filter(Da(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=Tl[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);i&&(Tl.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(Tl,st([e],a));return n&&c?t[0]:t};d&&l&&"function"==typeof u&&1!=u.length&&(r=d=!1);var c=this.__chain__,v=!!this.__actions__.length,p=o&&!c,m=r&&!v;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 p&&m?e.apply(this,a):(E=this.thru(s),p?n?E.value()[0]:E.value():E)})}),nt(["pop","push","shift","sort","splice","unshift"],function(e){var t=fe[e],l=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Tl.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=Tl[t];if(l){var n=l.name+"";he.call(fl,n)||(fl[n]=[]),fl[n].push({name:t,func:l})}}),fl[Ti(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,v=0,p=ol(u,this.__takeCount__);if(!l||!n&&i==u&&p==u)return ei(e,this.__actions__);var m=[];e:for(;u--&&v<p;){for(var E=-1,_=e[d+=t];++E<c;){var f=s[E],g=f.type,A=(0,f.iteratee)(_);if(2==g)_=A;else if(!A){if(1==g)continue e;break e}}m[v++]=_}return m},Tl.prototype.at=na,Tl.prototype.chain=function(){return ta(this)},Tl.prototype.commit=function(){return new Il(this.value(),this.__chain__)},Tl.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__++]}},Tl.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},Tl.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)},Tl.prototype.toJSON=Tl.prototype.valueOf=Tl.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Tl.prototype.first=Tl.prototype.head,mt&&(Tl.prototype[mt]=function(){return this}),Tl}();ze?((ze.exports=Yt)._=Yt,Ge._=Yt):$e._=Yt}).call(A)});const Cn=e=>{var n,a;let{t:r,config:u,formData:d,setError:s,clearErrors:c,formState:v,index:p,setFieldReports:m,documentList:E}=e;Digit.ULBService.getCurrentTenantId();const _=Digit.ULBService.getStateId(),[f,g]=t.useState((null==d||null===(n=d.FeildReports)||void 0===n||null===(a=n[p])||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:D}=i.useLocation();D.includes("/modify-application/")&&(y="update");const{isLoading:C}=Digit.Hooks.pt.usePropertyMDMS(_,"TradeLicense",["documentObj"]);window.location.href.includes("renew-application-details");let T=[];return E&&E.map(e=>{T.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==f?void 0:f.length)>0&&(e.FieldReports[p]={...e.FieldReports[p],Documents:f}),e&&null!=e&&e.FieldReports&&(null==e?void 0:e.FieldReports.length)>0&&f.length>0&&m(e.FieldReports)})()},[f]),C?l.createElement(o.Loader,null):l.createElement("div",null,null==T?void 0:T.map((e,t)=>l.createElement("div",null,l.createElement(Tn,{key:t,document:e,action:y,t:r,id:"obps-doc-"+t,error:A,setError:S,setDocuments:g,documents:f,formData:d,setFormError:s,clearFormErrors:c,config:u,formState:v,stateId:_}))),A&&l.createElement(o.Toast,{label:A,onClose:()=>S(null),error:!0}))};function Tn(e){let{t:n,document:i,setDocuments:a,documents:r,formData:u,setFormError:d,clearFormErrors:s,config:c,formState:v,stateId:p={stateId:p}}=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),[D,C]=t.useState([]),T=()=>{var e,t;let l=null===(e=v.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==_||!_.documentType||0!=r.filter(e=>e.documentType===(null==_?void 0:_.documentType)).length&&D.filter(e=>{var t;return(null==e||null===(t=e.file)||void 0===t?void 0:t.documentType)===(null==_?void 0:_.documentType)}).length===r.filter(e=>e.documentType===(null==_?void 0:_.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==_?void 0:_.documentType));if(null!=_&&_.id)return[...t,{documentType:null==_?void 0:_.documentType,fileStoreId:S,tenantId:E,id:null==_?void 0:_.id}];{let e=[];return D.map(t=>{var l,n;e.push({documentType:null==_?void 0:_.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&&T():window.location.href.includes("renew-application-details")||(S&&null!=_&&_.documentType?S&&null!=_&&_.documentType&&T():(()=>{var e,t;let l=null===(e=v.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,_,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,v,p,m,E,_,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)&&(f({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===(v=u.documents)||void 0===v||null===(p=v.documents)||void 0===p||null===(m=p[e])||void 0===m?void 0:m.id}),h(null==u||null===(E=u.documents)||void 0===E||null===(_=E.documents)||void 0===_||null===(g=_[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%"}},""+n(""+(null==i?void 0:i.documentType.replaceAll(".","_")))),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(o.MultiUploadWrapper,{module:"BPA",tenantId:p,getFormState:e=>function(e,t){let l=Object.fromEntries(e),n=Object.values(l);C(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&&f({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 Pn=()=>({InspectionDate:"",InspectionTime:"",Checklist:[],Documents:[],key:Date.now()}),Nn=e=>{var n;const{unit:i,index:r,allFieldReport:u,removeUnit:d,setFieldReports:s,t:c,formData:v,config:p,onSelect:m,userType:E,setError:_,clearErrors:f,formState:g,isErrors:A,setIsErrors:S,questionList:h,documentList:b}=e,{control:y,formState:D,watch:C,trigger:T,getValues:P}=a.useForm(),N=C(),{errors:I}=D,L=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(()=>{T()},[]),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:[]};Dn.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})),T())},[N]),t.useEffect(()=>{var e;Object.keys(I).length&&!Dn.isEqual((null===(e=g.errors[p.key])||void 0===e?void 0:e.type)||{},I)?_(p.key,{type:I}):!Object.keys(I).length&&g.errors[p.key]&&A&&f(p.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,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(Cn,{t:c,config:p,onSelect:m,userType:E,formData:v,setError:_,clearErrors:f,formState:g,index:r,setFieldReports:s,documentList:b}))))},In=e=>l.createElement("h1",{className:"heading-m"},e.label),Ln=()=>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"})),Bn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ln,null)),On=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p,moduleCode:m}=e;const{data:E,isLoading:_}=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:f,data:g}=Digit.Hooks.pt.useMDMS(u,p,"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,D]=t.useState([]),[C,T]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState(null),[R,w]=t.useState([]),[x,M]=t.useState(null),[F,k]=t.useState(!1);function U(e){N(e.target.files[0])}return t.useEffect(()=>{var e;g&&g["egf-master"]&&w(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),t.useEffect(()=>{var e;D(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=c(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:x,setSelectedFinancialYear:M}):(e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${null==i?void 0:i.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:i.isTerminateState||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?null:n(v||"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:C,setSelectedApprover:T,selectFile:U,uploadedFile:I,setUploadedFile:L,businessService:p}))},[r,y,R,x,I]),r&&A.form?l.createElement(o.Modal,{headerBarMain:l.createElement(In,{label:a(A.label.heading)}),headerBarEnd:l.createElement(Bn,{onClick:d}),actionCancelLabel:a(A.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(A.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!x:_||(null==r?void 0:r.docUploadRequired)&&!I,formId:"modal-action"},f?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"};v.creationReason="STATUS",s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:{...v,workflow:t}})}else if(null!=r&&r.showFinancialYearsModal)s({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==x?void 0:x.name,propertyId:null==v?void 0:v.propertyId,tenantId:u,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:p,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!C?[]:[C],I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:I}]),s({Property:{...v,workflow:t}})}},defaultValues:h,formId:"modal-action"})):l.createElement(o.Loader,null)},Rn=e=>l.createElement("h1",{className:"heading-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"})),xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(wn,null)),Mn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p}=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:_}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[f,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,D]=t.useState({}),[C,T]=t.useState(null),[P,N]=t.useState(null),[I,L]=t.useState(null),[B,O]=t.useState([]),[R,w]=t.useState(null);function x(e){T(e.target.files[0])}return t.useEffect(()=>{var e;_&&_["egf-master"]&&O(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),t.useEffect(()=>{var e;b(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),t.useEffect(()=>{!function(){try{L(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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?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)}}()},[C]),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,v=!0;return"SENDBACKTOCITIZEN"!=(null==n?void 0:n.action)&&"APPROVE"!=(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_NEWTL_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("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:D,selectFile:x,uploadedFile:P,setUploadedFile:N,businessService:p}))},[r,h,B,R,P]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Rn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(xn,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(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){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]:null,wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:null},s({Licenses:[v]})},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},Fn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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"})),Un=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(kn,null)),Hn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p}=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({}),[D,C]=t.useState(null),[T,P]=t.useState(null),[N,I]=t.useState(null),L=!!Digit.Utils.browser.isMobile();function B(e){C(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(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",D,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)}}()},[D]),t.useEffect(()=>{r&&f((e=>{let{t:t,action:n,approvers:i,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:d,setUploadedFile:s,businessService:c,error:v}=e,p=!0;return"SENDBACKTOCITIZEN"==(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_BPAREG_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("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:v})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:y,selectFile:B,uploadedFile:T,setUploadedFile:P,businessService:p,error:N}))},[r,S,T,N]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Fn,{label:a(_.label.heading)}),headerBarEnd:l.createElement(Un,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(_.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:_.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){v={...v,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:T?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]:null},s({Licenses:[v]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},Wn=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),jn=()=>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"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jn,null)),Gn=e=>{var n,i,a,r,d,s,v,p,m,E,_,f;let{t:g,action:A,tenantId:S,closeModal:h,submitAction:b,applicationDetails:y,applicationData:D,businessService:C,workflowDetails:T,blockReason:P}=e;console.log("applicationData",D),console.log("workflowDetails",T),Digit.Hooks.obps.useObpsAPI(null!==(n=D)&&void 0!==n&&null!==(i=n.landInfo)&&void 0!==i&&null!==(a=i.address)&&void 0!==a&&a.city?null===(r=D)||void 0===r||null===(d=r.landInfo)||void 0===d||null===(s=d.address)||void 0===s?void 0:s.city:S,!1);const{data:N,isLoading:I}=Digit.Hooks.useEmployeeSearch(S,{roles:null==T||null===(v=T.data)||void 0===v||null===(p=v.initialActionState)||void 0===p||null===(m=p.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===(_=E[0])||void 0===_||null===(f=_.assigneeRoles)||void 0===f?void 0:f.map(e=>({code:e})),isActive:!0},{enabled:!(null!=A&&A.isTerminateState)}),[L,B]=(u.useQueryClient(),t.useState({})),[O,R]=t.useState({}),[w,x]=t.useState([]),[M,F]=t.useState([]),[k,U]=t.useState({}),[H,W]=t.useState({}),[j,$]=t.useState(null),[G,z]=t.useState(null),[Y,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;x(null==N||null===(e=N.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[N]),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=c(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?z(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(()=>{F(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:v,selectedApprover:p,setSelectedApprover:m,selectedBlockReason:E,setBlockReason:_,selectFile:f,uploadedFile:g,setUploadedFile:A,assigneeLabel:S,businessService:h,error:b,blockReasonFiltered:y}=e,D=!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)||(D=!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||D||"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||D||"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:v,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:p})},{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:_,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:f,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:w,selectedApprover:k,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:W,selectFile:J,uploadedFile:G,setUploadedFile:z,businessService:C,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:M}))},[A,w,V,G,Y]),A&&L.form?l.createElement(o.Modal,{headerBarMain:l.createElement(Wn,{label:g(L.label.heading)}),headerBarEnd:l.createElement($n,{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,v,p,m,E,_,f,C,P,N,I,L,B,O,R,w,x;D={...D,documents:te(),additionalDetails:{...null===(t=D)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(D),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==T||null===(i=T.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==T||null===(u=T.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!=k&&k.uuid?[null==k?void 0:k.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(v=T.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(m=p[0])||void 0===m||null===(E=m.state)||void 0===E?void 0:E.applicationStatus)?[null==T||null===(_=T.data)||void 0===_||null===(f=_.processInstances)||void 0===f||null===(C=f[0])||void 0===C||null===(P=C.assigner)||void 0===P?void 0:P.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,varificationDocuments:G?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:G}]:null},action:null==A?void 0:A.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==T||null===(N=T.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==T||null===(O=T.data)||void 0===O||null===(R=O.processInstances)||void 0===R||null===(w=R[0])||void 0===w||null===(x=w.assigner)||void 0===x?void 0:x.uuid]:null!=k&&k.uuid?[null==k?void 0:k.uuid]:null,wfDocuments:G?[{documentType:(null==A?void 0:A.action)+" DOC",fileName:null==j?void 0:j.name,fileStoreId:G}]: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=D)||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=D)||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=D)||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=D)||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 v,p,m;D.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",D.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",D.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",D.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),D.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==y||null===(v=y.nocData)||void 0===v?void 0:v.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===(p=e[0])||void 0===p||null===(m=p.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,v,p,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===(v=e.Noc)||void 0===v||null===(p=v.applicationStatus)||void 0===p?void 0:p.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(E=e.Noc)||void 0===E?void 0:E.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==D.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:D},(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:D},(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)},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"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yn,null)),Vn=e=>{var n,a;let{t:r,action:d,tenantId:s,closeModal:v,submitAction:p,applicationData:m,businessService:E}=e;const{data:_,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==d||null===(n=d.assigneeRoles)||void 0===n||null===(a=n.map)||void 0===a?void 0:a.call(n,e=>({code:e})),isActive:!0},{enabled:!(null!=d&&d.isTerminateState)}),[g,A]=(u.useQueryClient(),t.useState({})),[S,h]=t.useState({}),[b,y]=t.useState([]),[D,C]=t.useState({}),[T,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==_||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{B(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)B(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))B(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",T,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?I(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):B(r("CS_FILE_UPLOAD_ERROR"))})},function(){B(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),t.useEffect(()=>{d&&A((e=>{var t;let{t:n,action:i,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:d,uploadedFile:s,setUploadedFile:c,assigneeLabel:v,businessService:p,error:m}=e,E=!1;"REVOCATE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)||(E=!0);let _=!1;return"APPROVE"!=(null==i?void 0:i.action)&&"REJECT"!=(null==i?void 0:i.action)&&"AUTO_APPROVE"!=i.action&&"AUTO_REJECT"!=i.action||(_=!0),{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${p}_${null==i?void 0:i.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:i.isTerminateState||_?null:n(v||"WF_ROLE_"+(null===(t=i.assigneeRoles)||void 0===t?void 0:t[0])),type:"dropdown",populators:i.isTerminateState||_?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:r,action:d,approvers:b,selectedApprover:D,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:I,businessService:E,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:L}))},[d,b,N,L]),d&&g.form?l.createElement(o.Modal,{headerBarMain:l.createElement(zn,{label:r(g.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:v}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:v,actionSaveLabel:r(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"}:{}},f?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==d?void 0:d.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=D&&D.uuid?[null==D?void 0:D.uuid]:null,documents:N?[{documentType:(null==d?void 0:d.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:N}]:null},documents:o},p({Noc:m},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(o.Loader,null)},qn=e=>l.createElement("h1",{className:"heading-m"},e.label),Xn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xn,null)),Zn=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}},Qn=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:v,applicationData:p,businessService:m}=e;const{data:E,isLoading:_}=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,g]=t.useState({}),[A,S]=t.useState({}),[h,b]=t.useState([]),[y,D]=t.useState({}),[C,T]=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){T(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(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))L(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,l,n,i;(null==e||null===(t=e.data)||void 0===t||null===(l=t.files)||void 0===l?void 0:l.length)>0?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)}}()},[C]),t.useEffect(()=>{var e,t,n,i;"DisconnectWSConnection"==(null===(e=p)||void 0===e||null===(t=e.processInstance)||void 0===t?void 0:t.businessService)||"DisconnectSWConnection"==(null===(n=p)||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:u,selectFile:d,uploadedFile:c,setUploadedFile:v,businessService:p,error:m}=e,E=!0,_=!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)||(_=!0),{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: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:u,selected:r}):null},_&&{label:n("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!_,type:"custom",populators:_?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,t)=>l.createElement(o.DatePicker,s({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:d,onDelete:()=>{v(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:D,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:v,error:p}=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==v?void 0:v.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:p,iserror:p,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:h,selectedApprover:y,setSelectedApprover:D,selectFile:R,uploadedFile:P,setUploadedFile:N,businessService:m,error:I}))},[r,h,P,I]),r&&f.form?l.createElement(o.Modal,{headerBarMain:l.createElement(qn,{label:a(f.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:d}),actionCancelLabel:a(f.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:a(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:B&&O?{width:"100%",height:"auto"}:{}},_?l.createElement(o.Loader,null):l.createElement(o.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,l,n,i,o,a,d,s,c,m;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var E,_,f,g,A,S,h,b,D;const t={...null===(E=p)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,comments:null!=e&&e.comments?e.comments:null},l={...null===(f=p)||void 0===f?void 0:f.billAmendmentDetails,workflow:{businessId:null===(g=p)||void 0===g||null===(A=g.billAmendmentDetails)||void 0===A?void 0:A.amendmentId,action:null==r?void 0:r.action,tenantId:u,businessService:null!==(S=p)&&void 0!==S&&null!==(h=S.applicationType)&&void 0!==h&&h.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=p)&&void 0!==b&&null!==(D=b.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==C?void 0:C.name,fileStoreId:P}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.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==C?void 0:C.name,fileStoreId:P}]:[]}};v({AmendmentUpdate:l})}else{if(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]:[],assignes:null!=y&&y.uuid?[{uuid:null==y?void 0:y.uuid}]:[],wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:P}]:null,processInstance:{...null===(l=p)||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==C?void 0:C.name,fileStoreId:P}]:[]}},null!=e&&e.date&&null!==(n=p)&&void 0!==n&&null!==(i=n.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=mt(null==e?void 0:e.date);p.disconnectionExecutionDate=Zn(t)}else if(null!=e&&e.date){const t=mt(null==e?void 0:e.date);p.connectionExecutionDate=Zn(t)}var T;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(d=p)||void 0===d||null===(s=d.processInstance)||void 0===s?void 0:s.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(T=p)||void 0===T?void 0:T.serviceType)?v({WaterConnection:p,disconnectRequest:!0}):v({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(c=p)||void 0===c?void 0:c.applicationType))v({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(m=p)||void 0===m?void 0:m.applicationType))v({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var N,I,L,B,O,R,w,x,M,F,k,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&&(p.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&&(p.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&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyReason)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.adhocRebateReason)||""),"WATER"==(null===(H=p)||void 0===H?void 0:H.serviceType)?v({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):v({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:A,formId:"modal-action"})):l.createElement(o.Loader,null)},ei=e=>l.createElement("h1",{className:"heading-m"},e.label),ti=()=>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"})),li=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ti,null)),ni=e=>{var n,i;let{t:a,action:r,tenantId:u,closeModal:d,submitAction:s,applicationData:v,businessService:p,moduleCode:m}=e;console.log("applicationData",v);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),[D,C]=t.useState(null),[T,P]=t.useState(null),[N,I]=t.useState(null),[L,B]=t.useState(!1);function O(e){C(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(D){const e=function(){if(D.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",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?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)}}()},[D]),t.useEffect(()=>{r&&f((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:T,setUploadedFile:P,businessService:p}))},[r,S,T]),r&&_.form?l.createElement(o.Modal,{headerBarMain:l.createElement(ei,{label:a(_.label.heading)}),headerBarEnd:l.createElement(li,{onClick:d}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:d,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",s({PetRegistrationApplications:[{...v,workflow:t}]})}let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!b?[]:[b],T&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:T}]),s({PetRegistrationApplications:[{...v,workflow:t}]})},defaultValues:g,formId:"modal-action"})):l.createElement(o.Loader,null)},ii=e=>null!=e&&e.businessService.includes("PT")?l.createElement(On,e):null!=e&&e.businessService.includes("ptr")?l.createElement(ni,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")||null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Mn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(Hn,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Gn,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Vn,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Qn,e):void 0,oi=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)||[],v=Digit.ULBService.getStateId(),[p,m]=t.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[E,_]=t.useState(null),[f,g]=t.useState([]),[A,S]=t.useState(!0),[h,b]=t.useState(!1),[y,D]=t.useState(!1),{isLoading:C,data:T}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"]),{isLoading:P,data:N}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]);return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=T&&null!==(e=T.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==T||null===(o=T.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)},[!C,!P]),t.useEffect(()=>{let e=0;f.map(t=>{let l=!1;p.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||!(p.length>0))},[p,h]),t.useEffect(()=>{D("DOC_VERIFICATION_INPROGRESS"===s&&(null==c?void 0:c.length)>0)},[r,d]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==f?void 0:f.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(ai,{key:t,index:t,document:e,t:o,error:E,setError:_,setDocuments:m,documents:p,setCheckRequiredFields:b,applicationStatus:s,actions:c,bpaTaxDocuments:f,checkEnablingDocs:y}))))};function ai(e){var n,i;let{t:a,document:r,setDocuments:u,documents:d,index:s,bpaTaxDocuments:c,checkEnablingDocs:v}=e;const p=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],m=Digit.ULBService.getStateId(),[E,_]=t.useState(p?{...p,active:!0,code:null==p?void 0:p.documentType,i18nKey:null==p?void 0:p.documentType}:1===(null==r||null===(n=r.dropdownData)||void 0===n?void 0:n.length)?null==r?void 0:r.dropdownData[0]:{}),[f,g]=t.useState(null),[A,S]=t.useState(()=>(null==p?void 0:p.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==f?void 0:f.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(()=>{},[f]),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(Gl,{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:E,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: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 ri(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],s=Digit.ULBService.getStateId(),[v,p]=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==_?void 0:_.length)||null===_?l:[...null==l?void 0:l.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==i||null===(t=i.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:_,documentUid:_,fileName:(null==m?void 0:m.name)||""}]})},[_]),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=c(function(){return f(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?f(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:s,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 ui=e=>{var n;let{t:i,noc:a,docs:r,isNoc:u,applicationData:d,NOCdata:s,bpaActionsDetails:c}=e;Digit.ULBService.getStateId();const v=Digit.ULBService.getStateId(),p=(null==d?void 0:d.status)||"",m=(null==c||null===(n=c.data)||void 0===n?void 0:n.nextActions)||[],{data:E}=Digit.Hooks.obps.useMDMS(v,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:_}=Digit.Hooks.obps.useMDMS(v,"BPA",["DocTypeMapping"],{enabled:!u}),{data:f}=Digit.Hooks.obps.useMDMS(v,"common-masters",["DocumentType"]),[g,A]=t.useState([]),[S,h]=t.useState([]),[b,y]=t.useState(!1),[D,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[T,P]=t.useState(null),N=window.location.href.includes("/employee/");return t.useEffect(()=>{var e;A(null==f||null===(e=f["common-masters"])||void 0===e?void 0:e.DocumentType)},[f]),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==_||null===(s=_.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 v=[];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))}),v.push(e)}),h(v))},[E,g]),t.useEffect(()=>{y("NOC_VERIFICATION_INPROGRESS"===p&&(null==m?void 0:m.length)>0)},[d,c]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(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(Gl,{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(ri,{key:t,document:e,t:i,error:T,setError:P,setNocDocuments:C,nocDocuments:D,checkEnablingDocs:b}))))},di=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 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?{...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: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=[...d];t.splice(e,1),s([...t])})(t)}))),l.createElement(o.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:i("BPA_ADD_MORE"),onClick:()=>{s([...d,{label:""}])}}))};function si(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 vi(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 pi=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))},mi=e=>{var i,a,r;let{data:u,OpenImage:d,privacy:s={}}=e;const[c,v]=t.useState(!1),{t:p}=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,p("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(pi,{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,p("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:()=>{v(!0)},style:{color:"#800000"}},p("View More")):null),c&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{v(!1)},style:{color:"#800000"}},p("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,p("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 Ei(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 _i(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 fi=e=>{var i,a,r,u,d;let{wsAdditionalDetails:s}=e;const{t:c}=n.useTranslation();let v=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[l,n]=t.split("=");return e[l]=n?decodeURIComponent(n.replace(/\+/g," ")):"",e},{}):{};var p;const m=null==v?void 0:v.mode;var{connectionDetails:E,plumberDetails:_,roadCuttingDetails:f,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==_?void 0:_.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==f?void 0:f.map(e=>{var t;return l.createElement("div",{style:(null==f?void 0:f.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:""})))))))},gi=[{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"}],Ai=[{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"}],Si=e=>{var i,a,r,u;let{wsAdditionalDetails:d}=e;const{t:c}=n.useTranslation(),[v,p,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[E,f,g]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),A=!(null==d||null===(i=d.additionalDetails)||void 0===i||!i.isPaid),[S,h]=t.useState(!1),[b,y]=t.useState(v||{}),[D,C]=t.useState(null),[T,P]=t.useState(d.additionalDetails.data?d.additionalDetails.data:{}),[N,I]=t.useState(d.additionalDetails.values?d.additionalDetails.values:[]),L=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(L,"BillingService",["TaxHeadMaster"]),t.useEffect(()=>{var e,t,n;const i={...null==d||null===(e=d.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==v||null===(n=v.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,u,s,c,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==v||null===(o=v.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==v||null===(r=v.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==v||null===(s=v.billDetails)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.taxAmount)}];I(e),P(null==v||null===(m=v.billDetails)||void 0===m?void 0:m[0])}else p(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"})),w=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(R,null)),x=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==T?void 0:T.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!=d&&null!==(a=d.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(w,{onClick:()=>{y(v),h(!1)}}),actionCancelLabel:c("PT_CANCEL"),actionCancelOnSubmit:()=>{y(v),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==d||null===(n=d.additionalDetails)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:c("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,u,s,v,m,E,g,A;const e=null==d||null===(o=d.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==d||null===(r=d.additionalDetails)||void 0===r||null===(u=r.appDetails)||void 0===u?void 0:u.tenantId,l={...null==d||null===(s=d.additionalDetails)||void 0===s||null===(v=s.appDetails)||void 0===v?void 0:v.additionalDetails,...b};d.additionalDetails.appDetails.additionalDetails=l;const n={CalculationCriteria:"WATER"==(null==d||null===(m=d.additionalDetails)||void 0===m||null===(E=m.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:d.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:d.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==d||null===(g=d.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,v,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===(v=c[0])||void 0===v?void 0:v.taxAmount}];f(mt(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,p(b),h(!1)}).catch(e=>{var t,l,n,i,o,a;C({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(l=t.data)&&void 0!==l&&null!==(n=l.Errors[0])&&void 0!==n&&n.message?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 C({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:gi,optionKey:"title",select:e=>x("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,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>x("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,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>x("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:Ai,optionKey:"title",select:e=>x("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:c})),"PT_OTHERS"===(null==b||null===(u=b.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(o.CardLabel,null,c("PT_REASON")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:c,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>x("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,s({style:{background:"#FAFAFA"},t:c,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>x("adhocRebate",!1,e)},B={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:c("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),D&&l.createElement(o.Toast,{style:{zIndex:"10000"},warning:null==D?void 0:D.isWarning,error:null==D||!D.isWarning,label:c(null==D?void 0:D.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},hi=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"})))},bi=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(hi,{style:{display:"inline",marginBottom:"5px"}})," "+t(r),l.createElement("div",null," "+t(u)))))},yi=e=>{var i,a,r,u,d,s,c;let{wsAdditionalDetails:v}=e;const{t:p}=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!=v&&null!==(i=v.additionalDetails)&&void 0!==i&&i.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=v.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),f(t),E(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},p("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(o.Modal,{headerBarMain:l.createElement(g,{label:p("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"}},p("WS_APPLICATION_FEE_HEADER")),null==_||null===(a=_.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:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==_?void 0:_.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(o.CardSectionHeader,{style:{margin:"10px 0px"}},p("WS_SERVICE_FEE_HEADER")),null==_||null===(u=_.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:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==_?void 0:_.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==_||null===(s=_.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:""+p(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(o.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+p("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==_?void 0:_.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Di={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:{}},Ci=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:Di.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Di.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Di.cell,...Di.cellLeft,...Di.cellHeader}},r("CS_BILL_PERIOD")),i.map((e,t)=>l.createElement("th",{style:{...Di.cell,...i.length==t+1?Di.cellRight:{},...Di.cellHeader},key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Di.cell,...Di.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),i.map((t,n)=>l.createElement("td",{style:{...Di.cell,textAlign:"left",...i.length==n+1?Di.cellRight:{},whiteSpace:"pre"},key:n,numeric:!0},n>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Di.cell,...Di.cellLeft}}),i.map((e,t)=>t==i.length-1?l.createElement("td",{style:{...Di.cell,...Di.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},a):t==i.length-2?l.createElement("td",{style:{...Di.cell,textAlign:"left"},key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Di.cell,key:t,numeric:!0})))))))},Ti={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))"}},Pi=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 v="₹ "+((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 p={};!d||Object.keys(d).map((e,t)=>{Object.keys(d[e]).map(t=>{p[t]=d[e]&&d[e][t]&&d[e][t].order||0})});let m=[];m=Object.keys(p),m.sort((e,t)=>p[e]-p[t]);const[E,_]=t.useState(!1);return 0==c||c<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Ti.headerStyle},u("CS_ARREARS_DETAILS")),E&&l.createElement(Ci,{headers:[...m],values:d,arrears:v}),!E&&l.createElement("div",{style:Ti.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{_(!0)}},u("CS_SHOW_CARD"))),E&&l.createElement("div",{style:Ti.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{_(!1)}},u("CS_HIDE_CARD"))))};function Ni(e){var a,r,u,d,s,c,v,p,m,E,f,g,A,S;let{applicationDetails:h,demandData:b,workflowDetails:y,isDataLoading:D,applicationData:C,totalDemandTax:T,timelineStatusPrefix:P,showTimeLine:N=!0,statusAttribute:I="status",paymentsList:L,oldValue:B,isInfoLabel:O=!1}=e;const{t:R}=n.useTranslation();let w=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function x(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[M,F]=t.useState({}),[k,U]=t.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==C?void 0:C.status)||k.loading||k.loaded||k.canLoad||U({loading:!1,loaded:!1,canLoad:!0}),null==k||!k.canLoad||k.loading||k.loaded||(U({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==C?void 0:C.tenantId)||tenantId,null==C?void 0:C.propertyId,F,U));const H=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()}`},W=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:H(null==C||null===(i=C.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==C?void 0:C.channel)||""};return l.createElement(mi,{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,v,p,m,E,f,g,A,S,b,y,D;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}}},T=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==C||null===(s=C.processInstance)||void 0===s||null===(c=s.assignes)||void 0===c||null===(v=c[0])||void 0===v?void 0:v.uuid)===(null==e||null===(p=e.assignes)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.uuid)&&null!=C&&null!==(E=C.processInstance)&&void 0!==E&&null!==(f=E.assignes)&&void 0!==f&&null!==(g=f[0])&&void 0!==g&&g.mobileNumber?null==C||null===(A=C.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===(D=y[0])||void 0===D?void 0:D.mobileNumber,comment:R(null==e?void 0:e.comment),wfComment:T?T.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(mi,{data:P,OpenImage:x,privacy:i})}{var T,P,N,I,L;const t={date:H(null==C||null===(T=C.auditDetails)||void 0===T?void 0:T.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(mi,{data:t})}},j=(e,t)=>e?t?e:R(e):R("NA"),$=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"),z=window.location.href.includes("employee/obps"),Y=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||$?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),K={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"}},V=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${j(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${R(null==e?void 0:e.isUnit)}`:R("N/A"):null!=e&&e.value?j(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):R("N/A"),[q,X]=t.useState(!1);console.log("demand Data arr",b);const J=b.reduce((e,t)=>e+t.demandInterest,0),Z=b.reduce((e,t)=>e+t.demandPenality,0),Q=b.reduce((e,t)=>e+t.collectionTax,0),ee=b.reduce((e,t)=>e+t.collectionInterest,0),te=b.reduce((e,t)=>e+t.collectionPenality,0),le=b.reduce((e,t)=>e+t.balanceTax,0);return b.reduce((e,t)=>e+t.balanceInterest,0),b.reduce((e,t)=>e+t.balancePenality,0),l.createElement(o.Card,{style:{position:"relative"},className:"employeeCard-override"},O?l.createElement(bi,{t:R,userType:!1,infoBannerLabel:"CS_FILE_APPLICATION_INFO_LABEL",infoClickLable:"WS_CLICK_ON_LABEL",infoClickInfoLabel:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO_LABEL":"WS_CLICK_ON_INFO_LABEL",infoClickInfoLabel1:window.location.href.includes("disconnection")||window.location.href.includes("application")?"WS_DISCONNECTION_CLICK_ON_INFO1_LABEL":""}):null,null==h||null===(a=h.applicationDetails)||void 0===a?void 0:a.map((e,n)=>{var a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,b,D,C,T,P,N,I,O,x,F,k,U,H,W,j,K,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"}:$?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==n||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(o.CardSectionHeader,{style:0==n&&$?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},G?""+R(e.title):R(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(o.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},R(e.title)),(null==e?void 0:e.isTable)&&l.createElement("table",{style:{tableLayout:"fixed",width:"100%",borderCollapse:"collapse"}},l.createElement("tr",{style:{textAlign:"left"}},null==e?void 0:e.headers.map(e=>l.createElement("th",{style:{padding:"10px",paddingLeft:"0px"}},R(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"}},R(e))))):l.createElement("tr",null,n.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},R(e)))))),l.createElement(o.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||$?{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:R(t.title),label:R(t.title),text:l.createElement("img",{src:R(t.value),alt:"",privacy:null==t?void 0:t.privacy})}):1==(null==t?void 0:t.isLink)?l.createElement(o.Row,{key:R(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"}},R(null==t?void 0:t.title)))):G||z?""+R(t.title):R(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:Y(),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:""+R(""+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:R(t.title),label:R(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:Y(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===t.title?l.createElement(Pi,{bill:null===(r=M.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(pn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:L,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===(v=e.additionalDetails)||void 0===v?void 0:v.fiReport)&&l.createElement(vn,{fiReport:null==h||null===(p=h.applicationData)||void 0===p||null===(m=p.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===(_=e.additionalDetails)||void 0===_?void 0:_.floors}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.owners)&&l.createElement(vi,{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(_i,{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(Ei,{units:null==e||null===(D=e.additionalDetails)||void 0===D?void 0:D.accessories}),!w&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==y||null===(T=y.data)||void 0===T||null===(P=T.nextActions)||void 0===P?void 0:P.length)>0&&l.createElement(di,{applicationData:null==h?void 0:h.applicationData,t:R,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(oi,{t:R,applicationData:null==h?void 0:h.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:y})),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.noc)&&l.createElement(ui,{t:R,isNoc:!0,NOCdata:e.values,applicationData:null==h?void 0:h.applicationData,docs:e.additionalDetails.noc,noc:null===(x=e.additionalDetails)||void 0===x?void 0:x.data,bpaActionsDetails:y}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.scruntinyDetails)&&l.createElement(pn,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.buildingExtractionDetails)&&l.createElement(pn,{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(Gl,{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(Yl,{documents:null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.documents}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation)&&l.createElement(si,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(fi,{wsAdditionalDetails:e,oldValue:B}),(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(Si,{wsAdditionalDetails:e,workflowDetails:y}),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(yi,{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)||D)&&l.createElement(o.Loader,null),!(null!=y&&y.isLoading)&&!D&&l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},R("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:R(`${P}${null==y||null===(v=y.data)||void 0===v||null===(p=v.timeline[0])||void 0===p?void 0:p.state}`),customChild:W(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,v;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!==(v=c.state)&&void 0!==v&&v.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==t?"":"_DONE"),l.createElement(l.Fragment,{key:t},l.createElement(o.CheckPoint,{keyValue:t,isCompleted:0===t,info:e.comment,label:R(`${P}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I]}${a}`),customChild:W(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:R(q?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{X(e=>!e)}})))),l.createElement(o.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:K.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:K.th},"Installments"),l.createElement("th",{colSpan:"3",style:K.th},"Demand"),l.createElement("th",{colSpan:"3",style:K.th},"Collection"),l.createElement("th",{colSpan:"3",style:K.th},"Balance"),l.createElement("th",{style:K.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:K.th}),l.createElement("th",{style:K.th},"Tax"),l.createElement("th",{style:K.th},"Interest"),l.createElement("th",{style:K.th},"Penalty"),l.createElement("th",{style:K.th},"Tax"),l.createElement("th",{style:K.th},"Interest"),l.createElement("th",{style:K.th},"Penalty"),l.createElement("th",{style:K.th},"Tax"),l.createElement("th",{style:K.th},"Interest"),l.createElement("th",{style:K.th},"Penalty"),l.createElement("th",{style:K.th},"Advance"))),l.createElement("tbody",null,b.map(e=>l.createElement("tr",null,l.createElement("td",{style:K.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:K.td},e.demandTax),l.createElement("td",{style:K.td},e.demandInterest),l.createElement("td",{style:K.td},e.demandPenality),l.createElement("td",{style:K.td},e.collectionTax),l.createElement("td",{style:K.td},e.collectionInterest),l.createElement("td",{style:K.td},e.collectionPenality),l.createElement("td",{style:K.td},e.balanceTax),l.createElement("td",{style:K.td},e.balanceInterest),l.createElement("td",{style:K.td},e.balancePenality),l.createElement("td",{style:K.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:K.th},"Total"),l.createElement("td",{style:K.td},T),l.createElement("td",{style:K.td},J),l.createElement("td",{style:K.td},Z),l.createElement("td",{style:K.td},Q),l.createElement("td",{style:K.td},ee),l.createElement("td",{style:K.td},te),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td})),l.createElement("tr",null,l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("th",{style:K.th},"Total"),l.createElement("td",{style:K.td},le),l.createElement("td",{style:K.td},"0"),l.createElement("td",{style:K.td},"0"),l.createElement("td",{style:K.td},"0")),l.createElement("tr",null,l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("td",{style:K.td}),l.createElement("th",{style:K.th},"Total Balance"),l.createElement("td",{style:K.td},le)))))}function Ii(e){var t,n,i,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S;let{t:h,showToast:b,closeToast:y,businessService:D}=e;if(null!=D&&D.includes("NewTL")||null!=D&&D.includes("TL")||null!=D&&D.includes("EDITRENEWAL")){var C;let e="";switch(null==b||null===(C=b.action)||void 0===C?void 0:C.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_${D}_${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!=D&&D.includes("BPA")||null!=D&&D.includes("BPA_LOW")||null!=D&&D.includes("BPA_OC")){var T;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!=D&&D.includes("BPA_OC")?h(e[1]):h(e[0]),l};let t="";switch(null==b||null===(T=b.action)||void 0===T?void 0:T.action){case"REVOCATE":t="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":t="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":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===(_=b.error)||void 0===_?void 0:_.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===(f=b.error)||void 0===f?void 0:f.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_${D}_${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_${D}_${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 Li(e){var i,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S;let{workflowDetails:h,displayMenu:b,onActionSelect:y,setDisplayMenu:D,businessService:C,forcedActionPrefix:T,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,w=!1,x=(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===(v=c.nextActions)||void 0===v?void 0:v.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,()=>{D(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==x?void 0:x.length)||null!=x&&null!==(p=x[0])&&void 0!==p&&null!==(m=p.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==x?void 0:x.length)?(w=!1,R=!0):(null==x?void 0:x.length)>0&&(w=!0,R=!1),l.createElement(l.Fragment,null,!(null!=h&&h.isLoading)&&w&&!R&&l.createElement(o.ActionBar,{style:{...P}},b&&(null!=h&&null!==(E=h.data)&&void 0!==E&&null!==(_=E.actionState)&&void 0!==_&&_.nextActions||null!=h&&null!==(f=h.data)&&void 0!==f&&f.nextActions)?l.createElement(o.Menu,{localeKeyPrefix:T||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase()),options:x,optionKey:"action",t:I,onSelect:y,style:N}):null,l.createElement(o.SubmitBar,{ref:B,label:I("WF_TAKE_ACTION"),onSubmit:()=>D(!b)})),!(null!=h&&h.isLoading)&&!w&&R&&l.createElement(o.ActionBar,{style:{...P}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==x||null===(g=x[0])||void 0===g?void 0:g.action,value:null==x||null===(A=x[0])||void 0===A?void 0:A.action,onClick:e=>{y((null==x?void 0:x[0])||{})}},I(`${T||"WF_EMPLOYEE_"+(null==C?void 0:C.toUpperCase())}_${null==x||null===(S=x[0])||void 0===S?void 0:S.action}`))))}const Bi=()=>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"})),Oi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Bi,null));function Ri(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(Oi,{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 wi=e=>{var a,r;console.log("props",e);let d=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const s=Digit.ULBService.getCurrentTenantId(),v=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(v,"BPA",["BlockReason"]),{t:m}=n.useTranslation(),E=i.useHistory();let{id:_}=i.useParams();const[f,g]=t.useState(!1),[A,S]=t.useState(null),[h,b]=t.useState(!1),[y,D]=t.useState(!1),[C,T]=t.useState(!1),{data:P}=Digit.Hooks.obps.useMDMS(v,"BPA",["RiskTypeComputation"]),{applicationDetails:N,demandData:I,totalDemandTax:L,totalBalanceTax:B,showToast:O,setShowToast:R,isLoading:w,isDataLoading:x,applicationData:M,mutate:F,nocMutation:k,workflowDetails:U,id:H,businessService:W,closeToast:j,moduleCode:$,timelineStatusPrefix:G,forcedActionPrefix:z,statusAttribute:Y,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=u.useQueryClient(),te=()=>{S(null),b(!1)};return w||y?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,w?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement(Ni,{applicationDetails:N,demandData:I,id:H,workflowDetails:U,isDataLoading:x,applicationData:M,totalDemandTax:L,totalBalanceTax:B,businessService:W,timelineStatusPrefix:G,statusAttribute:Y,paymentsList:q,showTimeLine:X,oldValue:J,isInfoLabel:Z}),h?l.createElement(ii,{t:m,action:A,tenantId:s,state:v,id:_,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,d,s,v,p,_,f,g){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)||0==(null==e||null===(r=e.Licenses)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.comment)||void 0===d?void 0:d.length)||0==(null==e||null===(s=e.WaterConnection)||void 0===s||null===(v=s.comment)||void 0===v?void 0:v.length)||0==(null==e||null===(p=e.SewerageConnection)||void 0===p||null===(_=p.comment)||void 0===_?void 0:_.length)||0==(null==e||null===(f=e.BPA)||void 0===f||null===(g=f.comment)||void 0===g?void 0:g.length))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 d(t){if(n)return t;F&&(D(!0),F(e,{onError:(e,t)=>{D(!1),R({key:"error",error:e}),setTimeout(j,5e3)},onSuccess:(e,t)=>{var n,i,o,a,r,u,d,s,c,v,p,_;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),D(!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?null!=t&&null!==(r=t.AmendmentUpdate)&&void 0!==r&&null!==(u=r.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(s=d.workflow)&&void 0!==s&&s.action.includes("RE-SUBMIT")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(v=c.workflow)&&void 0!==v&&v.action.includes("APPROVE")?R({key:"success",label:m("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(p=t.AmendmentUpdate)&&void 0!==p&&null!==(_=p.workflow)&&void 0!==_&&_.action.includes("REJECT")&&R({key:"success",label:m("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(R({key:"success",action:A}),Q&&setTimeout(Q,3e3),setTimeout(j,5e3),ee.clear(),ee.refetchQueries("APPLICATION_SEARCH"))}})),te()}D(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&k){var e;const l=null===(e=t)||void 0===e?void 0:e.map(e=>null==k?void 0:k.mutateAsync(e)),i=c(function(){return D(!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,v,p;D(!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===(v=c.Errors)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.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(d):d(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==p||null===(r=p.BPA)||void 0===r?void 0:r.BlockReason}):null,C?l.createElement(Ri,{action:A,workflowDetails:U,businessService:W,isWarningPop:C,closeWarningPopup:()=>{T(!1)}}):null,l.createElement(Ii,{t:m,showToast:O,closeToast:j,businessService:W}),d?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(s,{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,c,v,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(l=t.selfCertificationCharges)||void 0===l?void 0:l.BPA_MALBA_CHARGES)+parseInt(null==u||null===(n=u.BPA)||void 0===n||null===(i=n.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(a=u.BPA)||void 0===a||null===(r=a.additionalDetails)||void 0===r||null===(d=r.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(v=c.additionalDetails)||void 0===v||null===(p=v.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,s)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(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(Li,{workflowDetails:U,displayMenu:f,onActionSelect:function(e){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]),null!=e&&e.isToast)R({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(j,5e3);else if(null!=e&&e.isWarningPopUp)T(!0);else if(null!=e&&e.redirectionUrll){var t,l,n,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))E.push(""+(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.pathname),JSON.stringify({data:null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.state,url:`${null===(o=location)||void 0===o?void 0:o.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.action)){var a,r;E.push(""+(null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.pathname),{data:null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.state})}else{var u;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname}`)}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action)){var d,s;E.push({pathname:null===(d=e.redirectionUrl)||void 0===d?void 0:d.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else b(!0);S(e),g(!1)},setDisplayMenu:g,businessService:W,forcedActionPrefix:z,ActionBarStyle:K,MenuStyle:V})))},xi=[{head:"",body:[{type:"component",component:"InspectionReport",key:"FieldReports",withoutLabel:!0,hideInCitizen:!0}]}];var Mi=function(e){return"symbol"==typeof e||ie(e)&&"[object Symbol]"==O(e)},Fi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ki=/^\w*$/,Ui=function(e,t){if(se(e))return!1;var l=typeof e;return!("number"!=l&&"symbol"!=l&&"boolean"!=l&&null!=e&&!Mi(e))||ki.test(e)||!Fi.test(e)||null!=t&&e in Object(t)};function Hi(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(Hi.Cache||X),l}Hi.Cache=X;var Wi,ji,$i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gi=/\\(\\)?/g,zi=(Wi=Hi(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace($i,function(e,l,n,i){t.push(n?i.replace(Gi,"$1"):l||e)}),t},function(e){return 500===ji.size&&ji.clear(),e}),ji=Wi.cache,Wi),Yi=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},Ki=C?C.prototype:void 0,Vi=Ki?Ki.toString:void 0,qi=function(e,t){return se(e)?e:Ui(e,t)?[e]:zi(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(se(t))return Yi(t,e)+"";if(Mi(t))return Vi?Vi.call(t):"";var l=t+"";return"0"==l&&1/t==-1/0?"-0":l}(e)}(e))},Xi=function(e){if("string"==typeof e||Mi(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ji=function(e,t){for(var l=0,n=(t=qi(t,e)).length;null!=e&&l<n;)e=e[Xi(t[l++])];return l&&l==n?e:void 0},Zi=function(e,t,l){var n=null==e?void 0:Ji(e,t);return void 0===n?l:n};function Qi(e){var t=-1,l=null==e?0:e.length;for(this.__data__=new X;++t<l;)this.add(e[t])}Qi.prototype.add=Qi.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Qi.prototype.has=function(e){return this.__data__.has(e)};var eo=Qi,to=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},lo=function(e,t){return e.has(t)},no=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,v=!0,p=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 _=a?n(E,m,c,t,e,o):n(m,E,c,e,t,o);if(void 0!==_){if(_)continue;v=!1;break}if(p){if(!to(t,function(e,t){if(!lo(p,t)&&(m===e||i(m,e,l,n,o)))return p.push(t)})){v=!1;break}}else if(m!==E&&!i(m,E,l,n,o)){v=!1;break}}return o.delete(e),o.delete(t),v},io=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e,n){l[++t]=[n,e]}),l},oo=function(e){var t=-1,l=Array(e.size);return e.forEach(function(e){l[++t]=e}),l},ao=C?C.prototype:void 0,ro=ao?ao.valueOf:void 0,uo=Object.prototype.hasOwnProperty,so=Object.prototype.hasOwnProperty,co=function e(t,l,n,i,o){return t===l||(null==t||null==l||!ie(t)&&!ie(l)?t!=t&&l!=l:function(e,t,l,n,i,o){var a=se(e),r=se(t),u=a?"[object Array]":Qe(e),d=r?"[object Array]":Qe(t),s="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),c="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),v=u==d;if(v&&ve(e)){if(!ve(t))return!1;a=!0,s=!1}if(v&&!s)return o||(o=new Z),a||Se(e)?no(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 tt(e),new tt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return p(+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=io;case"[object Set]":if(r||(r=oo),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=no(r(e),r(t),n,i,o,a);return a.delete(e),d;case"[object Symbol]":if(ro)return ro.call(e)==ro.call(t)}return!1}(e,t,u,l,n,i,o);if(!(1&l)){var m=s&&so.call(e,"__wrapped__"),E=c&&so.call(t,"__wrapped__");if(m||E){var _=m?e.value():e,f=E?t.value():t;return o||(o=new Z),i(_,f,l,n,o)}}return!!v&&(o||(o=new Z),function(e,t,l,n,i,o){var a=1&l,r=We(e),u=r.length;if(u!=We(t).length&&!a)return!1;for(var d=u;d--;){var s=r[d];if(!(a?s in t:uo.call(t,s)))return!1}var c=o.get(e),v=o.get(t);if(c&&v)return c==t&&v==e;var p=!0;o.set(e,t),o.set(t,e);for(var m=a;++d<u;){var E=e[s=r[d]],_=t[s];if(n)var f=a?n(_,E,s,t,e,o):n(E,_,s,e,t,o);if(!(void 0===f?E===_||i(E,_,l,n,o):f)){p=!1;break}m||(m="constructor"==s)}if(p&&!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||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,l,n,i,o))}(t,l,n,i,e,o))},vo=function(e){return e==e&&!R(e)},po=function(e,t){return function(l){return null!=l&&l[e]===t&&(void 0!==t||e in Object(l))}},mo=function(e,t){return null!=e&&t in Object(e)},Eo=function(e){return e},_o=function(e){return"function"==typeof e?e:null==e?Eo:"object"==typeof e?se(e)?(i=e[1],Ui(n=e[0])&&vo(i)?po(Xi(n),i):function(e){var t=Zi(e,n);return void 0===t&&t===i?function(e,t){return null!=e&&function(e,t,l){for(var n=-1,i=(t=qi(t,e)).length,o=!1;++n<i;){var a=Xi(t[n]);if(!(o=null!=e&&l(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ee(i)&&me(a,i)&&(se(e)||de(e))}(e,t,mo)}(e,n):co(i,t,3)}):1==(l=function(e){for(var t=Ie(e),l=t.length;l--;){var n=t[l],i=e[n];t[l]=[n,i,vo(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 Z;if(!co(d,u,3,void 0,s))return!1}}return!0}(e,0,l)}:function(e){return Ui(e)?(t=Xi(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return Ji(t,e)}}(e);var t}(e);var t,l,n,i},fo=function(e,t){if(e!==t){var l=void 0!==e,n=null===e,i=e==e,o=Mi(e),a=void 0!==t,r=null===t,u=t==t,d=Mi(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 go=e=>{var a,r,u,s,p,m,E,_,f,g,A,S,h,b,y;let{showTermsPopup:D,setShowTermsPopup:C,otpVerifiedTimestamp:T}=e;const[P,N]=t.useState(!1),{state:I}=i.useLocation(),{t:L}=n.useTranslation(),B=Digit.UserService.getUser(),O=null==B||null===(a=B.info)||void 0===a?void 0:a.name,R=null==B?void 0:B.info.mobileNumber,[w,x]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT",null!=I&&I.edcrNumber?{data:{scrutinyNumber:{edcrNumber:null==I?void 0:I.edcrNumber}}}:{}),[M,F]=t.useState(!1),[k,U]=t.useState(!1),H=null==w||null===(r=w.additionalDetails)||void 0===r?void 0:r.architectid,W=null==w||null===(u=w.owners)||void 0===u||null===(s=u.owners)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.name,j=null==w||null===(m=w.owners)||void 0===m||null===(E=m.owners)||void 0===E||null===(_=E[0])||void 0===_?void 0:_.mobileNumber,$=null==w||null===(f=w.additionalDetails)||void 0===f?void 0:f.typeOfArchitect,G=null==w||null===(g=w.additionalDetails)||void 0===g?void 0:g.khasraNumber,z=null==w||null===(A=w.additionalDetails)||void 0===A?void 0:A.UlbName,Y=null==w||null===(S=w.additionalDetails)||void 0===S?void 0:S.wardnumber,K=null==w||null===(h=w.additionalDetails)||void 0===h?void 0:h.area,V=null==w||null===(b=w.additionalDetails)||void 0===b?void 0:b.zonenumber,q=null==w||null===(y=w.additionalDetails)||void 0===y?void 0:y.Ulblisttype,X=T;t.useEffect(()=>{null!=w&&w.additionalDetails&&!w.additionalDetails.TimeStamp&&x(e=>({...e,additionalDetails:{...e.additionalDetails,TimeStamp:sessionStorage.getItem("otpVerifiedTimestamp")}}))},[w,T,x]);const J=`\nTo,\n<b>${q}</b>\n<b>${z}</b>\n\n \nDear Sir or Madam,\n\n\nI, under signed Shri/Smt/Kum <b>${O}</b> (<b>${$}</b>) having Registration No. <b>${H}</b> is appointed by the <b>${W}</b> Mobile number <b>${j}</b> for the development on land bearing Kh. No <b>${G}</b> Area <b>${K}</b> (Sq.mts).\n\n\nThis site falls in ward number <b>${Y}</b> zone number <b>${V}</b> in the Master plan of <b>${z}</b> and the proposed Residential/Commercial/Industrial construction is permissible in this area.\n\n\nI am currently registered as <b>${$}</b> with the Competent Authority and empanelled under Self-Certification Scheme.\n\n\nI hereby certify that I/we have appointed by the owner to prepare the plans, sections and details, structural details as required under the Punjab Municipal Building Byelaws for the above mentioned project. \n\n\nThat the drawings prepared and uploaded along with other necessary documents on this E-Naksha Platform are as per the provisions of Punjab Municipal Building Byelaws and this building plan has been applied under Self-Certification Scheme. \n\n\nI certify that:\n\n\nThat I am fully conversant with the provisions of the Punjab Municipal Building Byelaws and other applicable instructions/ regulations, which are in force and I undertake to fulfill the same.\n\n\nThat plans have been prepared within the framework of provisions of the Master Plan and applicable Building Bye Laws / Regulations. \n\n\nThat site does not falls in any prohibited area/ government land/ encroachment or any other land restricted for building construction or in any unauthorized colony. \n\n\nThat plan is in conformity to structural safety norms. \n\n\nThat I have seen the originals of all the documents uploaded and Nothing is concealed thereof. \n\n\nThat all the requisite documents/NOC required to be uploaded have been uploaded on E-Naksha portal along with plan. \n\n\nThat above stated facts are true and all the requisite documents uploaded with this E-Naksha plan.\n\n\n\n This Document is Verified By OTP at <b>${X}</b>\n\n\n Name of Professional - <b>${O}</b> \n Designation - <b>${$}</b>\n Architect Id - <b>${H}</b> \n Mobile Number - <b>${R}</b>\n \n \n `,Z=e=>[`Name of Professional - <b>${O}</b>`,`Designation - <b>${$}</b>`,`Architect Id - <b>${H}</b>`,`Mobile Number - <b>${R}</b>`].includes(e.trim()),Q=()=>{C(!1)},ee={modal:{width:"100%",height:"100%",top:"0",position:"relative",backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center"},modalOverlay:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.7)"},modalContent:{backgroundColor:"#FFFFFF",padding:"2rem",borderRadius:"0.5rem",maxWidth:"800px",margin:"auto",fontFamily:"Roboto, serif",overflowX:"hidden",textAlign:"justify",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.2)",maxHeight:"80vh",overflowY:"auto"},heading:{textAlign:"center",fontWeight:"bold",marginBottom:"10px"},subheading:{textAlign:"center",fontWeight:"bold",marginBottom:"20px"},rightAlignedText:{textAlign:"right",whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:"Roboto, serif"}};return l.createElement("div",null,l.createElement(d,{isOpen:D,onRequestClose:Q,contentLabel:"Self-Declaration",style:{modal:ee.modal,overlay:ee.modalOverlay,content:ee.modalContent}},l.createElement("div",null),l.createElement("div",null,l.createElement("h2",{style:ee.heading},"DECLARATION UNDER SELF-CERTIFICATION SCHEME"),l.createElement("h3",{style:ee.subheading},"(For proposed Construction)"),l.createElement("h3",{style:ee.subheading},"(By Architect/ Civil Engineer/ Building Designer and Supervisor)"),l.createElement("div",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",textAlign:"justify",fontFamily:"Roboto, serif"}},J.split("\n").map((e,t)=>l.createElement(l.Fragment,{key:t},l.createElement("div",{style:Z(e)?ee.rightAlignedText:{},dangerouslySetInnerHTML:{__html:e}}),((e,t)=>{const l=`This Document is Verified By OTP at <b>${X}</b>`;return"That above stated facts are true and all the requisite documents uploaded with this E-Naksha plan."===e.trim()&&""===(null==t?void 0:t.trim())||e.trim()===l})(e,J.split("\n")[t+1])&&l.createElement("div",{style:{marginBottom:"2rem"}})))),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement(o.SubmitBar,{label:L("BPA_CLOSE"),onSubmit:Q})),l.createElement("br",null),l.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},l.createElement("br",null),l.createElement(o.SubmitBar,{label:L("BPA_UPLOAD"),onSubmit:function(){try{const e=v(function(){return c(function(){return F(!0),Promise.resolve(Digit.PaymentService.generatePdf(Digit.ULBService.getStateId(),{Bpa:[w]},"architectconsent")).then(function(e){var t;(null==e||null===(t=e.filestoreIds[0])||void 0===t?void 0:t.length)>0?(alert("File Uploaded Successfully"),sessionStorage.setItem("ArchitectConsentdocFilestoreid",null==e?void 0:e.filestoreIds[0]),U(!0)):alert("File Upload Failed")})},function(e){alert("Error Uploading PDF:",e)})},function(e,t){if(F(!1),e)throw t;return t});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:M||k})))))},Ao=e=>e.substr(0,1).toUpperCase()+e.substr(1);var So=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)}},ho=Object.prototype.toString;function bo(e){return"[object Array]"===ho.call(e)}function yo(e){return void 0===e}function Do(e){return null!==e&&"object"==typeof e}function Co(e){if("[object Object]"!==ho.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function To(e){return"[object Function]"===ho.call(e)}function Po(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),bo(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 No={isArray:bo,isArrayBuffer:function(e){return"[object ArrayBuffer]"===ho.call(e)},isBuffer:function(e){return null!==e&&!yo(e)&&null!==e.constructor&&!yo(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:Do,isPlainObject:Co,isUndefined:yo,isDate:function(e){return"[object Date]"===ho.call(e)},isFile:function(e){return"[object File]"===ho.call(e)},isBlob:function(e){return"[object Blob]"===ho.call(e)},isFunction:To,isStream:function(e){return Do(e)&&To(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:Po,merge:function e(){var t={};function l(l,n){t[n]=Co(t[n])&&Co(l)?e(t[n],l):Co(l)?e({},l):bo(l)?l.slice():l}for(var n=0,i=arguments.length;n<i;n++)Po(arguments[n],l);return t},extend:function(e,t,l){return Po(t,function(t,n){e[n]=l&&"function"==typeof t?So(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 Io(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Lo=function(e,t,l){if(!t)return e;var n;if(l)n=l(t);else if(No.isURLSearchParams(t))n=t.toString();else{var i=[];No.forEach(t,function(e,t){null!=e&&(No.isArray(e)?t+="[]":e=[e],No.forEach(e,function(e){No.isDate(e)?e=e.toISOString():No.isObject(e)&&(e=JSON.stringify(e)),i.push(Io(t)+"="+Io(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 Bo(){this.handlers=[]}Bo.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},Bo.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},Bo.prototype.forEach=function(e){No.forEach(this.handlers,function(t){null!==t&&e(t)})};var Oo=Bo,Ro=function(e,t,l){return No.forEach(l,function(l){e=l(e,t)}),e},wo=function(e){return!(!e||!e.__CANCEL__)},xo=function(e,t){No.forEach(e,function(l,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=l,delete e[n])})},Mo=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)},Fo=No.isStandardBrowserEnv()?{write:function(e,t,l,n,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),No.isNumber(l)&&a.push("expires="+new Date(l).toGMTString()),No.isString(n)&&a.push("path="+n),No.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(){}},ko=["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"],Uo=No.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=No.isString(t)?n(t):t;return l.protocol===e.protocol&&l.host===e.host}}():function(){return!0},Ho={"Content-Type":"application/x-www-form-urlencoded"};function Wo(e,t){!No.isUndefined(e)&&No.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var jo,$o={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(jo=function(e){return new Promise(function(t,l){var n=e.data,i=e.headers;No.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(),Lo(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?(No.forEach(n.split("\n"),function(e){if(r=e.indexOf(":"),i=No.trim(e.substr(0,r)).toLowerCase(),a=No.trim(e.substr(r+1)),i){if(u[i]&&ko.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(Mo("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(Mo("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){l(Mo("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),l(Mo(t,e,"ECONNABORTED",o)),o=null},No.isStandardBrowserEnv()){var c=(e.withCredentials||Uo(s))&&e.xsrfCookieName?Fo.read(e.xsrfCookieName):void 0;c&&(i[e.xsrfHeaderName]=c)}if("setRequestHeader"in o&&No.forEach(i,function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)}),No.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)})}),jo),transformRequest:[function(e,t){return xo(t,"Accept"),xo(t,"Content-Type"),No.isFormData(e)||No.isArrayBuffer(e)||No.isBuffer(e)||No.isStream(e)||No.isFile(e)||No.isBlob(e)?e:No.isArrayBufferView(e)?e.buffer:No.isURLSearchParams(e)?(Wo(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):No.isObject(e)?(Wo(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, */*"}}};No.forEach(["delete","get","head"],function(e){$o.headers[e]={}}),No.forEach(["post","put","patch"],function(e){$o.headers[e]=No.merge(Ho)});var Go=$o;function zo(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Yo=function(e){return zo(e),e.headers=e.headers||{},e.data=Ro(e.data,e.headers,e.transformRequest),e.headers=No.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),No.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||Go.adapter)(e).then(function(t){return zo(e),t.data=Ro(t.data,t.headers,e.transformResponse),t},function(t){return wo(t)||(zo(e),t&&t.response&&(t.response.data=Ro(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},Ko=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 No.isPlainObject(e)&&No.isPlainObject(t)?No.merge(e,t):No.isPlainObject(t)?No.merge({},t):No.isArray(t)?t.slice():t}function u(n){No.isUndefined(t[n])?No.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(e[n],t[n])}No.forEach(n,function(e){No.isUndefined(t[e])||(l[e]=r(void 0,t[e]))}),No.forEach(i,u),No.forEach(o,function(n){No.isUndefined(t[n])?No.isUndefined(e[n])||(l[n]=r(void 0,e[n])):l[n]=r(void 0,t[n])}),No.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 No.forEach(s,u),l};function Vo(e){this.defaults=e,this.interceptors={request:new Oo,response:new Oo}}Vo.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Ko(this.defaults,e)).method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var t=[Yo,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},Vo.prototype.getUri=function(e){return e=Ko(this.defaults,e),Lo(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},No.forEach(["delete","get","head","options"],function(e){Vo.prototype[e]=function(t,l){return this.request(Ko(l||{},{method:e,url:t,data:(l||{}).data}))}}),No.forEach(["post","put","patch"],function(e){Vo.prototype[e]=function(t,l,n){return this.request(Ko(n||{},{method:e,url:t,data:l}))}});var qo=Vo;function Xo(e){this.message=e}Xo.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Xo.prototype.__CANCEL__=!0;var Jo=Xo;function Zo(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 Jo(e),t(l.reason))})}Zo.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Zo.source=function(){var e;return{token:new Zo(function(t){e=t}),cancel:e}};var Qo=Zo;function ea(e){var t=new qo(e),l=So(qo.prototype.request,t);return No.extend(l,qo.prototype,t),No.extend(l,t),l}var ta=ea(Go);ta.Axios=qo,ta.create=function(e){return ea(Ko(ta.defaults,e))},ta.Cancel=Jo,ta.CancelToken=Qo,ta.isCancel=wo,ta.all=function(e){return Promise.all(e)},ta.spread=function(e){return function(t){return e.apply(null,t)}},ta.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var la=ta;la.default=ta,la.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 na=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 v=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var p,m,E,_;return e.isSuccess?"BPA_SUBMIT_APP"==v?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}_${_t(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(p=d.workflow)||void 0===p?void 0:p.action}_${_t(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(_=d.workflow)||void 0===_?void 0:_.action}_${_t(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${_t(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"))},ia=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")},oa=e=>{var t;return l.createElement(o.Banner,{message:na(e),applicationNumber:null===(t=e.data)||void 0===t?void 0:t.BPA[0].applicationNo,info:e.isSuccess?ia(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 v=sessionStorage.getItem("BPA_SUBMIT_APP")?JSON.parse(sessionStorage.getItem("BPA_SUBMIT_APP")):null;var p,m,E,_;return e.isSuccess?"BPA_SUBMIT_APP"==v?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}_${_t(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_SUBMIT_HEADER_${s}_${null==d||null===(p=d.workflow)||void 0===p?void 0:p.action}_${_t(c," ","_").toUpperCase()}`):window.location.href.includes("editApplication")?null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(_=d.workflow)||void 0===_?void 0:_.action}_${_t(c," ","_").toUpperCase()}`):null==e?void 0:e.t(`BPA_HEADER_${s}_${null==d||null===(E=d.workflow)||void 0===E?void 0:E.action}_${_t(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"))},ra=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")},ua=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?ra(e):"",successful:e.isSuccess,headerStyles:{fontSize:"32px"}})},da=e=>e.substr(0,1).toUpperCase()+e.substr(1),sa=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:sa(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"}})},va={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:yn,{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(),v=Digit.ULBService.getStateId(),p=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}]),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:_}=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:!!p}}),{isLoading:f,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(()=>{f||E||(a((null!=g&&g.totalCount?null==g?void 0:g.totalCount:0)+(null!=_&&_.totalCount?null==_?void 0:_.totalCount:0)),u((null==g?void 0:g.nearingSlaCount)||0+(null==_?void 0:_.nearingSlaCount)||0))},[g,_]),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:f||E?"":e,label:d("TOTAL_FSM"),link:"/digit-ui/employee/obps/inbox"},{count:f||E?"":r,label:d("TOTAL_NEARING_SLA"),link:"/digit-ui/employee/obps/inbox"}],links:[{count:E?"":null==_?void 0:_.totalCount,label:d("ES_COMMON_STAKEHOLDER_INBOX_LABEL"),link:"/digit-ui/employee/obps/stakeholder-inbox",field:"STAKEHOLDER"},{count:f?"":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"}]}),[f,E,_,g,e,r]);return p||(A.links=A.links.filter(e=>"STAKEHOLDER"!==e.field)),m||(A.links=A.links.filter(e=>"BPA"!==e.field)),m||p?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),v=Digit.ULBService.getStateId(),[p,m]=t.useState(!1),{data:E,isLoading:_}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping"),[f,g]=t.useState([]),A=Digit.ULBService.getStateId(),{t:S}=n.useTranslation(),h=i.useLocation(),[b,y,D]=Digit.Hooks.useSessionStorage("BPA_HOME_CREATE",{}),{data:C,isLoading:T}=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,w]=t.useState(0),[x,M]=t.useState(window.Digit.Utils.browser.isMobile()?50:10),[F,k]=t.useState([{id:"createdTime",sortOrder:"DESC"}]),{isLoading:U,data:H}=Digit.Hooks.obps.useArchitectInbox({tenantId:v,moduleName:"bpa-services",businessService:["BPA_LOW","BPA","BPA_OC"],filters:{searchForm:{...B},tableForm:{sortBy:null==F||null===(u=F[0])||void 0===u?void 0:u.id,limit:x,offset:R,sortOrder:null==F||null===(d=F[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:v,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(!_){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")}))}},[_]),t.useEffect(()=>{var e,t;if(!T&&(null==C||null===(e=C.BPA)||void 0===e||null===(t=e.homePageUrlLinks)||void 0===t?void 0:t.length)>0){var l,n;let e=[];null==C||null===(l=C.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)}},[!T]),t.useEffect(()=>{D()},[]),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(_||!p||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:f,styles:{minWidth:"90%",minHeight:"90%"}}],G=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)),G},EDCRForm:e=>{var n,a,r,u,d,c,v,p;let{t:m,config:E,onSelect:_,formData:f,ownerIndex:g=0,isShowToast:A,isSubmitBtnDisable:S,setIsShowToast:h}=e;i.useLocation(),Digit.ULBService.getCurrentTenantId();const b=Digit.ULBService.getStateId(),[y,D]=t.useState([]),[C,T]=t.useState(null==f||null===(n=f.Scrutiny)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.applicantName),[P,N]=t.useState(null==f||null===(r=f.Scrutiny)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.tenantIdData),[I,L]=t.useState(()=>{var e,t,l;return(null==f||null===(e=f.Scrutiny)||void 0===e||null===(t=e[0])||void 0===t||null===(l=t.proofIdentity)||void 0===l?void 0:l.fileStoreId)||null}),[B,O]=t.useState(null==f||null===(d=f.owners)||void 0===d||null===(c=d.documents)||void 0===c?void 0:c.proofIdentity),[R,w]=t.useState(null),[x,M]=t.useState(""),[F,k]=t.useState(null),U=i.useHistory(),[H,W]=t.useState(null==f||null===(v=f.Scrutiny)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.coreArea),{isLoading:j,data:$}=Digit.Hooks.obps.useMDMS(b,"tenant",["citymodule"]);return t.useEffect(()=>{var e,t,l,n;if((null==$||null===(e=$.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==$||null===(i=$.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_"+_t(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=m,l.sort((e,t)=>n(e.code).localeCompare(n(t.code))));D(t)}},[$]),t.useEffect(()=>{(x||A)&&(T(""),N(""),W(""),L(null),O(""),M("")),A&&U.replace("/digit-ui/citizen/obps/edcrscrutiny/apply/acknowledgement",{data:null!=A&&A.label?null==A?void 0:A.label:"BPA_INTERNAL_SERVER_ERROR",type:"ERROR"})},[x,A,S]),j||S?l.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},l.createElement(o.Loader,null),l.createElement("span",{style:{display:"block",textAlign:"center",marginTop:"16px",fontWeight:"bold",fontSize:"18px"}},m("BPA_LOADING_TEXT"))):l.createElement(o.FormStep,{t:m,config:E,onSelect:()=>{const e={};e.tenantId=P,e.applicantName=C,e.file=B,e.coreArea=H,_(E.key,e)},onSkip:()=>{M("NEED TO DELETE")},isDisabled:!P||!C||!H||!B||S,onAdd:function(){M("NEED TO DELETE")},isMultipleAllow:!0},l.createElement(o.CardLabel,null,m("EDCR_SCRUTINY_CITY")+" *"),l.createElement(o.Dropdown,{t:m,isMandatory:!1,option:y,selected:P,optionKey:"i18nKey",select:function(e){N(e)},uploadMessage:x}),l.createElement(o.CardLabel,null,m("EDCR_SCRUTINY_NAME_LABEL")+" *"),l.createElement(o.TextInput,s({isMandatory:!1,optionKey:"i18nKey",t:m,name:"applicantName",onChange:function(e){T(e.target.value)},uploadMessage:x,value:C},{isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:m("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,""+m("BPA_CORE_AREA")),l.createElement(o.Dropdown,{t:m,isMandatory:!1,option:[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],selected:H,optionKey:"i18nKey",select:function(e){W(e)},uploadMessage:x}),l.createElement(o.CardLabel,null,m("BPA_PLAN_DIAGRAM_LABEL")+" *"),l.createElement(o.UploadFile,{id:"edcr-doc",extraStyleName:"propertyCreate",onUpload:function(e){L(e.target.files[0]),O(e.target.files[0])},onDelete:()=>{L(null),O("")},message:I?"1 "+m("PT_ACTION_FILEUPLOADED"):m("ES_NO_FILE_SELECTED_LABEL"),error:R,uploadMessage:x}),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}},m("EDCR_UPLOAD_FILE_LIMITS_LABEL")),A&&l.createElement(o.Toast,{error:A.key,label:m(A.label),onClose:()=>h(null),isDleteBtn:!0}))},BasicDetails:e=>{var i,a,r,u,d,s,c,v,p,m,E,_;let{formData:f,onSelect:g,config:A}=e;const[S,h]=t.useState(null),[b,y]=t.useState((null==f||null===(i=f.data)||void 0===i?void 0:i.edcrDetails)||null),[D,C]=t.useState(null==f||null===(a=f.data)||void 0===a?void 0:a.scrutinyNumber),[T,P]=t.useState(!(null==f||null===(r=f.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(Mt(null==D?void 0:D.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($l,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==D||!D.edcrNumber)return;return Promise.resolve(Mt(null==D?void 0:D.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=>C({edcrNumber:e.target.value}),value:null==D?void 0:D.edcrNumber,signature:!0,signatureImg:!R&&l.createElement(o.SearchIconSvg,{className:"signature-img",onClick:!R&&null!=D&&D.edcrNumber?()=>function(e){try{return Promise.resolve(Mt(null==D?void 0:D.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?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: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===(v=b.planDetail)||void 0===v||null===(p=v.planInformation)||void 0===p?void 0:p.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:D,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!=D&&null!==(_=D.edcrNumber)&&void 0!==_&&_.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(),[v,p]=(i.useHistory(),i.useParams(),t.useState([])),[m,E]=t.useState([]),{data:_,isLoading:f}=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:D}=Digit.Hooks.obps.useMDMS(c,"BPA",["homePageUrlLinks"]);return t.useEffect(()=>{let e,t="",l="",n="",i="",o=!0;for(let N=0;N<(null==h||null===(a=h.Licenses)||void 0===a?void 0:a.length);N++){var a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,b,y,D,C,T,P;"APPROVED"===(null==h||null===(r=h.Licenses)||void 0===r||null===(u=r[N])||void 0===u?void 0:u.status)&&o&&(o=!1,t=(null==h||null===(d=h.Licenses)||void 0===d||null===(s=d[N])||void 0===s||null===(c=s.tradeLicenseDetail)||void 0===c||null===(v=c.tradeUnits)||void 0===v||null===(p=v[0])||void 0===p||null===(m=p.tradeType)||void 0===m?void 0:m.split(".")[0])||"ARCHITECT",l=null==h||null===(E=h.Licenses)||void 0===E||null===(_=E[N])||void 0===_?void 0:_.applicationNumber,n=null==h||null===(f=h.Licenses)||void 0===f||null===(g=f[N])||void 0===g||null===(A=g.tradeLicenseDetail)||void 0===A||null===(S=A.owners[0])||void 0===S?void 0:S.name,i=null==h||null===(b=h.Licenses)||void 0===b||null===(y=b[N])||void 0===y||null===(D=y.tradeLicenseDetail)||void 0===D||null===(C=D.owners[0])||void 0===C?void 0:C.permanentAddress,sessionStorage.setItem("BPA_ARCHITECT_NAME",JSON.stringify(t)),sessionStorage.setItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER",JSON.stringify(l)),sessionStorage.setItem("BPA_STAKEHOLDER_NAME",JSON.stringify(n)),sessionStorage.setItem("BPA_STAKEHOLDER_ADDRESS",JSON.stringify(i)),e=null==h||null===(T=h.Licenses)||void 0===T||null===(P=T[N])||void 0===P?void 0:P.tradeLicenseDetail.additionalDetail.isSelfCertificationRequired,sessionStorage.setItem("isSelfCertificationRequired",JSON.stringify(e)))}},[h]),t.useEffect(()=>{if(!D){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})})}},[!D]),t.useEffect(()=>{if(!f){let e=[],t=[];const l=window.location.href.split("/"),n=l[l.length-2],i=l[l.length-3];for(let t=0;t<_.length;t++)e[_[t].applicationType]||e[_[t].ServiceType]||(e[_[t].applicationType]=_[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))})}),p(t)})}},[!f]),f?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")),f?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,null==v||null===(r=v[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,v,p,m,E,_;let{formData:f,onSelect:g,config:A}=e;const S=window.location.href.includes("editApplication"),[h,b]=t.useState(A),{t:y}=n.useTranslation(),[D,C]=t.useState(""),[T,P]=t.useState(""),[N,I]=t.useState(""),[L,B]=t.useState(""),[O,R]=t.useState(""),[w,x]=t.useState(""),[M,F]=t.useState(""),[k,U]=t.useState(""),[H,W]=t.useState(""),[j,$]=t.useState(""),[G,z]=t.useState(""),[Y,K]=t.useState(""),[V,q]=t.useState(""),[X,J]=t.useState(""),[Z,Q]=t.useState(""),ee=(Digit.ULBService.getCurrentTenantId(),null==f||null===(i=f.uiFlow)||void 0===i?void 0:i.flow),te=Digit.ULBService.getStateId();t.useEffect(()=>{if(S){const e={...A,inputs:A.inputs.map(e=>"boundaryWallLength"===e.name?{...e,disable:!0}:e)};b(e)}},[ee,S]);const{data:le,isLoading:ne}=Digit.Hooks.obps.useScrutinyDetails(te,null==f||null===(a=f.data)||void 0===a?void 0:a.scrutinyNumber);return ne?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement($l,{flow:"OCBPA"===ee?"OCBPA":""}),l.createElement(o.FormStep,{config:h,onSelect:e=>{g(null==h?void 0:h.key,{...e})},childrenAtTheBottom:!1,t:y,_defaultValues:null!=f&&null!==(r=f.data)&&void 0!==r&&r.boundaryWallLength&&null!=f&&null!==(u=f.data)&&void 0!==u&&u.wardnumber?null==f?void 0:f.data:null==f?void 0:f.additionalDetails,onSkip:()=>g()},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:y("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=le&&null!==(d=le.planDetail)&&void 0!==d&&null!==(s=d.planInformation)&&void 0!==s&&s.plotArea?`${null==le||null===(c=le.planDetail)||void 0===c||null===(v=c.planInformation)||void 0===v?void 0:v.plotArea} ${y("BPA_SQ_MTRS_LABEL")}`:"NA"}),l.createElement(o.Row,{className:"border-none",label:y("BPA_PLOT_NUMBER_LABEL"),text:null==le||null===(p=le.planDetail)||void 0===p||null===(m=p.planInformation)||void 0===m?void 0:m.plotNo}),l.createElement(o.Row,{className:"border-none",label:y("BPA_KHATHA_NUMBER_LABEL"),text:null==le||null===(E=le.planDetail)||void 0===E||null===(_=E.planInformation)||void 0===_?void 0:_.khataNo}))))},ScrutinyDetails:e=>{var a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$;let{onSelect:G,formData:z,config:Y}=e;const{t:K}=n.useTranslation(),[V,q]=(i.useHistory(),t.useState([])),[X,J]=t.useState((null==z?void 0:z.subOccupancy)||(null==z||null===(a=z.landInfo)||void 0===a?void 0:a.unit)||{}),[Z,Q]=t.useState([]),[ee,te]=t.useState([]);let le=Digit.UserService.getUser();const ne=(null==le||null===(r=le.info)||void 0===r?void 0:r.permanentCity)||Digit.ULBService.getCurrentTenantId(),ie=null==z||null===(u=z.uiFlow)||void 0===u?void 0:u.flow,[oe,ae]=t.useState(null),re=Digit.ULBService.getStateId(),{isMdmsLoading:ue}=Digit.Hooks.obps.useMDMS(re,"BPA",["SubOccupancyType"]),{data:de}=Digit.Hooks.obps.useScrutinyDetails(ne,null==z||null===(d=z.data)||void 0===d?void 0:d.scrutinyNumber,{enabled:!0});function se(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:K("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:K(""+(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:K("BPA_FLOOR_NAME_"+e.number)})}),n}const ce=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}})},ve=[{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"}],pe=e=>{const t=e;return(e,l,n)=>e[t]},me=t.useMemo(()=>null==ve?void 0:ve.map(e=>({Header:K(""+e.name),accessor:pe(e.id),id:e.id})));function Ee(e){var t,l,n,i,o;let a=null==z||null===(t=z.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?""+K("BPA_SUBOCCUPANCYTYPE_"+_t(null==e?void 0:e.toUpperCase(),"-","_")):"NA")).join(", "))}return r||"NA"}return ue?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement($l,{currentStep:"OCBPA"===ie?2:1,flow:"OCBPA"===ie?"OCBPA":""}),l.createElement(o.FormStep,{t:K,config:Y,onSelect:()=>{if("OCBPA"===ie)if(null!=z&&z.id)G("",z,"",!0);else{var e,t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D;let C={};C.edcrNumber=null!=z&&null!==(e=z.edcrNumber)&&void 0!==e&&e.edcrNumber?null==z||null===(t=z.edcrNumber)||void 0===t?void 0:t.edcrNumber:null==z||null===(l=z.data)||void 0===l||null===(n=l.scrutinyNumber)||void 0===n?void 0:n.edcrNumber,C.riskType=null==z||null===(i=z.data)||void 0===i?void 0:i.riskType,C.applicationType=null==z||null===(o=z.data)||void 0===o?void 0:o.applicationType,C.serviceType=null==z||null===(a=z.data)||void 0===a?void 0:a.serviceType;const T=Digit.UserService.getUser(),P=null==T||null===(r=T.info)||void 0===r?void 0:r.uuid;C.tenantId=null==z||null===(u=z.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===(v=c.landInfo)||void 0===v?void 0:v.tenantId,C.workflow={action:"INITIATE",assignes:[null==T||null===(p=T.info)||void 0===p?void 0:p.uuid]},C.accountId=P,C.documents=null,C.additionalDetails={},null!=z&&null!==(m=z.data)&&void 0!==m&&m.holdingNumber&&(C.additionalDetails.holdingNo=null==z||null===(E=z.data)||void 0===E?void 0:E.holdingNumber),null!=z&&null!==(_=z.data)&&void 0!==_&&_.registrationDetails&&(C.additionalDetails.registrationDetails=null==z||null===(f=z.data)||void 0===f?void 0:f.registrationDetails),null!=z&&null!==(g=z.data)&&void 0!==g&&g.applicationType&&(C.additionalDetails.applicationType=null==z||null===(A=z.data)||void 0===A?void 0:A.applicationType),null!=z&&null!==(S=z.data)&&void 0!==S&&S.serviceType&&(C.additionalDetails.serviceType=null==z||null===(h=z.data)||void 0===h?void 0:h.serviceType),C.landInfo=(null==z||null===(b=z.data)||void 0===b||null===(y=b.bpaData)||void 0===y||null===(D=y.bpaApprovalResponse)||void 0===D?void 0:D[0].landInfo)||{};let N=sessionStorage.getItem("BPA_ARCHITECT_NAME"),I=N?JSON.parse(N):"ARCHITECT";C.additionalDetails.typeOfArchitect=I,Digit.OBPSService.create({BPA:C},ne).then((e,t)=>{var l;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(e.BPA[0].data=z.data,e.BPA[0].uiFlow=null==z?void 0:z.uiFlow,G("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;ae({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 G(Y.key,X)},onSkip:()=>G()},l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},K("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",style:{border:"none"},label:K("OCBPA"===ie?"BPA_OC_EDCR_NO_LABEL":"BPA_EDCR_NO_LABEL"),text:null==de?void 0:de.edcrNumber,labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),l.createElement(o.Row,{className:"border-none",label:K("BPA_UPLOADED_PLAN_DIAGRAM"),text:l.createElement(ce,{label:K("Uploaded Plan.pdf"),jumpTo:null==de?void 0:de.updatedDxfFile})}),l.createElement(o.Row,{className:"border-none",label:K("BPA_SCRUNTINY_REPORT_OUTPUT"),text:l.createElement(ce,{label:K("BPA_SCRUTINY_REPORT_PDF"),jumpTo:null==de?void 0:de.planReport})})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},K("OCBPA"===ie?"BPA_ACTUAL_BUILDING_EXTRACT_HEADER":"BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:K("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:null!=de&&null!==(s=de.planDetail)&&void 0!==s&&null!==(c=s.blocks)&&void 0!==c&&null!==(v=c[0])&&void 0!==v&&null!==(p=v.building)&&void 0!==p&&p.totalBuitUpArea?`${null==de||null===(m=de.planDetail)||void 0===m||null===(E=m.blocks)||void 0===E||null===(_=E[0])||void 0===_||null===(f=_.building)||void 0===f?void 0:f.totalBuitUpArea} ${K("BPA_SQ_MTRS_LABEL")}`:K("NA")}),l.createElement(o.Row,{className:"border-none",label:K("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==de||null===(g=de.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:K("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:null!=de&&null!==(b=de.planDetail)&&void 0!==b&&null!==(y=b.blocks)&&void 0!==y&&null!==(D=y[0])&&void 0!==D&&null!==(C=D.building)&&void 0!==C&&C.declaredBuildingHeight?`${null==de||null===(T=de.planDetail)||void 0===T||null===(P=T.blocks)||void 0===P||null===(N=P[0])||void 0===N||null===(I=N.building)||void 0===I?void 0:I.declaredBuildingHeight} ${K("BPA_MTRS_LABEL")}`:K("NA")}),l.createElement(o.Row,{className:"border-none",label:K("BPA_SECTION_HEIGHT_EXCLUDING_MUMTY_PARAPET"),text:null!=de&&null!==(L=de.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&&R.buildingHeightExcludingMP?`${null==de||null===(w=de.planDetail)||void 0===w||null===(x=w.blocks)||void 0===x||null===(M=x[0])||void 0===M||null===(F=M.building)||void 0===F?void 0:F.buildingHeightExcludingMP} ${K("BPA_MTRS_LABEL")}`:K("NA")})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},K("BPA_OCC_SUBOCC_HEADER")),null==de||null===(k=de.planDetail)||void 0===k||null===(U=k.blocks)||void 0===U?void 0:U.map((e,t)=>{var n;return l.createElement("div",{key:t,style:{marginTop:"20px"}},"OCBPA"!==ie?l.createElement("div",{className:"tag-container"},X["Block_"+e.number]&&X["Block_"+e.number].length>0&&(null===(n=X["Block_"+e.number])||void 0===n?void 0:n.map((t,n)=>l.createElement(o.RemoveableTag,{key:n,text:""+K(t.i18nKey),onClick:()=>((e,t,l)=>{let n=X["Block_"+l].filter((t,l)=>l!==e);q(n);let i=X;i["Block_"+l]=n,J(i)})(n,0,e.number)})))):null,"OCBPA"!==ie?X["Block_"+e.number]&&X["Block_"+e.number].length>0&&l.createElement(o.LinkButton,{style:{textAlign:"left"},label:"Clear All",onClick:()=>(e=>{let t=[],l=X;l["Block_"+e]=t,q(t),J(l)})(e.number)}):null,l.createElement("div",{style:{marginTop:"20px"}},"OCBPA"===ie?l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:""+K("BPA_SUB_OCCUPANCY_LABEL"),text:Ee(t)})):null,l.createElement("div",{style:{overflowX:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:K,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:se(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"}},K("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{label:K("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=de&&null!==(H=de.planDetail)&&void 0!==H&&null!==(W=H.planInformation)&&void 0!==W&&W.demolitionArea?`${null==de||null===(j=de.planDetail)||void 0===j||null===($=j.planInformation)||void 0===$?void 0:$.demolitionArea} ${K("BPA_SQ_MTRS_LABEL")}`:K("CS_NA")}))),oe&&l.createElement(o.Toast,{error:!0,label:K(null==oe?void 0:oe.message),isDleteBtn:!0,onClose:()=>{ae(null)}}))},BPANewBuildingdetails:e=>{var n,r,u,d,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$;let{t:G,config:z,onSelect:Y,formData:K}=e;i.useLocation();let V=window.location.href.charAt(window.location.href.length-1),q={};const X=e=>e?{i18nKey:e,code:e,value:e}:null,[J,Z]=t.useState((null==K||null===(n=K.owners)||void 0===n?void 0:n.approvedColony)||X(null==K||null===(r=K.additionalDetails)||void 0===r?void 0:r.approvedColony)||""),[Q,ee]=t.useState((null==K||null===(u=K.owners)||void 0===u?void 0:u.masterPlan)||X(null==K||null===(d=K.additionalDetails)||void 0===d?void 0:d.masterPlan)||""),[te,le]=t.useState((null==K||null===(v=K.owners)||void 0===v?void 0:v.UlbName)||X(null==K||null===(p=K.additionalDetails)||void 0===p?void 0:p.UlbName)||""),[ne,ie]=t.useState((null==K||null===(m=K.owners)||void 0===m?void 0:m.buildingStatus)||X(null==K||null===(E=K.additionalDetails)||void 0===E?void 0:E.buildingStatus)||""),[oe,ae]=t.useState((null==K||null===(_=K.owners)||void 0===_?void 0:_.schemes)||X(null==K||null===(f=K.additionalDetails)||void 0===f?void 0:f.schemes)||""),[re,ue]=t.useState((null==K||null===(g=K.owners)||void 0===g?void 0:g.purchasedFAR)||X(null==K||null===(A=K.additionalDetails)||void 0===A?void 0:A.purchasedFAR)||""),[de,se]=t.useState((null==K||null===(S=K.owners)||void 0===S?void 0:S.greenbuilding)||X(null==K||null===(h=K.additionalDetails)||void 0===h?void 0:h.greenbuilding)||""),[ce,ve]=t.useState((null==K||null===(b=K.owners)||void 0===b?void 0:b.restrictedArea)||X(null==K||null===(y=K.additionalDetails)||void 0===y?void 0:y.restrictedArea)||""),[pe,me]=t.useState((null==K||null===(D=K.owners)||void 0===D?void 0:D.District)||X(null==K||null===(C=K.additionalDetails)||void 0===C?void 0:C.District)||""),[Ee,_e]=t.useState((null==K||null===(T=K.owners)||void 0===T?void 0:T.proposedSite)||X(null==K||null===(P=K.additionalDetails)||void 0===P?void 0:P.proposedSite)||""),[fe,ge]=t.useState((null==K||null===(N=K.owners)||void 0===N?void 0:N.nameofApprovedcolony)||(null==K||null===(I=K.additionalDetails)||void 0===I?void 0:I.nameofApprovedcolony)||""),[Ae,Se]=t.useState((null==K||null===(L=K.owners)||void 0===L?void 0:L.NocNumber)||(null==K||null===(B=K.additionalDetails)||void 0===B?void 0:B.NocNumber)||""),[he,be]=t.useState((null==K||null===(O=K.owners)||void 0===O?void 0:O.schemesselection)||X(null==K||null===(R=K.additionalDetails)||void 0===R?void 0:R.schemesselection)||""),[ye,De]=t.useState((null==K||null===(w=K.owners)||void 0===w?void 0:w.schemeName)||(null==K||null===(x=K.additionalDetails)||void 0===x?void 0:x.schemeName)||""),[Ce,Te]=t.useState("Pre-Approved Standard Designs"),[Pe,Ne]=t.useState((null==K||null===(M=K.owners)||void 0===M?void 0:M.rating)||X(null==K||null===(F=K.additionalDetails)||void 0===F?void 0:F.rating)||""),[Ie,Le]=t.useState((null==K||null===(k=K.owners)||void 0===k?void 0:k.use)||X(null==K||null===(U=K.additionalDetails)||void 0===U?void 0:U.use)||""),[Be,Oe]=t.useState((null==K||null===(H=K.owners)||void 0===H?void 0:H.Ulblisttype)||X(null==K||null===(W=K.additionalDetails)||void 0===W?void 0:W.Ulblisttype)||""),[Re,we]=t.useState(null==K||null===(j=K.owners)||void 0===j?void 0:j.uploadedFile),[xe,Me]=t.useState(null==K||null===($=K.owners)||void 0===$?void 0:$.greenuploadedFile),[Fe,ke]=t.useState(),[Ue,He]=t.useState(),[We,je]=t.useState(null),[$e,Ge]=t.useState("");Digit.Utils.browser.isMobile(),t.useEffect(()=>{!function(){try{je(null);const e=function(){if(Ue&&null!=Ue&&Ue.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Ue||null===(t=Ue.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(Ue.size>=2e6)je(G("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Ue,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?we(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):je(G("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else je(G("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Ue]),t.useEffect(()=>{!function(){try{je(null);const e=function(){if(Fe&&null!=Fe&&Fe.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Fe||null===(t=Fe.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(Fe.size>=2e6)je(G("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Fe,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?Me(null==e||null===(n=e.data)||void 0===n||null===(i=n.files[0])||void 0===i?void 0:i.fileStoreId):je(G("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else je(G("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Fe]);const ze=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"},{code:"LAL_LAKEER",i18nKey:"LAL LAKEER"}],Ye=[{code:"YES",i18nKey:"YES"},{code:"NO",i18nKey:"NO"}],Ke=[{code:"PROPOSED",i18nKey:"Proposed"}],Ve=Digit.ULBService.getStateId(),{data:qe}=Digit.Hooks.obps.useUlbType(Ve,"BPA","UlbType"),{data:Xe}=Digit.Hooks.obps.useDistricts(Ve,"BPA","Districts"),{data:Je}=Digit.Hooks.obps.useULBList(Ve,"BPA","Ulb");let Ze=[],Qe=[],et=[];qe&&qe.map(e=>{(null==e?void 0:e.Districts)===(null==te?void 0:te.code)&&Ze.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Xe&&Xe.map(e=>{Qe.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})}),Je&&Je.map(e=>{e.Districts==(null==te?void 0:te.code)&&et.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{data:tt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"BuildingStatus"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.BuildingStatus}});let lt=[];tt&&tt.map(e=>{lt.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:nt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"RatingValue"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.RatingValue}});let it=[];nt&&nt.map(e=>{it.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:ot}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"MasterFields"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.MasterFields}});let at=[];ot&&ot.map(e=>{at.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:rt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"Scheme"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.Scheme}});let ut=[];rt&&rt.map(e=>{ut.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{data:dt}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"BPA",[{name:"SchemeType"}],{select:e=>{var t;return null==e||null===(t=e.BPA)||void 0===t?void 0:t.SchemeType}});let st=[];dt&&dt.map(e=>{st.push({i18nKey:"BPA_"+e.code,code:""+e.code,value:""+e.name})});const{control:ct}=a.useForm();function vt(e){ge(e.target.value)}function pt(e){Se(e.target.value)}function mt(e){De(e.target.value)}function Et(e){Te(e.target.value)}function _t(e){we(e.target.files[0]),He(e.target.files[0])}function ft(e){Me(e.target.files[0]),ke(e.target.files[0])}return l.createElement(l.Fragment,null,l.createElement($l,{currentStep:2}),l.createElement(o.FormStep,{config:z,onSelect:()=>{let e={...K.owners&&K.owners[V],approvedColony:J,use:Ie,UlbName:te,Ulblisttype:Be,District:pe,rating:Pe,masterPlan:Q,buildingStatus:ne,schemes:oe,schemesselection:he,purchasedFAR:re,greenbuilding:de,restrictedArea:ce,proposedSite:Ee,nameofApprovedcolony:fe,schemeName:ye,transferredscheme:Ce,NocNumber:Ae,uploadedFile:Re,greenuploadedFile:xe},t={...K};var l,n,i;t.owners||(t.owners=[]),"NO"==(null==J?void 0:J.code)?Ae||Re||null!=K&&null!==(l=K.owners)&&void 0!==l&&l.uploadedFile?"YES"===(null==de?void 0:de.code)?xe||null!=K&&null!==(n=K.owners)&&void 0!==n&&n.greenuploadedFile?Y(z.key,{...K[z.key],...e},t,!1,V):alert("Please Upload Document"):Y(z.key,{...K[z.key],...e},t,!1,V):alert("Please fill NOC number or Upload NOC Document"):"YES"===(null==de?void 0:de.code)?xe||null!=K&&null!==(i=K.owners)&&void 0!==i&&i.greenuploadedFile?Y(z.key,{...K[z.key],...e},t,!1,V):alert("Please Upload Document"):Y(z.key,{...K[z.key],...e},t,!1,V)},onSkip:()=>Y(),t:G,isDisabled:!(J&&Q&&Be&&te&&ne&&oe&&re&&de&&ce&&Ee)},l.createElement("div",null,l.createElement(o.CardLabel,null,""+G("BPA_APPROVED_COLONY")),l.createElement(a.Controller,{control:ct,name:"approvedColony",rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:J,select:Z,option:ze,optionKey:"i18nKey",t:G})}),(()=>{var e;switch(null==J?void 0:J.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+G("BPA_APPROVED_COLONY_NAME")),l.createElement(o.TextInput,s({t:G,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"nameofApprovedcolony",value:fe,onChange:vt,style:{width:"86%"},ValidationRequired:!1},q={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:G("TL_NAME_ERROR_MESSAGE")})));case"NO":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+G("BPA_NOC_NUMBER")),l.createElement("div",{className:"field-container"},l.createElement(o.TextInput,s({t:G,type:"text",isMandatory:!1,optionKey:"i18nKey",defaultValue:null==K||null===(e=K.owners)||void 0===e?void 0:e.NocNumber,name:"NocNumber",value:Ae,onChange:pt,style:{width:"86%"},ValidationRequired:!1},q={pattern:"^[a-zA-Z0-9/]*$",type:"text",title:G("TL_NAME_ERROR_MESSAGE")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"95px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>{console.log("inside_NOC_search")}}," ",l.createElement(o.SearchIcon,null)," ")),l.createElement("div",{style:{position:"relative",fontWeight:"bold",left:"20px"}},"OR"),l.createElement(o.UploadFile,{id:"noc-doc",style:{width:"86%"},onUpload:_t,onDelete:()=>{we(null),He("")},message:Re?"1 "+G("FILEUPLOADED"):G("ES_NO_FILE_SELECTED_LABEL"),error:We,uploadMessage:$e}));default:return null}})(),l.createElement(o.CardLabel,{style:{marginTop:"15px"}},""+G("BPA_MASTER_PLAN")),l.createElement(a.Controller,{control:ct,name:"masterPlan",defaultValue:Q,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:Q,select:ee,option:Ye,optionKey:"i18nKey",t:G})}),(()=>{switch(null==Q?void 0:Q.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+G("BPA_USE")),l.createElement(a.Controller,{control:ct,name:"use",defaultValue:Ie,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:Ie,select:Le,option:at,optionKey:"i18nKey",t:G})}));case"NO":default:return null}})(),l.createElement(o.CardLabel,null,""+G("BPA_DISTRICT")),l.createElement(a.Controller,{control:ct,name:"UlbName",defaultValue:te,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:te,select:le,option:Qe,optionKey:"i18nKey",t:G})}),l.createElement(o.CardLabel,null,""+G("BPA_ULB_NAME")),l.createElement(a.Controller,{control:ct,name:"District",defaultValue:pe,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:pe,select:me,option:et,optionKey:"i18nKey",t:G})}),l.createElement(o.CardLabel,null,""+G("BPA_ULB_TYPE")),l.createElement(a.Controller,{control:ct,name:"Ulblisttype",defaultValue:Be,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:Be,select:Oe,option:Ze,optionKey:"i18nKey",t:G})}),l.createElement(o.CardLabel,null,""+G("BPA_BUILDING_STATUS")),l.createElement(a.Controller,{control:ct,name:"buildingStatus",defaultValue:ne,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:ne,select:ie,option:lt,optionKey:"i18nKey",t:G})}),l.createElement(o.CardLabel,null,""+G("BPA_SCHEMES")),l.createElement(a.Controller,{control:ct,name:"schemes",defaultValue:oe,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:oe,select:ae,option:ut,optionKey:"i18nKey",t:G})}),(()=>{switch(null==oe?void 0:oe.code){case"SCHEME":return l.createElement(t.Fragment,null,l.createElement(o.CardLabel,null,""+G("BPA_SCHEME_TYPE_LABEL")),l.createElement(a.Controller,{control:ct,name:"schemesselection",defaultValue:he,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:he,select:be,option:st,optionKey:"i18nKey",t:G})}),l.createElement(o.CardLabel,null,""+G("BPA_SCHEME_NAME")),l.createElement(o.TextInput,s({t:G,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"schemeName",value:ye,onChange:mt,style:{width:"86%"},ValidationRequired:!1},q={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:G("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,""+G("BPA_TRANFERRED_SCHEME_LABEL")),l.createElement(o.TextInput,s({t:G,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"transferredscheme",value:Ce,onChange:Et,style:{width:"86%"},ValidationRequired:!1},q={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:G("PT_NAME_ERROR_MESSAGE")})));case"NON_SCHEME":default:return null}})(),l.createElement(o.CardLabel,null,""+G("BPA_PURCHASED_FAR")),l.createElement(a.Controller,{control:ct,name:"purchasedFAR",defaultValue:re,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:re,select:ue,option:Ye,optionKey:"i18nKey",t:G})}),l.createElement(o.CardLabel,null,""+G("BPA_GREEN_BUIDINGS")),l.createElement(a.Controller,{control:ct,name:"greenbuilding",defaultValue:de,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:de,select:se,option:Ye,optionKey:"i18nKey",t:G})}),(()=>{switch(null==de?void 0:de.code){case"YES":return l.createElement(t.Fragment,null,l.createElement(o.UploadFile,{id:"green-building-doc",onUpload:ft,onDelete:()=>{Me(null),ke("")},message:xe?"1 "+G("FILEUPLOADED"):G("ES_NO_FILE_SELECTED_LABEL"),error:We,uploadMessage:$e}),l.createElement("br",null),l.createElement(o.CardLabel,null,""+G("BPA_SELECT_RATINGS")),l.createElement(a.Controller,{control:ct,name:"rating",defaultValue:Pe,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:Pe,select:Ne,option:it,optionKey:"i18nKey",t:G})}));case"NO":default:return null}})(),l.createElement(o.CardLabel,null,""+G("BPA_RESTRICTED_AREA")),l.createElement(a.Controller,{control:ct,name:"restrictedArea",defaultValue:ce,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:ce,select:ve,option:Ye,optionKey:"i18nKey",t:G})}),l.createElement(o.CardLabel,null,""+G("BPA_PROPOSED_SITE_TYPE")),l.createElement(a.Controller,{control:ct,name:"proposedSite",defaultValue:Ee,rules:{required:G("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(o.Dropdown,{className:"form-field",selected:Ee,select:_e,option:Ke,optionKey:"i18nKey",t:G})}))))},OwnerDetails:e=>{var n,i,a,r,u,d,c,v,p;let{t:m,config:E,onSelect:_,formData:f}=e;console.log("formdatatstd",f);let g={};sessionStorage.removeItem("currentPincode");let A=window.location.href.includes("edit-application"),S=window.location.href.includes("renew-trade");const h=Digit.ULBService.getCurrentTenantId(),b=Digit.ULBService.getStateId(),[y,D]=t.useState(!A&&!S),[C,T]=t.useState([]),[P,N]=t.useState([]),[I,L]=t.useState(null==f||null===(n=f.owners)||void 0===n?void 0:n.ownershipCategory),[B,O]=t.useState((null==f||null===(i=f.owners)||void 0===i?void 0:i.name)||""),[R,w]=t.useState((null==f||null===(a=f.owners)||void 0===a?void 0:a.emailId)||""),[x,M]=t.useState((null==f||null===(r=f.owners)||void 0===r?void 0:r.aadharNumber)||""),[F,k]=t.useState(!1),[U,H]=t.useState(null==f||null===(u=f.owners)||void 0===u?void 0:u.gender),[W,j]=t.useState((null==f||null===(d=f.owners)||void 0===d?void 0:d.mobileNumber)||""),[$,G]=t.useState(null),[z,Y]=t.useState(!1);Digit.Utils.browser.isMobile();const K=!(null==I||!I.code.includes("MULTIPLEOWNERS"));null==f||null===(c=f.owners)||void 0===c||null===(v=c.owners)||void 0===v||v.forEach(e=>{"false"==e.isPrimaryOwner&&(e.isPrimaryOwner=!1)});const[V,q]=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}]),X=Digit.UserService.getUser();console.log("userrrr",X),t.useEffect(()=>{var e=0;V.map(t=>{null!=t&&t.isPrimaryOwner&&(e=1),D(!(null!=t&&t.name&&null!=t&&t.mobileNumber&&null!=t&&t.gender))}),y||!I||null!=I&&I.code.includes("SINGLEOWNER")||D(1!=e)},[V]),t.useEffect(()=>{const e=mt(V);I&&!K&&(null==e?void 0:e.length)>1&&q([{...e[0],isPrimaryOwner:!0}])},[I]);const{isLoading:J,data:Z}=Digit.Hooks.obps.useMDMS(b,"common-masters",["OwnerShipCategory"]),{data:Q}=Digit.Hooks.obps.useMDMS(b,"common-masters",["GenderType"]);t.useEffect(()=>{var e;const t=null==Z||null===(e=Z["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_"+_t(null==e?void 0:e.code,".","_")}),T(e)}},[Z]),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}),N(e)}},[Q]);const[ee,te]=t.useState(null);function le(e){let t="";return e.map((e,l)=>{t=t+(0!==l?",":"")+e.code}),t}return l.createElement("div",null,l.createElement($l,{currentStep:3}),l.createElement(o.FormStep,{config:E,onSelect:function(){try{return te(null),Promise.resolve(function(e,t){try{let e=!1,t=[];return t=null==V?void 0:V.map((e,t)=>{var l;return Digit.UserService.userSearch(Digit.ULBService.getStateId(),{userName:null==V||null===(l=V[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],V.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&&G({key:"true",error:!0,message:`${m("BPA_OWNER_VALIDATION_1")} ${null==i?void 0:i.join(", ")} ${m("BPA_OWNER_VALIDATION_2")}`}),1!=e})}catch(e){return Promise.reject(e)}}()).then(function(e){if(e)if(1==K&&1==V.length)window.scrollTo(0,0),te("BPA_ERROR_MULTIPLE_OWNER");else{let e,K=f.owners;if(e={...K,owners:V,ownershipCategory:I},null!=f&&f.id)_(E.key,e);else{var t,l,n,i,o,a,r,u,d,s,c,v,p,m,g,A,S,b,y,D,C,T,P,N,L,B,O,R,w,x,M,F,k,U,H,W,j,$,z,q,J,Z,Q,ee,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e,fe,ge,Ae,Se,he,be,ye,De,Ce,Te,Pe,Ne,Ie,Le,Be,Oe,Re,we,xe,Me,Fe,ke,Ue,He,We,je,$e,Ge,ze,Ye,Ke,Ve,qe,Xe,Je,Ze,Qe,et,tt,lt,nt,it,ot,at,rt,ut,dt,st,ct,vt,pt,mt,Et,_t,ft,gt,At,St,ht,bt,yt,Dt,Ct,Tt,Pt,Nt,It,Lt,Bt,Ot,Rt,wt,xt,Mt,Ft,kt,Ut,Ht,Wt,jt,$t,Gt,zt,Yt,Kt,Vt,qt,Xt,Jt;Y(!0);let E=[];null===(t=e)||void 0===t||null===(l=t.owners)||void 0===l||l.map(e=>{E.push({...e,active:!0,name:e.name,emailId:e.emailId,aadharNumber:e.aadharNumber,mobileNumber:e.mobileNumber,isPrimaryOwner:e.isPrimaryOwner,gender:e.gender.code,fatherOrHusbandName:"NAME"})});let V={};V.edcrNumber=null!=f&&null!==(n=f.edcrNumber)&&void 0!==n&&n.edcrNumber?null==f||null===(i=f.edcrNumber)||void 0===i?void 0:i.edcrNumber:null==f||null===(o=f.data)||void 0===o||null===(a=o.scrutinyNumber)||void 0===a?void 0:a.edcrNumber,V.riskType=null==f||null===(r=f.data)||void 0===r?void 0:r.riskType,V.applicationType=null==f||null===(u=f.data)||void 0===u?void 0:u.applicationType,V.serviceType=null==f||null===(d=f.data)||void 0===d?void 0:d.serviceType;const te=Digit.UserService.getUser(),Zt=null==te||null===(s=te.info)||void 0===s?void 0:s.uuid;V.tenantId=null==f||null===(c=f.address)||void 0===c||null===(v=c.city)||void 0===v?void 0:v.code,V.workflow={action:"INITIATE",assignes:[null==te||null===(p=te.info)||void 0===p?void 0:p.uuid]},V.accountId=Zt,V.documents=null,V.additionalDetails={GISPlaceName:null==f||null===(m=f.address)||void 0===m?void 0:m.placeName},V.additionalDetails.boundaryWallLength=(null==f||null===(g=f.data)||void 0===g?void 0:g.boundaryWallLength)||"NA",V.additionalDetails.area=(null==f?void 0:f.data.edcrDetails.planDetail.planInformation.plotArea).toString()||"NA",V.additionalDetails.height=(null==f?void 0:f.data.edcrDetails.planDetail.blocks[0].building.buildingHeight).toString()||"NA",V.additionalDetails.usage=(null==f?void 0:f.data.occupancyType)||"NA",V.additionalDetails.builtUpArea=(null==f?void 0:f.data.edcrDetails.planDetail.blocks[0].building.totalBuitUpArea).toString(),V.additionalDetails.ownerName=E.map(e=>e.name).join(","),null!=f&&null!==(A=f.data)&&void 0!==A&&A.registrationDetails&&(V.additionalDetails.registrationDetails=null==f||null===(S=f.data)||void 0===S?void 0:S.registrationDetails),null!=f&&null!==(b=f.data)&&void 0!==b&&b.applicationType&&(V.additionalDetails.applicationType=null==f||null===(y=f.data)||void 0===y?void 0:y.applicationType),null!=f&&null!==(D=f.data)&&void 0!==D&&D.serviceType&&(V.additionalDetails.serviceType=null==f||null===(C=f.data)||void 0===C?void 0:C.serviceType),null!=f&&null!==(T=f.data)&&void 0!==T&&T.wardnumber&&(V.additionalDetails.wardnumber=null==f||null===(P=f.data)||void 0===P?void 0:P.wardnumber),null!=f&&null!==(N=f.data)&&void 0!==N&&N.zonenumber&&(V.additionalDetails.zonenumber=null==f||null===(L=f.data)||void 0===L?void 0:L.zonenumber),null!=f&&null!==(B=f.data)&&void 0!==B&&B.khasraNumber&&(V.additionalDetails.khasraNumber=null==f||null===(O=f.data)||void 0===O?void 0:O.khasraNumber),null!=f&&null!==(R=f.data)&&void 0!==R&&R.applicationType&&(V.additionalDetails.applicationType=null==f||null===(w=f.data)||void 0===w?void 0:w.applicationType),null!=f&&null!==(x=f.data)&&void 0!==x&&x.serviceType&&(V.additionalDetails.serviceType=null==f||null===(M=f.data)||void 0===M?void 0:M.serviceType),null!=f&&null!==(F=f.data)&&void 0!==F&&F.architectid&&(V.additionalDetails.architectid=null==f||null===(k=f.data)||void 0===k?void 0:k.architectid),null!=f&&null!==(U=f.data)&&void 0!==U&&U.propertyuid&&(V.additionalDetails.propertyuid=null==f||null===(H=f.data)||void 0===H?void 0:H.propertyuid),null!=f&&null!==(W=f.data)&&void 0!==W&&W.bathnumber&&(V.additionalDetails.bathnumber=null==f||null===(j=f.data)||void 0===j?void 0:j.bathnumber),null!=f&&null!==($=f.data)&&void 0!==$&&$.kitchenNumber&&(V.additionalDetails.kitchenNumber=null==f||null===(z=f.data)||void 0===z?void 0:z.kitchenNumber),null!=f&&null!==(q=f.data)&&void 0!==q&&q.approxinhabitants&&(V.additionalDetails.approxinhabitants=null==f||null===(J=f.data)||void 0===J?void 0:J.approxinhabitants),null!=f&&null!==(Z=f.data)&&void 0!==Z&&Z.materialusedinfloor&&(V.additionalDetails.materialusedinfloor=null==f||null===(Q=f.data)||void 0===Q?void 0:Q.materialusedinfloor),null!=f&&null!==(ee=f.data)&&void 0!==ee&&ee.distancefromsewer&&(V.additionalDetails.distancefromsewer=null==f||null===(ne=f.data)||void 0===ne?void 0:ne.distancefromsewer),null!=f&&null!==(ie=f.data)&&void 0!==ie&&ie.sourceofwater&&(V.additionalDetails.sourceofwater=null==f||null===(oe=f.data)||void 0===oe?void 0:oe.sourceofwater),null!=f&&null!==(ae=f.data)&&void 0!==ae&&ae.watercloset&&(V.additionalDetails.watercloset=null==f||null===(re=f.data)||void 0===re?void 0:re.watercloset),null!=f&&null!==(ue=f.data)&&void 0!==ue&&ue.materialused&&(V.additionalDetails.materialused=null==f||null===(de=f.data)||void 0===de?void 0:de.materialused),null!=f&&null!==(se=f.data)&&void 0!==se&&se.materialusedinroofs&&(V.additionalDetails.materialusedinroofs=null==f||null===(ce=f.data)||void 0===ce?void 0:ce.materialusedinroofs),null!=f&&null!==(ve=f.owners)&&void 0!==ve&&null!==(pe=ve.approvedColony)&&void 0!==pe&&pe.code&&(V.additionalDetails.approvedColony=null==f||null===(me=f.owners)||void 0===me||null===(Ee=me.approvedColony)||void 0===Ee?void 0:Ee.code),null!=f&&null!==(_e=f.owners)&&void 0!==_e&&null!==(fe=_e.buildingStatus)&&void 0!==fe&&fe.code&&(V.additionalDetails.buildingStatus=null==f||null===(ge=f.owners)||void 0===ge||null===(Ae=ge.buildingStatus)||void 0===Ae?void 0:Ae.code),null!=f&&null!==(Se=f.owners)&&void 0!==Se&&null!==(he=Se.greenbuilding)&&void 0!==he&&he.code&&(V.additionalDetails.greenbuilding=null==f||null===(be=f.owners)||void 0===be||null===(ye=be.greenbuilding)||void 0===ye?void 0:ye.code),null!=f&&null!==(De=f.owners)&&void 0!==De&&null!==(Ce=De.masterPlan)&&void 0!==Ce&&Ce.code&&(V.additionalDetails.masterPlan=null==f||null===(Te=f.owners)||void 0===Te||null===(Pe=Te.masterPlan)||void 0===Pe?void 0:Pe.code),null!=f&&null!==(Ne=f.owners)&&void 0!==Ne&&null!==(Ie=Ne.proposedSite)&&void 0!==Ie&&Ie.code&&(V.additionalDetails.proposedSite=null==f||null===(Le=f.owners)||void 0===Le||null===(Be=Le.proposedSite)||void 0===Be?void 0:Be.code),null!=f&&null!==(Oe=f.owners)&&void 0!==Oe&&null!==(Re=Oe.purchasedFAR)&&void 0!==Re&&Re.code&&(V.additionalDetails.purchasedFAR=null==f||null===(we=f.owners)||void 0===we||null===(xe=we.purchasedFAR)||void 0===xe?void 0:xe.code),null!=f&&null!==(Me=f.owners)&&void 0!==Me&&null!==(Fe=Me.restrictedArea)&&void 0!==Fe&&Fe.code&&(V.additionalDetails.restrictedArea=null==f||null===(ke=f.owners)||void 0===ke||null===(Ue=ke.restrictedArea)||void 0===Ue?void 0:Ue.code),null!=f&&null!==(He=f.owners)&&void 0!==He&&null!==(We=He.schemes)&&void 0!==We&&We.i18nKey&&(V.additionalDetails.schemes=null==f||null===(je=f.owners)||void 0===je||null===($e=je.schemes)||void 0===$e?void 0:$e.i18nKey),null!=f&&null!==(Ge=f.owners)&&void 0!==Ge&&null!==(ze=Ge.UlbName)&&void 0!==ze&&ze.code&&(V.additionalDetails.UlbName=null==f||null===(Ye=f.owners)||void 0===Ye||null===(Ke=Ye.UlbName)||void 0===Ke?void 0:Ke.code.toLowerCase().replace(/^\w/,e=>e.toUpperCase())),null!=f&&null!==(Ve=f.owners)&&void 0!==Ve&&null!==(qe=Ve.District)&&void 0!==qe&&qe.code&&(V.additionalDetails.District=null==f||null===(Xe=f.owners)||void 0===Xe||null===(Je=Xe.District)||void 0===Je?void 0:Je.code),null!=f&&null!==(Ze=f.owners)&&void 0!==Ze&&Ze.nameofApprovedcolony&&(V.additionalDetails.nameofApprovedcolony=null==f||null===(Qe=f.owners)||void 0===Qe?void 0:Qe.nameofApprovedcolony),null!=f&&null!==(et=f.owners)&&void 0!==et&&et.NocNumber&&(V.additionalDetails.NocNumber=null==f||null===(tt=f.owners)||void 0===tt?void 0:tt.NocNumber),null!=f&&null!==(lt=f.owners)&&void 0!==lt&&null!==(nt=lt.coreArea)&&void 0!==nt&&nt.code&&(V.additionalDetails.coreArea=null==f||null===(it=f.owners)||void 0===it||null===(ot=it.coreArea)||void 0===ot?void 0:ot.code),null!=f&&null!==(at=f.owners)&&void 0!==at&&null!==(rt=at.schemesselection)&&void 0!==rt&&rt.i18nKey&&(V.additionalDetails.schemesselection=null==f||null===(ut=f.owners)||void 0===ut||null===(dt=ut.schemesselection)||void 0===dt?void 0:dt.i18nKey),null!=f&&null!==(st=f.owners)&&void 0!==st&&st.schemeName&&(V.additionalDetails.schemeName=null==f||null===(ct=f.owners)||void 0===ct?void 0:ct.schemeName),null!=f&&null!==(vt=f.owners)&&void 0!==vt&&vt.transferredscheme&&(V.additionalDetails.transferredscheme=null==f||null===(pt=f.owners)||void 0===pt?void 0:pt.transferredscheme),null!=f&&null!==(mt=f.owners)&&void 0!==mt&&null!==(Et=mt.Ulblisttype)&&void 0!==Et&&Et.value&&(V.additionalDetails.Ulblisttype=null==f||null===(_t=f.owners)||void 0===_t||null===(ft=_t.Ulblisttype)||void 0===ft?void 0:ft.value),null!=f&&null!==(gt=f.owners)&&void 0!==gt&>.uploadedFile&&(V.additionalDetails.uploadedFileNoc=null==f||null===(At=f.owners)||void 0===At?void 0:At.uploadedFile),null!=f&&null!==(St=f.owners)&&void 0!==St&&null!==(ht=St.rating)&&void 0!==ht&&ht.code&&(V.additionalDetails.rating=null==f||null===(bt=f.owners)||void 0===bt||null===(yt=bt.rating)||void 0===yt?void 0:yt.code),null!=f&&null!==(Dt=f.owners)&&void 0!==Dt&&Dt.greenuploadedFile&&(V.additionalDetails.uploadedFileGreenBuilding=null==f||null===(Ct=f.owners)||void 0===Ct?void 0:Ct.greenuploadedFile),null!=f&&null!==(Tt=f.owners)&&void 0!==Tt&&null!==(Pt=Tt.use)&&void 0!==Pt&&Pt.code&&(V.additionalDetails.use=null==f||null===(Nt=f.owners)||void 0===Nt||null===(It=Nt.use)||void 0===It?void 0:It.code),null!=X&&null!==(Lt=X.info)&&void 0!==Lt&&Lt.name&&(V.additionalDetails.architectName=null==X||null===(Bt=X.info)||void 0===Bt?void 0:Bt.name),null!=X&&null!==(Ot=X.info)&&void 0!==Ot&&Ot.mobileNumber&&(V.additionalDetails.architectMobileNumber=null==X||null===(Rt=X.info)||void 0===Rt?void 0:Rt.mobileNumber),V.landInfo={},V.landInfo.address={},null!=f&&null!==(wt=f.address)&&void 0!==wt&&null!==(xt=wt.city)&&void 0!==xt&&xt.code&&(V.landInfo.address.city=null==f||null===(Mt=f.address)||void 0===Mt||null===(Ft=Mt.city)||void 0===Ft?void 0:Ft.code),null!=f&&null!==(kt=f.address)&&void 0!==kt&&null!==(Ut=kt.locality)&&void 0!==Ut&&Ut.code&&(V.landInfo.address.locality={code:null==f||null===(Ht=f.address)||void 0===Ht||null===(Wt=Ht.locality)||void 0===Wt?void 0:Wt.code}),null!=f&&null!==(jt=f.address)&&void 0!==jt&&jt.pincode&&(V.landInfo.address.pincode=null==f||null===($t=f.address)||void 0===$t?void 0:$t.pincode),null!=f&&null!==(Gt=f.address)&&void 0!==Gt&&Gt.landmark&&(V.landInfo.address.landmark=null==f||null===(zt=f.address)||void 0===zt?void 0:zt.landmark),null!=f&&null!==(Yt=f.address)&&void 0!==Yt&&Yt.street&&(V.landInfo.address.street=null==f||null===(Kt=f.address)||void 0===Kt?void 0:Kt.street),null!=f&&null!==(Vt=f.address)&&void 0!==Vt&&Vt.geoLocation&&(V.landInfo.address.geoLocation=null==f||null===(qt=f.address)||void 0===qt?void 0:qt.geoLocation),V.landInfo.owners=E,V.landInfo.ownershipCategory=I.code,V.landInfo.tenantId=null==f||null===(Xt=f.address)||void 0===Xt||null===(Jt=Xt.city)||void 0===Jt?void 0:Jt.code,V.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:le(e[1])})}),a}(f);let Qt=sessionStorage.getItem("BPA_ARCHITECT_NAME"),el=Qt?JSON.parse(Qt):"ARCHITECT";V.additionalDetails.typeOfArchitect=el,V.additionalDetails.stakeholderName=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_NAME")),V.additionalDetails.ownersWithAddress=E.map(e=>{var t,l,n,i,o,a,r,u,d,s,c;let v=0!==(null==f||null===(t=f.address)||void 0===t?void 0:t.landmark.length)?null==f||null===(l=f.address)||void 0===l?void 0:l.doorNo:"NA",p=0!==(null==f||null===(n=f.address)||void 0===n?void 0:n.street.length)?null==f||null===(i=f.address)||void 0===i?void 0:i.street:"NA",m=void 0!==(null==f||null===(o=f.address)||void 0===o?void 0:o.pincode)&&0!==(null==f||null===(a=f.address)||void 0===a?void 0:a.pincode.length)?null==f||null===(r=f.address)||void 0===r?void 0:r.pincode:"NA";return`${e.name} (${p}, ${v}, ${null==f||null===(u=f.address)||void 0===u||null===(d=u.city)||void 0===d||null===(s=d.city)||void 0===s?void 0:s.name}, ${null==f||null===(c=f.address)||void 0===c?void 0:c.locality.name}, ${m})`}).join("; "),V.additionalDetails.stakeholderRegistrationNumber=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_REGISTRATION_NUMBER")),V.additionalDetails.stakeholderAddress=JSON.parse(sessionStorage.getItem("BPA_STAKEHOLDER_ADDRESS")),V.additionalDetails.isSelfCertificationRequired="true",Digit.OBPSService.create({BPA:V},h).then((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v,p;(null==e||null===(l=e.BPA)||void 0===l?void 0:l.length)>0&&(null==e||null===(n=e.BPA)||void 0===n||null===(i=n[0])||void 0===i||null===(o=i.landInfo)||void 0===o||null===(a=o.owners)||void 0===a||a.forEach(e=>{e.gender={code:e.gender,active:!0,i18nKey:"COMMON_GENDER_"+e.gender}}),e.BPA[0].owners={...K,owners:null==e||null===(r=e.BPA)||void 0===r||null===(u=r[0])||void 0===u||null===(d=u.landInfo)||void 0===d?void 0:d.owners,ownershipCategory:I},e.BPA[0].address=null==e||null===(s=e.BPA)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.landInfo)||void 0===v?void 0:v.address,e.BPA[0].address.city=f.address.city,e.BPA[0].address.locality=f.address.locality,e.BPA[0].placeName=null==f||null===(p=f.address)||void 0===p?void 0:p.placeName,e.BPA[0].data=f.data,e.BPA[0].BlockIds=function(e){let t={};return e.map((e,l)=>{t["Block_"+e.floorNo]=e.id}),t}(e.BPA[0].landInfo.unit),e.BPA[0].subOccupancy=null==f?void 0:f.subOccupancy,e.BPA[0].uiFlow=null==f?void 0:f.uiFlow,Y(!1),_("",e.BPA[0],"",!0))}).catch(e=>{var t,l,n;Y(!1),G({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})})}}})}catch(e){return Promise.reject(e)}},onSkip:()=>_(),t:m,isDisabled:y||function(){let e=0;return V&&(null==V||V.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}()||!I||z,forcedError:m(ee)},J?l.createElement(o.Loader,null):l.createElement("div",{style:{marginBottom:"10px"}},l.createElement("div",null,l.createElement(o.CardLabel,null,m("BPA_TYPE_OF_OWNER_LABEL")+" *"),l.createElement(o.RadioButtons,{isMandatory:E.isMandatory,options:C,selectedOption:I,optionsKey:"i18nKey",onSelect:function(e){L(e)},value:I,labelKey:"PT_OWNERSHIP",isDependent:!0})),V.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"}},m("CORE_COMMON_MOBILE_NUMBER")+" *"),K&&l.createElement(o.LinkButton,{label:l.createElement(o.DeleteIcon,{style:{float:"right",position:"relative",bottom:"5px"},fill:1!=V.length?"#494848":"#FAFAFA"}),style:{width:"100px",display:"inline",background:"black"},onClick:e=>function(e){const t=[...V];1!=t.length&&(t.splice(e,1),1==t.length&&(t[0]={...t[0],isPrimaryOwner:!0}),q(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,s({style:{background:"#FAFAFA",padding:"0px 35px"},type:"text",t:m,isMandatory:!1,optionKey:"i18nKey",name:"mobileNumber",value:e.mobileNumber,onChange:e=>function(e,t){let l=[...V];l[e].mobileNumber=t.target.value,j(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&D(!1)}(t,e)},g={isRequired:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:m("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=mt(V),a=(null==t||null===(l=t[e])||void 0===l?void 0:l.mobileNumber)||"";if(G(null),!a.match(Et("MobileNo")))return G({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 G({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==V||null===(i=V[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))G({key:"true",warning:!0,message:"ERR_MOBILE_NUMBER_NOT_REGISTERED"});else{var d,s,c,v,p;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=Pt(null==n?void 0:n.dob)),null!=n&&n.createdDate&&(n.createdDate=Bt(null==n?void 0:n.createdDate),n.lastModifiedDate=Bt(null==n?void 0:n.lastModifiedDate),n.pwdExpiryDate=Bt(null==n?void 0:n.pwdExpiryDate));let i=[...t];var m;i[e]&&(i[e]=n,i[e].isPrimaryOwner=(null===(m=V[e])||void 0===m?void 0:m.isPrimaryOwner)||!1),q(i),null!==(s=i[e])&&void 0!==s&&s.mobileNumber&&null!==(c=i[e])&&void 0!==c&&c.name&&null!==(v=i[e])&&void 0!==v&&null!==(p=v.gender)&&void 0!==p&&p.code?D(!0):D(!1),u&&(D(!1),G({key:"true",error:!0,message:"BPA_OWNER_VALIDATION_"+(null==u?void 0:u.code)}))}});G({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,m("CORE_COMMON_NAME")+" *"),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:e.name,onChange:e=>function(e,t){let l=[...V];l[e].name=t.target.value,O(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&D(!1)}(t,e)},g={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:m("TL_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,m("BPA_APPLICANT_GENDER_LABEL")+" *"),l.createElement(o.RadioOrSelect,{name:"gender",options:P,selectedOption:e.gender,optionKey:"i18nKey",onSelect:e=>function(e,t){let l=[...V];l[e].gender=t,H(t),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&D(!1)}(t,e),t:m}),l.createElement(o.CardLabel,null,""+m("BPA_AADHAAR_NUMBER_LABEL")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"aadharNumber",value:e.aadharNumber,onChange:e=>function(e,t){let l=[...V];l[e].aadharNumber=t.target.value,M(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&D(!1)}(t,e)},g={pattern:"^[2-9]{1}[0-9]{3}[0-9]{4}[0-9]{4}$",type:"tel",title:m("INVALID_AADHAAR_NUMBER")})),l.createElement(o.CardLabel,null,""+m("CORE_EMAIL_ID")),l.createElement(o.TextInput,s({style:{background:"#FAFAFA"},t:m,type:"emailId",isMandatory:!1,optionKey:"i18nKey",name:"emailId",value:e.emailId,onChange:e=>function(e,t){let l=[...V];l[e].emailId=t.target.value,w(t.target.value),q(l),l[e].gender&&l[e].mobileNumber&&l[e].name&&D(!1)}(t,e)},g={pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"emailId",title:m("TL_EMAIL_ID_ERROR_MESSAGE")},{disabled:!1})),K&&l.createElement(o.CheckBox,{label:m("BPA_IS_PRIMARY_OWNER_LABEL"),onChange:e=>function(e,t){let l=[...V];l.map(e=>{e.isPrimaryOwner=!1}),l[e].isPrimaryOwner=!K||t.target.checked,k(t.target.checked),q(l)}(t,e),value:e.isPrimaryOwner,checked:e.isPrimaryOwner,style:{paddingTop:"10px"}})))),K?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=[...V];e.push({name:"",gender:"",mobileNumber:null,isPrimaryOwner:!1}),q(e),D(!0)}()},m("BPA_ADD_OWNER")))):null)),$&&l.createElement(o.Toast,{error:null==$?void 0:$.error,warning:null==$?void 0:$.warning,label:m(null==$?void 0:$.message),isDleteBtn:!0,onClose:()=>{G(null)}}))},DocumentDetails:e=>{var n,i;let{t:a,config:r,onSelect:u,formData:d}=e;const s=Digit.ULBService.getStateId(),c=Digit.ULBService.getCurrentTenantId(),[v,p]=t.useState((null==d||null===(n=d.documents)||void 0===n?void 0:n.documents)||(null==d?void 0:d.documents)||[]),[m,E]=t.useState(null),[_,f]=t.useState(!0),[g,A]=t.useState(!1),S=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,[h,b]=t.useState(!1),y=mt((null==d?void 0:d.PrevStateDocuments)||[]),{data:D,isLoading:C}=Digit.Hooks.obps.useBPATaxDocuments(s,d,y||[]);return t.useEffect(()=>{const e=D.filter(e=>e.required).map(e=>e.code),t=e.filter(e=>v.reduce((t,l)=>{var n,i,o,a;return e==`${null==l||null===(n=l.documentType)||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i[0]}.${null==l||null===(o=l.documentType)||void 0===o||null===(a=o.split("."))||void 0===a?void 0:a[1]}`||t},!1));f(!(t.length==e.length&&v.length>0))},[v,g]),l.createElement("div",null,l.createElement($l,{currentStep:3,flow:"OCBPA"===S?"OCBPA":""}),C?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{let e,t=d.documents,l=[];D&&(null==D||D.map(e=>{v&&v.filter(t=>e.code===_t(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")&&_||h,onAdd:function(){}},null==D?void 0:D.filter(e=>"ARCHITECT.UNDERTAKING"!==e.code&&"CITIZEN.UNDERTAKING"!==e.code).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(zl,{key:t,document:e,t:a,error:m,setError:E,setDocuments:p,documents:v,setCheckRequiredFields:A,formData:d,beforeUploadDocuments:y||[],isNextButtonDisabled:h,setIsNextButtonDisabled:b}))),m&&l.createElement(o.Toast,{label:m,onClose:()=>E(null),error:!0}),l.createElement(o.SubmitBar,{label:a("BPA_SAVE_AS_DRAFT"),onSubmit:()=>{var e,t,l,n,i,o,a;let r={...d};r.documents={...d.documents,documents:v};let u={id:r.id,applicationNo:r.applicationNo,approvalNo:r.approvalNo,accountId:r.accountId,edcrNumber:r.edcrNumber,riskType:r.riskType,businessService:r.businessService,landId:r.landId,tenantId:r.tenantId,approvalDate:r.approvalDate,applicationDate:r.applicationDate,status:r.status,documents:r.documents.documents,landInfo:{...r.landInfo,address:{...null===(e=r.landInfo)||void 0===e?void 0:e.address,city:null===(t=r.landInfo)||void 0===t||null===(l=t.address)||void 0===l||null===(n=l.city)||void 0===n?void 0:n.code},owners:null==r||null===(i=r.landInfo)||void 0===i?void 0:i.owners.map(e=>{var t;return{...e,gender:null===(t=e.gender)||void 0===t?void 0:t.code}}),unit:null==r||null===(o=r.landInfo)||void 0===o||null===(a=o.unit)||void 0===a?void 0:a.map(e=>({id:null==e?void 0:e.id,floorNo:null==e?void 0:e.floorNo,unitType:null==e?void 0:e.unitType,blockIndex:null==e?void 0:e.blockIndex,usageCategory:null==e?void 0:e.usageCategory,occupancyType:null==e?void 0:e.occupancyType}))},assignee:r.assignee||[],workflow:{action:"SAVE_AS_DRAFT",assignes:null,comments:null,varificationDocuments:null},auditDetails:r.auditDetails,additionalDetails:r.additionalDetails,applicationType:"BUILDING_PLAN_SCRUTINY",serviceType:"NEW_CONSTRUCTION",occupancyType:"A"};Digit.OBPSService.update({BPA:u},c).then(e=>{console.log("Draft saved successfully",e)}).catch(e=>{console.error("Error saving draft",e)})},disabled:_}),l.createElement("br",null)),(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,v]=t.useState((null==d||null===(n=d.nocDocuments)||void 0===n?void 0:n.nocDocuments)||[]),[p,m]=t.useState(null),[E,_]=t.useState([]),[f,g]=t.useState(!0),[A,S]=t.useState(!1);let[h,b]=t.useState(null!=d&&d.PrevStateNocDocuments?mt(null==d?void 0:d.PrevStateNocDocuments):[]);const y=null==d||null===(i=d.uiFlow)||void 0===i?void 0:i.flow,[D,C]=t.useState(null==d?void 0:d.applicationNo),[T,P]=t.useState([]),[N,I]=t.useState([]),[L,B]=t.useState([]),{data:O}=Digit.Hooks.obps.useNocDetails(null==d?void 0:d.tenantId,{sourceRefId:D}),{isLoading:R,data:w}=Digit.Hooks.obps.useMDMS(s,"NOC",["DocumentTypeMapping"]),{data:x}=Digit.Hooks.obps.useMDMS(s,"common-masters",["DocumentType"]),{data:M,isLoading:F}=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==w||null===(e=w.NOC)||void 0===e?void 0:e.DocumentTypeMapping)},[w]),t.useEffect(()=>{var e;B(null==x||null===(e=x["common-masters"])||void 0===e?void 0:e.DocumentType)},[x]),t.useEffect(()=>{if(null!=T&&T.length&&null!=N&&N.length){let e=[];T.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})}),_(t)}},[T,N,L,h]),l.createElement("div",null,l.createElement($l,{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:T,nocTaxDocuments:E},u(r.key,e)},onSkip:()=>{let e;e={...d.nocDocuments,nocDocuments:c,NocDetails:T,nocTaxDocuments:E},u(r.key,e)},onAdd:function(){}},null==E?void 0:E.map((e,t)=>l.createElement(Kl,{key:t,document:e,t:a,error:p,setError:m,setNocDocuments:v,nocDocuments:c,setCheckRequiredFields:S,formData:d,beforeUploadNocDocuments:h,pdfLoading:F})),p&&l.createElement(o.Toast,{label:p,onClose:()=>m(null),error:!0})))},NOCNumber:e=>{var n,i,a,r;let{t:u,config:d,onSelect:s,formData:c}=e;const[v,p]=t.useState((null==c||null===(n=c.additionalDetails)||void 0===n?void 0:n.nocNumber)||(null==c||null===(i=c.nocnumber)||void 0===i?void 0:i.nocNumber)||"");return Digit.ULBService.getCurrentTenantId(),Digit.Utils.browser.isMobile(),l.createElement("div",null,l.createElement($l,{currentStep:0}),l.createElement(o.FormStep,{t:u,config:d,onSelect:()=>{s(null==d?void 0:d.key,{nocNumber:v})},isDisabled:!v},l.createElement("div",{className:"field-container"},l.createElement(o.TextInput,{class:"card-input",type:"text",t:u,isMandatory:!1,optionKey:"i18nKey",name:"nocNumber",value:v,onChange:e=>{p(e.target.value)},defaultValue:(null==c||null===(a=c.nocnumber)||void 0===a?void 0:a.nocNumber)||(null==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.nocNumber)}),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"20px",marginTop:"-24px",marginRight:"-20px"},onClick:e=>{console.log("inside_search")}}," ",l.createElement(o.SearchIcon,null)," "))))},LocationDetails:e=>{var n,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w;let{t:x,config:M,onSelect:F,userType:k,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 G=Digit.Hooks.obps.useTenants(),z=(i.useLocation(),Digit.ULBService.getCurrentTenantId()),[Y,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===(v=c[0])||void 0===v?void 0:v.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===(p=U)||void 0===p||null===(m=p.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===(_=U)||void 0===_||null===(f=_.address)||void 0===f?void 0:f.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(),[ve,pe]=t.useState((null==W||null===(D=W.address)||void 0===D?void 0:D.locality)||(null===(C=U)||void 0===C||null===(T=C.address)||void 0===T?void 0:T.locality)||null);let[me,Ee]=t.useState(G),_e=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 fe=window.Digit.Utils.browser.isMobile();t.useEffect(()=>{var e;if(!le||!se)if(me=k&&"employee"===k?G.filter(e=>e.code===z):X?G.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==Number(X))}):G,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===_e&&(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},x);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({})),pe(null),ce(null)}return t.useEffect(()=>{var e,t;if(null!=W&&null!==(e=W.address)&&void 0!==e&&e.locality)pe(null==W||null===(t=W.address)||void 0===t?void 0:t.locality);else if(le&&ge&&!Y){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==ve?void 0:ve.code)&&pe(U.address.locality),(null!==(r=U)&&void 0!==r&&null!==(u=r.address)&&void 0!==u&&u.pincode||X)&&!Y&&(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&&pe()),(!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==ve||ve&&(null===(d=t[0])||void 0===d?void 0:d.code)!==(null==ve?void 0:ve.code))&&(pe(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($l,null),V&&l.createElement(Vl,{t:x,onSelect:F,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:x,config:M,onSelect:()=>{const e={};e.pincode=X,e.city=le,e.locality=ve,e.street=ie,e.landmark=ae,e.geoLocation=Z,e.placeName=ue,F(M.key,e)},isDisabled:!le||!ve||Y,isMultipleAllow:!0,forcedError:x(Y)},l.createElement(o.CardLabel,null,""+x("BPA_GIS_LABEL")),l.createElement("div",{style:{}},l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,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(""),pe(null)}}),l.createElement(o.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement("svg",{style:fe?{float:"right",position:"relative",bottom:"25px",marginTop:"-20px",marginRight:"5px"}:{position:"relative",left:"515px",bottom:"25px",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,""+x("BPA_DETAILS_PIN_LABEL")),!V&&l.createElement(o.TextInput,{isMandatory:!1,optionKey:"i18nKey",type:"text",t:x,name:"pincode",onChange:he,value:X,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,x("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){pe(null),ce(null),ne(e),sessionStorage.setItem("currentCity",JSON.stringify(e)),U.address.city=e},t:x,isDependent:!0,disabled:!0}),l.createElement("span",{className:"form-pt-dropdown-only"},l.createElement(o.CardLabel,null,x("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===(w=R.locality)||void 0===w?void 0:w.name,optionKey:"i18nkey",t:x,isDependent:!0,labelKey:_t(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:ve,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),pe(e),sessionStorage.setItem("currLocality",JSON.stringify(e))},t:x,isDependent:!0,labelKey:_t(null==le?void 0:le.code,".","_").toUpperCase()+"_REVENUE"})),l.createElement(o.CardLabel,null,""+x("BPA_DETAILS_SRT_NAME_LABEL")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"street",onChange:function(e){oe(e.target.value)},value:ie,disabled:!(null==W||!W.address)}),l.createElement(o.CardLabel,null,""+x("ES_NEW_APPLICATION_LOCATION_LANDMARK")),!V&&l.createElement(o.TextInput,{style:{},isMandatory:!1,optionKey:"i18nKey",t:x,name:"landmark",onChange:function(e){re(e.target.value)},value:ae,disabled:!(null==W||!W.address)})))},GIS:Vl,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,u,d,c;let{t:v,config:p,onSelect:m,formData:E,ownerIndex:_=0}=e;const f=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),[D,C]=t.useState(null);let T={};function P(){}const N=()=>{},I=()=>{const e={};e.file=file,m(p.key,e)};return l.createElement("div",null,l.createElement(o.FormStep,{t:v,config:p,onSelect:I,onSkip:N,isDisabled:!g,onAdd:P,isMultipleAllow:!0},l.createElement(o.CardCaption,null,""+v("BPA_OC_NEW_BUILDING_CONSTRUCTION_LABEL")),l.createElement(o.CardHeader,null,""+v("BPA_OC_EDCR_SCRUTINY_LABEL")),l.createElement(o.CardText,null,""+v("BPA_PROVIDE_BPN_AND_BPD_APP_LABEL")),l.createElement(o.CardLabel,null,v("EDCR_BUILDING_PERMIT_NUM_LABEL")+" *"),l.createElement(o.TextInput,s({isMandatory:!1,optionKey:"i18nKey",t:v,name:"permitNumber",onChange:function(e){A(e.target.value)},value:g},T={isRequired:!0,pattern:Et("Name"),title:v("BPA_INVALID_NAME")})),l.createElement(o.CardLabel,null,v("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({}),C(null);let e={permitDate:Pt(S),approvalNo:g};return Digit.OBPSService.BPASearch(f,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,v,p,m,E,_;const l=null==e||null===(c=e.BPA)||void 0===c||null===(v=c[0])||void 0===v||null===(p=v.landInfo)||void 0===p||null===(m=p.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===(_=t.edcrDetail)||void 0===_?void 0:_[0])}}).catch(e=>{var t,l,n;C({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;C({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})}):C({key:"error",warning:!0,message:v("ERR_FILL_EDCR_PERMIT_INCORRECT_DATE")})}else 0==(null==e||null===(n=e.BPA)||void 0===n?void 0:n.length)&&C({key:"error",error:!0,message:v("BPA_NO_REC_FOUND_LABEL")})}).catch(e=>{var t,l,n;C({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:v("ACTION_TEST_BPA_STAKE_HOLDER_SEARCH"),disabled:!g||!S})),D&&l.createElement(o.Toast,{error:null==D?void 0:D.error,warning:null==D?void 0:D.warning,label:v(null==D?void 0:D.message),isDleteBtn:!0,onClose:()=>{C(null)}})),null!=b&&b.edcrNumber?l.createElement(o.FormStep,{t:v,config:p,onSelect:I,onSkip:N,isDisabled:!g,onAdd:P,isMultipleAllow:!0},l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+v("REPORT_FSM_RESULT_APPLICANTNAME"),text:v(null==b?void 0:b.applicantName),className:"border-none"}),l.createElement(o.Row,{label:""+v("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:v(null==b?void 0:b.applicationSubType),className:"border-none"}),l.createElement(o.Row,{label:""+v("EDCR_TOTAL_BUILD_UP_AREA_LABEL"),text:v(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:""+v("EDCR_BUILDING_HEIGHT_LABEL"),text:v(null==b||null===(u=b.planDetail)||void 0===u||null===(d=u.blocks[0])||void 0===d||null===(c=d.building)||void 0===c?void 0:c.buildingHeight),className:"border-none"}),l.createElement(o.Row,{label:""+v("BPA_ARCHITECT_NAME_LABEL"),text:v(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"}},""+v("BPA_PERMIT_EDCR_DETAILS_LABEL")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{label:""+v("BPA_EDCR_NO_LABEL"),text:v(null==b?void 0:b.edcrNumber),className:"border-none"})),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("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"}},v("BPA_UPLOADED_PLAN_DXF"))),l.createElement("h1",{style:{fontSize:"18px",lineHeight:"21px",fontWeight:"700",padding:"0px 0px 16px 0px"}},""+v("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"}},v("BPA_SCRUTINY_REPORT_PDF"))),l.createElement("div",{onClick:()=>{m(p.key,b)}},l.createElement(o.SubmitBar,{label:v("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:v,setIsShowToast:p}=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),f(""),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,v]),v?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:a,config:r,onSelect:()=>{const e={};e.file=_,u(r.key,e,!0,!0)},onSkip:()=>{},isDisabled:!_||v,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]),f(e.target.files[0])},onDelete:()=>{E(null),f("")},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:()=>p(null),isDleteBtn:!0}))},StakeholderDocsRequired:e=>{var a,r,u,d;let{onSelect:s}=e;const{t:c}=n.useTranslation(),v=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),{data:m,isLoading:E}=(i.useHistory(),Digit.Hooks.obps.useMDMS(p,"StakeholderRegistraition","TradeTypetoRoleMapping"));let _=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),t.useEffect(()=>{v&&Digit.LocalizationService.getLocale({modules:["rainmaker-bpareg"],locale:Digit.StoreData.getCurrentLanguage(),tenantId:""+v})},[v]),E?l.createElement(o.Loader,null):l.createElement(t.Fragment,null,l.createElement("div",{className:_?"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,v,p,m,E,_;let{t:f,config:g,onSelect:A,formData:S}=e;null!==JSON.parse(sessionStorage.getItem("BPAREGintermediateValue"))?(S=JSON.parse(sessionStorage.getItem("BPAREGintermediateValue")),sessionStorage.setItem("BPAREGintermediateValue",null)):S=S,window.location.href.split("/").pop(),Digit.ULBService.getCurrentTenantId();const h=Digit.ULBService.getStateId(),[b,y]=t.useState((null===(n=S)||void 0===n||null===(i=n.LicneseType)||void 0===i?void 0:i.LicenseType)||(null===(a=S)||void 0===a||null===(r=a.formData)||void 0===r||null===(u=r.LicneseType)||void 0===u?void 0:u.LicenseType)||""),[D,C]=t.useState((null===(d=S)||void 0===d||null===(s=d.LicneseType)||void 0===s?void 0:s.ArchitectNo)||(null===(c=S)||void 0===c||null===(v=c.formData)||void 0===v||null===(p=v.LicneseType)||void 0===p?void 0:p.ArchitectNo)||null),{data:T}=Digit.Hooks.obps.useMDMS(h,"StakeholderRegistraition","TradeTypetoRoleMapping");let P=window.location.href.includes("/openlink/");Digit.Utils.browser.isMobile();const[N,I]=t.useState((null===(m=S)||void 0===m?void 0:m.selfCertification)||(null===(E=S)||void 0===E||null===(_=E.formData)||void 0===_?void 0:_.selfCertification)||null);return P&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),l.createElement("div",null,l.createElement("div",{className:P?"OpenlinkContainer":""},P&&l.createElement(o.BackButton,{style:{border:"none"}},f("CS_COMMON_BACK")),l.createElement($l,{currentStep:1,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{t:f,config:g,onSelect:function(){var e,t,l,n;if(null!==(e=S)&&void 0!==e&&e.result&&null!==(t=S)&&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=S)||void 0===i?void 0:i.formData;e.LicneseType.LicenseType=b,e.LicneseType.ArchitectNo=D,e.LicneseType.selfCertification=N||!1,A("",S)}else A(g.key,{LicenseType:b,ArchitectNo:D,selfCertification:N})},onSkip:()=>A(),isDisabled:b&&null!=b&&b.i18nKey.includes("ARCHITECT")?!b||!D:!b},l.createElement(o.CardLabel,null,f("BPA_LICENSE_TYPE"),"*"),l.createElement("div",{className:"form-pt-dropdown-only"},T&&l.createElement(o.RadioOrSelect,{t:f,optionKey:"i18nKey",isMandatory:g.isMandatory,options:function(){var e;let t=[],l=!1;return null==T||null===(e=T.StakeholderRegistraition)||void 0===e||e.TradeTypetoRoleMapping.map(e=>{l=t.some(t=>t.i18nKey.includes(e.tradeType.split(".")[0])),l||t.push({role:e.role,i18nKey:"TRADELICENSE_TRADETYPE_"+e.tradeType.split(".")[0],tradeType:e.tradeType})}),t}()||{},selectedOption:b,onSelect:function(e){y(e)}})),b&&(null==b?void 0:b.i18nKey.includes("ARCHITECT"))&&l.createElement("div",null,l.createElement(o.CardLabel,null,f("BPA_COUNCIL_NUMBER")+"*"),l.createElement(o.TextInput,{t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"ArchitectNo",value:D,onChange:function(e){C(e.target.value)}})),b&&((null==b?void 0:b.i18nKey.includes("ARCHITECT"))||(null==b?void 0:b.i18nKey.includes("_ENGINEER"))||(null==b?void 0:b.i18nKey.includes("DESIGNER"))||(null==b?void 0:b.i18nKey.includes("SUPERVISOR")))&&l.createElement("div",null,l.createElement(o.CheckBox,{label:null!=b&&b.i18nKey.includes("ARCHITECT")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ARCHITECT)]":null!=b&&b.i18nKey.includes("_ENGINEER")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY ENGINEER)]":null!=b&&b.i18nKey.includes("DESIGNER")?"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY DESIGNER)]":"[DECLARATION UNDER SELF-CERTIFICATION SCHEME ('Residential') (BY SUPERVISOR)]",onChange:function(e){I(e.target.checked)},value:N,checked:N||!1,style:{marginBottom:"40px"}})))))},LicenseDetails:e=>{var n,a,r,u,d,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B;let{t:O,config:R,onSelect:w,formData:x}=e;i.useLocation();const M=Digit.UserService.getUser(),F=Digit.ULBService.getCurrentTenantId();let k=window.location.href.includes("openlink");const U=null==M||null===(n=M.info)||void 0===n?void 0:n.uuid,{data:H,isLoading:W}=Digit.Hooks.useUserSearch(F,{uuid:[U]},{},{enabled:!!U}),[j,$]=t.useState((k?"":null==M||null===(a=M.info)||void 0===a?void 0:a.name)||(null==x||null===(r=x.LicneseDetails)||void 0===r?void 0:r.name)||(null==x||null===(u=x.formData)||void 0===u||null===(d=u.LicneseDetails)||void 0===d?void 0:d.name)||""),[G,z]=t.useState((k?"":null==M||null===(c=M.info)||void 0===c?void 0:c.emailId)||(null==x||null===(v=x.LicneseDetails)||void 0===v?void 0:v.email)||(null==x||null===(p=x.formData)||void 0===p||null===(m=p.LicneseDetails)||void 0===m?void 0:m.email)||""),[Y,K]=t.useState((!k&&H?{i18nKey:"COMMON_GENDER_"+(null==H||null===(E=H.user)||void 0===E||null===(_=E[0])||void 0===_?void 0:_.gender),code:null==H||null===(f=H.user)||void 0===f||null===(g=f[0])||void 0===g?void 0:g.gender,value:null==H||null===(A=H.user)||void 0===A||null===(S=A[0])||void 0===S?void 0:S.gender}:"")||(null==x||null===(h=x.LicneseDetails)||void 0===h?void 0:h.gender)||(null==x||null===(b=x.formData)||void 0===b||null===(y=b.LicneseDetails)||void 0===y?void 0:y.gender)),[V,q]=t.useState((k?"":null==M||null===(D=M.info)||void 0===D?void 0:D.mobileNumber)||(null==x||null===(C=x.LicneseDetails)||void 0===C?void 0:C.mobileNumber)||(null==x||null===(T=x.formData)||void 0===T||null===(P=T.LicneseDetails)||void 0===P?void 0:P.mobileNumber)||""),[X,J]=t.useState((null==x||null===(N=x.LicneseDetails)||void 0===N?void 0:N.PanNumber)||(null==x||null===(I=x.formData)||void 0===I||null===(L=I.LicneseDetails)||void 0===L?void 0:L.PanNumber)||"");t.useEffect(()=>{var e,t,l,n,i,o,a,r;null!=Y&&Y.code||null==H||null===(e=H.user)||void 0===e||null===(t=e[0])||void 0===t||!t.gender||k||K({i18nKey:"COMMON_GENDER_"+(null==H||null===(l=H.user)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.gender),code:null==H||null===(i=H.user)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.gender,value:null==H||null===(a=H.user)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.gender})},[H]);const Z=Digit.ULBService.getStateId();Digit.Utils.browser.isMobile(),k&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{isLoading:Q,data:ee}=Digit.Hooks.obps.useMDMS(Z,"common-masters",["GenderType"]);let te=[];return ee&&ee["common-masters"].GenderType.filter(e=>e.active).map(e=>{te.push({i18nKey:"COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),W?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:k?"OpenlinkContainer":""},k&&l.createElement(o.BackButton,{style:{border:"none"}},O("CS_COMMON_BACK")),l.createElement($l,{currentStep:1,flow:"STAKEHOLDER"}),Q&&W?l.createElement(o.Loader,null):l.createElement(o.FormStep,{config:R,onSelect:()=>{var e,t;if(null!=x&&x.result&&null!=x&&null!==(e=x.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id){let e=null==x?void 0:x.formData;e.LicneseDetails.name=j,e.LicneseDetails.mobileNumber=V,e.LicneseDetails.gender=Y,e.LicneseDetails.email=G,e.LicneseDetails.PanNumber=X,w("",x)}else w(R.key,{name:j,mobileNumber:V,gender:Y,email:G,PanNumber:X})},onSkip:()=>w(),t:O,isDisabled:!j||!V||!Y},l.createElement("div",null,l.createElement(o.CardLabel,null,O("BPA_APPLICANT_NAME_LABEL")+"*"),l.createElement(o.TextInput,s({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"name",value:j,onChange:function(e){$(e.target.value)},disable:!(!j||k)},{isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:O("PT_NAME_ERROR_MESSAGE")})),l.createElement(o.CardLabel,null,O("BPA_APPLICANT_GENDER_LABEL")+"*"),l.createElement(o.RadioButtons,{t:O,options:te,optionsKey:"code",name:"gender",value:Y,selectedOption:Y,onSelect:function(e){K(e)},isDependent:!0,labelKey:"COMMON_GENDER",disable:!(!Y||k)}),l.createElement(o.CardLabel,null,O("BPA_OWNER_MOBILE_NO_LABEL")+"*"),l.createElement(o.MobileNumber,{value:V,name:"mobileNumber",onChange:e=>{q({value:e}.value)},disable:!(!V||k),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:O("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.CardLabel,null,O("BPA_APPLICANT_EMAIL_LABEL")),l.createElement(o.TextInput,{t:O,type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:G,onChange:function(e){z(e.target.value)},disable:!(null==M||null===(B=M.info)||void 0===B||!B.emailId||k),required:!0,pattern:"[A-Za-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",type:"email",title:O("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.CardLabel,null,""+O("BPA_APPLICANT_PAN_NO")),l.createElement(o.TextInput,{t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"PanNumber",value:X,onChange:function(e){J(e.target.value)},required:!0,pattern:"[A-Z]{5}[0-9]{4}[A-Z]{1}",title:O("BPA_INVALID_PAN_NO")})))))},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)||""),[v,p]=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($l,{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=v,u("",d,"",!0);else{var l,n,i,o,a,r,c,p,m,_,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===(p=d.LicneseType)||void 0===p||null===(m=p.LicenseType)||void 0===m?void 0:m.tradeType}],additionalDetail:{counsilForArchNo:null==d||null===(_=d.LicneseType)||void 0===_?void 0:_.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:v},"",!0)}).catch(e=>{var t,l,n;A(!1),f({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==v?(p(!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=""),p(!1),c(""))},checked:v,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:v}))),l.createElement("div",{style:{disabled:"true",height:"30px",width:"100%",fontSize:"14px"}}),_&&l.createElement(o.Toast,{error:"error"===(null==_?void 0:_.key),label:m,isDleteBtn:!0,onClose:()=>{f(null),E(null)}}))},PermanentAddress:e=>{var n,i,a;let{t:r,config:u,onSelect:d,formData:s}=e;const[c,v]=t.useState((null==s||null===(n=s.LicneseDetails)||void 0===n?void 0:n.PermanentAddress)||(null==s||null===(i=s.formData)||void 0===i||null===(a=i.LicneseDetails)||void 0===a?void 0:a.PermanentAddress));Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();let p=window.location.href.includes("/openlink/");return Digit.Utils.browser.isMobile(),p&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")}),l.createElement(l.Fragment,null,l.createElement("div",{className:p?"OpenlinkContainer":""},p&&l.createElement(o.BackButton,{style:{border:"none"}},r("CS_COMMON_BACK")),l.createElement($l,{currentStep:2,flow:"STAKEHOLDER"}),l.createElement(o.FormStep,{config:u,onSelect:()=>{var e,t;null!=s&&s.result&&null!=s&&null!==(e=s.result)&&void 0!==e&&null!==(t=e.Licenses[0])&&void 0!==t&&t.id?((null==s?void 0:s.formData).LicneseDetails.PermanentAddress=c,d("",s)):d(u.key,{PermanentAddress:c})},onSkip:()=>d(),t:r,isDisabled:!c},l.createElement(o.CardLabel,null,r("BPA_PERMANANT_ADDRESS_LABEL")+"*"),l.createElement(o.TextArea,{t:r,isMandatory:!1,type:"text",optionKey:"i18nKey",name:"PermanentAddress",onChange:function(e){v(e.target.value)},value:c}))))},StakeholderDocuments:e=>{var n,i,a,r;let{t:u,config:d,onSelect:s,formData:c}=e;Digit.ULBService.getCurrentTenantId();const v=Digit.ULBService.getStateId(),[p,m]=t.useState((null==c||null===(n=c.documents)||void 0===n?void 0:n.documents)||[]),[E,_]=t.useState(null),[f,g]=t.useState([]),[A,S]=t.useState(!0),[h,b]=t.useState(!1),y=!!Digit.Utils.browser.isMobile();let D=window.location.href.includes("/openlink/");D&&(window.onunload=function(){sessionStorage.removeItem("Digit.BUILDING_PERMIT")});const{data:C,isLoading:T}=Digit.Hooks.obps.useMDMS(v,"StakeholderRegistraition","TradeTypetoRoleMapping");return t.useEffect(()=>{var e,t,l,n;let i=[];var o,a;null!=C&&null!==(e=C.StakeholderRegistraition)&&void 0!==e&&e.TradeTypetoRoleMapping&&(i=null==C||null===(o=C.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)},[!T]),t.useEffect(()=>{let e=0;f.map(t=>{let l=!1;p.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||!(p.length>0))},[p,h]),l.createElement("div",null,l.createElement("div",{className:D?"OpenlinkContainer":""},D&&l.createElement(o.BackButton,{style:{border:"none"}},u("CS_COMMON_BACK")),l.createElement($l,{currentStep:3,flow:"STAKEHOLDER"}),T?l.createElement(o.Loader,null):l.createElement(o.FormStep,{t:u,config:d,onSelect:()=>{let e,t=c.documents,l=[];f&&p&&null!==p&&f.map((e,t)=>{let n=p.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==f?void 0:f.map((e,t)=>l.createElement(Sn,{key:t,document:e,t:u,error:E,setError:_,setDocuments:m,documents:p,setCheckRequiredFields:b,isCitizenUrl:y})),E&&l.createElement(o.Toast,{label:E,isDleteBtn:!0,onClose:()=>_(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,d,s,v,p,m,E,_,f,g,A,S,h;let{formData:b,onSelect:y,config:D}=e;const[C,T]=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()),[w,x]=t.useState((null==b||null===(r=b.data)||void 0===r?void 0:r.bpaData)||{}),[M,F]=t.useState((null==b||null===(u=b.data)||void 0===u?void 0:u.edcrDetails)||null),[k,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===(s=M.planDetail)||void 0===s||null===(v=s.plot)||void 0===v?void 0:v.area,null==M||null===(p=M.planDetail)||void 0===p?void 0:p.blocks),t.useEffect(()=>{},C);const j=function(){try{return F(null),x(null),U(!0),Promise.resolve(function(e,t){return Promise.resolve(function(e,t){try{return Promise.resolve(c(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)&&(T({key:"true",message:null==e?void 0:e.message}),F(null),x(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,v,p,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 T({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===(v=i.bpaResponse)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.status)||"INITIATED"!=(null==i||null===(m=i.bpaResponse)||void 0===m||null===(E=m[0])||void 0===E?void 0:E.status)))return void T({key:"true",message:"APPLICATION_NUMBER_ALREADY_EXISTS"});sessionStorage.setItem("checkForProcced",JSON.stringify(!1)),T(null),F(M)}null!=e&&null!==(n=e.ocEdcrDetails)&&void 0!==n&&n.edcrNumber&&(F(null==e?void 0:e.ocEdcrDetails),x(null==e?void 0:e.otherDetails),T(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 G=e=>{let t=!1;if(w&&M){var l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,g;const e=(null==w||null===(l=w.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,D={LOW:0,MEDIUM:1,HIGH:2},C=Digit.Utils.obps.calculateRiskType(null==W||null===(c=W.BPA)||void 0===c?void 0:c.RiskTypeComputation,null==A||null===(v=A.planDetail)||void 0===v||null===(p=v.plot)||void 0===p?void 0:p.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===(_=e.planDetail)||void 0===_||null===(f=_.plot)||void 0===f?void 0:f.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,T({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,T({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,T({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}D[P]<D[C]?(t=!1,T({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."})):D[P]>D[C]?(t=JSON.parse(sessionStorage.getItem("checkForProcced")),T({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,C,N,I,L;t&&y(null==D?void 0:D.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===(C=W.BPA)||void 0===C?void 0:C.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:w,edcrDetails:M})};return H?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement($l,{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 T({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(){});T({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"}})),k?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===(_=W.BPA)||void 0===_?void 0:_.RiskTypeComputation,null==M||null===(f=M.planDetail)||void 0===f||null===(g=f.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:G})),C&&l.createElement(o.Toast,{error:!(null==C||!C.key),warning:!(null==C||!C.warning),label:O(null==C?void 0:C.message),isDleteBtn:!0,onClose:()=>{T(null)},onNo:()=>{T(null)},onYes:()=>{sessionStorage.setItem("checkForProcced",JSON.stringify(!0)),G()},isWarningButtons:!0}))},OBPSSearchApplication:e=>{var n,r,u,d,c,v,p,m,E,_,f,g,A,S,h,b,y;let{t:D,onSubmit:C,data:T,error:P,searchData:N,isLoading:I,Count:L,setparamerror:B}=e;const[O,R]=t.useState(null),w=sessionStorage.getItem("Digit.citizen.userRequestObject"),x=w?JSON.parse(w):{},M=null==x||null===(n=x.value)||void 0===n?void 0:n.info,F=null==x||null===(r=x.value)||void 0===r||null===(u=r.info)||void 0===u?void 0:u.mobileNumber,{register:k,control:U,handleSubmit:H,setValue:W,getValues:j,reset:$,formState:G}=a.useForm({defaultValues:{applicationNo:"",mobileNumber:window.location.href.includes("/search/obps-application")?F:"",name:"",fromDate:"",toDate:"",status:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC",applicationType:(null==M||null===(d=M.roles)||void 0===d||null===(c=d.filter(e=>e.code.includes("BPAREG_")))||void 0===c?void 0:c.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?{code:"BUILDING_PLAN_SCRUTINY",i18nKey:"WF_BPA_BUILDING_PLAN_SCRUTINY"}:(null==M||null===(p=M.roles)||void 0===p||null===(m=p.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===(_=M.roles)||void 0===_||null===(f=_.filter(e=>e.code.includes("BPAREG_")))||void 0===f?void 0:f.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(()=>{k("offset",0),k("limit",10),k("sortBy","commencementDate"),k("sortOrder","DESC")},[k]),l.useEffect(()=>{var e,t,l,n,i,o,a,r,u,d,s,c,v,p;G.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:"",name:"",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===(v=c.filter(e=>e.code.includes("BPAREG_")))||void 0===v?void 0:v.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?"":{applicationType:["BUILDING_PLAN_SCRUTINY","BUILDING_OC_PLAN_SCRUTINY"],code:"NEW_CONSTRUCTION",i18nKey:"BPA_SERVICETYPE_NEW_CONSTRUCTION"},...N,isSubmitSuccessful:!1})},[G]);const z=(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?Nt(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_OWNER_HEAD"),accessor:e=>{var t;return a((null==e||null===(t=e.additionalDetails)||void 0===t?void 0:t.ownerName)||"NA")},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:D}),[Y,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(C)()}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:G,Controller:a.Controller,register:k,control:U,t:D,reset:$,previousPage:q},Z=e=>{var t;const l="BPAREG"==(null==T||null===(t=T[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==T?void 0:T.map(e=>{var t,l,n,i,o,a,r,u;return{[D("BPA_APPLICATION_NUMBER_LABEL")]:e.applicationNo||e.applicationNumber,[D("BPA_COMMON_TABLE_COL_APP_DATE_LABEL")]:Nt(null===(t=e.auditDetails)||void 0===t?void 0:t.createdTime)||"",[D("BPA_SEARCH_APPLICATION_TYPE_LABEL")]:null!=e&&null!==(l=e.additionalDetails)&&void 0!==l&&l.applicationType?D("WF_BPA_"+(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.applicationType)):D(null!=e&&e.businessService?"BPA_APPLICATIONTYPE_"+(null==e?void 0:e.businessService):"CS_NA"),[D("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL")]:D((null===(i=e.additionalDetails)||void 0===i?void 0:i.serviceType)||D("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]))||D("CS_NA")),[D("BPA_CURRENT_OWNER_HEAD")]:(null==e?void 0:e.assignee)||D("CS_NA"),[D("BPA_STATUS_LABEL")]:D((null==e?void 0:e.state)&&"WF_BPA_"+e.state||(null==e?void 0:e.state)&&"WF_BPA_"+e.status||D("CS_NA"))}}),[T]);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:u}=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,D("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,D("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(kt,s({},i,{closeMobilePopupModal:u}))));default:return l.createElement("span",null)}},u=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:D("ES_COMMON_SEARCH_APPLICATION"),handleActionClick:()=>n({type:"set",payload:"SearchFormComponent"})})),e?l.createElement(o.PopUp,null,l.createElement(u,{onSubmit:e=>{n({type:"remove"}),C(e)},handleSubmit:H,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:J,currentlyActiveMobileModal:e,closeMobilePopupModal:i})):null,null!=T&&null!==(ee=T[0])&&void 0!==ee&&ee.display?l.createElement(o.Card,{style:{marginTop:20}},D(null==T||null===(te=T[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,D("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,D("BPA_SEARCH_CREATED_BY_STAKEHOLDER_LABEL"))),l.createElement(o.SearchForm,{onSubmit:C,handleSubmit:H},l.createElement(kt,J)),!I&&null!=T&&null!==(b=T[0])&&void 0!==b&&b.display?l.createElement(o.Card,{style:{marginTop:20}},D(null==T||null===(y=T[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:D,data:T,columns:z,getCellProps:e=>({style:{minWidth:e.column.Header===D("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){W("limit",Number(e.target.value)),H(C)()},currentPage:Y,onNextPage:function(){W("offset",j("offset")+j("limit")),H(C)()},onPrevPage:q,pageSizeLimit:j("limit"),onSort:V,totalRecords:L,disableSort:!1,onLastPage:()=>{W("offset",L&&10*Math.ceil(L/10)-j("limit")),H(C)()},onFirstPage:()=>{W("offset",0),H(C)()},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:D(O.label),isDleteBtn:!0,onClose:()=>{R(null)}}))},InspectionReport:e=>{let{config:a,onSelect:r,userType:u,formData:d,setError:c,formState:v,clearErrors:p}=e;const{t:m}=n.useTranslation(),{pathname:E}=i.useLocation(),_=E.includes("/modify-application/"),[f,g]=t.useState((null==d?void 0:d.FieldReports)||[Pn()]),[A,S]=t.useState({index:-1,type:""}),h=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),[b,y]=t.useState([]),[D,C]=t.useState([]),[T,P]=t.useState([]),[N,I]=t.useState([]),[L,B]=t.useState([]),[O,R]=t.useState([]),[w,x]=t.useState(!1),[M,F]=t.useState((null==d?void 0:d.tradedetils1)||[]);let k=window.location.href.includes("tl/renew-application-details");window.location.href.includes("tl/renew-application-details")&&(k=!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=f.map(e=>e);r(null==a?void 0:a.key,e),sessionStorage.setItem("INSPECTION_DATA",JSON.stringify(e))},[f]),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:f,setFocusIndex:S,removeUnit:e=>{g(t=>t.filter(t=>t.key!=e.key))},formData:d,formState:v,setFieldReports:g,t:m,setError:c,clearErrors:p,config:a,onSelect:r,userType:u,tradeCategoryValues:D,tradeTypeOptionsList:T,setTradeTypeOptionsList:P,tradeTypeMdmsData:b,tradeSubTypeOptionsList:O,setTradeSubTypeOptionsList:R,setTradeTypeMdmsData:y,setTradeCategoryValues:C,tradeMdmsData:U,isErrors:w,setIsErrors:x,previousLicenseDetails:M,setPreviousLicenseDetails:F,isLoading:H,bpaDocs:W,type:"LOW",questionList:N,setquestionList:I,documentList:L};return _?l.createElement(l.Fragment,null):l.createElement("div",null,l.createElement(l.Fragment,null,f&&f.map((e,t)=>l.createElement(Nn,s({key:e.key,index:t,unit:e},j)))),l.createElement(o.LinkButton,{label:m("BPA_ADD_FIELD_INSPECTION"),onClick:()=>{const e=Pn();g(t=>[...t,e])},style:{color:"#a82227",width:"fit-content"}}))},BPAInbox:kl,StakeholderInbox:e=>{let{parentRoute:r}=e;const{t:u}=n.useTranslation(),d=Digit.ULBService.getStateId(),c={},v={moduleName:"BPAREG",applicationStatus:[],businessService:null,locality:[],assignee:"ASSIGNED_TO_ALL"},p={sortBy:"",limit:window.Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},m=Digit.SessionStorage.get("STAKEHOLDER.INBOX"),E=t.useMemo(()=>m||{filterForm:v,searchForm:c,tableForm:p},[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(d,"revenue",{},u),{isLoading:S,data:{table:h,statuses:b,totalCount:y}={}}=Digit.Hooks.obps.useBPAInbox({tenantId:d,filters:{..._}}),D={logoIcon:l.createElement(o.CaseIcon,null),headerText:"CS_COMMON_OBPS",links:[{text:u("BPA_SEARCH_PAGE_TITLE"),link:"/digit-ui/employee/obps/search/application",businessService:"BPA",roles:["BPAREG_EMPLOYEE","BPAREG_APPROVER","BPAREG_DOC_VERIFIER","BPAREG_DOC_VERIFIER"]}]},C=t.useCallback(e=>{let{registerRef:t,searchFormState:n,searchFieldComponents:i}=e;return l.createElement(Wl,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),T=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==_?void 0:_.filterForm,getFilterFormValue:o,localitiesForEmployeesCurrentTenant:g,loadingLocalitiesForEmployeesCurrentTenant:A})},[b,S,g,A]),P={SearchFormFields:C,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==_?void 0:_.searchForm,resetSearchFormDefaultValues:c,onSearchFormReset:e=>{e("mobileNumber",null),e("applicationNo",null),f({action:"mutateSearchForm",data:c})}},N={FilterFormFields:T,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),f({action:"mutateTableForm",data:{...p}}),f({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==_?void 0:_.filterForm,resetFilterFormDefaultValues:v,onFilterFormReset:e=>{e("moduleName","BPAREG"),e("applicationStatus",""),e("locality",[]),e("assignee","ASSIGNED_TO_ALL"),f({action:"mutateFilterForm",data:v})}},I=(e=>{var o,a,r,u;let{parentRoute:d,onPageSizeChange:s,formState:c,totalCount:v,table:p,dispatch:m,onSortingByData:E}=e;const{t:_}=n.useTranslation(),f=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:`${d}/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: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:v,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(v/10)-parseInt(null===(e=c.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>m({action:"mutateTableForm",data:{...c.tableForm,offset:0}}),data:p,columns:f}})({parentRoute:r,onPageSizeChange:e=>{f({action:"mutateTableForm",data:{..._.tableForm,limit:e.target.value}})},formState:_,totalCount:y,table:h,dispatch:f,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";_.tableForm.sortBy===t&&_.tableForm.sortOrder===n||f({action:"mutateTableForm",data:{..._.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;f({action:"mutateTableForm",data:{..._.tableForm,sortOrder:t}})},sortFormDefaultValues:null==_?void 0:_.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),f({action:"mutateTableForm",data:p})}};return l.createElement(t.Fragment,null,l.createElement(o.Header,null,u("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"},u("BPA_SEARCH_PAGE_TITLE")))),l.createElement(o.InboxComposer,s({isInboxLoading:S,PropsForInboxLinks:D},P,N,B,{propsForInboxTable:I,propsForInboxMobileCards:L,formState:_})))},StakeholderCheckPage:e=>{var t,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F;let{onSubmit:k,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(),G=Digit.ULBService.getStateId();let z=window.location.href.includes("/openlink/");const Y=window.Digit.Utils.browser.isMobile();Digit.Utils.browser.isMobile(),z&&(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:G||$.split(".")[0]},{enabled:!!X,retry:!1});let Q=z?"/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:z?"OpenlinkContainer":""},l.createElement("div",null,z&&l.createElement(o.BackButton,{style:{border:"none"}},H("CS_COMMON_BACK")),l.createElement($l,{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===(v=V.LicneseType)||void 0===v||null===(p=v.LicenseType)||void 0===p?void 0:p.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===(_=V.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"}},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===(f=V.LicneseDetails)||void 0===f?void 0:f.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:Y?{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:Y?{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(sn,{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===(D=y.Bill[0])||void 0===D||null===(C=D.billDetails[0])||void 0===C?void 0:C.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===(T=Z.billResponse)||void 0===T||null===(P=T.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:k,disabled:null==Z||null===(w=Z.billResponse)||void 0===w||null===(x=w.Bill)||void 0===x||null===(M=x[0])||void 0===M||null===(F=M.billDetails[0])||void 0===F||!F.amount})))))},BPACheckPage:e=>{var a,r,u,d,s,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,G,z,Y,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e,fe,ge,Ae,Se,he,be,ye,De,Ce,Te,Pe,Ne,Ie,Le,Be,Oe,Re,we,xe,Me,Fe,ke,Ue,He,We,je,$e,Ge,ze,Ye,Ke,Ve,qe,Xe;let{onSubmit:Je,value:Ze}=e;const[Qe,et]=t.useState(),[tt,lt]=t.useState(),[nt,it]=t.useState(),[ot,at]=t.useState(),[rt,ut]=t.useState(),[dt,st]=t.useState(),[ct,vt]=t.useState(),{t:pt}=n.useTranslation(),mt=(i.useHistory(),i.useRouteMatch(),Digit.UserService.getUser()),Et=Digit.ULBService.getStateId(),ft=(null==mt||null===(a=mt.info)||void 0===a?void 0:a.permanentCity)||(null==Ze?void 0:Ze.tenantId)||Digit.ULBService.getCurrentTenantId(),{data:gt}=Digit.Hooks.obps.useMDMS(Et,"BPA",["GaushalaFees","MalbaCharges","LabourCess"]),[At,St]=t.useState(),[ht,bt]=t.useState(),[yt,Dt]=t.useState([]),[Ct,Tt]=t.useState(),[Pt,It]=t.useState(""),[Lt,Bt]=t.useState(null),[Ot,Rt]=t.useState({});let wt;"BPA_LOW"===Ze.businessService?wt="BPA.LOW_RISK_PERMIT_FEE":"BPA"===Ze.businessService&&(wt="BPA.NC_APP_FEE");const{data:xt,address:Mt,owners:kt,nocDocuments:Ut,documents:Ht,additionalDetails:Wt,subOccupancy:jt,PrevStateDocuments:$t,PrevStateNocDocuments:Gt,applicationNo:zt}=Ze,Yt=window.location.href.includes("editApplication"),[Kt,Vt]=t.useState(!1),qt=!!sessionStorage.getItem("ArchitectConsentdocFilestoreid"),Xt=null==mt||null===(r=mt.info)||void 0===r?void 0:r.mobileNumber,[Jt,Zt]=t.useState(!1),[Qt,el]=t.useState(!1),[tl,ll]=t.useState(Xt||""),[nl,il]=t.useState(!1),[ol,al]=t.useState(""),[rl,ul]=t.useState(!1),[dl,sl]=t.useState(""),[cl,vl]=t.useState(null),pl={username:tl,password:ol,tenantId:null==mt||null===(u=mt.info)||void 0===u?void 0:u.tenantId,userType:null==mt||null===(d=mt.info)||void 0===d?void 0:d.type},ml=10===tl.length&&/^[0-9]+$/.test(tl);t.useEffect(()=>{!function(){try{Bt(null);const e=function(){if(Ct&&null!=Ct&&Ct.type){const e=function(e,t,l){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Ct||null===(t=Ct.type)||void 0===t||null===(l=t.split("/"))||void 0===l?void 0:l.pop()))){const e=function(){if(Ct.size>=2e6)Bt(pt("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=c(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Ct,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?Dt([...yt,{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}]):Bt(pt("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else Bt(pt("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[Ct]),t.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(yt))},[yt]);const El=null==Ze||null===(s=Ze.documents)||void 0===s?void 0:s.documents.find(e=>"SITEPHOTOGRAPH.ONE.ONE"===(null==e?void 0:e.documentType));t.useEffect(()=>{var e,t,l,n,i,o,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C;if(null!=Ze&&null!==(e=Ze.additionalDetails)&&void 0!==e&&null!==(t=e.lessAdjustmentFeeFiles)&&void 0!==t&&t.length){var T;const e=null==Ze||null===(T=Ze.additionalDetails)||void 0===T?void 0:T.lessAdjustmentFeeFiles.map((e,t)=>{var l,n,i,o,a,r;return t===(null==Ze||null===(l=Ze.additionalDetails)||void 0===l||null===(n=l.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==Ze||null===(i=Ze.additionalDetails)||void 0===i||null===(o=i.lessAdjustmentFeeFiles[(null==Ze||null===(a=Ze.additionalDetails)||void 0===a||null===(r=a.lessAdjustmentFeeFiles)||void 0===r?void 0:r.length)-1])||void 0===o?void 0:o.fileStoreId:null});Digit.UploadServices.Filefetch(e,Et).then(e=>Rt(null==e?void 0:e.data))}Yt&&(et(null==Ze||null===(c=Ze.additionalDetails)||void 0===c||null===(v=c.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==Ze||null===(p=Ze.additionalDetails)||void 0===p||null===(m=p.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES),lt(null==Ze||null===(E=Ze.additionalDetails)||void 0===E||null===(_=E.selfCertificationCharges)||void 0===_?void 0:_.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==Ze||null===(f=Ze.additionalDetails)||void 0===f||null===(g=f.selfCertificationCharges)||void 0===g?void 0:g.BPA_OTHER_CHARGES),it(null==Ze||null===(A=Ze.additionalDetails)||void 0===A||null===(S=A.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==Ze||null===(h=Ze.additionalDetails)||void 0===h||null===(b=h.selfCertificationCharges)||void 0===b?void 0:b.BPA_LESS_ADJUSMENT_PLOT),St(null==Ze||null===(y=Ze.additionalDetails)||void 0===y?void 0:y.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==Ze||null===(D=Ze.additionalDetails)||void 0===D?void 0:D.otherFeesDiscription),Dt(null==Ze||null===(C=Ze.additionalDetails)||void 0===C?void 0:C.lessAdjustmentFeeFiles));let P=parseInt(sessionStorage.getItem("plotArea"))||(null==hl||null===(l=hl.planDetail)||void 0===l||null===(n=l.planInformation)||void 0===n?void 0:n.plotArea)||(null==Ze||null===(i=Ze.additionalDetails)||void 0===i?void 0:i.area);const N=Math.round(10.7639*P>909?(null==gt||null===(o=gt.BPA)||void 0===o?void 0:o.LabourCess[1].rate)*(10.7639*P):0),I=Math.round(null==gt||null===(a=gt.BPA)||void 0===a?void 0:a.GaushalaFees[0].rate),L=Math.round(10.7639*P<=500?null==gt||null===(r=gt.BPA)||void 0===r?void 0:r.MalbaCharges[0].rate:10.7639*P>500&&10.7639*P<=1e3?null==gt||null===(u=gt.BPA)||void 0===u||null===(d=u.MalbaCharges)||void 0===d?void 0:d[1].rate:(null==gt||null===(s=gt.BPA)||void 0===s?void 0:s.MalbaCharges[2].rate)||500);sessionStorage.setItem("Malbafees",L),sessionStorage.setItem("WaterCharges",L/2),sessionStorage.setItem("GaushalaFees",I),sessionStorage.setItem("LabourCess",N),ut(I),at(N),st(L),vt(L/2)},[gt,null==Ze?void 0:Ze.additionalDetails]);let _l=[];null==$t||$t.map(e=>{_l.push({...e,module:"OBPS"})}),null==Ht||null===(v=Ht.documents)||void 0===v||v.map(e=>{_l.push({...e,module:"OBPS"})}),null==Gt||Gt.map(e=>{_l.push({...e,module:"NOC"})}),null==Ut||null===(p=Ut.nocDocuments)||void 0===p||p.map(e=>{_l.push({...e,module:"NOC"})});const{data:fl,isLoading:gl}=Digit.Hooks.useDocumentSearch(_l,{enabled:(null==_l?void 0:_l.length)>0});let Al=[];var Sl;(null==fl||null===(m=fl.pdfFiles)||void 0===m?void 0:m.length)>0&&(null==fl||null===(Sl=fl.pdfFiles)||void 0===Sl||Sl.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Al.push(e)}));const{data:hl,isLoading:bl}=Digit.Hooks.obps.useScrutinyDetails(ft,null==Ze||null===(E=Ze.data)||void 0===E?void 0:E.scrutinyNumber,{enabled:!(null==Ze||null===(_=Ze.data)||void 0===_||!_.scrutinyNumber)});let yl=null==Ze?void 0:Ze.applicationNo;const Dl={consumerCode:yl},{data:Cl}=Digit.Hooks.useFetchBillsForBuissnessService({businessService:wt,...Dl,tenantId:ft},{enabled:!!yl,retry:!1});var Tl,Pl;Yt||(Ze.additionalDetails.P1charges=null==Cl||null===(Tl=Cl.Bill[0])||void 0===Tl||null===(Pl=Tl.billDetails[0])||void 0===Pl?void 0:Pl.amount);const Nl=window.location.href.includes("sendbacktocitizen");let Il=`/digit-ui/citizen/obps/bpa/${null==Wt?void 0:Wt.applicationType.toLowerCase()}/${null==Wt?void 0:Wt.serviceType.toLowerCase()}`;Yt&&(Il=`/digit-ui/citizen/obps/editApplication/bpa/${null==Ze?void 0:Ze.tenantId}/${null==Ze?void 0:Ze.applicationNo}`),Nl&&(Il=`/digit-ui/citizen/obps/sendbacktocitizen/bpa/${null==Ze?void 0:Ze.tenantId}/${null==Ze?void 0:Ze.applicationNo}`);const Ll=[{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"}],Bl=e=>{const t=e;return(e,l,n)=>e[t]},Ol=t.useMemo(()=>Ll.map(e=>({Header:pt(""+e.name),accessor:Bl(e.id),id:e.id})));function Rl(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:pt("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:pt(""+(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:pt("BPA_FLOOR_NAME_"+e.number)})}),l}function wl(e){location.href=e}function xl(e){let t=[];return jt&&jt["Block_"+(e+1)]&&jt["Block_"+(e+1)].map(e=>{var l;t.push(""+pt(_t(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_")))}),null!=t&&t.length?t.join(", "):"NA"}return gl||bl?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement($l,{currentStep:4}),l.createElement(o.Header,{styles:{marginLeft:"10px"}},pt("BPA_STEPPER_SUMMARY_HEADER")),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:pt("BPA_APPLICATION_NUMBER_LABEL"),text:zt||""}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,pt("BPA_BASIC_DETAILS_TITLE")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:pt("BPA_BASIC_DETAILS_APP_DATE_LABEL"),text:Nt(Number(null==xt?void 0:xt.applicationDate))}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_BASIC_DETAILS_APPLICATION_TYPE_LABEL"),text:pt("WF_BPA_"+(null==xt?void 0:xt.applicationType))}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_BASIC_DETAILS_SERVICE_TYPE_LABEL"),text:pt(null==xt?void 0:xt.serviceType)}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_BASIC_DETAILS_OCCUPANCY_LABEL"),text:null==xt?void 0:xt.occupancyType}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),text:pt("WF_BPA_"+(null==xt?void 0:xt.riskType))}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,pt("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:()=>wl(Il+"/plot-details")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:pt("BPA_BOUNDARY_PLOT_AREA_LABEL"),text:null!=hl&&null!==(f=hl.planDetail)&&void 0!==f&&null!==(g=f.planInformation)&&void 0!==g&&g.plotArea?`${null==hl||null===(A=hl.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.plotArea} ${pt("BPA_SQ_MTRS_LABEL")}`:pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_PLOT_NUMBER_LABEL"),text:(null==hl||null===(h=hl.planDetail)||void 0===h||null===(b=h.planInformation)||void 0===b?void 0:b.plotNo)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_KHATHA_NUMBER_LABEL"),text:(null==hl||null===(y=hl.planDetail)||void 0===y||null===(D=y.planInformation)||void 0===D?void 0:D.khataNo)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),text:(null==xt?void 0:xt.registrationDetails)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_BOUNDARY_WALL_LENGTH_LABEL"),text:(null==xt?void 0:xt.boundaryWallLength)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_KHASRA_NUMBER_LABEL"),text:(null==xt?void 0:xt.khasraNumber)||(null==Ze||null===(C=Ze.additionalDetails)||void 0===C?void 0:C.khasraNumber)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_WARD_NUMBER_LABEL"),text:(null==xt?void 0:xt.wardnumber)||(null==Ze||null===(T=Ze.additionalDetails)||void 0===T?void 0:T.wardnumber)||pt("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.CardHeader,null,pt("BPA_STEPPER_SCRUTINY_DETAILS_HEADER")),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},pt("BPA_EDCR_DETAILS")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:pt("BPA_EDCR_NO_LABEL"),text:null==xt||null===(P=xt.scrutinyNumber)||void 0===P?void 0:P.edcrNumber}),l.createElement(o.CardSubHeader,null,pt("BPA_UPLOADED_PLAN_DIAGRAM")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>wl(null==hl?void 0:hl.updatedDxfFile)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},pt("Uploaded Plan.pdf")),l.createElement(o.CardSubHeader,null,pt("BPA_SCRUNTINY_REPORT_OUTPUT")),l.createElement(o.LinkButton,{label:l.createElement(o.PDFSvg,null),onClick:()=>wl(null==hl?void 0:hl.planReport)}),l.createElement("p",{style:{marginTop:"8px",marginBottom:"20px",textAlign:"Left",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},pt("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"}},pt("BPA_BUILDING_EXTRACT_HEADER")),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",label:pt("BPA_TOTAL_BUILT_UP_AREA_HEADER"),text:`${null==hl||null===(N=hl.planDetail)||void 0===N||null===(I=N.blocks)||void 0===I||null===(L=I[0])||void 0===L||null===(B=L.building)||void 0===B?void 0:B.totalBuitUpArea} ${pt("BPA_SQ_MTRS_LABEL")}`}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_SCRUTINY_DETAILS_NUMBER_OF_FLOORS_LABEL"),text:null==hl||null===(O=hl.planDetail)||void 0===O||null===(R=O.blocks)||void 0===R||null===(w=R[0])||void 0===w||null===(x=w.building)||void 0===x?void 0:x.totalFloors}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_HEIGHT_FROM_GROUND_LEVEL_FROM_MUMTY"),text:`${null==hl||null===(M=hl.planDetail)||void 0===M||null===(F=M.blocks)||void 0===F||null===(k=F[0])||void 0===k||null===(U=k.building)||void 0===U?void 0:U.declaredBuildingHeight} ${pt("BPA_MTRS_LABEL")}`}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_SECTION_HEIGHT_EXCLUDING_MUMTY_PARAPET"),text:`${null==hl||null===(H=hl.planDetail)||void 0===H||null===(W=H.blocks)||void 0===W||null===(j=W[0])||void 0===j||null===($=j.building)||void 0===$?void 0:$.buildingHeightExcludingMP} ${pt("BPA_MTRS_LABEL")}`})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},pt("BPA_OCC_SUBOCC_HEADER")),null==hl||null===(G=hl.planDetail)||void 0===G?void 0:G.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==hl||null===(n=hl.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"}},pt("BPA_BLOCK_SUBHEADER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:pt("BPA_SUB_OCCUPANCY_LABEL"),text:""===xl(t)?pt("CS_NA"):xl(t)})),l.createElement("div",{style:{overflow:"scroll"}},l.createElement(o.Table,{className:"customTable table-fixed-first-column table-border-style",t:pt,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:Rl(e),columns:Ol,getCellProps:e=>({style:{}})})))}),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},pt("BPA_APP_DETAILS_DEMOLITION_DETAILS_LABEL")),l.createElement(o.StatusTable,{style:{border:"none"}},l.createElement(o.Row,{className:"border-none",label:pt("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),text:null!=hl&&null!==(z=hl.planDetail)&&void 0!==z&&null!==(Y=z.planInformation)&&void 0!==Y&&Y.demolitionArea?`${null==hl||null===(K=hl.planDetail)||void 0===K||null===(V=K.planInformation)||void 0===V?void 0:V.demolitionArea} ${pt("BPA_SQ_MTRS_LABEL")}`:pt("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,pt("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:()=>wl(Il+"/location")}),l.createElement(o.Row,{className:"border-none",textStyle:{paddingLeft:"12px"},label:pt("BPA_DETAILS_PIN_LABEL"),text:(null==Mt?void 0:Mt.pincode)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_CITY_LABEL"),text:(null==Mt||null===(q=Mt.city)||void 0===q?void 0:q.name)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_LOC_MOHALLA_LABEL"),text:(null==Mt||null===(X=Mt.locality)||void 0===X?void 0:X.name)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_DETAILS_SRT_NAME_LABEL"),text:(null==Mt?void 0:Mt.street)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("ES_NEW_APPLICATION_LOCATION_LANDMARK"),text:(null==Mt?void 0:Mt.landmark)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_SITEPHOTOGRAPH_LATITUDE"),text:(null==El||null===(J=El.additionalDetails)||void 0===J?void 0:J.latitude)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_SITEPHOTOGRAPH_LONGITUDE"),text:(null==El||null===(Z=El.additionalDetails)||void 0===Z?void 0:Z.longitude)||pt("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,pt("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:()=>wl(Il+"/owner-details")}),(null==kt?void 0:kt.owners)&&(null==kt?void 0:kt.owners.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==kt||null===(n=kt.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"}:{}},kt.owners.length>1&&l.createElement(o.CardSubHeader,null,pt("COMMON_OWNER")," ",t+1),l.createElement(o.StatusTable,null,l.createElement(o.Row,{className:"border-none",textStyle:0==t&&1==kt.owners.length?{paddingLeft:"12px"}:{},label:pt("CORE_COMMON_NAME"),text:null==e?void 0:e.name}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_APPLICANT_GENDER_LABEL"),text:pt(null==e||null===(i=e.gender)||void 0===i?void 0:i.i18nKey)}),l.createElement(o.Row,{className:"border-none",label:pt("CORE_COMMON_MOBILE_NUMBER"),text:null==e?void 0:e.mobileNumber}),l.createElement(o.Row,{className:"border-none",label:pt("CORE_COMMON_EMAIL_ID"),text:(null==e?void 0:e.emailId)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("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,pt("BPA_ADDITIONAL_BUILDING_DETAILS")),l.createElement(o.Row,{className:"border-none",label:pt("BPA_APPROVED_COLONY_LABEL"),text:(null==kt||null===(Q=kt.approvedColony)||void 0===Q?void 0:Q.i18nKey)||(null==Ze||null===(ee=Ze.additionalDetails)||void 0===ee?void 0:ee.approvedColony)||pt("CS_NA")}),"YES"===(null==kt||null===(te=kt.approvedColony)||void 0===te?void 0:te.i18nKey)&&l.createElement(l.Fragment,null,l.createElement(o.Row,{className:"border-none",label:pt("BPA_APPROVED_COLONY_NAME"),text:(null==kt?void 0:kt.nameofApprovedcolony)||(null==Ze||null===(le=Ze.additionalDetails)||void 0===le?void 0:le.nameofApprovedcolony)||pt("CS_NA")})),"NO"===(null==kt||null===(ne=kt.approvedColony)||void 0===ne?void 0:ne.i18nKey)&&l.createElement(l.Fragment,null,l.createElement(o.Row,{className:"border-none",label:pt("BPA_NOC_NUMBER"),text:(null==kt?void 0:kt.NocNumber)||(null==Ze||null===(ie=Ze.additionalDetails)||void 0===ie?void 0:ie.NocNumber)||pt("CS_NA")})),l.createElement(o.Row,{className:"border-none",label:pt("BPA_ULB_TYPE_LABEL"),text:(null==kt||null===(oe=kt.Ulblisttype)||void 0===oe?void 0:oe.value)||(null==Ze||null===(ae=Ze.additionalDetails)||void 0===ae?void 0:ae.Ulblisttype)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_ULB_NAME_LABEL"),text:(null==kt||null===(re=kt.UlbName)||void 0===re?void 0:re.code)||(null==Ze||null===(ue=Ze.additionalDetails)||void 0===ue?void 0:ue.UlbName)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_DISTRICT_LABEL"),text:(null==kt||null===(de=kt.District)||void 0===de?void 0:de.code)||(null==Ze||null===(se=Ze.additionalDetails)||void 0===se?void 0:se.District)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_BUILDING_STATUS_LABEL"),text:(null==kt||null===(ce=kt.buildingStatus)||void 0===ce?void 0:ce.code)||(null==Ze||null===(ve=Ze.additionalDetails)||void 0===ve?void 0:ve.buildingStatus)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_CORE_AREA_LABEL"),text:(null==hl||null===(pe=hl.planDetail)||void 0===pe?void 0:pe.coreArea)||(null==Ze||null===(me=Ze.additionalDetails)||void 0===me?void 0:me.coreArea)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_PROPOSED_SITE_LABEL"),text:(null==kt||null===(Ee=kt.proposedSite)||void 0===Ee?void 0:Ee.code)||(null==Ze||null===(_e=Ze.additionalDetails)||void 0===_e?void 0:_e.proposedSite)||pt("CS_NA")}),"SCHEME"===(null==kt||null===(fe=kt.schemes)||void 0===fe?void 0:fe.code)&&l.createElement(l.Fragment,null,l.createElement(o.Row,{className:"border-none",label:pt("BPA_SCHEME_TYPE_LABEL"),text:(null==kt||null===(ge=kt.schemesselection)||void 0===ge?void 0:ge.value)||(null==Ze||null===(Ae=Ze.additionalDetails)||void 0===Ae?void 0:Ae.schemesselection)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_SCHEME_NAME_LABEL"),text:(null==kt?void 0:kt.schemeName)||(null==Ze||null===(Se=Ze.additionalDetails)||void 0===Se?void 0:Se.schemeName)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_TRANFERRED_SCHEME_LABEL"),text:(null==kt?void 0:kt.transferredscheme)||(null==Ze||null===(he=Ze.additionalDetails)||void 0===he?void 0:he.transferredscheme)||pt("CS_NA")})),l.createElement(o.Row,{className:"border-none",label:pt("BPA_PURCHASED_FAR_LABEL"),text:(null==kt||null===(be=kt.purchasedFAR)||void 0===be?void 0:be.code)||(null==Ze||null===(ye=Ze.additionalDetails)||void 0===ye?void 0:ye.purchasedFAR)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_MASTER_PLAN_LABEL"),text:(null==kt||null===(De=kt.masterPlan)||void 0===De?void 0:De.code)||(null==Ze||null===(Ce=Ze.additionalDetails)||void 0===Ce?void 0:Ce.masterPlan)||pt("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_GREEN_BUILDING_LABEL"),text:(null==kt||null===(Te=kt.greenbuilding)||void 0===Te?void 0:Te.code)||(null==Ze||null===(Pe=Ze.additionalDetails)||void 0===Pe?void 0:Pe.greenbuilding)||pt("CS_NA")}))),l.createElement(o.Card,{style:{paddingRight:"16px"}},l.createElement(o.StatusTable,null,l.createElement(o.CardHeader,null,pt("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:()=>wl(Il+"/document-details")}),l.createElement(Gl,{documents:Ft(Al),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,pt("BPA_SUMMARY_FEE_EST")),l.createElement(o.StatusTable,null,l.createElement(o.CardSubHeader,null,pt("BPA_P1_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:pt("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==hl||null===(Ne=hl.planDetail)||void 0===Ne||null===(Ie=Ne.blocks)||void 0===Ie||null===(Le=Ie[0])||void 0===Le||null===(Be=Le.building)||void 0===Be?void 0:Be.totalBuitUpArea)*2.5)}),l.createElement(o.Row,{className:"border-none",label:pt("BOUNDARY_WALL_FEES"),text:"₹ "+Math.round(2.5*(null==xt?void 0:xt.boundaryWallLength))}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_APPL_FEES"),text:"₹ "+((null==Ze||null===(Oe=Ze.additionalDetails)||void 0===Oe?void 0:Oe.P1charges)||(null==Cl||null===(Re=Cl.Bill[0])||void 0===Re||null===(we=Re.billDetails[0])||void 0===we?void 0:we.amount))}),l.createElement(o.CardSubHeader,null,pt("BPA_P2_SUMMARY_FEE_EST")),l.createElement(o.Row,{className:"border-none",label:pt("BPA_COMMON_MALBA_AMT"),text:"₹ "+dt}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_COMMON_LABOUR_AMT"),text:"₹ "+ot}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+rt}),l.createElement(o.CardSubHeader,null,pt("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(o.CardLabel,null,pt("BPA_COMMON_WATER_AMT")),l.createElement(o.TextInput,{t:pt,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"waterCharges",defaultValue:null==Ze||null===(xe=Ze.additionalDetails)||void 0===xe||null===(Me=xe.selfCertificationCharges)||void 0===Me?void 0:Me.BPA_WATER_CHARGES,value:ct,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)?(vt(e),sessionStorage.setItem("WaterCharges",e)):alert(pt("Please enter only upto 9 numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),l.createElement(o.CardLabel,null,pt("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(o.TextInput,{t:pt,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:null==Ze||null===(Fe=Ze.additionalDetails)||void 0===Fe||null===(ke=Fe.selfCertificationCharges)||void 0===ke?void 0:ke.BPA_DEVELOPMENT_CHARGES,value:Qe,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)?(et(e),sessionStorage.setItem("development",e)):alert(pt("Please enter only upto 9 numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),l.createElement(o.CardLabel,null,pt("BPA_COMMON_OTHER_AMT")),l.createElement(o.TextInput,{t:pt,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:null==Ze||null===(Ue=Ze.additionalDetails)||void 0===Ue||null===(He=Ue.selfCertificationCharges)||void 0===He?void 0:He.BPA_OTHER_CHARGES,value:tt,onChange:e=>{!function(e){/^[0-9]*$/.test(e)?(lt(e),sessionStorage.setItem("otherCharges",e)):alert(pt("Please enter numbers"))}(e.target.value)},required:!0,pattern:/^[0-9]*$/}),parseInt(tt)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,pt("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(o.TextArea,{t:pt,type:"text",name:"otherChargesDiscription",defaultValue:null==Ze||null===(We=Ze.additionalDetails)||void 0===We?void 0:We.otherFeesDiscription,value:At,onChange:e=>{!function(e){St(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(o.CardLabel,null,pt("BPA_COMMON_LESS_AMT")),l.createElement(o.TextInput,{t:pt,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:null==Ze||null===(je=Ze.additionalDetails)||void 0===je||null===($e=je.selfCertificationCharges)||void 0===$e?void 0:$e.BPA_LESS_ADJUSMENT_PLOT,value:nt,onChange:e=>{!function(e){/^[0-9]*$/.test(e)?parseInt(e)>(parseInt(Qe)?parseInt(Qe):0)+(parseInt(tt)?parseInt(tt):0)+parseInt(dt)+parseInt(ot)+parseInt(ct)+parseInt(rt)?alert(pt("Less adjustment fees cannot be grater than Total of other P2 fees")):(it(e),sessionStorage.setItem("lessAdjusment",e)):alert(pt("Please enter numbers"))}(e.target.value)},required:!0,pattern:"^[0-9]*$"}),parseInt(nt)>0?l.createElement("div",null,l.createElement(o.CardLabel,null,pt("BPA_COMMON_LESS_AMT_FILE")),l.createElement(o.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){bt(e.target.files[0]),Tt(e.target.files[0])},onDelete:()=>{bt(null),Tt("")},message:ht?"1 "+pt("FILEUPLOADED"):pt("ES_NO_FILE_SELECTED_LABEL"),error:Lt,uploadMessage:Pt})):null,(null==Ot||null===(Ge=Ot.fileStoreIds)||void 0===Ge?void 0:Ge.length)&&parseInt(null==Ze||null===(ze=Ze.additionalDetails)||void 0===ze||null===(Ye=ze.selfCertificationCharges)||void 0===Ye?void 0:Ye.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(o.CardLabel,{style:{marginTop:"15px"}},pt("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Ot||null===(Ke=Ot.fileStoreIds)||void 0===Ke?void 0:Ke.length)&&parseInt(null==Ze||null===(Ve=Ze.additionalDetails)||void 0===Ve||null===(qe=Ve.selfCertificationCharges)||void 0===qe?void 0:qe.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Ot||null===(Xe=Ot.fileStoreIds[0])||void 0===Xe?void 0:Xe.url},l.createElement(o.PDFSvg,null)),l.createElement(o.Row,{className:"border-none"}),l.createElement(o.Row,{className:"border-none",label:pt("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseInt(Qe)?parseInt(Qe):0)+(parseInt(tt)?parseInt(tt):0)+parseInt(dt)+parseInt(ot)+(parseInt(ct)?parseInt(ct):0)+parseInt(rt)-(parseInt(nt)?parseInt(nt):0))})),l.createElement("br",null),"INITIATED"===(null==Ze?void 0:Ze.status)&&l.createElement("div",null,l.createElement(o.CardLabel,null,pt("ARCHITECT_SHOULD_VERIFY_HIMSELF_BY_CLICKING_BELOW_BUTTON")),l.createElement(o.LinkButton,{label:pt("BPA_VERIFY"),onClick:()=>{el(!0)}}),l.createElement("br",null),Qt&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,pt("BPA_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:pt,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"mobileNumber",value:tl,onChange:e=>{ll(e.target.value)},required:!0,pattern:"[0-9]{10}",type:"tel",title:pt("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:pt("BPA_GET_OTP"),onClick:function(){try{const e=c(function(){var e,t;return Promise.resolve(Digit.UserService.sendOtp({otp:{mobileNumber:tl,tenantId:null==mt||null===(e=mt.info)||void 0===e?void 0:e.tenantId,userType:null==mt||null===(t=mt.info)||void 0===t?void 0:t.type,type:"login"}})).then(function(e){e.isSuccessful?il(!0):(console.error("Error sending OTP Response is false:",e.error),alert("Something Went Wrong"))})},function(e){console.error("Error sending OTP:",e),alert("Something went wrong")});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!ml})),l.createElement("br",null),nl&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,pt("BPA_OTP")),l.createElement(o.TextInput,{t:pt,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"otp",value:ol,onChange:e=>{al(e.target.value)},required:!0,pattern:"[0-9]{6}",type:"tel",title:pt("BPA_INVALID_OTP")}),l.createElement(o.SubmitBar,{label:pt("VERIFY_OTP"),onSubmit:function(){try{const e=c(function(){return Promise.resolve(Digit.UserService.authenticate(pl)).then(function(e){if("Access Token generated successfully"===e.ResponseInfo.status){ul(!0),sl(pt("VERIFIED"));const e=new Date;vl(e),sessionStorage.setItem("otpVerifiedTimestamp",e.toString().replace(/GMT.*\((.*)\)/,"").trim())}else ul(!1),sl(pt("WRONG OTP"))})},function(e){console.error("Error verifying OTP:",e),alert("OTP Verification Error "),ul(!1),sl(pt("OTP Verification Error"))});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}),dl&&l.createElement(o.CardLabel,{style:{color:"red"}},dl))),l.createElement("br",null),l.createElement("div",null,l.createElement(o.CheckBox,{label:l.createElement("div",null,pt("I_AGREE_TO_BELOW_UNDERTAKING"),l.createElement(o.LinkButton,{label:pt("DECLARATION_UNDER_SELF_CERTIFICATION_SCHEME"),onClick:()=>{rl?Zt(!0):alert("Please verify yourself")}})),onChange:()=>{Vt(!Kt)},styles:{height:"auto"}}),Jt&&l.createElement(go,{showTermsPopup:Jt,setShowTermsPopup:Zt,otpVerifiedTimestamp:cl})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",height:"2px",marginTop:"20px",marginBottom:"20px"}}),l.createElement(o.SubmitBar,{label:pt("BPA_SEND_TO_CITIZEN_LABEL"),onSubmit:function(){Qe||sessionStorage.setItem("development",0),ct||sessionStorage.setItem("WaterCharges",0),nt||sessionStorage.setItem("lessAdjusment",0),tt||sessionStorage.setItem("otherCharges",0),parseInt(nt)>parseInt(Qe)+parseInt(tt)+parseInt(dt)+parseInt(ot)+parseInt(ct)+parseInt(rt)?alert(pt("Enterd Less Adjustment amount is invalid")):Je()},disabled:!Kt||!rl||!qt,id:!0})))},OCBPACheckPage:e=>{var a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,G,z,Y,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:ve,isLoading:pe}=Digit.Hooks.useDocumentSearch(ce,{enabled:(null==ce?void 0:ce.length)>0});let me=[],Ee=[];var _e;(null==ve||null===(d=ve.pdfFiles)||void 0===d?void 0:d.length)>0&&(null==ve||null===(_e=ve.pdfFiles)||void 0===_e||_e.map(e=>{"OBPS"==(null==e?void 0:e.module)&&me.push(e),"NOC"==(null==e?void 0:e.module)&&Ee.push(e)}));const{data:fe,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"}],De=e=>{const t=e;return(e,l,n)=>e[t]},Ce=t.useMemo(()=>ye.map(e=>({Header:Z(""+e.name),accessor:De(e.id),id:e.id})));function Te(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_"+_t(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return a||"NA"}function Ne(e){location.href=e}return pe||ge?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement($l,{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:Nt(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!=fe&&null!==(v=fe.planDetail)&&void 0!==v&&null!==(p=v.planInformation)&&void 0!==p&&p.plotArea?`${null==fe||null===(m=fe.planDetail)||void 0===m||null===(E=m.planInformation)||void 0===E?void 0:E.plotArea} ${Z("BPA_SQ_MTRS_LABEL")}`:Z("CS_NA"),textStyle:{paddingLeft:"12px"}}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_PLOT_NUMBER_LABEL"),text:(null==fe||null===(_=fe.planDetail)||void 0===_||null===(f=_.planInformation)||void 0===f?void 0:f.plotNo)||Z("CS_NA")}),l.createElement(o.Row,{className:"border-none",label:""+Z("BPA_KHATHA_NUMBER_LABEL"),text:(null==fe||null===(g=fe.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_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==fe?void 0:fe.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==fe?void 0:fe.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!=fe&&null!==(h=fe.planDetail)&&void 0!==h&&null!==(b=h.blocks)&&void 0!==b&&null!==(y=b[0])&&void 0!==y&&null!==(D=y.building)&&void 0!==D&&D.totalBuitUpArea?`${null==fe||null===(C=fe.planDetail)||void 0===C||null===(T=C.blocks)||void 0===T||null===(P=T[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==fe||null===(I=fe.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==fe||null===(R=fe.planDetail)||void 0===R||null===(w=R.blocks)||void 0===w||null===(x=w[0])||void 0===x||null===(M=x.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==fe||null===(F=fe.planDetail)||void 0===F?void 0:F.blocks.map((e,t)=>{var n,i;return l.createElement("div",{key:t,style:(null==fe||null===(n=fe.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:Te(e),columns:Ce,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!=fe&&null!==(k=fe.planDetail)&&void 0!==k&&null!==(U=k.planInformation)&&void 0!==U&&U.demolitionArea?`${null==fe||null===(H=fe.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(Gl,{documents:Ft(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?Nt(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:Nt(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(Gl,{documents:Ft(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===(G=he.Bill)||void 0===G||null===(z=G[0])||void 0===z||null===(Y=z.billDetails[0])||void 0===Y?void 0:Y.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,r,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,G,z,Y,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e;let{value:fe}=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,De]=t.useState(null),[Ce,Te]=t.useState(!1),[Pe,Ne]=t.useState(null),Ie=null==fe||null===(r=fe.data)||void 0===r?void 0:r.edcrDetails,Le=u.useQueryClient(),{data:Be,address:Oe,owners:Re,nocDocuments:we,documents:xe,subOccupancy:Me,PrevStateDocuments:Fe,PrevStateNocDocuments:ke,applicationNo:Ue}=fe;let He=`/digit-ui/citizen/obps/sendbacktocitizen/${"BPA_OC"==fe.businessService?"ocbpa":"bpa"}/${null==fe?void 0:fe.tenantId}/${null==fe?void 0:fe.applicationNo}`;"OCBPA"===(null==fe||null===(d=fe.uiFlow)||void 0===d?void 0:d.flow)&&(He=`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==fe?void 0:fe.tenantId}/${null==fe?void 0:fe.applicationNo}`),Se="BPA_LOW"===fe.businessService?"BPA.LOW_RISK_PERMIT_FEE":"BPA"===fe.businessService?"BPA.NC_APP_FEE":"BPA.NC_OC_APP_FEE";let We=[];null==Fe||Fe.map(e=>{We.push({...e,module:"OBPS"})}),null==xe||null===(s=xe.documents)||void 0===s||s.map(e=>{We.push({...e,module:"OBPS"})}),null==ke||ke.map(e=>{We.push({...e,module:"NOC"})}),null==we||null===(c=we.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 Ge=[],ze=[];var Ye;(null==je||null===(v=je.pdfFiles)||void 0===v?void 0:v.length)>0&&(null==je||null===(Ye=je.pdfFiles)||void 0===Ye||Ye.map(e=>{"OBPS"==(null==e?void 0:e.module)&&Ge.push(e),"NOC"==(null==e?void 0:e.module)&&ze.push(e)}));const{data:Ke,isLoading:Ve}=Digit.Hooks.useRecieptSearch({tenantId:null==fe?void 0:fe.tenantId,businessService:Se,consumerCodes:null==fe?void 0:fe.applicationNo},{enabled:!!(null!=fe&&fe.applicationNo&&Se&&null!=fe&&fe.tenantId)}),qe=Digit.Hooks.obps.useObpsAPI(null==fe?void 0:fe.tenantId,!1),Xe=Digit.Hooks.useWorkflowDetails({tenantId:null==fe?void 0:fe.tenantId,id:null==fe?void 0:fe.applicationNo,moduleCode:"OBPS",config:{enabled:!(null==fe||!fe.applicationNo||null==fe||!fe.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(_t(null==e||null===(l=e.i18nKey)||void 0===l?void 0:l.toUpperCase(),"-","_"))+", "}),t}return t.useEffect(()=>{switch(ye){case"FORWARD":Te(!0)}},[ye]),$e||Ve?l.createElement(o.Loader,null):l.createElement(l.Fragment,null,l.createElement($l,{currentStep:4,flow:"OCBPA"===(null==fe||null===(p=fe.uiFlow)||void 0===p?void 0:p.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:Nt(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===(_=Ie.planDetail)||void 0===_||null===(f=_.planInformation)||void 0===f?void 0:f.plotArea} ${ge("BPA_SQ_MTRS_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==fe||null===(b=fe.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==fe||null===(D=fe.uiFlow)||void 0===D?void 0:D.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!==(C=Ie.planDetail)&&void 0!==C&&null!==(T=C.blocks)&&void 0!==T&&null!==(P=T[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===(w=R.blocks)||void 0===w||null===(x=w[0])||void 0===x||null===(M=x.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===(F=Ie.planDetail)||void 0===F||null===(k=F.blocks)||void 0===k||null===(U=k[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===(G=Ie.planDetail)||void 0===G||null===(z=G.planInformation)||void 0===z?void 0:z.demolitionArea} ${ge("BPA_SQ_MTRS_LABEL")} `:ge("CS_NA")}))),"OCBPA"!==(null==fe||null===(Y=fe.uiFlow)||void 0===Y?void 0:Y.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(Gl,{documents:Ft(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,ge("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"}},""+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(Gl,{documents:Ft(null==ze?void 0:ze.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===(ve=ce[0])||void 0===ve||null===(pe=ve.bill)||void 0===pe||null===(me=pe.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){De("FORWARD"),Te(!0)}})),Ce?l.createElement(dn,{t:ge,action:ye,tenantId:be,id:null==fe?void 0:fe.applicationNo,closeModal:()=>{De(null),Te(!1)},submitAction:e=>{var t;let l=mt(fe);l.assignee=[];const n="OCBPA"===(null==fe||null===(t=fe.uiFlow)||void 0===t?void 0:t.flow),i=Ct(l,n,!0);qe.mutate({BPA:{...null==i?void 0:i.BPA,workflow:e}},{onError:(e,t)=>{var l,n,i;Te(!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)=>{Te(!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==fe?void 0:fe.tenantId}/${null==fe?void 0:fe.applicationNo}/acknowledgement`,{data:null==fe?void 0:fe.applicationNo})}})},actionData:null==Xe||null===(_e=Xe.data)||void 0===_e?void 0:_e.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,v;const{t:p}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var _;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:p("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:p("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:p(null==e||null===(_=e.data)||void 0===_?void 0:_.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isPermitApplication",!0),sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0));const f=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==f?void 0:f.appliactionType)&&(null==e?void 0:e.serviceType)===(null==f?void 0:f.applicationSubType)&&A({linkData:e,edcrNumber:null==f?void 0:f.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(f.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==f.status?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==f?void 0:f.edcrNumber,info:p("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"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.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"})),p("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==f||null===(c=f.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==f||null===(v=f.applicationSubType)||void 0===v?void 0:v.toLowerCase()}/docs-required`,state:g},replace:!0},l.createElement(o.SubmitBar,{label:p("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"}},p("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:p("CORE_COMMON_GO_TO_HOME")}))))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("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"}},p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.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"})),p("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:p("CORE_COMMON_GO_TO_HOME")})))))},OCEDCRAcknowledgement:e=>{var a,r,u,d,s,c,v;const{t:p}=n.useTranslation(),[m,E]=(i.useHistory(),t.useState(!1));var _;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:p("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:p("CORE_COMMON_GO_TO_HOME")}))),m?l.createElement(o.Toast,{error:"error",label:p(null==e||null===(_=e.data)||void 0===_?void 0:_.data),onClose:()=>E(null),isDleteBtn:!0}):null);sessionStorage.setItem("isEDCRDisable",JSON.stringify(!0)),sessionStorage.setItem("isPermitApplication",!0);const f=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==f?void 0:f.appliactionType)&&(null==e?void 0:e.serviceType)===(null==f?void 0:f.applicationSubType)&&A({linkData:e,edcrNumber:null==f?void 0:f.edcrNumber})}))},[!b]);const y=function(){try{var e=window.open(f.planReport,"_blank");return e&&e.focus(),Promise.resolve()}catch(e){return Promise.reject(e)}};return l.createElement("div",null,"Accepted"==(null==f?void 0:f.status)?l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("BPA_OC_EDCR_ACKNOWLEDGEMENT_SUCCESS_MESSAGE_LABEL"),applicationNumber:null==f?void 0:f.edcrNumber,info:p("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"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.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"})),p("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==f||null===(c=f.appliactionType)||void 0===c?void 0:c.toLowerCase()}/${null==f||null===(v=f.applicationSubType)||void 0===v?void 0:v.toLowerCase()}/docs-required`,state:g},replace:!0},l.createElement(o.SubmitBar,{label:p("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:p("CORE_COMMON_GO_TO_HOME")})))):l.createElement(o.Card,{style:{padding:"0px"}},l.createElement(o.Banner,{message:p("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"}},p("EDCR_ACKNOWLEDGEMENT_REJECTED_MESSAGE_TEXT_LABEL")),l.createElement(o.CardText,{style:{padding:"0px 8px",marginBottom:"10px"}},`${p("PDF_STATIC_LABEL_CONSOLIDATED_BILL_CONSUMER_ID_TL")} - ${null==f?void 0:f.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"})),p("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:p("CORE_COMMON_GO_TO_HOME")})))))},BPAAcknowledgement:e=>{var a,r,u,d,s,c;let{data:v,onSuccess:p}=e;const{t:m}=n.useTranslation(),E=Digit.ULBService.getCurrentTenantId(),_=Digit.Hooks.obps.useObpsAPI(null!=v&&null!==(a=v.address)&&void 0!==a&&a.city?null===(r=v.address)||void 0===r||null===(u=r.city)||void 0===u?void 0:u.code:E,!0),f=Digit.Hooks.obps.useObpsAPI(null!=v&&null!==(d=v.address)&&void 0!==d&&d.city?null===(s=v.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!=v&&null!==(e=v.address)&&void 0!==e&&e.city?null===(t=v.address)||void 0===t||null===(l=t.city)||void 0===l?void 0:l.code:E;v.tenantId=i;let o={};null==v||null===(n=v.nocDocuments)||void 0===n||n.NocDetails.map(e=>{o=gt(e,v),_.mutate(o,{onSuccess:p})}),o=Ct(v),f.mutate(o,{onSuccess:p}),sessionStorage.removeItem("Malbafees"),sessionStorage.removeItem("WaterCharges"),sessionStorage.removeItem("GaushalaFees"),sessionStorage.removeItem("LabourCess"),sessionStorage.removeItem("otherCharges"),sessionStorage.removeItem("lessAdjusment"),sessionStorage.removeItem("development")}catch(e){}},[]),f.isLoading||f.isIdle?l.createElement(o.Loader,null):l.createElement(o.Card,null,l.createElement(oa,{t:m,data:f.data,isSuccess:f.isSuccess,isLoading:f.isIdle||f.isLoading}),f.isSuccess&&l.createElement(o.CardText,null,((e,t)=>{var l,n,i,o,a,r,u,d,s,c,v;const p=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==p?void 0:p.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==p||null===(r=p.workflow)||void 0===r?void 0:r.action}_${null!=p&&null!==(u=p.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==p||null===(d=p.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${_t(E," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${m}_${null==p||null===(s=p.workflow)||void 0===s?void 0:s.action}_${null!=p&&null!==(c=p.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==p||null===(v=p.additionalDetails)||void 0===v?void 0:v.typeOfArchitect:"ARCHITECT"}_${_t(E," ","_").toUpperCase()}`)})(m,f.data)),!f.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")})),f.isSuccess&&l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o.SubmitBar,{label:m("CS_COMMON_DOWNLOAD"),onSubmit:function(){try{const e=v,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,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,U,H,W,j,$,G,z,Y,K,V,q,X,J,Z,Q,ee,te,le,ne,ie,oe,ae,re,ue,de,se,ce,ve,pe,me,Ee,_e,fe;const Ae=Digit.UserService.getUser();return console.log("application",e),Promise.resolve({t:l,tenantId:null==t?void 0:t.code,name:`${l(null==t?void 0:t.i18nKey)} ${ge=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),ge.toLowerCase().split(" ").map(Ao).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===(v=c.planInformation)||void 0===v?void 0:v.occupancy},{title:l("BPA_BASIC_DETAILS_RISK_TYPE_LABEL"),value:l("WF_BPA_"+(null==e?void 0:e.riskType))||"NA"}]},{title:l("BPA_PLOT_DETAILS_TITLE"),values:[{title:l("BPA_BOUNDARY_PLOT_AREA_LABEL"),value:(null==e||null===(p=e.data)||void 0===p||null===(m=p.edcrDetails)||void 0===m||null===(E=m.planDetail)||void 0===E||null===(_=E.planInformation)||void 0===_?void 0:_.plotArea)+" sq mtrs"||"NA"},{title:l("BPA_PLOT_NUMBER_LABEL"),value:(null==e||null===(f=e.data)||void 0===f||null===(g=f.edcrDetails)||void 0===g||null===(A=g.planDetail)||void 0===A||null===(S=A.planInformation)||void 0===S?void 0:S.plotNo)||"NA"},{title:l("BPA_KHATHA_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===(D=y.planInformation)||void 0===D?void 0:D.khataNo)||"NA"},{title:l("BPA_HOLDING_NUMBER_LABEL"),value:(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.holdingNo)||"NA"},{title:l("BPA_BOUNDARY_LAND_REG_DETAIL_LABEL"),value:(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.registrationDetails)||"NA"},{title:l("BPA_APPLICATION_DEMOLITION_AREA_LABEL"),value:l((null==e||null===(P=e.data)||void 0===P||null===(N=P.edcrDetails)||void 0===N||null===(I=N.planDetail)||void 0===I||null===(L=I.planInformation)||void 0===L?void 0:L.demolitionArea)+" sq mtrs")||"NA"},{title:l("BPA_WARD_NUMBER_LABEL"),value:(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.wardnumber)||"NA"},{title:l("BPA_KHASRA_NUMBER_LABEL"),value:(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.khasraNumber)||"NA"}]},{title:l("BPA_APPLICANT_DETAILS_HEADER"),values:[{title:l("CORE_COMMON_NAME"),value:(null==e||null===(R=e.landInfo)||void 0===R||null===(w=R.owners[0])||void 0===w?void 0:w.name)||"NA"},{title:l("BPA_APPLICANT_GENDER_LABEL"),value:(null==e||null===(x=e.landInfo)||void 0===x||null===(M=x.owners[0])||void 0===M?void 0:M.gender)||"NA"},{title:l("CORE_COMMON_MOBILE_NUMBER"),value:(null==e||null===(F=e.landInfo)||void 0===F||null===(k=F.owners[0])||void 0===k?void 0:k.mobileNumber)||"NA"},{title:l("CORE_COMMON_EMAIL_ID"),value:(null==e||null===(U=e.landInfo)||void 0===U||null===(H=U.owners[0])||void 0===H?void 0:H.emailId)||"NA"},{title:l("BPA_IS_PRIMARY_OWNER_LABEL"),value:(null==e||null===(W=e.landInfo)||void 0===W||null===(j=W.owners[0])||void 0===j?void 0:j.isPrimaryOwner)||"NA"}]},{title:l("BPA_ARCHITECT_DETAILS"),values:[{title:l("BPA_ARCHITECT_NAME"),value:(null==Ae||null===($=Ae.info)||void 0===$?void 0:$.name)||"NA"},{title:l("BPA_ARCHITECT_MOBILE_NUMBER"),value:(null==Ae||null===(G=Ae.info)||void 0===G?void 0:G.mobileNumber)||"NA"},{title:l("BPA_ARCHITECT_ID"),value:(null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.architectid)||"NA"},{title:l("BPA_ARCHITECT_EMAIL"),value:(null==Ae||null===(Y=Ae.info)||void 0===Y?void 0:Y.emailId)||"NA"}]},{title:l("BPA_NEW_TRADE_DETAILS_HEADER_DETAILS"),values:[{title:l("BPA_DETAILS_PIN_LABEL"),value:(null==e||null===(K=e.landInfo)||void 0===K||null===(V=K.address)||void 0===V?void 0:V.pincode)||"NA"},{title:l("BPA_CITY_LABEL"),value:(null==e||null===(q=e.landInfo)||void 0===q||null===(X=q.address)||void 0===X?void 0:X.city)||"NA"},{title:l("BPA_LOC_MOHALLA_LABEL"),value:(null==e||null===(J=e.landInfo)||void 0===J||null===(Z=J.address)||void 0===Z||null===(Q=Z.locality)||void 0===Q?void 0:Q.name)||"NA"},{title:l("BPA_DETAILS_SRT_NAME_LABEL"),value:(null==e||null===(ee=e.landInfo)||void 0===ee||null===(te=ee.address)||void 0===te?void 0:te.street)||"NA"},{title:l("ES_NEW_APPLICATION_LOCATION_LANDMARK"),value:(null==e||null===(le=e.landInfo)||void 0===le||null===(ne=le.address)||void 0===ne?void 0:ne.landmark)||"NA"}]},{title:l("BPA_COLONY_DETAILS"),values:[{title:l("BPA_APPROVED_COLONY"),value:(null==e||null===(ie=e.additionalDetails)||void 0===ie?void 0:ie.approvedColony)||"NA"},{title:l("BPA_MASTER_PLAN"),value:(null==e||null===(oe=e.additionalDetails)||void 0===oe?void 0:oe.masterPlan)||"NA"},{title:l("BPA_DISTRICT"),value:(null==e||null===(ae=e.additionalDetails)||void 0===ae?void 0:ae.District)||"NA"},{title:l("BPA_ULB_NAME"),value:(null==e||null===(re=e.additionalDetails)||void 0===re?void 0:re.UlbName)||"NA"},{title:l("BPA_BUILDING_STATUS"),value:(null==e||null===(ue=e.additionalDetails)||void 0===ue?void 0:ue.buildingStatus)||"NA"},{title:l("BPA_SCHEMES"),value:(null==e||null===(de=e.additionalDetails)||void 0===de?void 0:de.schemes)||"NA"},{title:l("BPA_SCHEMES_TYPE"),value:(null==e||null===(se=e.additionalDetails)||void 0===se?void 0:se.schemesselection)||"NA"},{title:l("BPA_PURCHASED_FAR"),value:(null==e||null===(ce=e.additionalDetails)||void 0===ce?void 0:ce.purchasedFAR)||"NA"},{title:l("BPA_GREEN_BUIDINGS"),value:(null==e||null===(ve=e.additionalDetails)||void 0===ve?void 0:ve.greenbuilding)||"NA"},{title:l("BPA_RESTRICTED_AREA"),value:(null==e||null===(pe=e.additionalDetails)||void 0===pe?void 0:pe.restrictedArea)||"NA"},{title:l("BPA_PROPOSED_SITE_TYPE"),value:(null==e||null===(me=e.additionalDetails)||void 0===me?void 0:me.proposedSite)||"NA"},{title:l("BPA_CORE_AREA"),value:(null==e||null===(Ee=e.data)||void 0===Ee||null===(_e=Ee.edcrDetails)||void 0===_e||null===(fe=_e.planDetail)||void 0===fe?void 0:fe.coreArea)||"NA"}]}]})}catch(e){return Promise.reject(e)}var ge}(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=gt(e,a),s.mutate(t,{onSuccess:r})}),t=Ct(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(ua,{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,v;const p=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==p?void 0:p.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==p||null===(r=p.workflow)||void 0===r?void 0:r.action}_${null!=p&&null!==(u=p.additionalDetails)&&void 0!==u&&u.typeOfArchitect?null==p||null===(d=p.additionalDetails)||void 0===d?void 0:d.typeOfArchitect:"ARCHITECT"}_${_t(E," ","_").toUpperCase()}`),e(`BPA_SUB_HEADER_${m}_${null==p||null===(s=p.workflow)||void 0===s?void 0:s.action}_${null!=p&&null!==(c=p.additionalDetails)&&void 0!==c&&c.typeOfArchitect?null==p||null===(v=p.additionalDetails)||void 0===v?void 0:v.typeOfArchitect:"ARCHITECT"}_${_t(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",v=null==u?void 0:u.status,p=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}_${p}_${_t(v," ","_").toUpperCase()}`:`BPA_HEADER_${c}_${p}_${_t(v," ","_").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}_${p}_${m||"ARCHITECT"}_${_t(v," ","_").toUpperCase()}`:`BPA_SUB_HEADER_${c}_${p}_${m||"ARCHITECT"}_${_t(v," ","_").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,v,p,m,E;let{data:_,onSuccess:f}=e;const{t:g}=n.useTranslation(),{id:A}=i.useParams(),S=Digit.ULBService.getCurrentTenantId(),h=Digit.Hooks.obps.useStakeholderAPI(null!=_&&null!==(a=_.address)&&void 0!==a&&a.city?null===(r=_.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 D=window.location.href.includes("openlink");Digit.Utils.browser.isMobile();const C=(null==h||null===(d=h.data)||void 0===d||null===(s=d.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(v=c.tradeLicenseDetail)||void 0===v||null===(p=v.tradeUnits)||void 0===p||null===(m=p[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!=_&&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,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,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===(v=e.formData)||void 0===v||null===(p=v.LicneseType)||void 0===p||null===(m=p.LicenseType)||void 0===m?void 0:m.tradeType,id:null==e||null===(E=e.result)||void 0===E||null===(_=E.Licenses[0])||void 0===_||null===(f=_.tradeLicenseDetail)||void 0===f||null===(g=f.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===(D=e.formData)||void 0===D||null===(C=D.LicneseDetails)||void 0===C||null===(T=C.gender)||void 0===T?void 0:T.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===(w=R.LicneseDetails)||void 0===w?void 0:w.PermanentAddress,correspondenceAddress:null==e?void 0:e.Correspondenceaddress,pan:null==e||null===(x=e.formData)||void 0===x||null===(M=x.LicneseDetails)||void 0===M?void 0:M.PanNumber,uuid:null==e||null===(F=e.result)||void 0===F||null===(k=F.Licenses[0])||void 0===k||null===(U=k.tradeLicenseDetail)||void 0===U||null===(H=U.owners)||void 0===H||null===(W=H[0])||void 0===W?void 0:W.uuid}],applicationDocuments:Tt(e)}}]}})(_),h.mutate(o,{onSuccess:f})}catch(e){}},[]);const T=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(T,{applicationNumber:A,tenantId:T},{}));return h.isLoading||h.isIdle?l.createElement(o.Loader,null):l.createElement("div",null,l.createElement("div",{className:D?"OpenlinkContainer":""},D&&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_"+C)}${g("CS_FILE_STAKEHOLDER_RESPONSE")}`),!h.isSuccess&&l.createElement(o.CardText,null,g("CS_FILE_PROPERTY_FAILED_RESPONSE")),h.isSuccess&&!D&&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,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,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)} ${w=l("ULBGRADE_"+(null==t||null===(n=t.city)||void 0===n?void 0:n.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),w.toLowerCase().split(" ").map(da).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===(v=c.values[1])||void 0===v?void 0:v.value)||"NA"},{title:l("LICENSE_TYPE"),value:(null==e||null===(p=e.applicationData)||void 0===p?void 0:p.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===(_=E.owners)||void 0===_||null===(f=_[0])||void 0===f?void 0:f.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===(D=y.values[1])||void 0===D?void 0:D.value)||"NA"},{title:l("BPA_APPLICANT_EMAIL_LABEL"),value:(null==e||null===(C=e.applicationDetails)||void 0===C||null===(T=C[2])||void 0===T||null===(P=T.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 w}(e,t,g)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),!D&&l.createElement(i.Link,{to:"/digit-ui/citizen"},l.createElement(o.LinkButton,{label:g("CORE_COMMON_GO_TO_HOME")})),h.isSuccess&&D&&l.createElement(i.Link,{to:{pathname:"/digit-ui/citizen"}},l.createElement(o.SubmitBar,{label:g("BPA_COMMON_PROCEED_NEXT")})))))},ObpsCreateEDCR:e=>{var o,a,r,d;const s=u.useQueryClient(),c=i.useRouteMatch(),{t:v}=n.useTranslation(),p=(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 D(e,t,l,n){var i,o,a,r;h(!0);const u=Digit.UserService.getUser();let d={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{uuid:null==u||null===(i=u.info)||void 0===i?void 0:i.uuid,tenantId:null==u||null===(o=u.info)||void 0===o?void 0:o.tenantId}}};const s=null==t?void 0:t.applicantName,c=null==t||null===(a=t.coreArea)||void 0===a?void 0:a.code,v=null==t?void 0:t.file,m=null==t||null===(r=t.tenantId)||void 0===r?void 0:r.code,E=ft();d={...d,tenantId:m},d={...d,transactionNumber:E},d={...d,applicantName:s},d={...d,coreArea:c},d={...d,appliactionType:"BUILDING_PLAN_SCRUTINY"},d={...d,applicationSubType:"NEW_CONSTRUCTION"};let f=new FormData;f.append("edcrRequest",JSON.stringify(d)),f.append("planFile",v),Digit.EDCRService.create({data:f},m).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),_(null==e||null===(a=e.data)||void 0===a?void 0:a.edcrDetail),p.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"}),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 C=()=>{},T=()=>{};y=null!==(o=y)&&void 0!==o&&o.EdcrConfig?null===(a=y)||void 0===a?void 0:a.EdcrConfig:ql,y.forEach(e=>{m=m.concat(e.body.filter(e=>!e.hideInCitizen))}),m.indexRoute="home";const P=null===(r=Digit)||void 0===r||null===(d=r.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:D,onSkip:C,t:v,formData:E,onAdd:T,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,r,d;const s=u.useQueryClient(),c=i.useRouteMatch(),{t:v}=n.useTranslation(),{pathname:p}=i.useLocation(),{path:m}=i.useRouteMatch(),E=i.useHistory();let _=[];const[f,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 D=Digit.ULBService.getStateId();let{data:C}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(D,[]);const T=(e,t,l,n)=>{n?function(e,t,l,n){var i,o,a,r,u,d,s,c;y(!0);const v=f,p=Digit.UserService.getUser();let m={transactionNumber:"",edcrNumber:"",planFile:null,tenantId:"",RequestInfo:{apiId:"",ver:"",ts:"",action:"",did:"",authToken:"",key:"",msgId:"",correlationId:"",userInfo:{id:null==p||null===(i=p.info)||void 0===i?void 0:i.uuid,tenantId:null==p||null===(o=p.info)||void 0===o?void 0:o.tenantId}}};const _=ft(),A=null==v||null===(a=v.ScrutinyDetails)||void 0===a?void 0:a.edcrNumber,S=null==v||null===(r=v.ScrutinyDetails)||void 0===r?void 0:r.tenantId,b=null==v||null===(u=v.ScrutinyDetails)||void 0===u?void 0:u.applicantName,D=Pt(null==v||null===(d=v.ScrutinyDetails)||void 0===d?void 0:d.ocPermitdate),C=null==v||null===(s=v.ScrutinyDetails)||void 0===s?void 0:s.ocPermitNumber,T=null==v||null===(c=v.ScrutinyDetails)||void 0===c?void 0:c.edcrNumber,P=null==t?void 0:t.file;m={...m,transactionNumber:_},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:D},m={...m,permitNumber:C},m={...m,comparisonEdcrNumber:T};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({...f,[e]:{...f[e],...t}}),l||(e=>{const t=p.split("/").pop(),{nextStep:l}=_.find(e=>e.route===t);let n=E.push;if(null===l)return n(m+"/check");n(`${m}/${l}`)})()},P=()=>{},N=()=>{};C=null!==(o=C)&&void 0!==o&&o.OCEdcrConfig?null===(a=C)||void 0===a?void 0:a.OCEdcrConfig:Xl,C.forEach(e=>{_=_.concat(e.body.filter(e=>!e.hideInCitizen))}),_.indexRoute="docs-required";const I=null===(r=Digit)||void 0===r||null===(d=r.ComponentRegistryService)||void 0===d?void 0:d.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:`${c.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:T,onSkip:P,t:v,formData:f,onAdd:N,isShowToast:S,isSubmitBtnDisable:b,setIsShowToast:h}))}),l.createElement(i.Route,{path:c.path+"/acknowledgement"},l.createElement(I,{data:f,onSuccess:()=>{sessionStorage.removeItem("CurrentFinancialYear"),s.invalidateQueries("TL_CREATE_TRADE")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${c.path}/${_.indexRoute}`})))},ObpsNewBuildingPermit:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{pathname:p,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useRouteMatch(),_=i.useHistory();i.useLocation(),Digit.SessionStorage.set("OBPS_PT","true"),sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[f,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}:{...f,[e]:{...f[e],...t}}),(e=>{const t=p.split("/").pop(),{nextStep:l}=Zl.find(e=>e.route===t);let n=_.push;if(null===l)return n(Ql(E.path,E.params)+"/check");n(`${Ql(E.path,E.params)}/${l}`)})()},y=()=>{};let D=[];h=null!==(e=h)&&void 0!==e&&e.BuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.BuildingPermitConfig:Jl,h.forEach(e=>{D=D.concat(e.body.filter(e=>!e.hideInCitizen))}),D.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const C=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("BPACheckPage"),T=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("BPAAcknowledgement");return l.createElement(i.Switch,null,Zl.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(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:v,formData:f}))}),l.createElement(i.Route,{path:Ql(E.path,E.params)+"/check"},l.createElement(C,{onSubmit:function(){try{return _.push(Ql(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:f})),l.createElement(i.Route,{path:Ql(E.path,E.params)+"/acknowledgement"},l.createElement(T,{data:f,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Ql(E.path,E.params)}/${D.indexRoute}`})))},ObpsOCBuildingPermit:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{pathname:p,state:m}=(i.useRouteMatch(),i.useLocation()),E=i.useHistory(),_=i.useRouteMatch();sessionStorage.removeItem("BPA_SUBMIT_APP"),Digit.ULBService.getCurrentTenantId();const[f,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}:{...f,[e]:{...f[e],...t}}),(e=>{const t=p.split("/").pop(),{nextStep:l}=D.find(e=>e.route===t);let n=E.push;if(null===l)return n(tn(_.path,_.params)+"/check");n(`${tn(_.path,_.params)}/${l}`)})()},y=()=>{};let D=[];h=null!==(e=h)&&void 0!==e&&e.OCBuildingPermitConfig?null===(o=h)||void 0===o?void 0:o.OCBuildingPermitConfig:en,h.forEach(e=>{D=D.concat(e.body.filter(e=>!e.hideInCitizen))}),D.indexRoute="docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const C=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("OCBPACheckPage"),T=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("OCBPAAcknowledgement");return l.createElement(i.Switch,null,D.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:b,onSkip:y,t:v,formData:f}))}),l.createElement(i.Route,{path:tn(_.path,_.params)+"/check"},l.createElement(C,{onSubmit:function(){try{return E.push(tn(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:f})),l.createElement(i.Route,{path:tn(_.path,_.params)+"/acknowledgement"},l.createElement(T,{data:f,onSuccess:()=>{c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${tn(_.path,_.params)}/${D.indexRoute}`})))},ObpsStakeholderRegistration:()=>{var e,o,a,r,d,s;const c=u.useQueryClient(),{t:v}=n.useTranslation(),{path:p}=i.useRouteMatch(),{pathname:m,state:E}=i.useLocation(),_=i.useHistory(),[f,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}:{...f,[e]:{...f[e],...t}}),(e=>{const t=m.split("/").pop(),{nextStep:l}=D.find(e=>e.route===t);let n=_.push;if(null===l)return n(p+"/check");n(`${p}/${l}`)})()},y=()=>{};let D=[];h=null!==(e=h)&&void 0!==e&&e.StakeholderConfig?null===(o=h)||void 0===o?void 0:o.StakeholderConfig:ln,h.forEach(e=>{D=D.concat(e.body.filter(e=>!e.hideInCitizen))}),D.indexRoute="stakeholder-docs-required",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(A(),sessionStorage.setItem("isPermitApplication",!1))},[]);const C=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("StakeholderCheckPage"),T=null===(d=Digit)||void 0===d||null===(s=d.ComponentRegistryService)||void 0===s?void 0:s.getComponent("StakeholderAcknowledgement");return l.createElement(i.Switch,null,D.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}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:b,onSkip:y,t:v,formData:f}))}),l.createElement(i.Route,{path:p+"/check"},l.createElement(C,{onSubmit:function(){try{return _.push(p+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:f})),l.createElement(i.Route,{path:p+"/acknowledgement"},l.createElement(T,{data:f,onSuccess:()=>{A(),c.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${p}/${D.indexRoute}`})))},ObpsCitizenBpaApplicationDetail:()=>{var e,a,r,d,s,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x;const M=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{var i,o;let e=new Date;fe.applicationData.additionalDetails.runDate=Pt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let T={...null==fe?void 0:fe.applicationData,edcrDetail:[{...null==fe?void 0:fe.edcrDetails}]};const P=Digit.ULBService.getStateId();let N=0;for(let e=0;e<(null===(a=he)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.processInstances)||void 0===u?void 0:u.length);e++){var a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y;"POST_PAYMENT_APPLY"!==(null===(d=he)||void 0===d||null===(s=d.data)||void 0===s||null===(c=s.processInstances[e])||void 0===c?void 0:c.action)&&"PAY"!==(null===(v=he)||void 0===v||null===(p=v.data)||void 0===p||null===(m=p.processInstances[e])||void 0===m?void 0:m.action)||"APPROVAL_INPROGRESS"!==(null===(E=he)||void 0===E||null===(_=E.data)||void 0===_||null===(f=_.processInstances)||void 0===f||null===(g=f[e])||void 0===g||null===(A=g.state)||void 0===A?void 0:A.applicationStatus)||0!=N||(T.additionalDetails.submissionDate=null===(S=he)||void 0===S||null===(h=S.data)||void 0===h||null===(b=h.processInstances[e])||void 0===b||null===(y=b.auditDetails)||void 0===y?void 0:y.createdTime,N=1)}var D;if("NO"==(null==T||null===(i=T.additionalDetails)||void 0===i?void 0:i.approvedColony))T.additionalDetails.permitData="The plot has been officially regularized under No."+(null==T||null===(D=T.additionalDetails)||void 0===D?void 0:D.NocNumber)+" dated dd/mm/yyyy, registered in the name of <name as per the NOC>. This regularization falls within the jurisdiction of "+P+".Any form of misrepresentation of the NoC is strictly prohibited. Such misrepresentation renders the building plan null and void, and it will be regarded as an act of impersonation. Criminal proceedings will be initiated against the owner and concerned architect / engineer/ building designer / supervisor involved in such actions";else if("YES"==(null==T||null===(o=T.additionalDetails)||void 0===o?void 0:o.approvedColony)){var C;T.additionalDetails.permitData="The building plan falls under approved colony "+(null==T||null===(C=T.additionalDetails)||void 0===C?void 0:C.nameofApprovedcolony)}else T.additionalDetails.permitData="The building plan falls under Lal Lakir";return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[T]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,i;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),T.applicationType=null==fe||null===(n=fe.applicationData)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...T}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?wt(new Blob([e.data],{type:"application/pdf"})):Rt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},F=function(e){let{payments:t,...l}=e;try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(W,{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 l=function(){if(null==t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(W,{Payments:[{...t}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==t?void 0:t.fileStoreId]}}();return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},{id:k}=i.useParams(),{t:U}=n.useTranslation(),H=Digit.ULBService.getCurrentTenantId(),W=Digit.ULBService.getStateId(),j=window.Digit.Utils.browser.isMobile(),$=u.useQueryClient(),[G,z]=t.useState(null),[Y,K]=t.useState(!1),[V,q]=t.useState(!1),[X,J]=t.useState(!1),[Z,Q]=t.useState(!1),[ee,te]=t.useState(null),[le,ne]=t.useState(!1),[ie,oe]=t.useState(!1),[ae,re]=t.useState(!1),[ue,de]=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 se=Digit.UserService.getUser(),ce=null==se||null===(e=se.info)||void 0===e?void 0:e.mobileNumber,ve=i.useHistory();sessionStorage.setItem("bpaApplicationDetails",!1);let pe=!1;const{data:me}=Digit.Hooks.obps.useMDMS(W,"StakeholderRegistraition","TradeTypetoRoleMapping"),{isLoading:Ee,data:_e}=Digit.Hooks.obps.useMDMS(W,"BPA",["DocTypeMapping"]),{data:fe,isLoading:ge}=Digit.Hooks.obps.useBPADetailsPage(H,{applicationNo:k});console.log("datata",fe);const{data:Ae}=Digit.Hooks.obps.useMDMS(H.split(".")[0],"BPA",["RiskTypeComputation"]),Se=Digit.Hooks.obps.useObpsAPI(null==fe||null===(a=fe.applicationData)||void 0===a?void 0:a.tenantId,!1);let he=Digit.Hooks.useWorkflowDetails({tenantId:null==fe||null===(r=fe.applicationData)||void 0===r?void 0:r.tenantId,id:k,moduleCode:"OBPS",config:{enabled:!!fe}});const[be,ye]=t.useState(!1),[De,Ce]=t.useState(!1),[Te,Pe]=t.useState(!1),[Ne,Ie]=t.useState(ce||""),[Le,Be]=t.useState(!1),[Oe,Re]=t.useState(""),[we,xe]=t.useState(!1),[Me,Fe]=t.useState(""),[ke,Ue]=t.useState(null),He={username:Ne,password:Oe,tenantId:null==se||null===(d=se.info)||void 0===d?void 0:d.tenantId,userType:null==se||null===(s=se.info)||void 0===s?void 0:s.type},We=10===Ne.length&&/^[0-9]+$/.test(Ne),je=!!sessionStorage.getItem("CitizenConsentdocFilestoreid");t.useEffect(()=>{if(!Ee&&!ge){var e;let v=[];if(null!=_e&&null!==(e=_e.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;v=null==_e||null===(t=_e.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==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.riskType)&&e.ServiceType==(null==fe||null===(l=fe.applicationData)||void 0===l||null===(n=l.additionalDetails)||void 0===n?void 0:n.serviceType)&&e.applicationType==(null==fe||null===(i=fe.applicationData)||void 0===i||null===(o=i.additionalDetails)||void 0===o?void 0:o.applicationType)});let e=null==fe||null===(n=fe.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,p=[];v&&(null===(u=v)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=v)||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=>{p.push(e)})}));const m=null==fe?void 0:fe.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:p}]}}:e);fe.applicationDetails=[...m]}}},[_e,fe]),t.useEffect(()=>{var e,t;"CITIZEN_APPROVAL_INPROCESS"==(null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.status)||"INPROGRESS"==(null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.status)?oe(!0):oe(!1)},[fe]);const $e=(e,t)=>e?t?e:U(e):U("NA");t.useEffect(()=>{switch(ee){case"APPROVE":case"SEND_TO_ARCHITECT":case"APPLY":case"SKIP_PAYMENT":case"POST_PAYMENT_APPROVE":case"POST_PAYMENT_APPLY":J(!0)}},[ee]);const Ge=()=>{z(null)};function ze(e){var t;let l="BPA_OC"==(null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.businessService)?"ocbpa":"bpa";var n,i,o,a,r,u,d;"FORWARD"===e&&ve.replace(`/digit-ui/citizen/obps/sendbacktocitizen/ocbpa/${null==fe||null===(n=fe.applicationData)||void 0===n?void 0:n.tenantId}/${null==fe||null===(i=fe.applicationData)||void 0===i?void 0:i.applicationNo}/check`,{data:null==fe?void 0:fe.applicationData,edcrDetails:null==fe?void 0:fe.edcrDetails}),"PAY"===e&&window.location.assign(`${window.location.origin}/digit-ui/citizen/payment/collect/${Ot(null==fe?void 0:fe.businessService,null==fe?void 0:fe.applicationStatus)}/${k}/${null==fe?void 0:fe.tenantId}?tenantId=${null==fe?void 0:fe.tenantId}`),"SEND_TO_CITIZEN"===e&&((null===(o=he)||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==fe||null===(u=fe.applicationData)||void 0===u?void 0:u.tenantId}/${null==fe||null===(d=fe.applicationData)||void 0===d?void 0:d.applicationNo}`):At(null==fe?void 0:fe.applicationData,Ae,ve,U)),te(e),q(!1)}function Ye(){return!!ie&&(pe?!pe:!Y)}const Ke=e=>{var t,l,n,i,o;re(!0);const a=null==fe||null===(t=fe.applicationData)||void 0===t||null===(l=t.documents)||void 0===l?void 0:l.some(e=>"CITIZEN.UNDERTAKING"===e.documentType),r=[...null==fe||null===(n=fe.applicationData)||void 0===n?void 0:n.documents.filter(e=>"CITIZEN.UNDERTAKING"!==e.documentType),...a?null==fe||null===(i=fe.applicationData)||void 0===i?void 0:i.documents.filter(e=>"CITIZEN.UNDERTAKING"===e.documentType):[{documentType:"CITIZEN.UNDERTAKING",fileStoreId:sessionStorage.getItem("CitizenConsentdocFilestoreid"),fileStore:sessionStorage.getItem("CitizenConsentdocFilestoreid")}]],u={...null==fe?void 0:fe.applicationData,documents:r,additionalDetails:{...null==fe||null===(o=fe.applicationData)||void 0===o?void 0:o.additionalDetails,otpVerifiedTimestampcitizen:sessionStorage.getItem("otpVerifiedTimestampcitizen")}};Se.mutate({BPA:{...u,workflow:e}},{onError:(e,t)=>{var l,n,i,o,a,r;re(!1),J(!1),z({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(Ge,5e3)},onSuccess:(e,t)=>{re(!1),ve.replace("/digit-ui/citizen/obps/response",{data:e}),J(!1),z({key:"success",action:ee}),setTimeout(Ge,5e3),$.invalidateQueries("BPA_DETAILS_PAGE"),$.invalidateQueries("workFlowDetails")}})};if((null===(v=he)||void 0===v||null===(p=v.data)||void 0===p||null===(m=p.nextActions)||void 0===m?void 0:m.length)>0&&"CITIZEN_APPROVAL_INPROCESS"==(null==fe||null===(E=fe.applicationData)||void 0===E?void 0:E.status)){var Ve,qe,Xe;const e=Digit.UserService.getUser(),t=null==e||null===(Ve=e.info)||void 0===Ve?void 0:Ve.roles;var Je,Ze,Qe;if("CITIZEN_APPROVAL_INPROCESS"==(null==fe||null===(qe=fe.applicationData)||void 0===qe?void 0:qe.status))he.data.nextActions=1==(null==t?void 0:t.length)&&"CITIZEN"==(null==t||null===(Je=t[0])||void 0===Je?void 0:Je.code)?null===(Ze=he)||void 0===Ze||null===(Qe=Ze.data)||void 0===Qe?void 0:Qe.nextActions:[];else if("INPROGRESS"==(null==fe||null===(Xe=fe.applicationData)||void 0===Xe?void 0:Xe.status)){var et,tt;let e=!1;null==me||null===(et=me.StakeholderRegistraition)||void 0===et||null===(tt=et.TradeTypetoRoleMapping)||void 0===tt||tt.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 lt,nt;(null==t?void 0:t.length)>1&&t.forEach(t=>{l.includes(t.code)&&(e=!0)}),he.data.nextActions=e?null===(lt=he)||void 0===lt||null===(nt=lt.data)||void 0===nt?void 0:nt.nextActions:[]}}if("SEND_BACK_TO_CITIZEN"===(null===(_=he)||void 0===_||null===(f=_.data)||void 0===f||null===(g=f.processInstances)||void 0===g||null===(A=g[0])||void 0===A?void 0:A.action)){var it;Y&&K(!0),pe=!0;const e=Digit.UserService.getUser(),t=null==e||null===(it=e.info)||void 0===it?void 0:it.roles;var ot,at;1!==(null==t?void 0:t.length)&&(he={...he,data:{...null===(ot=he)||void 0===ot?void 0:ot.data,actionState:{nextActions:[]}},data:{...null===(at=he)||void 0===at?void 0:at.data,nextActions:[]}})}if(ge||ae)return l.createElement(o.Loader,null);let rt=[];var ut,dt,st,ct,vt,pt,Et,_t,ft,gt,St,ht,bt;if((null==fe||null===(S=fe.collectionBillDetails)||void 0===S?void 0:S.length)>0&&mt(null==fe?void 0:fe.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)&&rt.push({order:1,label:U("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.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)&&rt.push({order:2,label:U("BPA_OC_DEV_PEN_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.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)&&rt.push({order:1,label:U("BPA_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.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)&&rt.push({order:1,label:U("BPA_APP_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.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)&&rt.push({order:2,label:U("BPA_SAN_FEE_RECEIPT"),onClick:()=>{var t,l;return F({tenantId:null==fe||null===(t=fe.applicationData)||void 0===t?void 0:t.tenantId,payments:e,consumerCodes:null==fe||null===(l=fe.applicationData)||void 0===l?void 0:l.applicationNo})}})}),fe&&"BPA_LOW"===(null==fe||null===(h=fe.applicationData)||void 0===h?void 0:h.businessService)&&(null==fe||null===(b=fe.collectionBillDetails)||void 0===b?void 0:b.length)>0)(null==fe||null===(ut=fe.applicationData)||void 0===ut||!ut.status.includes("REVOCATION"))&&rt.push({order:3,label:U("BPA_PERMIT_ORDER"),onClick:()=>{var e;return M({tenantId:null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit-low")}}),(null==fe||null===(dt=fe.applicationData)||void 0===dt?void 0:dt.status.includes("REVOCATION"))&&rt.push({order:3,label:U("BPA_REVOCATION_PDF_LABEL"),onClick:()=>{var e;return function(e){let{tenantId:t,...l}=e;try{let e={...null==fe?void 0:fe.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==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId})}});else if(fe&&"BPA"===(null==fe||null===(y=fe.applicationData)||void 0===y?void 0:y.businessService)&&(null==fe||null===(D=fe.collectionBillDetails)||void 0===D?void 0:D.length)>0){var yt;"APPROVED"===(null==fe||null===(yt=fe.applicationData)||void 0===yt?void 0:yt.status)&&rt.push({order:3,label:U("BPA_PERMIT_ORDER"),onClick:()=>{var e;return M({tenantId:null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId},"buildingpermit")}})}else{var Dt;"APPROVED"===(null==fe||null===(Dt=fe.applicationData)||void 0===Dt?void 0:Dt.status)&&rt.push({order:3,label:U("BPA_OC_CERTIFICATE"),onClick:()=>{var e;return M({tenantId:null==fe||null===(e=fe.applicationData)||void 0===e?void 0:e.tenantId},"occupancy-certificate")}})}null!=fe&&fe.comparisionReport&&rt.push({order:4,label:U("BPA_COMPARISON_REPORT_LABEL"),onClick:()=>{var e;return window.open(null==fe||null===(e=fe.comparisionReport)||void 0===e?void 0:e.comparisonReport,"_blank")}}),rt.sort(function(e,t){return e.order-t.order}),(null===(C=he)||void 0===C||null===(T=C.data)||void 0===T||null===(P=T.nextActions)||void 0===P?void 0:P.length)>0&&(he.data.nextActions=null===(st=he)||void 0===st||null===(ct=st.data)||void 0===ct||null===(vt=ct.nextActions)||void 0===vt?void 0:vt.filter(e=>"INITIATE"!==e.action),he.data.nextActions=null===(pt=he)||void 0===pt||null===(Et=pt.data)||void 0===Et||null===(_t=Et.nextActions)||void 0===_t?void 0:_t.filter(e=>"ADHOC"!==e.action),he.data.nextActions=null===(ft=he)||void 0===ft||null===(gt=ft.data)||void 0===gt||null===(St=gt.nextActions)||void 0===St?void 0:St.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==fe||null===(N=fe.applicationDetails)||void 0===N?void 0:N.length)>0&&(fe.applicationDetails=(null==fe||null===(ht=fe.applicationDetails)||void 0===ht?void 0:ht.length)>0&&(null==fe||null===(bt=fe.applicationDetails)||void 0===bt?void 0:bt.filter(e=>0!==Object.keys(e).length)));const Ct=null==fe||null===(I=fe.applicationDetails)||void 0===I?void 0:I.filter(e=>0!==Object.keys(e).length);return(null==Ct?void 0:Ct.length)>0&&(fe.applicationDetails=Ct),l.createElement(t.Fragment,null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(o.Header,{styles:{fontSize:"32px",marginLeft:"10px"}},U("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,rt&&rt.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>ne(!le),displayOptions:le,options:rt}),l.createElement(o.LinkButton,{label:U("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"}),de(!0)}}))),null==fe||null===(L=fe.applicationDetails)||void 0===L?void 0:L.filter(e=>Object.keys(e).length>0).map((e,n,a)=>{var r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,H,W,$,G,z,X,J,ee,te,le,ne,oe,ae,re,ue,de,se,ce,ve,me,Ee,_e,ge,Ae,Se,ye,De,Ce,Te,Pe,Ne,Ie,Le,Be,Oe,Re,xe,Me,Fe,ke,Ue,He,We,Ge,Ke;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"}},U(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:U(null==e?void 0:e.title),text:null!=e&&e.value?`${$e(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${U(null==e?void 0:e.isUnit)}`:U("CS_NA")}:null!=e&&e.isLink?{className:"border-none",label:U(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:U(null==e?void 0:e.title),text:$e(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||U("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===(v=e.additionalDetails)||void 0===v||null===(p=v.values)||void 0===p?void 0:p.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:U(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?$e(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated):U("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isUnit?null:l.createElement(o.Row,{className:"border-none",label:U(null==t?void 0:t.title),text:null!=t&&t.value?`${$e(null==t?void 0:t.value,null==t?void 0:t.isNotTranslated)} ${U(null==t?void 0:t.isUnit)}`:U("CS_NA")}),null!=e&&e.isTitleRepeat||null==t||!t.isHeader?null:l.createElement(o.CardSubHeader,{style:{fontSize:"20px"}},U(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==fe?void 0:fe.applicationData}):null,null!=e&&e.isScrutinyDetails&&(null==e||null===(E=e.additionalDetails)||void 0===E||null===(_=E.scruntinyDetails)||void 0===_?void 0:_.length)>0?null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.scruntinyDetails.map(e=>l.createElement(t.Fragment,null,l.createElement(o.Row,{className:"border-none",label:U(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"}},U(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:`${U("Owner")} - ${n+1}`}):null,null==t?void 0:t.values.map(e=>l.createElement(o.Row,{className:"border-none",label:U(null==e?void 0:e.title),text:$e(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)||U("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(Gl,{documents:Ft(null==e||null===(D=e.additionalDetails)||void 0===D||null===(C=D.obpsDocuments)||void 0===C||null===(T=C[0])||void 0===T?void 0:T.values),svgStyles:{},isSendBackFlow:!1,isHrLine:!0,titleStyles:{fontSize:"20px",lineHeight:"24px",fontWeight:700,marginBottom:"10px"}})),null!=e&&e.isFieldInspection&&(null==fe||null===(P=fe.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(vn,{isCitizen:!0,fiReport:null==fe||null===(L=fe.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===(R=O.noc)||void 0===R?void 0:R.length)>0?null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc.map((t,n)=>{var i,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,H,W,j,$,G,z,Y,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:U(`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:U(""+(null==e||null===(r=e.values)||void 0===r||null===(u=r[0])||void 0===u?void 0:u.title)),textStyle:{marginLeft:"10px"},text:$e(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===(v=c[0])||void 0===v?void 0:v.isNotTranslated)}),l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(p=e.values)||void 0===p||null===(m=p[1])||void 0===m?void 0:m.title)),textStyle:"APPROVED"==(null==e||null===(E=e.values)||void 0===E||null===(_=E[1])||void 0===_?void 0:_.value)||"AUTO_APPROVED"==(null==e||null===(f=e.values)||void 0===f||null===(g=f[1])||void 0===g?void 0:g.value)?{marginLeft:"10px",color:"#00703C"}:{marginLeft:"10px",color:"#D4351C"},text:$e(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!==(D=y[2])&&void 0!==D&&D.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(C=e.values)||void 0===C||null===(T=C[2])||void 0===T?void 0:T.title)),textStyle:{marginLeft:"10px"},text:$e(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!==(O=B[3])&&void 0!==O&&O.value?l.createElement(o.Row,{className:"border-none",label:U(""+(null==e||null===(R=e.values)||void 0===R||null===(w=R[3])||void 0===w?void 0:w.title)),textStyle:{marginLeft:"10px"},text:$e(null==e||null===(x=e.values)||void 0===x||null===(M=x[3])||void 0===M?void 0:M.value,null==e||null===(F=e.values)||void 0===F||null===(k=F[3])||void 0===k?void 0:k.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:U(""+(null==e||null===(j=e.values)||void 0===j||null===($=j[4])||void 0===$?void 0:$.title)),textStyle:{marginLeft:"10px"},text:$e(null==e||null===(G=e.values)||void 0===G||null===(z=G[4])||void 0===z?void 0:z.value,null==e||null===(Y=e.values)||void 0===Y||null===(K=Y[4])||void 0===K?void 0:K.isNotTranslated)}):null,l.createElement(o.Row,{className:"border-none",label:U(""+(null==t?void 0:t.title))})),l.createElement(o.StatusTable,null,null!=t&&t.values?l.createElement(Gl,{documents:Ft(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,U("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))}):null,(null==e||!e.isTitleVisible)&&(null==e||null===(x=e.additionalDetails)||void 0===x||null===(M=x.permit)||void 0===M?void 0:M.length)>0?null==e||null===(F=e.additionalDetails)||void 0===F||null===(H=F.permit)||void 0===H?void 0:H.map(e=>l.createElement(o.CardText,null,null==e?void 0:e.title)):null,(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&l.createElement(pn,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:[]}),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.inspectionReport)&&(null==e?void 0:e.isFeeDetails)&&("POST_PAYMENT_CITIZEN_APPROVAL_PENDING"==(null===(G=he)||void 0===G||null===(z=G.data)||void 0===z||null===(X=z.actionState)||void 0===X||null===(J=X.nextActions)||void 0===J||null===(ee=J[0])||void 0===ee?void 0:ee.state)||"POST_PAYMENT_CITIZEN_APPROVAL_PENDING"==(null===(te=he)||void 0===te||null===(le=te.data)||void 0===le||null===(ne=le.actionState)||void 0===ne?void 0:ne.state)||"POST_PAYMENT_INPROGRESS"==(null===(oe=he)||void 0===oe||null===(ae=oe.data)||void 0===ae||null===(re=ae.actionState)||void 0===re?void 0:re.state))&&l.createElement("div",{style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},l.createElement(o.Row,{className:"border-none",label:U("BLOCKING_REASON"),labelStyle:{fontSize:"15px"},text:(null==fe?void 0:fe.applicationData.additionalDetails.blockingReason)||"NA"}," "))))),n===a.length-1&&l.createElement(o.Card,null,l.createElement(t.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(nn,{application:null==fe?void 0:fe.applicationData,id:k}),!(null!==(ue=he)&&void 0!==ue&&ue.isLoading)&&(null===(de=he)||void 0===de||null===(se=de.data)||void 0===se||null===(ce=se.nextActions)||void 0===ce?void 0:ce.length)>0&&!pe&&ie&&l.createElement(o.CheckBox,{styles:{margin:"20px 0 40px",paddingTop:"10px"},checked:Y,label:l.createElement("div",null,l.createElement("span",null,U("BPA_I_AGREE_THE_LABEL")+" "),l.createElement("span",{style:{color:"#a82227",cursor:"pointer"},onClick:()=>Q(!Z)},U("BPA_TERMS_AND_CONDITIONS_LABEL"))),onChange:()=>{K(!Y),Y&&q(!Y)}})),!(null!==(ve=he)&&void 0!==ve&&ve.isLoading)&&(null===(me=he)||void 0===me||null===(Ee=me.data)||void 0===Ee||null===(_e=Ee.nextActions)||void 0===_e?void 0:_e.length)>1&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},V&&null!==(ge=he)&&void 0!==ge&&null!==(Ae=ge.data)&&void 0!==Ae&&Ae.nextActions?l.createElement(o.Menu,{localeKeyPrefix:"WF_BPA",options:null===(Se=he)||void 0===Se||null===(ye=Se.data)||void 0===ye?void 0:ye.nextActions.map(e=>e.action),t:U,onSelect:ze}):null,l.createElement(o.SubmitBar,{disabled:Ye()||"CITIZEN_APPROVAL_PENDING"===(null===(De=he)||void 0===De||null===(Ce=De.data)||void 0===Ce||null===(Te=Ce.actionState)||void 0===Te?void 0:Te.state)&&(!be||!we||!je),label:U("ES_COMMON_TAKE_ACTION"),onSubmit:()=>q(!V)}))),!(null!==(Pe=he)&&void 0!==Pe&&Pe.isLoading)&&1==(null===(Ne=he)||void 0===Ne||null===(Ie=Ne.data)||void 0===Ie||null===(Le=Ie.nextActions)||void 0===Le?void 0:Le.length)&&l.createElement(o.ActionBar,null,l.createElement("div",{style:{width:"100%"}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:j?"19px":"initial"},className:Ye()?"submit-bar-disabled":"submit-bar",disabled:Ye(),name:null===(Be=he)||void 0===Be||null===(Oe=Be.data)||void 0===Oe||null===(Re=Oe.nextActions)||void 0===Re||null===(xe=Re[0])||void 0===xe?void 0:xe.action,value:null===(Me=he)||void 0===Me||null===(Fe=Me.data)||void 0===Fe||null===(ke=Fe.nextActions)||void 0===ke||null===(Ue=ke[0])||void 0===Ue?void 0:Ue.action,onClick:e=>{ze(e.target.value)}},U("WF_BPA_"+(null===(He=he)||void 0===He||null===(We=He.data)||void 0===We||null===(Ge=We.nextActions)||void 0===Ge||null===(Ke=Ge[0])||void 0===Ke?void 0:Ke.action))))))))}),"CITIZEN_APPROVAL_PENDING"===(null===(B=he)||void 0===B||null===(O=B.data)||void 0===O||null===(R=O.actionState)||void 0===R?void 0:R.state)&&l.createElement("div",null,l.createElement(o.Card,null,l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(o.CardLabel,null,U("ARCHITECT_SHOULD_VERIFY_HIMSELF_BY_CLICKING_BELOW_BUTTON")),l.createElement(o.LinkButton,{label:U("BPA_VERIFY"),onClick:()=>{Pe(!0)}}),l.createElement("br",null),Te&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,U("BPA_MOBILE_NUMBER")),l.createElement(o.TextInput,{t:U,type:"tel",isMandatory:!0,optionKey:"i18nKey",name:"mobileNumber",value:Ne,onChange:e=>{Ie(e.target.value)},required:!0,pattern:"[0-9]{10}",type:"tel",title:U("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(o.LinkButton,{label:U("BPA_GET_OTP"),onClick:function(){try{const e=c(function(){var e,t;return Promise.resolve(Digit.UserService.sendOtp({otp:{mobileNumber:Ne,tenantId:null==se||null===(e=se.info)||void 0===e?void 0:e.tenantId,userType:null==se||null===(t=se.info)||void 0===t?void 0:t.type,type:"login"}})).then(function(e){e.isSuccessful?Be(!0):console.error("Error sending OTP Response is false:",e.error)})},function(e){console.error("Error sending OTP:",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},disabled:!We})),Le&&l.createElement(l.Fragment,null,l.createElement("br",null),l.createElement(o.CardLabel,null,U("BPA_OTP")),l.createElement(o.TextInput,{t:U,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"otp",value:Oe,onChange:e=>{Re(e.target.value)},required:!0,pattern:"[0-9]{6}",type:"tel",title:U("BPA_INVALID_OTP")}),l.createElement(o.SubmitBar,{label:U("VERIFY_OTP"),onSubmit:function(){try{const e=c(function(){return Promise.resolve(Digit.UserService.authenticate(He)).then(function(e){if("Access Token generated successfully"===e.ResponseInfo.status){xe(!0),Fe(U("VERIFIED"));const e=new Date;Ue(e),sessionStorage.setItem("otpVerifiedTimestampcitizen",e.toString().replace(/GMT.*\((.*)\)/,"").trim())}else xe(!1),Fe(U("WRONG OTP"))})},function(e){console.error("Error verifying OTP:",e),xe(!1),Fe(U("Error verifying OTP"))});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}}),Me&&l.createElement(o.CardLabel,{style:{color:"red"}},Me))),l.createElement("br",null),l.createElement("div",null,l.createElement(o.CheckBox,{label:l.createElement("div",null,U("I_AGREE_TO_BELOW_UNDERTAKING"),l.createElement(o.LinkButton,{label:U("DECLARATION_UNDER_SELF_CERTIFICATION_SCHEME"),onClick:()=>{we?Ce(!0):alert("Please verify yourself")}})),onChange:()=>{ye(!be)},styles:{height:"auto"}}),De&&l.createElement(mn,{showTermsPopup:De,setShowTermsPopup:Ce,otpVerifiedTimestamp:ke}))))),Z?l.createElement(dn,{t:U,action:"TERMS_AND_CONDITIONS",tenantId:H,id:k,closeModal:()=>{Q(!1)},submitAction:Ke,applicationData:(null==fe?void 0:fe.applicationData)||{}}):null,X?l.createElement(dn,{t:U,action:ee,tenantId:H,id:k,closeModal:()=>{te(null),J(!1)},submitAction:Ke,actionData:null===(w=he)||void 0===w||null===(x=w.data)||void 0===x?void 0:x.timeline}):null,G&&l.createElement(o.Toast,{error:"error"===G.key,label:U("success"===G.key?`ES_OBPS_${G.action}_UPDATE_SUCCESS`:G.action),onClose:Ge,style:{zIndex:"1000"}}))},ObpsBPASendToArchitect:e=>{var a,r,d,s,c,v,p;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const m=u.useQueryClient(),E=i.useRouteMatch(),{t:_}=n.useTranslation(),{applicationNo:f,tenantId:g}=i.useParams(),{pathname:A}=i.useLocation(),S=i.useHistory();let h=[],b={};const[y,D,C]=Digit.Hooks.useSessionStorage("BUILDING_PERMIT_EDITFLOW",{}),T=Digit.ULBService.getStateId();let{data:P}=Digit.Hooks.obps.SearchMdmsTypes.getFormConfig(T,[]);const{data:N}=Digit.Hooks.obps.useMDMS(Digit.ULBService.getStateId(),"BPA",["RiskTypeComputation"]),{data:I,isLoading:L}=Digit.Hooks.obps.useBPASearch(g,{applicationNo:f});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 w=f;const{data:x,isLoading:M}=Digit.Hooks.obps.useNocDetails(g,{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||M||L||R)){b=I?I[0]:{};const e=function(){if(O&&x)return b=I[0],F&&(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,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I,L,B,O,R,w,x,M,F,k,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===(v=e.landInfo)||void 0===v||null===(p=v.address)||void 0===p?void 0:p.locality,i18nkey:null==e||null===(m=e.landInfo)||void 0===m||null===(E=m.address)||void 0===E||null===(_=E.locality)||void 0===_?void 0:_.name},e.data={applicantName:null==t||null===(f=t.planDetail)||void 0===f||null===(g=f.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===(D=e.additionalDetails)||void 0===D?void 0:D.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(C=l.BPA)||void 0===C?void 0:C.RiskTypeComputation,null==t||null===(T=t.planDetail)||void 0===T||null===(P=T.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===(w=t.planDetail)||void 0===w||null===(x=w.plot)||void 0===x?void 0:x.area,null==t||null===(M=t.planDetail)||void 0===M?void 0:M.blocks),e.subOccupancy=j(null==e||null===(F=e.landInfo)||void 0===F?void 0:F.unit),e.uiFlow={flow:null==e||null===(k=e.businessService)||void 0===k||null===(U=k.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,x,_)).then(function(e){D({...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,x,y]);const k=(e,t,l,n)=>{D(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(En(E.path,E.params)+"/check");i(`${En(E.path,E.params)}/${n}`)})()},U=()=>{};P=null!==(r=P)&&void 0!==r&&r.BuildingPermitConfig?null===(d=P)||void 0===d?void 0:d.BuildingPermitConfig:Jl,P.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(C(),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===(v=Digit)||void 0===v||null===(p=v.ComponentRegistryService)||void 0===p?void 0:p.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:`${En(E.path,E.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:k,onSkip:U,t:_,formData:y}))}),l.createElement(i.Route,{path:En(E.path,E.params)+"/check"},l.createElement(H,{onSubmit:function(){try{return S.push(En(E.path,E.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:y})),l.createElement(i.Route,{path:En(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:`${En(E.path,E.params)}/${h.indexRoute}`})))},ObpsOCSendToArchitect:e=>{var a,r,d,s,c,v,p,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const E=u.useQueryClient(),_=i.useRouteMatch(),{t:f}=n.useTranslation(),{applicationNo:g,tenantId:A}=i.useParams(),{pathname:S}=i.useLocation(),h=i.useHistory();let b=[],y={};const[D,C,T]=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:w}=Digit.Hooks.obps.useScrutinyDetails(Digit.ULBService.getStateId(),O,{enabled:!(null==L||null===(r=L[0])||void 0===r||!r.edcrNumber)});let x=null==R?void 0:R.permitNumber;const{data:M}=Digit.Hooks.obps.useOCEdcrSearch(A,{approvalNo:x},{enabled:!(!x||null==R||!R.permitNumber)},O);let F=g;const{data:k,isLoading:U}=Digit.Hooks.obps.useNocDetails(A,{sourceRefId:F}),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||w)){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,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,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===(v=e.auditDetails)||void 0===v?void 0:v.createdTime,applicationType:null==t?void 0:t.appliactionType,holdingNumber:null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.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===(_=e.additionalDetails)||void 0===_?void 0:_.registrationDetails,riskType:Digit.Utils.obps.calculateRiskType(null==l||null===(f=l.BPA)||void 0===f?void 0:f.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===(D=y.plot)||void 0===D?void 0:D.area,null==t||null===(C=t.planDetail)||void 0===C?void 0:C.blocks),e.subOccupancy=I(null==e||null===(T=e.landInfo)||void 0===T?void 0:T.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,k,f,M)).then(function(e){C({...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)}},[L,R,I,k,M]);const W=(e,t,l,n)=>{C(n?t:{...D,[e]:{...D[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(_n(_.path,_.params)+"/check");i(`${_n(_.path,_.params)}/${n}`)})()},j=()=>{};N=null!==(d=N)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=N)||void 0===s?void 0:s.OCBuildingPermitConfig:en,N.forEach(e=>{b=b.concat(e.body.filter(e=>!e.hideInCitizen))}),b.indexRoute="check",t.useEffect(()=>{sessionStorage.getItem("isPermitApplication")&&"true"==sessionStorage.getItem("isPermitApplication")&&(T(),sessionStorage.setItem("isPermitApplication",!1))},[]);const $=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPACheckPage"),G=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCBPAAcknowledgement");return U||B||w?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:`${_n(_.path,_.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:_n(_.path,_.params)+"/check"},l.createElement($,{onSubmit:function(){try{return h.push(_n(_.path,_.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:D})),l.createElement(i.Route,{path:_n(_.path,_.params)+"/acknowledgement"},l.createElement(G,{data:D,onSuccess:()=>{E.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,R&&M&&l.createElement(i.Redirect,{to:`${_n(_.path,_.params)}/${b.indexRoute}`})))},ObpsBPASendBackToCitizen:e=>{var a,r,d,s,c,v,p,m;const{t:E}=n.useTranslation(),_=u.useQueryClient(),f=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=[],D={};const[C,T,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},w=h;const{data:x,isLoading:M}=Digit.Hooks.obps.useScrutinyDetails(S,R,{enabled:!(null==B||null===(r=B[0])||void 0===r||!r.edcrNumber)}),{data:F,isLoading:k}=Digit.Hooks.obps.useNocDetails(b,{sourceRefId:w}),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||k||O||M)){D=B?B[0]:{};const e=function(){if(B&&D&&x&&L&&F)return D=B[0],U&&(D.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...D})),Promise.resolve(It(D,x,L,F,E)).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)}},[B,x,L,F]);const H=(e,t,l,n)=>{T(n?t:{...C,[e]:{...C[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(Lt(f.path,f.params)+"/check");n(`${Lt(f.path,f.params)}/${l}`)})()},W=()=>{};I=null!==(d=I)&&void 0!==d&&d.BuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.BuildingPermitConfig: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 j=null===(c=Digit)||void 0===c||null===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),$=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCSendBackAcknowledgement");return k||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:`${Lt(f.path,f.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:H,onSkip:W,t:E,formData:C}))}),l.createElement(i.Route,{path:Lt(f.path,f.params)+"/check"},l.createElement(j,{onSubmit:function(){try{return A.push(Lt(f.path,f.params)+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:C})),l.createElement(i.Route,{path:Lt(f.path,f.params)+"/acknowledgement"},l.createElement($,{data:C,onSuccess:()=>{_.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Lt(f.path,f.params)}/${y.indexRoute}`})))},ObpsOCSendBackToCitizen:e=>{var a,r,d,s,c,v,p,m;sessionStorage.setItem("BPA_SUBMIT_APP",JSON.stringify("BPA_SUBMIT_APP"));const{t:E}=n.useTranslation(),_=u.useQueryClient(),f=i.useRouteMatch(),{pathname:g}=i.useLocation(),A=i.useHistory(),S=Digit.ULBService.getStateId(),{applicationNo:h,tenantId:b}=i.useParams();let y=[],D={};const[C,T,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 w={edcrNumber:null==O||null===(a=O[0])||void 0===a?void 0:a.edcrNumber},x=h;const{data:M,isLoading:F}=Digit.Hooks.obps.useScrutinyDetails(S,w,{enabled:!(null==O||null===(r=O[0])||void 0===r||!r.edcrNumber)}),{data:k,isLoading:U}=Digit.Hooks.obps.useNocDetails(b,{sourceRefId:x}),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||F||L)){D=O?O[0]:{};const e=function(){if(O&&D&&M&&B&&k)return D=O[0],H&&(D.isEditApplication=!0),sessionStorage.setItem("bpaInitialObject",JSON.stringify({...D})),Promise.resolve(It(D,M,B,k,E)).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)}},[O,M,B,k]);const W=(e,t,l,n)=>{T(n?t:{...C,[e]:{...C[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(Lt(f.path,f.params)+"/check");n(`${Lt(f.path,f.params)}/${l}`)})()},j=()=>{};I=null!==(d=I)&&void 0!==d&&d.OCBuildingPermitConfig?null===(s=I)||void 0===s?void 0:s.OCBuildingPermitConfig:en,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===(v=c.ComponentRegistryService)||void 0===v?void 0:v.getComponent("OCBPASendBackCheckPage"),G=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("OCSendBackAcknowledgement");return U||R||F?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:`${Lt(f.path,f.params)}/${e.route}`,key:t},l.createElement(u,{config:{texts:o,inputs:a,key:r},onSelect:W,onSkip:j,t:E,formData:C}))}),l.createElement(i.Route,{path:Lt(f.path,f.params)+"/check"},l.createElement($,{onSubmit:function(){return Promise.resolve()},value:C})),l.createElement(i.Route,{path:Lt(f.path,f.params)+"/acknowledgement"},l.createElement(G,{data:C,onSuccess:()=>{_.invalidateQueries("PT_CREATE_PROPERTY")}})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`${Lt(f.path,f.params)}/${y.indexRoute}`})))},ObpsEdcrInbox:e=>{let{parentRoute:i}=e;window.scroll(0,0);const{t:r}=n.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),d={},c={appliactionType:"",status:""},v={sortBy:"createdDate",limit:Digit.Utils.browser.isMobile()?50:10,offset:0,sortOrder:"DESC"},p=Digit.SessionStorage.get("EDCR.INBOX"),m=t.useMemo(()=>"IS_EDCR_BACK"===Digit.SessionStorage.get("EDCR_BACK")?{filterForm:c,searchForm:d,tableForm:v}:p||{filterForm:c,searchForm:d,tableForm:v},[Object.values((null==p?void 0:p.filterForm)||{}),Object.values((null==p?void 0:p.searchForm)||{}),Object.values((null==p?void 0:p.tableForm)||{})]),[E,_]=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:f,data:{table:g,totalCount:A}={}}=Digit.Hooks.obps.useEDCRInbox({tenantId:u,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(gn,{registerRef:t,searchFormState:n,searchFieldComponents:i})},[]),b=t.useCallback(e=>{let{registerRef:t,controlFilterForm:n,setFilterFormValue:i,getFilterFormValue:o}=e;return l.createElement(fn,{isInboxLoading:f,registerRef:t,controlFilterForm:n,setFilterFormValue:i,filterFormState:null==E?void 0:E.filterForm,getFilterFormValue:o})},[f]),y={SearchFormFields:h,onSearchFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateSearchForm",data:e})},searchFormDefaultValues:null==E?void 0:E.searchForm,resetSearchFormDefaultValues:d,onSearchFormReset:e=>{e("edcrNumber",null),e("applicationNumber",null),_({action:"mutateSearchForm",data:d})}},D={FilterFormFields:b,onFilterFormSubmit:e=>{e.hasOwnProperty("")&&(null==e||delete e[""]),_({action:"mutateTableForm",data:{...v}}),_({action:"mutateFilterForm",data:e})},filterFormDefaultValues:null==E?void 0:E.filterForm,resetFilterFormDefaultValues:c,onFilterFormReset:e=>{e("status",""),e("appliactionType",""),_({action:"mutateFilterForm",data:c})}},C=(e=>{var i,o,a,r;let{onPageSizeChange:u,formState:d,totalCount:s,table:c,dispatch:v,onSortingByData:p}=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))(Ml(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(An,{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 v({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 v({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:p,totalRecords:s,onSearch:null==d||null===(r=d.searchForm)||void 0===r?void 0:r.message,onLastPage:()=>{var e;return v({action:"mutateTableForm",data:{...d.tableForm,offset:10*Math.ceil(s/10)-parseInt(null===(e=d.tableForm)||void 0===e?void 0:e.limit)}})},onFirstPage:()=>v({action:"mutateTableForm",data:{...d.tableForm,offset:0}}),data:c,columns:E}})({parentRoute:i,onPageSizeChange:e=>{_({action:"mutateTableForm",data:{...E.tableForm,limit:e.target.value}})},formState:E,totalCount:A,table:g,dispatch:_,onSortingByData:e=>{if(e.length>0){const[{id:t,desc:l}]=e,n=l?"DESC":"ASC";E.tableForm.sortBy===t&&E.tableForm.sortOrder===n||_({action:"mutateTableForm",data:{...E.tableForm,sortBy:t,sortOrder:l?"DESC":"ASC"}})}}}),T=(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;_({action:"mutateTableForm",data:{...E.tableForm,sortOrder:t}})},sortFormDefaultValues:null==E?void 0:E.tableForm,onSortFormReset:e=>{e("sortOrder","DESC"),_({action:"mutateTableForm",data:v})}};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,s({isInboxLoading:f,PropsForInboxLinks:S},y,D,P,{propsForInboxTable:C,propsForInboxMobileCards:T,formState:E})))},ObpsEmpApplicationDetail:()=>{var e,a,r,u,d,s,c;const{id:v}=i.useParams(),{t:p}=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:v,tenantId:E},{}),b=window.Digit.Utils.browser.isMobile(),[y,D]=t.useState(!1),{mutate:C}=Digit.Hooks.obps.useBPAREGApplicationActions(m),T=Digit.Hooks.useWorkflowDetails({tenantId:null==m?void 0:m.split(".")[0],id:v,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:p("TL_RECEIPT"),onClick:()=>{var e,t;return xt(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,p("CS_TITLE_APPLICATION_DETAILS")),l.createElement("div",null,l.createElement("div",{style:{zIndex:"10",position:"relative"}},(null==h||null===(a=h.payments)||void 0===a?void 0:a.length)>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>A(!g),displayOptions:g,options:P,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),(null==T||null===(r=T.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(o.LinkButton,{label:p("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{D(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement(wi,{applicationDetails:h,isLoading:S,id:"timeline",isDataLoading:S,applicationData:null==h?void 0:h.applicationData,mutate:C,workflowDetails:T,businessService:null!=T&&null!==(d=T.data)&&void 0!==d&&d.applicationBusinessService?null==T||null===(s=T.data)||void 0===s?void 0:s.applicationBusinessService:null==h||null===(c=h.applicationData)||void 0===c?void 0:c.businessService,moduleCode:"BPAREG",showToast:_,setShowToast:f,ActionBarStyle:b?{}:{paddingRight:"50px"},MenuStyle:b?{}:{right:"50px"},closeToast:()=>{f(null)},timelineStatusPrefix:"WF_NEWTL_"}))},ObpsEmployeeBpaApplicationDetail:()=>{var e,a,r,u,d,s,c,v,p,m,E,_,f,g,A,S,h,b,y,D,C,T,P,N,I;const L=function(e,t,l){let{tenantId:n}=e;void 0===l&&(l="download");try{var i,o;let e=new Date;ie.applicationData.additionalDetails.runDate=Pt(e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate());let h={...null==ie?void 0:ie.applicationData,edcrDetail:[{...null==ie?void 0:ie.edcrDetails}]};const b=Digit.ULBService.getStateId();let y=0;for(let e=0;e<(null==pe||null===(a=pe.data)||void 0===a||null===(r=a.processInstances)||void 0===r?void 0:r.length);e++){var a,r,u,d,s,c,v,p,m,E,_,f,g;"POST_PAYMENT_APPLY"!==(null==pe||null===(u=pe.data)||void 0===u||null===(d=u.processInstances[e])||void 0===d?void 0:d.action)&&"PAY"!==(null==pe||null===(s=pe.data)||void 0===s||null===(c=s.processInstances[e])||void 0===c?void 0:c.action)||"APPROVAL_INPROGRESS"!==(null==pe||null===(v=pe.data)||void 0===v||null===(p=v.processInstances)||void 0===p||null===(m=p[e])||void 0===m||null===(E=m.state)||void 0===E?void 0:E.applicationStatus)||0!=y||(h.additionalDetails.submissionDate=null==pe||null===(_=pe.data)||void 0===_||null===(f=_.processInstances[e])||void 0===f||null===(g=f.auditDetails)||void 0===g?void 0:g.createdTime,y=1)}var A;if("NO"==(null==h||null===(i=h.additionalDetails)||void 0===i?void 0:i.approvedColony))h.additionalDetails.permitData="The plot has been officially regularized under No."+(null==h||null===(A=h.additionalDetails)||void 0===A?void 0:A.NocNumber)+" dated dd/mm/yyyy, registered in the name of <name as per the NOC>. This regularization falls within the jurisdiction of "+b+".Any form of misrepresentation of the NoC is strictly prohibited. Such misrepresentation renders the building plan null and void, and it will be regarded as an act of impersonation. Criminal proceedings will be initiated against the owner and concerned architect / engineer/ building designer / supervisor involved in such actions";else if("YES"==(null==h||null===(o=h.additionalDetails)||void 0===o?void 0:o.approvedColony)){var S;h.additionalDetails.permitData="The building plan falls under approved colony "+(null==h||null===(S=h.additionalDetails)||void 0===S?void 0:S.nameofApprovedcolony)}else h.additionalDetails.permitData="The building plan falls under Lal Lakir";return Promise.resolve(Digit.PaymentService.generatePdf(n,{Bpa:[h]},t)).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(n,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n,i;return window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank"),h.applicationType=null==ie||null===(n=ie.applicationData)||void 0===n||null===(i=n.additionalDetails)||void 0===i?void 0:i.applicationType,Promise.resolve(Digit.OBPSService.edcr_report_download({BPA:{...h}})).then(function(e){const t=parseInt(e.status,10);201!==t&&200!==t||("print"==l?wt(new Blob([e.data],{type:"application/pdf"})):Rt(new Blob([e.data],{type:"application/pdf"}),"edcrReport.pdf"))})})})}catch(e){return Promise.reject(e)}},B=function(e){let{payments:t,...l}=e;try{function n(){return Promise.resolve(Digit.PaymentService.printReciept(X,{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 l=function(){if(null==t||!t.fileStoreId)return Promise.resolve(Digit.PaymentService.generatePdf(X,{Payments:[{...t}]},"bpa-receipt")).then(function(t){e=t});e={filestoreIds:[null==t?void 0:t.fileStoreId]}}();return Promise.resolve(l&&l.then?l.then(n):n())}catch(e){return Promise.reject(e)}},{id:O}=i.useParams(),{t:R}=n.useTranslation(),w=Digit.ULBService.getCurrentTenantId(),[x,M]=t.useState(null),[F,k]=t.useState(!1),[U,H,W]=(i.useHistory(),Digit.Hooks.useSessionStorage("store-data",null)),[j,$,G]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[z,Y,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(w,{applicationNo:O});t.useEffect(()=>{if(!Z&&!oe){var e;let v=[];if(null!=Q&&null!==(e=Q.BPA)&&void 0!==e&&e.DocTypeMapping){var t,l,n,i,o,a,r,u,d,s,c;v=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,p=[];v&&(null===(u=v)||void 0===u||null===(d=u[0])||void 0===d?void 0:d.docTypes)&&(null===(s=v)||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=>{p.push(e)})}));const m=ie.applicationDetails&&ie.applicationDetails.map(e=>"BPA_DOCUMENT_DETAILS_LABEL"===e.title?{...e,additionalDetails:{obpsDocuments:[{title:"",values:p}]}}:e);ie.applicationDetails=m&&m.length>0?[...m]:null==ie?void 0:ie.applicationDetails}}},[Q,ie]);const[ae,re]=t.useState(!1),{mutate:ue}=Digit.Hooks.obps.useApplicationActions(w),de=Digit.Hooks.obps.useObpsAPI(w,!0);let ce="";sessionStorage.setItem("bpaApplicationDetails",!0),t.useEffect(()=>{$(!1),K()},[]);let ve=null!=le&&le.InspectionReportConfig?null==le?void 0:le.InspectionReportConfig:xi,pe=Digit.Hooks.useWorkflowDetails({tenantId:w,id:O,moduleCode:"BPA"});var me,Ee,_e,ge,Ae,Se,he,be,ye;pe&&pe.data&&!pe.isLoading&&(pe.data.initialActionState=(null==pe||null===(me=pe.data)||void 0===me?void 0:me.initialActionState)||{...null==pe||null===(Ee=pe.data)||void 0===Ee?void 0:Ee.actionState}||{},pe.data.actionState={...pe.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 De=Digit.UserService.getUser(),Ce=null==De||null===(a=De.info)||void 0===a?void 0:a.roles.filter(e=>{if("CEMP"==e.code&&e.tenantId===w||"CITIZEN"==e.code)return!0});if((null==pe||null===(r=pe.data)||void 0===r||null===(u=r.processInstances)||void 0===u?void 0:u.length)>0){var Te,Pe,Le;let e=[];e=null===(Te=Zi(null==pe||null===(Pe=pe.data)||void 0===Pe?void 0:Pe.processInstances[0],"nextActions",[]))||void 0===Te?void 0:Te.filter(e=>"ADHOC"!=e.action);let t=(Oe=["action"],Re=["desc"],null==(Be=e)?[]:(se(Oe)||(Oe=null==Oe?[]:[Oe]),se(Re=Re)||(Re=null==Re?[]:[Re]),function(e,t,l){t=t.length?Yi(t,function(e){return se(e)?function(t){return Ji(t,1===e.length?e[0]:e)}:e}):[Eo];var n=-1;return t=Yi(t,fe(_o)),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=fo(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=Ne(e)?Array(e.length):[];return function(e,t){if(null==e)return e;if(!Ne(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,Ie)}(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:Yi(t,function(t){return t(e)}),index:++n,value:e}}))}(Be,Oe,Re)));t&&0!=(null==t?void 0:t.length)||null==pe||null===(Le=pe.data)||void 0===Le||!Le.actionState||(pe.data.actionState.nextActions=[])}var Be,Oe,Re,we,xe,Me,Fe,ke,Ue;(null==pe||null===(d=pe.data)||void 0===d||null===(s=d.nextActions)||void 0===s?void 0:s.length)>0&&(pe.data.nextActions=null==pe||null===(we=pe.data)||void 0===we||null===(xe=we.nextActions)||void 0===xe?void 0:xe.filter(e=>"INITIATE"!==e.action),pe.data.nextActions=null==pe||null===(Me=pe.data)||void 0===Me||null===(Fe=Me.nextActions)||void 0===Fe?void 0:Fe.filter(e=>"ADHOC"!==e.action)),Ce&&(null==pe||null===(ke=pe.data)||void 0===ke||null===(Ue=ke.nextActions)||void 0===Ue||Ue.forEach(e=>{var t,l,n;"PAY"===(null==e?void 0:e.action)&&(e.redirectionUrll={pathname:`${Ot(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}/${w}?tenantId=${w}`,state:w})}));let He=[];var We,je,$e,Ge,ze,Ye;if((null==ie||null===(c=ie.collectionBillDetails)||void 0===c?void 0:c.length)>0&&mt(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===(v=ie.applicationData)||void 0===v?void 0:v.businessService)&&(null==ie||null===(p=ie.collectionBillDetails)||void 0===p?void 0:p.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===(_=ie.applicationData)||void 0===_?void 0:_.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==pe||null===(f=pe.data)||void 0===f||null===(g=f.nextActions)||void 0===g?void 0:g.length)>0&&(pe.data.nextActions=null==pe||null===($e=pe.data)||void 0===$e||null===(Ge=$e.nextActions)||void 0===Ge?void 0:Ge.filter(e=>"SKIP_PAYMENT"!==e.action)),(null==pe||null===(A=pe.data)||void 0===A||null===(S=A.nextActions)||void 0===S?void 0:S.length)>0&&(pe.data.nextActions=null==pe||null===(ze=pe.data)||void 0===ze||null===(Ye=ze.nextActions)||void 0===Ye?void 0:Ye.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("div",null,l.createElement("div",{style:{zIndex:"10",position:"relative"}},He&&He.length>0&&l.createElement(o.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>re(!ae),displayOptions:ae,options:He,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(o.LinkButton,{label:R("VIEW_TIMELINE"),style:{color:"#A52A2A"},onClick:()=>{te(!0);const e=document.getElementById("timeline");e&&e.scrollIntoView({behavior:"smooth"})}}))),l.createElement(wi,{applicationDetails:ie,isLoading:oe,isDataLoading:oe,applicationData:null==ie?void 0:ie.applicationData,nocMutation:de,mutate:ue,id:"timeline",workflowDetails:pe,businessService:null!=pe&&null!==(b=pe.data)&&void 0!==b&&b.applicationBusinessService?null==pe||null===(y=pe.data)||void 0===y?void 0:y.applicationBusinessService:null==ie||null===(D=ie.applicationData)||void 0===D?void 0:D.businessService,moduleCode:"BPA",showToast:x,ActionBarStyle:J?{}:{paddingRight:"50px"},MenuStyle:J?{}:{right:"50px"},setShowToast:M,closeToast:()=>{M(null),q(null)},statusAttribute:"state",timelineStatusPrefix:`WF_${null!=pe&&null!==(C=pe.data)&&void 0!==C&&C.applicationBusinessService?null==pe||null===(T=pe.data)||void 0===T?void 0:T.applicationBusinessService:null==ie||null===(P=ie.applicationData)||void 0===P?void 0:P.businessService}_`}),"FIELDINSPECTION_INPROGRESS"===(null==ie||null===(N=ie.applicationData)||void 0===N?void 0:N.status)&&(null==De||null===(I=De.info)||void 0===I?void 0:I.roles.filter(e=>"BPA_FIELD_INSPECTOR"===e.code)).length>0&&l.createElement(o.FormComposer,{heading:R(""),isDisabled:!F,config:ve.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)=>{k(!Object.keys(l.errors).length)},breaklineStyle:{border:"0px"},className:"employeeCard-override",cardClassName:"employeeCard-override"})))},Architectconcent:go,CitizenConsent:mn};exports.initOBPSComponents=()=>{Object.entries(va).forEach(e=>{let[t,l]=e;Digit.ComponentRegistryService.setComponent(t,l)})};
|