@upyog/upyog-ui-module-ptr 3.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/dist/index.js.map +1 -0
- package/dist/index.modern.js +18967 -0
- package/dist/index.modern.js.map +1 -0
- package/package.json +33 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,t=require("@upyog/digit-ui-react-components"),n=require("react"),l=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,i=require("react-i18next"),o=require("react-router-dom"),a=require("react-hook-form"),r=require("react-query");function u(){return(u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}function c(e,t){if(null==e)return{};var n={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;n[l]=e[l]}return n}let s=[];const d=e=>{let{currentStep:n=1,flow:o=""}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":s=[];break;default:s=["ES_TITILE_OWNER_DETAILS","ES_TITILE_PET_DETAILS","PTR_LOCATION_DETAILS","ES_TITILE_DOCUMENT_DETAILS","PTR_SUMMARY"]}})(o),l.createElement("div",{className:"timeline-container",style:r?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},s.map((e,i,o)=>l.createElement("div",{className:"timeline-checkpoint",key:i},l.createElement("div",{className:"timeline-content"},l.createElement("span",{className:"circle "+(i<=n-1&&"active")},i<n-1?l.createElement(t.TickMark,null):i+1),l.createElement("span",{className:"secondary-color"},a(e))),i<o.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))};var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e,t){return e(t={exports:{}},t.exports),t.exports}var m=v(function(e,t){(function(){var n="Expected a function",l="__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]",c="[object Error]",s="[object Function]",d="[object GeneratorFunction]",v="[object Map]",m="[object Number]",f="[object Object]",E="[object RegExp]",_="[object Set]",h="[object String]",g="[object Symbol]",S="[object WeakMap]",y="[object ArrayBuffer]",T="[object DataView]",b="[object Float32Array]",A="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",R="[object Uint16Array]",I="[object Uint32Array]",O=/\b__p \+= '';/g,x=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,w=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,F=RegExp(w.source),k=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,K=RegExp(V.source),Y=/^\s+/,q=/\s/,G=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/[()=,{}\[\]\/\s]/,J=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^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=/($^)/,ce=/['\n\r\u2028\u2029\\]/g,se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="["+de+"]",ve="["+se+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",Se="[\\ud800-\\udbff][\\udc00-\\udfff]",ye="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Te="(?:"+fe+"|"+Ee+")",be="(?:"+ye+"|"+Ee+")",Ae="(?:"+ve+"|"+_e+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[he,ge,Se].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",De="(?:"+["[\\u2700-\\u27bf]",ge,Se].join("|")+")"+Ce,Ne="(?:"+[he+ve+"?",ve,ge,Se,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),Re=RegExp(ve,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Ne+Ce,"g"),Oe=RegExp([ye+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,ye,"$"].join("|")+")",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,ye+Te,"$"].join("|")+")",ye+"?"+Te+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ye+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",me,De].join("|"),"g"),xe=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,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"],Me=-1,Fe={};Fe[b]=Fe[A]=Fe[C]=Fe[D]=Fe[N]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[R]=Fe[I]=!0,Fe[o]=Fe[a]=Fe[y]=Fe[r]=Fe[T]=Fe[u]=Fe[c]=Fe[s]=Fe[v]=Fe[m]=Fe[f]=Fe[E]=Fe[_]=Fe[h]=Fe[S]=!1;var ke={};ke[o]=ke[a]=ke[y]=ke[T]=ke[r]=ke[u]=ke[b]=ke[A]=ke[C]=ke[D]=ke[N]=ke[v]=ke[m]=ke[f]=ke[E]=ke[_]=ke[h]=ke[g]=ke[P]=ke["[object Uint8ClampedArray]"]=ke[R]=ke[I]=!0,ke[c]=ke[s]=ke[S]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof p&&p&&p.Object===Object&&p,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ve=t&&!t.nodeType&&t,Ke=Ve&&e&&!e.nodeType&&e,Ye=Ke&&Ke.exports===Ve,qe=Ye&&je.process,Ge=function(){try{return Ke&&Ke.require&&Ke.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ge&&Ge.isArrayBuffer,$e=Ge&&Ge.isDate,Ze=Ge&&Ge.isMap,Qe=Ge&&Ge.isRegExp,Je=Ge&&Ge.isSet,et=Ge&&Ge.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,l){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(l,a,n(a),e)}return l}function lt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(!t(e[n],n,e))return!1;return!0}function at(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function rt(e,t){return!(null==e||!e.length)&&_t(e,t,0)>-1}function ut(e,t,n){for(var l=-1,i=null==e?0:e.length;++l<i;)if(n(t,e[l]))return!0;return!1}function ct(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}function st(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e}function dt(e,t,n,l){var i=-1,o=null==e?0:e.length;for(l&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function pt(e,t,n,l){var i=null==e?0:e.length;for(l&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function vt(e,t){for(var n=-1,l=null==e?0:e.length;++n<l;)if(t(e[n],n,e))return!0;return!1}var mt=yt("length");function ft(e,t,n){var l;return n(e,function(e,n,i){if(t(e,n,i))return l=n,!1}),l}function Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function _t(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,gt,n)}function ht(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function gt(e){return e!=e}function St(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function yt(e){return function(t){return null==t?void 0:t[e]}}function Tt(e){return function(t){return null==e?void 0:e[t]}}function bt(e,t,n,l,i){return i(e,function(e,i,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var o=t(e[l]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Ct(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}function Dt(e){return e?e.slice(0,Vt(e)+1).replace(Y,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return ct(t,function(t){return e[t]})}function Rt(e,t){return e.has(t)}function It(e,t){for(var n=-1,l=e.length;++n<l&&_t(t,e[n],0)>-1;);return n}function Ot(e,t){for(var n=e.length;n--&&_t(t,e[n],0)>-1;);return n}function xt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=Tt({"À":"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=Tt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Mt(e){return"\\"+Be[e]}function Ft(e){return xe.test(e)}function kt(e){var t=-1,n=Array(e.size);return e.forEach(function(e,l){n[++t]=[l,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function Ut(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var r=e[n];r!==t&&r!==l||(e[n]=l,a[o++]=n)}return a}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Wt(e){return Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):mt(e)}function zt(e){return Ft(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var Kt=Tt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Yt=function e(t){var p,q=(t=null==t?ze:Yt.defaults(ze.Object(),t,Yt.pick(ze,we))).Array,se=t.Date,de=t.Error,pe=t.Function,ve=t.Math,me=t.Object,fe=t.RegExp,Ee=t.String,_e=t.TypeError,he=q.prototype,ge=me.prototype,Se=t["__core-js_shared__"],ye=pe.prototype.toString,Te=ge.hasOwnProperty,be=0,Ae=(p=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",Ce=ge.toString,De=ye.call(me),Ne=ze._,Ie=fe("^"+ye.call(Te).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xe=Ye?t.Buffer:void 0,Be=t.Symbol,je=t.Uint8Array,We=xe?xe.allocUnsafe:void 0,Ve=Bt(me.getPrototypeOf,me),Ke=me.create,qe=ge.propertyIsEnumerable,Ge=he.splice,mt=Be?Be.isConcatSpreadable:void 0,Tt=Be?Be.iterator:void 0,qt=Be?Be.toStringTag:void 0,Gt=function(){try{var e=Qi(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Xt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,$t=se&&se.now!==ze.Date.now&&se.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=ve.ceil,Jt=ve.floor,en=me.getOwnPropertySymbols,tn=xe?xe.isBuffer:void 0,nn=t.isFinite,ln=he.join,on=Bt(me.keys,me),an=ve.max,rn=ve.min,un=se.now,cn=t.parseInt,sn=ve.random,dn=he.reverse,pn=Qi(t,"DataView"),vn=Qi(t,"Map"),mn=Qi(t,"Promise"),fn=Qi(t,"Set"),En=Qi(t,"WeakMap"),_n=Qi(me,"create"),hn=En&&new En,gn={},Sn=Po(pn),yn=Po(vn),Tn=Po(mn),bn=Po(fn),An=Po(En),Cn=Be?Be.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function Pn(e){if(Ka(e)&&!wa(e)&&!(e instanceof xn)){if(e instanceof On)return e;if(Te.call(e,"__wrapped__"))return Ro(e)}return new On(e)}var Rn=function(){function e(){}return function(t){if(!Va(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function On(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function xn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new wn(e);this.size=t.size}function Bn(e,t){var n=wa(e),l=!n&&La(e),i=!n&&!l&&Ba(e),o=!n&&!l&&!i&&Ja(e),a=n||l||i||o,r=a?Ct(e.length,Ee):[],u=r.length;for(var c in e)!t&&!Te.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||oo(c,u))||r.push(c);return r}function Un(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function Hn(e,t){return bo(Ei(e),Xn(t,0,e.length))}function jn(e){return bo(Ei(e))}function Wn(e,t,n){(void 0!==n&&!Ia(e[t],n)||void 0===n&&!(t in e))&&qn(e,t,n)}function zn(e,t,n){var l=e[t];Te.call(e,t)&&Ia(l,n)&&(void 0!==n||t in e)||qn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(Ia(e[n][0],t))return n;return-1}function Kn(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function Yn(e,t){return e&&_i(t,yr(t),e)}function qn(e,t,n){"__proto__"==t&&Gt?Gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Gn(e,t){for(var n=-1,l=t.length,i=q(l),o=null==e;++n<l;)i[n]=o?void 0:Er(e,t[n]);return i}function Xn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function $n(e,t,n,l,i,a){var c,p=1&t,S=2&t,O=4&t;if(n&&(c=i?n(e,l,i,a):n(e)),void 0!==c)return c;if(!Va(e))return e;var x=wa(e);if(x){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Te.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!p)return Ei(e,c)}else{var L=to(e),w=L==s||L==d;if(Ba(e))return si(e,p);if(L==f||L==o||w&&!i){if(c=S||w?{}:lo(e),!p)return S?function(e,t){return _i(e,eo(e),t)}(e,function(e,t){return e&&_i(t,Tr(t),e)}(c,e)):function(e,t){return _i(e,Ji(e),t)}(e,Yn(c,e))}else{if(!ke[L])return i?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case y:return di(e);case r:case u:return new l(+e);case T:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case b:case A:case C:case D:case N:case P:case"[object Uint8ClampedArray]":case R:case I:return pi(e,n);case v:return new l;case m:case h:return new l(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case _:return new l;case g:return Dn?me(Dn.call(e)):{}}}(e,L,p)}}a||(a=new kn);var M=a.get(e);if(M)return M;a.set(e,c),$a(e)?e.forEach(function(l){c.add($n(l,t,n,l,e,a))}):Ya(e)&&e.forEach(function(l,i){c.set(i,$n(l,t,n,i,e,a))});var F=x?void 0:(O?S?Ki:Vi:S?Tr:yr)(e);return lt(F||e,function(l,i){F&&(l=e[i=l]),zn(c,i,$n(l,t,n,i,e,a))}),c}function Zn(e,t,n){var l=n.length;if(null==e)return!l;for(e=me(e);l--;){var i=n[l],o=e[i];if(void 0===o&&!(i in e)||!(0,t[i])(o))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new _e(n);return go(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var i=-1,o=rt,a=!0,r=e.length,u=[],c=t.length;if(!r)return u;n&&(t=ct(t,Nt(n))),l?(o=ut,a=!1):t.length>=200&&(o=Rt,a=!1,t=new Fn(t));e:for(;++i<r;){var s=e[i],d=null==n?s:n(s);if(s=l||0!==s?s:0,a&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;u.push(s)}else o(t,d,l)||u.push(s)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:H,variable:"",imports:{_:Pn}},(Pn.prototype=In.prototype).constructor=Pn,(On.prototype=Rn(In.prototype)).constructor=On,(xn.prototype=Rn(In.prototype)).constructor=xn,Ln.prototype.clear=function(){this.__data__=_n?_n(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(_n){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Te.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return _n?void 0!==t[e]:Te.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=_n&&void 0===t?"__lodash_hash_undefined__":t,this},wn.prototype.clear=function(){this.__data__=[],this.size=0},wn.prototype.delete=function(e){var t=this.__data__,n=Vn(t,e);return!(n<0||(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,0))},wn.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},wn.prototype.has=function(e){return Vn(this.__data__,e)>-1},wn.prototype.set=function(e,t){var n=this.__data__,l=Vn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new Ln,map:new(vn||wn),string:new Ln}},Mn.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return $i(this,e).get(e)},Mn.prototype.has=function(e){return $i(this,e).has(e)},Mn.prototype.set=function(e,t){var n=$i(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.clear=function(){this.__data__=new wn,this.size=0},kn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},kn.prototype.get=function(e){return this.__data__.get(e)},kn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof wn){var l=n.__data__;if(!vn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(l)}return n.set(e,t),this.size=n.size,this};var el=Si(ul),tl=Si(cl,!0);function nl(e,t){var n=!0;return el(e,function(e,l,i){return n=!!t(e,l,i)}),n}function ll(e,t,n){for(var l=-1,i=e.length;++l<i;){var o=e[l],a=t(o);if(null!=a&&(void 0===r?a==a&&!Qa(a):n(a,r)))var r=a,u=o}return u}function il(e,t){var n=[];return el(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function ol(e,t,n,l,i){var o=-1,a=e.length;for(n||(n=io),i||(i=[]);++o<a;){var r=e[o];t>0&&n(r)?t>1?ol(r,t-1,n,l,i):st(i,r):l||(i[i.length]=r)}return i}var al=yi(),rl=yi(!0);function ul(e,t){return e&&al(e,t,yr)}function cl(e,t){return e&&rl(e,t,yr)}function sl(e,t){return at(t,function(t){return ja(e[t])})}function dl(e,t){for(var n=0,l=(t=ai(t,e)).length;null!=e&&n<l;)e=e[No(t[n++])];return n&&n==l?e:void 0}function pl(e,t,n){var l=t(e);return wa(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":qt&&qt in me(e)?function(e){var t=Te.call(e,qt),n=e[qt];try{e[qt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[qt]=n:delete e[qt]),i}(e):function(e){return Ce.call(e)}(e)}function ml(e,t){return e>t}function fl(e,t){return null!=e&&Te.call(e,t)}function El(e,t){return null!=e&&t in me(e)}function _l(e,t,n){for(var l=n?ut:rt,i=e[0].length,o=e.length,a=o,r=q(o),u=Infinity,c=[];a--;){var s=e[a];a&&t&&(s=ct(s,Nt(t))),u=rn(s.length,u),r[a]=!n&&(t||i>=120&&s.length>=120)?new Fn(a&&s):void 0}s=e[0];var d=-1,p=r[0];e:for(;++d<i&&c.length<u;){var v=s[d],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?Rt(p,m):l(c,m,n))){for(a=o;--a;){var f=r[a];if(!(f?Rt(f,m):l(e[a],m,n)))continue e}p&&p.push(m),c.push(v)}}return c}function hl(e,t,n){var l=null==(e=fo(e,t=ai(t,e)))?e:e[No(Ho(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Ka(e)&&vl(e)==o}function Sl(e,t,n,l,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=wa(e),p=wa(t),S=d?a:to(e),b=p?a:to(t),A=(S=S==o?f:S)==f,C=(b=b==o?f:b)==f,D=S==b;if(D&&Ba(e)){if(!Ba(t))return!1;d=!0,A=!1}if(D&&!A)return s||(s=new kn),d||Ja(e)?Wi(e,t,n,l,i,s):function(e,t,n,l,i,o,a){switch(n){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!o(new je(e),new je(t)));case r:case u:case m:return Ia(+e,+t);case c:return e.name==t.name&&e.message==t.message;case E:case h:return e==t+"";case v:var s=kt;case _:if(s||(s=Ht),e.size!=t.size&&!(1&l))return!1;var d=a.get(e);if(d)return d==t;l|=2,a.set(e,t);var p=Wi(s(e),s(t),l,i,o,a);return a.delete(e),p;case g:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,S,n,l,i,s);if(!(1&n)){var N=A&&Te.call(e,"__wrapped__"),P=C&&Te.call(t,"__wrapped__");if(N||P){var R=N?e.value():e,I=P?t.value():t;return s||(s=new kn),i(R,I,n,l,s)}}return!!D&&(s||(s=new kn),function(e,t,n,l,i,o){var a=1&n,r=Vi(e),u=r.length;if(u!=Vi(t).length&&!a)return!1;for(var c=u;c--;){var s=r[c];if(!(a?s in t:Te.call(t,s)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var m=a;++c<u;){var f=e[s=r[c]],E=t[s];if(l)var _=a?l(E,f,s,t,e,o):l(f,E,s,e,t,o);if(!(void 0===_?f===E||i(f,E,n,l,o):_)){v=!1;break}m||(m="constructor"==s)}if(v&&!m){var h=e.constructor,g=t.constructor;h==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof h&&h instanceof h&&"function"==typeof g&&g instanceof g||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,n,l,i,s))}(e,t,n,l,Sl,i))}function yl(e,t,n,l){var i=n.length,o=i,a=!l;if(null==e)return!o;for(e=me(e);i--;){var r=n[i];if(a&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++i<o;){var u=(r=n[i])[0],c=e[u],s=r[1];if(a&&r[2]){if(void 0===c&&!(u in e))return!1}else{var d=new kn;if(l)var p=l(c,s,u,e,t,d);if(!(void 0===p?Sl(s,c,3,l,d):p))return!1}}return!0}function Tl(e){return!(!Va(e)||(t=e,Ae&&Ae in t))&&(ja(e)?Ie:ie).test(Po(e));var t}function bl(e){return"function"==typeof e?e:null==e?qr:"object"==typeof e?wa(e)?Pl(e[0],e[1]):Nl(e):nu(e)}function Al(e){if(!so(e))return on(e);var t=[];for(var n in me(e))Te.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cl(e,t){return e<t}function Dl(e,t){var n=-1,l=Fa(e)?q(e.length):[];return el(e,function(e,i,o){l[++n]=t(e,i,o)}),l}function Nl(e){var t=Zi(e);return 1==t.length&&t[0][2]?vo(t[0][0],t[0][1]):function(n){return n===e||yl(n,e,t)}}function Pl(e,t){return ro(e)&&po(t)?vo(No(e),t):function(n){var l=Er(n,e);return void 0===l&&l===t?_r(n,e):Sl(t,l,3)}}function Rl(e,t,n,l,i){e!==t&&al(t,function(o,a){if(i||(i=new kn),Va(o))!function(e,t,n,l,i,o,a){var r=_o(e,n),u=_o(t,n),c=a.get(u);if(c)Wn(e,n,c);else{var s=o?o(r,u,n+"",e,t,a):void 0,d=void 0===s;if(d){var p=wa(u),v=!p&&Ba(u),m=!p&&!v&&Ja(u);s=u,p||v||m?wa(r)?s=r:ka(r)?s=Ei(r):v?(d=!1,s=si(u,!0)):m?(d=!1,s=pi(u,!0)):s=[]:Ga(u)||La(u)?(s=r,La(r)?s=rr(r):Va(r)&&!ja(r)||(s=lo(u))):d=!1}d&&(a.set(u,s),i(s,u,l,o,a),a.delete(u)),Wn(e,n,s)}}(e,t,a,n,Rl,l,i);else{var r=l?l(_o(e,a),o,a+"",e,t,i):void 0;void 0===r&&(r=o),Wn(e,a,r)}},Tr)}function Il(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function Ol(e,t,n){t=t.length?ct(t,function(e){return wa(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[qr];var l=-1;return t=ct(t,Nt(Xi())),function(e,t){var l=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var l=-1,i=e.criteria,o=t.criteria,a=i.length,r=n.length;++l<a;){var u=vi(i[l],o[l]);if(u)return l>=r?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Dl(e,function(e,n,i){return{criteria:ct(t,function(t){return t(e)}),index:++l,value:e}}))}function xl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var a=t[l],r=dl(e,a);n(r,a)&&Hl(o,ai(a,e),r)}return o}function Ll(e,t,n,l){var i=l?ht:_t,o=-1,a=t.length,r=e;for(e===t&&(t=Ei(t)),n&&(r=ct(e,Nt(n)));++o<a;)for(var u=0,c=t[o],s=n?n(c):c;(u=i(r,s,u,l))>-1;)r!==e&&Ge.call(r,u,1),Ge.call(e,u,1);return e}function wl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==o){var o=i;oo(i)?Ge.call(e,i,1):Ql(e,i)}}return e}function Ml(e,t){return e+Jt(sn()*(t-e+1))}function Fl(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function kl(e,t){return So(mo(e,t,qr),e+"")}function Bl(e){return Un(Ir(e))}function Ul(e,t){var n=Ir(e);return bo(n,Xn(t,0,n.length))}function Hl(e,t,n,l){if(!Va(e))return e;for(var i=-1,o=(t=ai(t,e)).length,a=o-1,r=e;null!=r&&++i<o;){var u=No(t[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var s=r[u];void 0===(c=l?l(s,u,r):void 0)&&(c=Va(s)?s:oo(t[i+1])?[]:{})}zn(r,u,c),r=r[u]}return e}var jl=hn?function(e,t){return hn.set(e,t),e}:qr,Wl=Gt?function(e,t){return Gt(e,"toString",{configurable:!0,enumerable:!1,value:Vr(t),writable:!0})}:qr;function zl(e){return bo(Ir(e))}function Vl(e,t,n){var l=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=q(i);++l<i;)o[l]=e[l+t];return o}function Kl(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Yl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var o=l+i>>>1,a=e[o];null!==a&&!Qa(a)&&(n?a<=t:a<t)?l=o+1:i=o}return i}return ql(e,t,qr,n)}function ql(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,r=null===t,u=Qa(t),c=void 0===t;i<o;){var s=Jt((i+o)/2),d=n(e[s]),p=void 0!==d,v=null===d,m=d==d,f=Qa(d);if(a)var E=l||m;else E=c?m&&(l||p):r?m&&p&&(l||!v):u?m&&p&&!v&&(l||!f):!v&&!f&&(l?d<=t:d<t);E?i=s+1:o=s}return rn(o,4294967294)}function Gl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var a=e[n],r=t?t(a):a;if(!n||!Ia(r,u)){var u=r;o[i++]=0===a?0:a}}return o}function Xl(e){return"number"==typeof e?e:Qa(e)?NaN:+e}function $l(e){if("string"==typeof e)return e;if(wa(e))return ct(e,$l)+"";if(Qa(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zl(e,t,n){var l=-1,i=rt,o=e.length,a=!0,r=[],u=r;if(n)a=!1,i=ut;else if(o>=200){var c=t?null:Fi(e);if(c)return Ht(c);a=!1,i=Rt,u=new Fn}else u=t?[]:r;e:for(;++l<o;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,a&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),r.push(s)}else i(u,d,n)||(u!==r&&u.push(d),r.push(s))}return r}function Ql(e,t){return null==(e=fo(e,t=ai(t,e)))||delete e[No(Ho(t))]}function Jl(e,t,n,l){return Hl(e,t,n(dl(e,t)),l)}function ei(e,t,n,l){for(var i=e.length,o=l?i:-1;(l?o--:++o<i)&&t(e[o],o,e););return n?Vl(e,l?0:o,l?o+1:i):Vl(e,l?o+1:0,l?i:o)}function ti(e,t){var n=e;return n instanceof xn&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ni(e,t,n){var l=e.length;if(l<2)return l?Zl(e[0]):[];for(var i=-1,o=q(l);++i<l;)for(var a=e[i],r=-1;++r<l;)r!=i&&(o[i]=Jn(o[i]||a,e[r],t,n));return Zl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,a={};++l<i;)n(a,e[l],l<o?t[l]:void 0);return a}function ii(e){return ka(e)?e:[]}function oi(e){return"function"==typeof e?e:qr}function ai(e,t){return wa(e)?e:ro(e,t)?[e]:Do(ur(e))}var ri=kl;function ui(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:Vl(e,t,n)}var ci=Xt||function(e){return ze.clearTimeout(e)};function si(e,t){if(t)return e.slice();var n=e.length,l=We?We(n):new e.constructor(n);return e.copy(l),l}function di(e){var t=new e.constructor(e.byteLength);return new je(t).set(new je(e)),t}function pi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Qa(e),a=void 0!==t,r=null===t,u=t==t,c=Qa(t);if(!r&&!c&&!o&&e>t||o&&a&&u&&!r&&!c||l&&a&&u||!n&&u||!i)return 1;if(!l&&!o&&!c&&e<t||c&&n&&i&&!l&&!o||r&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,a=n.length,r=-1,u=t.length,c=an(o-a,0),s=q(u+c),d=!l;++r<u;)s[r]=t[r];for(;++i<a;)(d||i<o)&&(s[n[i]]=e[i]);for(;c--;)s[r++]=e[i++];return s}function fi(e,t,n,l){for(var i=-1,o=e.length,a=-1,r=n.length,u=-1,c=t.length,s=an(o-r,0),d=q(s+c),p=!l;++i<s;)d[i]=e[i];for(var v=i;++u<c;)d[v+u]=t[u];for(;++a<r;)(p||i<o)&&(d[v+n[a]]=e[i++]);return d}function Ei(e,t){var n=-1,l=e.length;for(t||(t=q(l));++n<l;)t[n]=e[n];return t}function _i(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?qn(n,r,u):zn(n,r,u)}return n}function hi(e,t){return function(n,l){var i=wa(n)?nt:Kn,o=t?t():{};return i(n,e,Xi(l,2),o)}}function gi(e){return kl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&ao(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var r=n[l];r&&e(t,r,l,o)}return t})}function Si(e,t){return function(n,l){if(null==n)return n;if(!Fa(n))return e(n,l);for(var i=n.length,o=t?i:-1,a=me(n);(t?o--:++o<i)&&!1!==l(a[o],o,a););return n}}function yi(e){return function(t,n,l){for(var i=-1,o=me(t),a=l(t),r=a.length;r--;){var u=a[e?r:++i];if(!1===n(o[u],u,o))break}return t}}function Ti(e){return function(t){var n=Ft(t=ur(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ui(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return dt(jr(Lr(t).replace(Pe,"")),e,"")}}function Ai(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Rn(e.prototype),l=e.apply(n,t);return Va(l)?l:n}}function Ci(e){return function(t,n,l){var i=me(t);if(!Fa(t)){var o=Xi(n,3);t=yr(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,l);return a>-1?i[o?t[a]:a]:void 0}}function Di(e){return zi(function(t){var l=t.length,i=l,o=On.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new _e(n);if(o&&!r&&"wrapper"==qi(a))var r=new On([],!0)}for(i=r?i:l;++i<l;){var u=qi(a=t[i]),c="wrapper"==u?Yi(a):void 0;r=c&&uo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?r[qi(c[0])].apply(r,c[3]):1==a.length&&uo(a)?r[u]():r.thru(a)}return function(){var e=arguments,n=e[0];if(r&&1==e.length&&wa(n))return r.plant(n).value();for(var i=0,o=l?t[i].apply(this,e):n;++i<l;)o=t[i].call(this,o);return o}})}function Ni(e,t,n,l,i,o,a,r,u,c){var s=128&t,d=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:Ai(e);return function E(){for(var _=arguments.length,h=q(_),g=_;g--;)h[g]=arguments[g];if(v)var S=Gi(E),y=xt(h,S);if(l&&(h=mi(h,l,i,v)),o&&(h=fi(h,o,a,v)),_-=y,v&&_<c){var T=Ut(h,S);return wi(e,t,Ni,E.placeholder,n,h,T,r,u,c-_)}var b=d?n:this,A=p?b[e]:e;return _=h.length,r?h=Eo(h,r):m&&_>1&&h.reverse(),s&&u<_&&(h.length=u),this&&this!==ze&&this instanceof E&&(A=f||Ai(A)),A.apply(b,h)}}function Pi(e,t){return function(n,l){return function(e,t,n,l){return ul(e,function(e,i,o){t(l,n(e),i,o)}),l}(n,e,t(l),{})}}function Ri(e,t){return function(n,l){var i;if(void 0===n&&void 0===l)return t;if(void 0!==n&&(i=n),void 0!==l){if(void 0===i)return l;"string"==typeof n||"string"==typeof l?(n=$l(n),l=$l(l)):(n=Xl(n),l=Xl(l)),i=e(n,l)}return i}}function Ii(e){return zi(function(t){return t=ct(t,Nt(Xi())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Oi(e,t){var n=(t=void 0===t?" ":$l(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Qt(e/Wt(t)));return Ft(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function xi(e){return function(t,n,l){return l&&"number"!=typeof l&&ao(t,n,l)&&(n=l=void 0),t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n,l){for(var i=-1,o=an(Qt((t-e)/(n||1)),0),a=q(o);o--;)a[l?o:++i]=e,e+=n;return a}(t,n,l=void 0===l?t<n?1:-1:lr(l),e)}}function Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ar(t),n=ar(n)),e(t,n)}}function wi(e,t,n,l,i,o,a,r,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,i,s?o:void 0,s?a:void 0,s?void 0:o,s?void 0:a,r,u,c],p=n.apply(void 0,d);return uo(e)&&ho(p,d),p.placeholder=l,yo(p,e,t)}function Mi(e){var t=ve[e];return function(e,n){if(e=ar(e),(n=null==n?0:rn(ir(n),292))&&nn(e)){var l=(ur(e)+"e").split("e");return+((l=(ur(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Fi=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Qr;function ki(e){return function(t){var n=to(t);return n==v?kt(t):n==_?jt(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,a,r,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new _e(n);var d=o?o.length:0;if(d||(t&=-97,o=a=void 0),u=void 0===u?u:an(ir(u),0),c=void 0===c?c:ir(c),d-=a?a.length:0,64&t){var p=o,v=a;o=a=void 0}var m=s?void 0:Yi(e),f=[e,t,i,o,a,p,v,r,u,c];if(m&&function(e,t){var n=e[1],i=t[1],o=n|i;if(!(o<131||128==i&&8==n||128==i&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n))return e;1&i&&(e[2]=t[2],o|=1&n?0:4);var a=t[3];if(a){var r=e[3];e[3]=r?mi(r,a,t[4]):a,e[4]=r?Ut(e[3],l):t[4]}(a=t[5])&&(e[5]=(r=e[5])?fi(r,a,t[6]):a,e[6]=r?Ut(e[5],l):t[6]),(a=t[7])&&(e[7]=a),128&i&&(e[8]=null==e[8]?t[8]:rn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],a=f[4],!(c=f[9]=void 0===f[9]?s?0:e.length:an(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||16==t?function(e,t,n){var l=Ai(e);return function i(){for(var o=arguments.length,a=q(o),r=o,u=Gi(i);r--;)a[r]=arguments[r];var c=o<3&&a[0]!==u&&a[o-1]!==u?[]:Ut(a,u);if((o-=c.length)<n)return wi(e,t,Ni,i.placeholder,void 0,a,c,void 0,void 0,n-o);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,a)}}(e,t,c):32!=t&&33!=t||a.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ai(e);return function t(){for(var a=-1,r=arguments.length,u=-1,c=l.length,s=q(c+r),d=this&&this!==ze&&this instanceof t?o:e;++u<c;)s[u]=l[u];for(;r--;)s[u++]=arguments[++a];return tt(d,i?n:this,s)}}(e,t,i,o);else var E=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var o=this&&this!==ze&&this instanceof t?i:e;return o.apply(l?n:this,arguments)}}(e,t,i);return yo((m?jl:ho)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ia(e,ge[n])&&!Te.call(l,n)?t:e}function Hi(e,t,n,l,i,o){return Va(e)&&Va(t)&&(o.set(t,e),Rl(e,t,void 0,Hi,o),o.delete(t)),e}function ji(e){return Ga(e)?void 0:e}function Wi(e,t,n,l,i,o){var a=1&n,r=e.length,u=t.length;if(r!=u&&!(a&&u>r))return!1;var c=o.get(e),s=o.get(t);if(c&&s)return c==t&&s==e;var d=-1,p=!0,v=2&n?new Fn:void 0;for(o.set(e,t),o.set(t,e);++d<r;){var m=e[d],f=t[d];if(l)var E=a?l(f,m,d,t,e,o):l(m,f,d,e,t,o);if(void 0!==E){if(E)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Rt(v,t)&&(m===e||i(m,e,n,l,o)))return v.push(t)})){p=!1;break}}else if(m!==f&&!i(m,f,n,l,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function zi(e){return So(mo(e,void 0,Mo),e+"")}function Vi(e){return pl(e,yr,Ji)}function Ki(e){return pl(e,Tr,eo)}var Yi=hn?function(e){return hn.get(e)}:Qr;function qi(e){for(var t=e.name+"",n=gn[t],l=Te.call(gn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Gi(e){return(Te.call(Pn,"placeholder")?Pn:e).placeholder}function Xi(){var e=Pn.iteratee||Gr;return e=e===Gr?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function $i(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Zi(e){for(var t=yr(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,po(i)]}return t}function Qi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Tl(n)?n:void 0}var Ji=en?function(e){return null==e?[]:(e=me(e),at(en(e),function(t){return qe.call(e,t)}))}:ou,eo=en?function(e){for(var t=[];e;)st(t,Ji(e)),e=Ve(e);return t}:ou,to=vl;function no(e,t,n){for(var l=-1,i=(t=ai(t,e)).length,o=!1;++l<i;){var a=No(t[l]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&za(i)&&oo(a,i)&&(wa(e)||La(e))}function lo(e){return"function"!=typeof e.constructor||so(e)?{}:Rn(Ve(e))}function io(e){return wa(e)||La(e)||!!(mt&&e&&e[mt])}function oo(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ae.test(e))&&e>-1&&e%1==0&&e<t}function ao(e,t,n){if(!Va(n))return!1;var l=typeof t;return!!("number"==l?Fa(n)&&oo(t,n.length):"string"==l&&t in n)&&Ia(n[t],e)}function ro(e,t){if(wa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qa(e))||W.test(e)||!j.test(e)||null!=t&&e in me(t)}function uo(e){var t=qi(e),n=Pn[t];if("function"!=typeof n||!(t in xn.prototype))return!1;if(e===n)return!0;var l=Yi(n);return!!l&&e===l[0]}(pn&&to(new pn(new ArrayBuffer(1)))!=T||vn&&to(new vn)!=v||mn&&"[object Promise]"!=to(mn.resolve())||fn&&to(new fn)!=_||En&&to(new En)!=S)&&(to=function(e){var t=vl(e),n=t==f?e.constructor:void 0,l=n?Po(n):"";if(l)switch(l){case Sn:return T;case yn:return v;case Tn:return"[object Promise]";case bn:return _;case An:return S}return t});var co=Se?ja:au;function so(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function po(e){return e==e&&!Va(e)}function vo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in me(n))}}function mo(e,t,n){return t=an(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=an(l.length-t,0),a=q(o);++i<o;)a[i]=l[t+i];i=-1;for(var r=q(t+1);++i<t;)r[i]=l[i];return r[t]=n(a),tt(e,this,r)}}function fo(e,t){return t.length<2?e:dl(e,Vl(t,0,-1))}function Eo(e,t){for(var n=e.length,l=rn(t.length,n),i=Ei(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function _o(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ho=To(jl),go=Zt||function(e,t){return ze.setTimeout(e,t)},So=To(Wl);function yo(e,t,n){var l=t+"";return So(e,function(e,t){var n=t.length;if(!n)return e;var l=n-1;return t[l]=(n>1?"& ":"")+t[l],t=t.join(n>2?", ":" "),e.replace(G,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!rt(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split($):[]}(l),n)))}function To(e){var t=0,n=0;return function(){var l=un(),i=16-(l-n);if(n=l,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function bo(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=Ml(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Ao,Co,Do=(Ao=Aa(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace(J,"$1"):n||e)}),t},function(e){return 500===Co.size&&Co.clear(),e}),Co=Ao.cache,Ao);function No(e){if("string"==typeof e||Qa(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof xn)return e.clone();var t=new On(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=kl(function(e,t){return ka(e)?Jn(e,ol(t,1,ka,!0)):[]}),Oo=kl(function(e,t){var n=Ho(t);return ka(n)&&(n=void 0),ka(e)?Jn(e,ol(t,1,ka,!0),Xi(n,2)):[]}),xo=kl(function(e,t){var n=Ho(t);return ka(n)&&(n=void 0),ka(e)?Jn(e,ol(t,1,ka,!0),void 0,n):[]});function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),Et(e,Xi(t,3),i)}function wo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ir(n),i=n<0?an(l+i,0):rn(i,l-1)),Et(e,Xi(t,3),i,!0)}function Mo(e){return null!=e&&e.length?ol(e,1):[]}function Fo(e){return e&&e.length?e[0]:void 0}var ko=kl(function(e){var t=ct(e,ii);return t.length&&t[0]===e[0]?_l(t):[]}),Bo=kl(function(e){var t=Ho(e),n=ct(e,ii);return t===Ho(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?_l(n,Xi(t,2)):[]}),Uo=kl(function(e){var t=Ho(e),n=ct(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?_l(n,void 0,t):[]});function Ho(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jo=kl(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var zo=zi(function(e,t){var n=null==e?0:e.length,l=Gn(e,t);return wl(e,ct(t,function(e){return oo(e,n)?+e:e}).sort(vi)),l});function Vo(e){return null==e?e:dn.call(e)}var Ko=kl(function(e){return Zl(ol(e,1,ka,!0))}),Yo=kl(function(e){var t=Ho(e);return ka(t)&&(t=void 0),Zl(ol(e,1,ka,!0),Xi(t,2))}),qo=kl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,Zl(ol(e,1,ka,!0),void 0,t)});function Go(e){if(!e||!e.length)return[];var t=0;return e=at(e,function(e){if(ka(e))return t=an(e.length,t),!0}),Ct(t,function(t){return ct(e,yt(t))})}function Xo(e,t){if(!e||!e.length)return[];var n=Go(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var $o=kl(function(e,t){return ka(e)?Jn(e,t):[]}),Zo=kl(function(e){return ni(at(e,ka))}),Qo=kl(function(e){var t=Ho(e);return ka(t)&&(t=void 0),ni(at(e,ka),Xi(t,2))}),Jo=kl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,ni(at(e,ka),void 0,t)}),ea=kl(Go),ta=kl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Xo(e,n)});function na(e){var t=Pn(e);return t.__chain__=!0,t}function la(e,t){return t(e)}var ia=zi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Gn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof xn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:la,args:[i],thisArg:void 0}),new On(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),oa=hi(function(e,t,n){Te.call(e,n)?++e[n]:qn(e,n,1)}),aa=Ci(Lo),ra=Ci(wo);function ua(e,t){return(wa(e)?lt:el)(e,Xi(t,3))}function ca(e,t){return(wa(e)?it:tl)(e,Xi(t,3))}var sa=hi(function(e,t,n){Te.call(e,n)?e[n].push(t):qn(e,n,[t])}),da=kl(function(e,t,n){var l=-1,i="function"==typeof t,o=Fa(e)?q(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):hl(e,t,n)}),o}),pa=hi(function(e,t,n){qn(e,n,t)});function va(e,t){return(wa(e)?ct:Dl)(e,Xi(t,3))}var ma=hi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fa=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ao(e,t[0],t[1])?t=[]:n>2&&ao(t[0],t[1],t[2])&&(t=[t[0]]),Ol(e,ol(t,1),[])}),Ea=$t||function(){return ze.Date.now()};function _a(e,t,n){return t=n?void 0:t,Bi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ha(e,t){var l;if("function"!=typeof t)throw new _e(n);return e=ir(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var ga=kl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,Gi(ga));l|=32}return Bi(e,l,t,n,i)}),Sa=kl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,Gi(Sa));l|=32}return Bi(t,l,e,n,i)});function ya(e,t,l){var i,o,a,r,u,c,s=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new _e(n);function m(t){var n=i,l=o;return i=o=void 0,s=t,r=e.apply(l,n)}function f(e){return s=e,u=go(_,t),d?m(e):r}function E(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-s>=a}function _(){var e=Ea();if(E(e))return h(e);u=go(_,function(e){var n=t-(e-c);return p?rn(n,a-(e-s)):n}(e))}function h(e){return u=void 0,v&&i?m(e):(i=o=void 0,r)}function g(){var e=Ea(),n=E(e);if(i=arguments,o=this,c=e,n){if(void 0===u)return f(c);if(p)return ci(u),u=go(_,t),m(c)}return void 0===u&&(u=go(_,t)),r}return t=ar(t)||0,Va(l)&&(d=!!l.leading,a=(p="maxWait"in l)?an(ar(l.maxWait)||0,t):a,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&ci(u),s=0,i=c=o=u=void 0},g.flush=function(){return void 0===u?r:h(Ea())},g}var Ta=kl(function(e,t){return Qn(e,1,t)}),ba=kl(function(e,t,n){return Qn(e,ar(t)||0,n)});function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(n);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(Aa.Cache||Mn),l}function Ca(e){if("function"!=typeof e)throw new _e(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=Mn;var Da=ri(function(e,t){var n=(t=1==t.length&&wa(t[0])?ct(t[0],Nt(Xi())):ct(ol(t,1),Nt(Xi()))).length;return kl(function(l){for(var i=-1,o=rn(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Na=kl(function(e,t){return Bi(e,32,void 0,t,Ut(t,Gi(Na)))}),Pa=kl(function(e,t){return Bi(e,64,void 0,t,Ut(t,Gi(Pa)))}),Ra=zi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function Ia(e,t){return e===t||e!=e&&t!=t}var Oa=Li(ml),xa=Li(function(e,t){return e>=t}),La=gl(function(){return arguments}())?gl:function(e){return Ka(e)&&Te.call(e,"callee")&&!qe.call(e,"callee")},wa=q.isArray,Ma=Xe?Nt(Xe):function(e){return Ka(e)&&vl(e)==y};function Fa(e){return null!=e&&za(e.length)&&!ja(e)}function ka(e){return Ka(e)&&Fa(e)}var Ba=tn||au,Ua=$e?Nt($e):function(e){return Ka(e)&&vl(e)==u};function Ha(e){if(!Ka(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ga(e)}function ja(e){if(!Va(e))return!1;var t=vl(e);return t==s||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wa(e){return"number"==typeof e&&e==ir(e)}function za(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Va(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ka(e){return null!=e&&"object"==typeof e}var Ya=Ze?Nt(Ze):function(e){return Ka(e)&&to(e)==v};function qa(e){return"number"==typeof e||Ka(e)&&vl(e)==m}function Ga(e){if(!Ka(e)||vl(e)!=f)return!1;var t=Ve(e);if(null===t)return!0;var n=Te.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ye.call(n)==De}var Xa=Qe?Nt(Qe):function(e){return Ka(e)&&vl(e)==E},$a=Je?Nt(Je):function(e){return Ka(e)&&to(e)==_};function Za(e){return"string"==typeof e||!wa(e)&&Ka(e)&&vl(e)==h}function Qa(e){return"symbol"==typeof e||Ka(e)&&vl(e)==g}var Ja=et?Nt(et):function(e){return Ka(e)&&za(e.length)&&!!Fe[vl(e)]},er=Li(Cl),tr=Li(function(e,t){return e<=t});function nr(e){if(!e)return[];if(Fa(e))return Za(e)?zt(e):Ei(e);if(Tt&&e[Tt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Tt]());var t=to(e);return(t==v?kt:t==_?Ht:Ir)(e)}function lr(e){return e?(e=ar(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ir(e){var t=lr(e),n=t%1;return t==t?n?t-n:t:0}function or(e){return e?Xn(ir(e),0,4294967295):0}function ar(e){if("number"==typeof e)return e;if(Qa(e))return NaN;if(Va(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Va(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||oe.test(e)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function rr(e){return _i(e,Tr(e))}function ur(e){return null==e?"":$l(e)}var cr=gi(function(e,t){if(so(t)||Fa(t))_i(t,yr(t),e);else for(var n in t)Te.call(t,n)&&zn(e,n,t[n])}),sr=gi(function(e,t){_i(t,Tr(t),e)}),dr=gi(function(e,t,n,l){_i(t,Tr(t),e,l)}),pr=gi(function(e,t,n,l){_i(t,yr(t),e,l)}),vr=zi(Gn),mr=kl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ao(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],a=Tr(o),r=-1,u=a.length;++r<u;){var c=a[r],s=e[c];(void 0===s||Ia(s,ge[c])&&!Te.call(e,c))&&(e[c]=o[c])}return e}),fr=kl(function(e){return e.push(void 0,Hi),tt(Ar,void 0,e)});function Er(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function _r(e,t){return null!=e&&no(e,t,El)}var hr=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},Vr(qr)),gr=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Te.call(e,t)?e[t].push(n):e[t]=[n]},Xi),Sr=kl(hl);function yr(e){return Fa(e)?Bn(e):Al(e)}function Tr(e){return Fa(e)?Bn(e,!0):function(e){if(!Va(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=so(e),n=[];for(var l in e)("constructor"!=l||!t&&Te.call(e,l))&&n.push(l);return n}(e)}var br=gi(function(e,t,n){Rl(e,t,n)}),Ar=gi(function(e,t,n,l){Rl(e,t,n,l)}),Cr=zi(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=ai(t,e),l||(l=t.length>1),t}),_i(e,Ki(e),n),l&&(n=$n(n,7,ji));for(var i=t.length;i--;)Ql(n,t[i]);return n}),Dr=zi(function(e,t){return null==e?{}:function(e,t){return xl(e,t,function(t,n){return _r(e,n)})}(e,t)});function Nr(e,t){if(null==e)return{};var n=ct(Ki(e),function(e){return[e]});return t=Xi(t),xl(e,n,function(e,n){return t(e,n[0])})}var Pr=ki(yr),Rr=ki(Tr);function Ir(e){return null==e?[]:Pt(e,yr(e))}var Or=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?xr(t):t)});function xr(e){return Hr(ur(e).toLowerCase())}function Lr(e){return(e=ur(e))&&e.replace(re,Lt).replace(Re,"")}var wr=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Mr=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fr=Ti("toLowerCase"),kr=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Br=bi(function(e,t,n){return e+(n?" ":"")+Hr(t)}),Ur=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Hr=Ti("toUpperCase");function jr(e,t,n){return e=ur(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wr=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Ha(e)?e:new de(e)}}),zr=zi(function(e,t){return lt(t,function(t){t=No(t),qn(e,t,ga(e[t],e))}),e});function Vr(e){return function(){return e}}var Kr=Di(),Yr=Di(!0);function qr(e){return e}function Gr(e){return bl("function"==typeof e?e:$n(e,1))}var Xr=kl(function(e,t){return function(n){return hl(n,e,t)}}),$r=kl(function(e,t){return function(n){return hl(e,n,t)}});function Zr(e,t,n){var l=yr(t),i=sl(t,l);null!=n||Va(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,yr(t)));var o=!(Va(n)&&"chain"in n&&!n.chain),a=ja(e);return lt(i,function(n){var l=t[n];e[n]=l,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Ei(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,st([this.value()],arguments))})}),e}function Qr(){}var Jr=Ii(ct),eu=Ii(ot),tu=Ii(vt);function nu(e){return ro(e)?yt(No(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=xi(),iu=xi(!0);function ou(){return[]}function au(){return!1}var ru,uu=Ri(function(e,t){return e+t},0),cu=Mi("ceil"),su=Ri(function(e,t){return e/t},1),du=Mi("floor"),pu=Ri(function(e,t){return e*t},1),vu=Mi("round"),mu=Ri(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new _e(n);return e=ir(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=_a,Pn.assign=cr,Pn.assignIn=sr,Pn.assignInWith=dr,Pn.assignWith=pr,Pn.at=vr,Pn.before=ha,Pn.bind=ga,Pn.bindAll=zr,Pn.bindKey=Sa,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return wa(e)?e:[e]},Pn.chain=na,Pn.chunk=function(e,t,n){t=(n?ao(e,t,n):void 0===t)?1:an(ir(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,a=q(Qt(l/t));i<l;)a[o++]=Vl(e,i,i+=t);return a},Pn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var o=e[t];o&&(i[l++]=o)}return i},Pn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=q(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(wa(n)?Ei(n):[n],ol(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=Xi();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new _e(n);return[l(e[0]),e[1]]}):[],kl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Pn.conforms=function(e){return function(e){var t=yr(e);return function(n){return Zn(n,e,t)}}($n(e,1))},Pn.constant=Vr,Pn.countBy=oa,Pn.create=function(e,t){var n=Rn(e);return null==t?n:Yn(n,t)},Pn.curry=function e(t,n,l){var i=Bi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Pn.curryRight=function e(t,n,l){var i=Bi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Pn.debounce=ya,Pn.defaults=mr,Pn.defaultsDeep=fr,Pn.defer=Ta,Pn.delay=ba,Pn.difference=Io,Pn.differenceBy=Oo,Pn.differenceWith=xo,Pn.drop=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,(t=n||void 0===t?1:ir(t))<0?0:t,l):[]},Pn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,0,(t=l-(t=n||void 0===t?1:ir(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?ei(e,Xi(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?ei(e,Xi(t,3),!0):[]},Pn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ao(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ir(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ir(l))<0&&(l+=i),l=n>l?0:or(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Pn.filter=function(e,t){return(wa(e)?at:il)(e,Xi(t,3))},Pn.flatMap=function(e,t){return ol(va(e,t),1)},Pn.flatMapDeep=function(e,t){return ol(va(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ir(n),ol(va(e,t),n)},Pn.flatten=Mo,Pn.flattenDeep=function(e){return null!=e&&e.length?ol(e,1/0):[]},Pn.flattenDepth=function(e,t){return null!=e&&e.length?ol(e,t=void 0===t?1:ir(t)):[]},Pn.flip=function(e){return Bi(e,512)},Pn.flow=Kr,Pn.flowRight=Yr,Pn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,l={};++t<n;){var i=e[t];l[i[0]]=i[1]}return l},Pn.functions=function(e){return null==e?[]:sl(e,yr(e))},Pn.functionsIn=function(e){return null==e?[]:sl(e,Tr(e))},Pn.groupBy=sa,Pn.initial=function(e){return null!=e&&e.length?Vl(e,0,-1):[]},Pn.intersection=ko,Pn.intersectionBy=Bo,Pn.intersectionWith=Uo,Pn.invert=hr,Pn.invertBy=gr,Pn.invokeMap=da,Pn.iteratee=Gr,Pn.keyBy=pa,Pn.keys=yr,Pn.keysIn=Tr,Pn.map=va,Pn.mapKeys=function(e,t){var n={};return t=Xi(t,3),ul(e,function(e,l,i){qn(n,t(e,l,i),e)}),n},Pn.mapValues=function(e,t){var n={};return t=Xi(t,3),ul(e,function(e,l,i){qn(n,l,t(e,l,i))}),n},Pn.matches=function(e){return Nl($n(e,1))},Pn.matchesProperty=function(e,t){return Pl(e,$n(t,1))},Pn.memoize=Aa,Pn.merge=br,Pn.mergeWith=Ar,Pn.method=Xr,Pn.methodOf=$r,Pn.mixin=Zr,Pn.negate=Ca,Pn.nthArg=function(e){return e=ir(e),kl(function(t){return Il(t,e)})},Pn.omit=Cr,Pn.omitBy=function(e,t){return Nr(e,Ca(Xi(t)))},Pn.once=function(e){return ha(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(wa(t)||(t=null==t?[]:[t]),wa(n=l?void 0:n)||(n=null==n?[]:[n]),Ol(e,t,n))},Pn.over=Jr,Pn.overArgs=Da,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=Na,Pn.partialRight=Pa,Pn.partition=ma,Pn.pick=Dr,Pn.pickBy=Nr,Pn.property=nu,Pn.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},Pn.pull=jo,Pn.pullAll=Wo,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Xi(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},Pn.pullAt=zo,Pn.range=lu,Pn.rangeRight=iu,Pn.rearg=Ra,Pn.reject=function(e,t){return(wa(e)?at:il)(e,Ca(Xi(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Xi(t,3);++l<o;){var a=e[l];t(a,l,e)&&(n.push(a),i.push(l))}return wl(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new _e(n);return kl(e,t=void 0===t?t:ir(t))},Pn.reverse=Vo,Pn.sampleSize=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),(wa(e)?Hn:Ul)(e,t)},Pn.set=function(e,t,n){return null==e?e:Hl(e,t,n)},Pn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Hl(e,t,n,l)},Pn.shuffle=function(e){return(wa(e)?jn:zl)(e)},Pn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ao(e,t,n)?(t=0,n=l):(t=null==t?0:ir(t),n=void 0===n?l:ir(n)),Vl(e,t,n)):[]},Pn.sortBy=fa,Pn.sortedUniq=function(e){return e&&e.length?Gl(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Gl(e,Xi(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ao(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ur(e))&&("string"==typeof t||null!=t&&!Xa(t))&&!(t=$l(t))&&Ft(e)?ui(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new _e(n);return t=null==t?0:an(ir(t),0),kl(function(n){var l=n[t],i=ui(n,0,t);return l&&st(i,l),tt(e,this,i)})},Pn.tail=function(e){var t=null==e?0:e.length;return t?Vl(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?Vl(e,0,(t=n||void 0===t?1:ir(t))<0?0:t):[]},Pn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,(t=l-(t=n||void 0===t?1:ir(t)))<0?0:t,l):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?ei(e,Xi(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?ei(e,Xi(t,3)):[]},Pn.tap=function(e,t){return t(e),e},Pn.throttle=function(e,t,l){var i=!0,o=!0;if("function"!=typeof e)throw new _e(n);return Va(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),ya(e,t,{leading:i,maxWait:t,trailing:o})},Pn.thru=la,Pn.toArray=nr,Pn.toPairs=Pr,Pn.toPairsIn=Rr,Pn.toPath=function(e){return wa(e)?ct(e,No):Qa(e)?[e]:Ei(Do(ur(e)))},Pn.toPlainObject=rr,Pn.transform=function(e,t,n){var l=wa(e),i=l||Ba(e)||Ja(e);if(t=Xi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:Va(e)&&ja(o)?Rn(Ve(e)):{}}return(i?lt:ul)(e,function(e,l,i){return t(n,e,l,i)}),n},Pn.unary=function(e){return _a(e,1)},Pn.union=Ko,Pn.unionBy=Yo,Pn.unionWith=qo,Pn.uniq=function(e){return e&&e.length?Zl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Zl(e,Xi(t,2)):[]},Pn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zl(e,void 0,t):[]},Pn.unset=function(e,t){return null==e||Ql(e,t)},Pn.unzip=Go,Pn.unzipWith=Xo,Pn.update=function(e,t,n){return null==e?e:Jl(e,t,oi(n))},Pn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,oi(n),l)},Pn.values=Ir,Pn.valuesIn=function(e){return null==e?[]:Pt(e,Tr(e))},Pn.without=$o,Pn.words=jr,Pn.wrap=function(e,t){return Na(oi(t),e)},Pn.xor=Zo,Pn.xorBy=Qo,Pn.xorWith=Jo,Pn.zip=ea,Pn.zipObject=function(e,t){return li(e||[],t||[],zn)},Pn.zipObjectDeep=function(e,t){return li(e||[],t||[],Hl)},Pn.zipWith=ta,Pn.entries=Pr,Pn.entriesIn=Rr,Pn.extend=sr,Pn.extendWith=dr,Zr(Pn,Pn),Pn.add=uu,Pn.attempt=Wr,Pn.camelCase=Or,Pn.capitalize=xr,Pn.ceil=cu,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ar(n))==n?n:0),void 0!==t&&(t=(t=ar(t))==t?t:0),Xn(ar(e),t,n)},Pn.clone=function(e){return $n(e,4)},Pn.cloneDeep=function(e){return $n(e,5)},Pn.cloneDeepWith=function(e,t){return $n(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return $n(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Zn(e,t,yr(t))},Pn.deburr=Lr,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=su,Pn.endsWith=function(e,t,n){e=ur(e),t=$l(t);var l=e.length,i=n=void 0===n?l:Xn(ir(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Pn.eq=Ia,Pn.escape=function(e){return(e=ur(e))&&k.test(e)?e.replace(M,wt):e},Pn.escapeRegExp=function(e){return(e=ur(e))&&K.test(e)?e.replace(V,"\\$&"):e},Pn.every=function(e,t,n){var l=wa(e)?ot:nl;return n&&ao(e,t,n)&&(t=void 0),l(e,Xi(t,3))},Pn.find=aa,Pn.findIndex=Lo,Pn.findKey=function(e,t){return ft(e,Xi(t,3),ul)},Pn.findLast=ra,Pn.findLastIndex=wo,Pn.findLastKey=function(e,t){return ft(e,Xi(t,3),cl)},Pn.floor=du,Pn.forEach=ua,Pn.forEachRight=ca,Pn.forIn=function(e,t){return null==e?e:al(e,Xi(t,3),Tr)},Pn.forInRight=function(e,t){return null==e?e:rl(e,Xi(t,3),Tr)},Pn.forOwn=function(e,t){return e&&ul(e,Xi(t,3))},Pn.forOwnRight=function(e,t){return e&&cl(e,Xi(t,3))},Pn.get=Er,Pn.gt=Oa,Pn.gte=xa,Pn.has=function(e,t){return null!=e&&no(e,t,fl)},Pn.hasIn=_r,Pn.head=Fo,Pn.identity=qr,Pn.includes=function(e,t,n,l){e=Fa(e)?e:Ir(e),n=n&&!l?ir(n):0;var i=e.length;return n<0&&(n=an(i+n,0)),Za(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Pn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ir(n);return i<0&&(i=an(l+i,0)),_t(e,t,i)},Pn.inRange=function(e,t,n){return t=lr(t),void 0===n?(n=t,t=0):n=lr(n),function(e,t,n){return e>=rn(t,n)&&e<an(t,n)}(e=ar(e),t,n)},Pn.invoke=Sr,Pn.isArguments=La,Pn.isArray=wa,Pn.isArrayBuffer=Ma,Pn.isArrayLike=Fa,Pn.isArrayLikeObject=ka,Pn.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&vl(e)==r},Pn.isBuffer=Ba,Pn.isDate=Ua,Pn.isElement=function(e){return Ka(e)&&1===e.nodeType&&!Ga(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(wa(e)||"string"==typeof e||"function"==typeof e.splice||Ba(e)||Ja(e)||La(e)))return!e.length;var t=to(e);if(t==v||t==_)return!e.size;if(so(e))return!Al(e).length;for(var n in e)if(Te.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return Sl(e,t)},Pn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?Sl(e,t,void 0,n):!!l},Pn.isError=Ha,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=ja,Pn.isInteger=Wa,Pn.isLength=za,Pn.isMap=Ya,Pn.isMatch=function(e,t){return e===t||yl(e,t,Zi(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,yl(e,t,Zi(t),n)},Pn.isNaN=function(e){return qa(e)&&e!=+e},Pn.isNative=function(e){if(co(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Tl(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=qa,Pn.isObject=Va,Pn.isObjectLike=Ka,Pn.isPlainObject=Ga,Pn.isRegExp=Xa,Pn.isSafeInteger=function(e){return Wa(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=$a,Pn.isString=Za,Pn.isSymbol=Qa,Pn.isTypedArray=Ja,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Ka(e)&&to(e)==S},Pn.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==vl(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=wr,Pn.last=Ho,Pn.lastIndexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l;return void 0!==n&&(i=(i=ir(n))<0?an(l+i,0):rn(i,l-1)),t==t?function(e,t,n){for(var l=n+1;l--;)if(e[l]===t)return l;return l}(e,t,i):Et(e,gt,i,!0)},Pn.lowerCase=Mr,Pn.lowerFirst=Fr,Pn.lt=er,Pn.lte=tr,Pn.max=function(e){return e&&e.length?ll(e,qr,ml):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,Xi(t,2),ml):void 0},Pn.mean=function(e){return St(e,qr)},Pn.meanBy=function(e,t){return St(e,Xi(t,2))},Pn.min=function(e){return e&&e.length?ll(e,qr,Cl):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,Xi(t,2),Cl):void 0},Pn.stubArray=ou,Pn.stubFalse=au,Pn.stubObject=function(){return{}},Pn.stubString=function(){return""},Pn.stubTrue=function(){return!0},Pn.multiply=pu,Pn.nth=function(e,t){return e&&e.length?Il(e,ir(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Qr,Pn.now=Ea,Pn.pad=function(e,t,n){e=ur(e);var l=(t=ir(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Oi(Jt(i),n)+e+Oi(Qt(i),n)},Pn.padEnd=function(e,t,n){e=ur(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?e+Oi(t-l,n):e},Pn.padStart=function(e,t,n){e=ur(e);var l=(t=ir(t))?Wt(e):0;return t&&l<t?Oi(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),cn(ur(e).replace(Y,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ao(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=lr(e),void 0===t?(t=e,e=0):t=lr(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return rn(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Ml(e,t)},Pn.reduce=function(e,t,n){var l=wa(e)?dt:bt,i=arguments.length<3;return l(e,Xi(t,4),n,i,el)},Pn.reduceRight=function(e,t,n){var l=wa(e)?pt:bt,i=arguments.length<3;return l(e,Xi(t,4),n,i,tl)},Pn.repeat=function(e,t,n){return t=(n?ao(e,t,n):void 0===t)?1:ir(t),Fl(ur(e),t)},Pn.replace=function(){var e=arguments,t=ur(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var l=-1,i=(t=ai(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var o=null==e?void 0:e[No(t[l])];void 0===o&&(l=i,o=n),e=ja(o)?o.call(e):o}return e},Pn.round=vu,Pn.runInContext=e,Pn.sample=function(e){return(wa(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Fa(e))return Za(e)?Wt(e):e.length;var t=to(e);return t==v||t==_?e.size:Al(e).length},Pn.snakeCase=kr,Pn.some=function(e,t,n){var l=wa(e)?vt:Kl;return n&&ao(e,t,n)&&(t=void 0),l(e,Xi(t,3))},Pn.sortedIndex=function(e,t){return Yl(e,t)},Pn.sortedIndexBy=function(e,t,n){return ql(e,t,Xi(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Yl(e,t);if(l<n&&Ia(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return Yl(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return ql(e,t,Xi(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Yl(e,t,!0)-1;if(Ia(e[n],t))return n}return-1},Pn.startCase=Br,Pn.startsWith=function(e,t,n){return e=ur(e),n=null==n?0:Xn(ir(n),0,e.length),t=$l(t),e.slice(n,n+t.length)==t},Pn.subtract=mu,Pn.sum=function(e){return e&&e.length?At(e,qr):0},Pn.sumBy=function(e,t){return e&&e.length?At(e,Xi(t,2)):0},Pn.template=function(e,t,n){var l=Pn.templateSettings;n&&ao(e,t,n)&&(t=void 0),e=ur(e),t=dr({},t,l,Ui);var i,o,a=dr({},t.imports,l.imports,Ui),r=yr(a),u=Pt(a,r),c=0,s=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+s.source+"|"+(s===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(Te.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(p,function(t,n,l,a,r,u){return l||(l=a),d+=e.slice(c,u).replace(ce,Mt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),r&&(o=!0,d+="';\n"+r+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var m=Te.call(t,"variable")&&t.variable;if(m){if(Q.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(O,""):d).replace(x,"$1").replace(L,"$1;"),d="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")+d+"return __p\n}";var f=Wr(function(){return pe(r,v+"return "+d).apply(void 0,u)});if(f.source=d,Ha(f))throw f;return f},Pn.times=function(e,t){if((e=ir(e))<1||e>9007199254740991)return[];var n=4294967295,l=rn(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Xi(t));++n<e;)t(n);return i},Pn.toFinite=lr,Pn.toInteger=ir,Pn.toLength=or,Pn.toLower=function(e){return ur(e).toLowerCase()},Pn.toNumber=ar,Pn.toSafeInteger=function(e){return e?Xn(ir(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=ur,Pn.toUpper=function(e){return ur(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=ur(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=$l(t)))return e;var l=zt(e),i=zt(t);return ui(l,It(l,i),Ot(l,i)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ur(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=$l(t)))return e;var l=zt(e);return ui(l,0,Ot(l,zt(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ur(e))&&(n||void 0===t))return e.replace(Y,"");if(!e||!(t=$l(t)))return e;var l=zt(e);return ui(l,It(l,zt(t))).join("")},Pn.truncate=function(e,t){var n=30,l="...";if(Va(t)){var i="separator"in t?t.separator:i;n="length"in t?ir(t.length):n,l="omission"in t?$l(t.omission):l}var o=(e=ur(e)).length;if(Ft(e)){var a=zt(e);o=a.length}if(n>=o)return e;var r=n-Wt(l);if(r<1)return l;var u=a?ui(a,0,r).join(""):e.slice(0,r);if(void 0===i)return u+l;if(a&&(r+=u.length-r),Xa(i)){if(e.slice(r).search(i)){var c,s=u;for(i.global||(i=fe(i.source,ur(te.exec(i))+"g")),i.lastIndex=0;c=i.exec(s);)var d=c.index;u=u.slice(0,void 0===d?r:d)}}else if(e.indexOf($l(i),r)!=r){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},Pn.unescape=function(e){return(e=ur(e))&&F.test(e)?e.replace(w,Kt):e},Pn.uniqueId=function(e){var t=++be;return ur(e)+t},Pn.upperCase=Ur,Pn.upperFirst=Hr,Pn.each=ua,Pn.eachRight=ca,Pn.first=Fo,Zr(Pn,(ru={},ul(Pn,function(e,t){Te.call(Pn.prototype,t)||(ru[t]=e)}),ru),{chain:!1}),Pn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Pn[e].placeholder=Pn}),lt(["drop","take"],function(e,t){xn.prototype[e]=function(n){n=void 0===n?1:an(ir(n),0);var l=this.__filtered__&&!t?new xn(this):this.clone();return l.__filtered__?l.__takeCount__=rn(n,l.__takeCount__):l.__views__.push({size:rn(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},xn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),lt(["filter","map","takeWhile"],function(e,t){var n=t+1,l=1==n||3==n;xn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");xn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");xn.prototype[e]=function(){return this.__filtered__?new xn(this):this[n](1)}}),xn.prototype.compact=function(){return this.filter(qr)},xn.prototype.find=function(e){return this.filter(e).head()},xn.prototype.findLast=function(e){return this.reverse().find(e)},xn.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new xn(this):this.map(function(n){return hl(n,e,t)})}),xn.prototype.reject=function(e){return this.filter(Ca(Xi(e)))},xn.prototype.slice=function(e,t){e=ir(e);var n=this;return n.__filtered__&&(e>0||t<0)?new xn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ir(t))<0?n.dropRight(-t):n.take(t-e)),n)},xn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},xn.prototype.toArray=function(){return this.take(4294967295)},ul(xn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Pn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Pn.prototype[t]=function(){var t=this.__wrapped__,a=l?[1]:arguments,r=t instanceof xn,u=a[0],c=r||wa(t),s=function(e){var t=i.apply(Pn,st([e],a));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(r=c=!1);var d=this.__chain__,p=!!this.__actions__.length,v=o&&!d,m=r&&!p;if(!o&&c){t=m?t:new xn(this);var f=e.apply(t,a);return f.__actions__.push({func:la,args:[s],thisArg:void 0}),new On(f,d)}return v&&m?e.apply(this,a):(f=this.thru(s),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=he[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Pn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(wa(i)?i:[],e)}return this[n](function(n){return t.apply(wa(n)?n:[],e)})}}),ul(xn.prototype,function(e,t){var n=Pn[t];if(n){var l=n.name+"";Te.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],xn.prototype.clone=function(){var e=new xn(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},xn.prototype.reverse=function(){if(this.__filtered__){var e=new xn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},xn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=wa(e),l=t<0,i=n?e.length:0,o=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var o=n[l],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=rn(t,e+a);break;case"takeRight":e=an(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,r=o.end,u=r-a,c=l?r:a-1,s=this.__iteratees__,d=s.length,p=0,v=rn(u,this.__takeCount__);if(!n||!l&&i==u&&v==u)return ti(e,this.__actions__);var m=[];e:for(;u--&&p<v;){for(var f=-1,E=e[c+=t];++f<d;){var _=s[f],h=_.type,g=(0,_.iteratee)(E);if(2==h)E=g;else if(!g){if(1==h)continue e;break e}}m[p++]=E}return m},Pn.prototype.at=ia,Pn.prototype.chain=function(){return na(this)},Pn.prototype.commit=function(){return new On(this.value(),this.__chain__)},Pn.prototype.next=function(){void 0===this.__values__&&(this.__values__=nr(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof In;){var l=Ro(n);l.__index__=0,l.__values__=void 0,t?i.__wrapped__=l:t=l;var i=l;n=n.__wrapped__}return i.__wrapped__=e,t},Pn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof xn){var t=e;return this.__actions__.length&&(t=new xn(this)),(t=t.reverse()).__actions__.push({func:la,args:[Vo],thisArg:void 0}),new On(t,this.__chain__)}return this.thru(Vo)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,Tt&&(Pn.prototype[Tt]=function(){return this}),Pn}();Ke?((Ke.exports=Yt)._=Yt,Ve._=Yt):ze._=Yt}).call(p)});const f=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},E=e=>{if(e){const t=new Date(e);let n=t.getMonth()+1,l=t.getDate(),i=t.getFullYear();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,i+"-"+n+"-"+l}return null},h=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},g=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e},S=[{head:"ES_TITILE_OWNER_DETAILS",body:[{route:"info",component:"PTRServiceDoc",nextStep:"owners",key:"Documents"},{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"property-details",texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"property-details",component:"PropertySearch",withoutLabel:!0,key:"propertyDetails",type:"component",nextStep:"address",hideInEmployee:!0,isMandatory:!0,texts:{submitBarLabel:"COMMON_NEXT",header:"PROPERTY_DETAILS_HEADER"}},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},key:"address",nextStep:"documents",isMandatory:!0,type:"component"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]}];function y(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function T(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}function b(e){var i,o;let{t:a,document:r,setDocuments:c,setError:s,documents:d,id:p,renewApplication:v,user:m}=e;const f=null==d?void 0:d.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],E=null==v||null===(i=v.documents)||void 0===i?void 0:i.find(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)}),[_,h]=n.useState(!1),[g,S]=n.useState(E?u({},E,{active:!0===(null==r?void 0:r.active),code:null==E?void 0:E.documentType,i18nKey:null==E?void 0:E.documentType}):1===(null==r||null===(o=r.dropdownData)||void 0===o?void 0:o.length)?null==r?void 0:r.dropdownData[0]:u({},f,{active:!0===(null==r?void 0:r.active),code:null==f?void 0:f.documentType,i18nKey:null==f?void 0:f.documentType.replaceAll(".","_")})),b=()=>l.createElement("div",{className:"loading-spinner"}),[A,C]=n.useState(null),[D,N]=n.useState(()=>(null==f?void 0:f.filestoreId)||null),{dropdownData:P}=r;var R=P;const[I,O]=n.useState(!1);return n.useEffect(()=>{var e;null==v||null===(e=v.documents)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==r?void 0:r.code)&&N(e)})},[null==v?void 0:v.documents]),n.useEffect(()=>{null!=g&&g.code&&null!=v&&v.applicationNumber?c(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==D?void 0:D.length)||null===D?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==D),{documentType:null==g?void 0:g.code,filestoreId:null==D?void 0:D.documentUid,documentUid:null==D?void 0:D.documentUid}]}):null!=g&&g.code&&c(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==D?void 0:D.length)||null===D?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==D),{documentType:null==g?void 0:g.code,filestoreId:D,documentUid:D}]})},[D,g]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)s(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=T(function(){return y(function(){return N(null),h(!0),Promise.resolve(Digit.UploadServices.Filestorage("PTR",A,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):s(a("CS_FILE_UPLOAD_ERROR"))})},function(){s(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(h(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{I&&N(null)},[I]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==r?void 0:r.code.replaceAll(".","_"))," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:g,style:{width:"EMPLOYEE"===(null==m?void 0:m.type)?"50%":"100%"},option:R.map(e=>{var t;return u({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>S(e),optionKey:"i18nKey",t:a})):l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a(null==r?void 0:r.code.replaceAll(".","_"))," ",l.createElement("span",{className:"astericColor"},"*"))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"}),l.createElement("div",{className:"field"},l.createElement(t.UploadFile,{onUpload:function(e){C(e.target.files[0])},onDelete:()=>{N(null)},id:p,message:_?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(b,null),l.createElement("span",null,"Uploading...")):D?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!D}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const A=e=>{var n,o,a;let{data:r,OpenImage:u}=e;const{t:c}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement(t.TelePhone,{mobile:r.mobileNumber}),r.source&&l.createElement("p",null,c("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(Reason,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)},C=e=>{var a,r,u,c,s,d,p;const{t:v}=i.useTranslation(),m=null==e||null===(a=e.application)||void 0===a||null===(r=a.workflow)||void 0===r?void 0:r.businessService,{isLoading:f,data:E}=Digit.Hooks.useWorkflowDetails({tenantId:null===(u=e.application)||void 0===u?void 0:u.tenantId,id:null===(c=e.application)||void 0===c?void 0:c.applicationNumber,moduleCode:m});function _(e){var t;window.open(null==e||null===(t=e.fullImage)||void 0===t?void 0:t[0],"_blank")}const h=t=>{if("OPEN"===t.state){var n,i;const o={date:null==t||null===(n=t.auditDetails)||void 0===n?void 0:n.lastModified,source:(null===(i=e.application)||void 0===i?void 0:i.channel)||""};return l.createElement(A,{data:o})}if(t.state){var o,a,r,u,c;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(a=t.assignes)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(A,{data:e,OpenImage:_})}{var s,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(s=e.application)||void 0===s?void 0:s.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:v(null==t?void 0:t.comment)};return l.createElement(A,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==E||null===(s=E.timeline)||void 0===s?void 0:s.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=E&&E.timeline&&1===(null==E||null===(d=E.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:v((null==E||null===(p=E.timeline[0])||void 0===p?void 0:p.state)&&"WF_"+m+"_"+E.timeline[0].state||"NA"),customChild:h(null==E?void 0:E.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==E?void 0:E.timeline)&&(null==E?void 0:E.timeline.map((e,n,i)=>{var o;return l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,label:v("ES_PTR_COMMON_STATUS_"+(null==E||null===(o=E.processInstances[n].state)||void 0===o?void 0:o.state)),customChild:h(e)}))})))),E&&(n=>{var i,a,r;let u=n[0];const c=n.map(e=>e.action);if(c.includes("PAY")||c.includes("EDIT")){let e=c.indexOf("EDIT")||c.indexOf("PAY");e=-1!=e?e:c.indexOf("PAY"),u=n[e]}switch(null===(i=u)||void 0===i?void 0:i.action){case"PAY":return"citizen"===(null==e?void 0:e.userType)?l.createElement("div",{style:{marginTop:"1em",bottom:"0px",width:"100%",marginBottom:"1.2em"}},l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/payment/my-bills/"+m+"/"+(null==e||null===(a=e.application)||void 0===a?void 0:a.applicationNumber),state:{tenantId:e.application.tenantId,applicationNumber:null==e||null===(r=e.application)||void 0===r?void 0:r.applicationNumber}}},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==E?void 0:E.nextActions))},D=["path","url"],N=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],P=()=>{var e,n,a,r,s,d;const p=o.useRouteMatch(),{path:v}=p,{t:m}=(c(p,D),i.useTranslation()),f=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRCreatePet"),E=null===(a=Digit)||void 0===a||null===(r=a.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRApplicationDetails"),_=null===(s=Digit)||void 0===s||null===(d=s.ComponentRegistryService)||void 0===d?void 0:d.getComponent("PTRMyApplications");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(h=N)&&(h=[]),h.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:v+"/petservice/new-application",component:f}),l.createElement(t.PrivateRoute,{path:v+"/petservice/revised-application",component:f}),l.createElement(t.PrivateRoute,{path:v+"/petservice/application/:acknowledgementIds/:tenantId",component:E}),l.createElement(t.PrivateRoute,{path:v+"/petservice/my-applications",component:_}),l.createElement(t.PrivateRoute,{path:v+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:m,parentRoute:v}))}))));var h},R=e=>{let{jumpTo:n}=e;const{t:a}=i.useTranslation(),r=o.useHistory();return l.createElement(t.LinkButton,{label:a("CS_COMMON_CHANGE"),className:"check-page-link-button",onClick:function(){r.push(n)}})},I=e=>e.substr(0,1).toUpperCase()+e.substr(1),O=(e,t)=>{let n=[{title:t("PTR_PET_NAME"),value:null==e?void 0:e.petDetails.petName},{title:t("PTR_PET_TYPE"),value:null==e?void 0:e.petDetails.petType},{title:t("PTR_BREED_TYPE"),value:null==e?void 0:e.petDetails.breedType},{title:t("PTR_VACCINATED_DATE"),value:null==e?void 0:e.petDetails.lastVaccineDate},{title:t("PTR_VACCINATION_NUMBER"),value:null==e?void 0:e.petDetails.vaccinationNumber},{title:t("PTR_DOCTOR_NAME"),value:null==e?void 0:e.petDetails.doctorName},{title:t("PTR_CLINIC_NAME"),value:null==e?void 0:e.petDetails.clinicName},{title:t("PTR_PET_AGE"),value:(null==e?void 0:e.petDetails.petAge)+" Months"},{title:t("PTR_PET_SEX"),value:null==e?void 0:e.petDetails.petGender}];return{title:t("ES_TITILE_PET_DETAILS"),values:n}},x=function(e,t,n){try{var l;function i(l){var i,o,a,r,u,c,s,d;return{t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(d=n("ULBGRADE_"+(null==t||null===(i=t.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),d.toLowerCase().split(" ").map(I).join(" ")),email:null==t?void 0:t.emailId,phoneNumber:null==t?void 0:t.contactNumber,heading:n("PTR_ACKNOWLEDGEMENT"),details:[{title:n("CS_TITLE_APPLICATION_DETAILS"),values:[{title:n("PTR_APPLICATION_NUMBER"),value:null==e?void 0:e.applicationNumber},{title:n("PTR_VALIDITY_DATE"),value:(s=null==e?void 0:e.validityDate,s?new Date(1e3*s).getDate()+"/"+(new Date(1e3*s).getMonth()+1)+"/"+new Date(1e3*s).getFullYear().toString():"NA")},{title:n("PTR_APPLICANT_NAME"),value:null==e?void 0:e.applicantName},{title:n("CS_APPLICATION_DETAILS_APPLICATION_DATE"),value:Digit.DateUtils.ConvertTimestampToDate(null==e||null===(o=e.auditDetails)||void 0===o?void 0:o.createdTime,"dd/MM/yyyy")},{title:n("PTR_MOBILE_NUMBER"),value:null==e?void 0:e.mobileNumber},{title:n("PTR_EMAIL_ID"),value:null==e?void 0:e.emailId}]},O(e,n),{title:n("PTR_LOCATION_DETAILS"),values:[{title:n("PTR_PINCODE"),value:null==e||null===(a=e.address)||void 0===a?void 0:a.pincode},{title:n("PTR_CITY"),value:null==e||null===(r=e.address)||void 0===r?void 0:r.city},{title:n("PTR_STREET_NAME"),value:null==e||null===(u=e.address)||void 0===u?void 0:u.street},{title:n("PTR_HOUSE_NO"),value:null==e||null===(c=e.address)||void 0===c?void 0:c.doorNo}]}]}}const o=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.fileStoreId);return Promise.resolve((null==o?void 0:o.length)>0?Promise.resolve(Digit.UploadServices.Filefetch(o,Digit.ULBService.getStateId())).then(i):i())}catch(e){return Promise.reject(e)}},L=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("revised-application")?t("PTR_REVISED_SUCCESSFULLY"):t("ES_PTR_RESPONSE_CREATE_ACTION"):e.isLoading?t("CS_PTR_APPLICATION_PENDING"):e.isSuccess?void 0:t("CS_PTR_APPLICATION_FAILED")},w={padding:"4px 0px",justifyContent:"space-between"},M=e=>{var n;return l.createElement(t.Banner,{message:L(e),applicationNumber:null===(n=e.data)||void 0===n?void 0:n.PetRegistrationApplications[0].applicationNumber,info:e.isSuccess?e.t("PTR_APPLICATION_NO"):"",successful:e.isSuccess,style:{width:"100%"}})},F=e=>{var n;let{application:a,buttonLabel:r}=e;const{t:u}=i.useTranslation(),c=o.useHistory();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_NO_LABEL"),note:null==a?void 0:a.applicationNumber}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICANT_NAME"),note:null==a?void 0:a.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_TYPE"),note:null==a?void 0:a.applicationType}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_STATUS"),note:null==a?void 0:a.status}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==a||null===(n=a.petDetails)||void 0===n?void 0:n.petType}),"Expired"==(null==a?void 0:a.status)&&l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal",onSubmit:()=>{var e;sessionStorage.setItem("petId",null==a?void 0:a.applicationNumber),null!=a&&a.petToken&&(null==a||null===(e=a.petToken)||void 0===e?void 0:e.length)>0&&sessionStorage.setItem("petToken",null==a?void 0:a.petToken),c.push("/digit-ui/citizen/ptr/petservice/revised-application")}}),l.createElement(o.Link,{to:"/digit-ui/citizen/ptr/petservice/application/"+(null==a?void 0:a.applicationNumber)+"/"+(null==a?void 0:a.tenantId)},l.createElement(t.SubmitBar,{label:r})))};var k,B=Array.isArray,U="object"==typeof p&&p&&p.Object===Object&&p,H="object"==typeof self&&self&&self.Object===Object&&self,j=U||H||Function("return this")(),W=j.Symbol,z=Object.prototype,V=z.hasOwnProperty,K=z.toString,Y=W?W.toStringTag:void 0,q=Object.prototype.toString,G=W?W.toStringTag:void 0,X=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":G&&G in Object(e)?function(e){var t=V.call(e,Y),n=e[Y];try{e[Y]=void 0;var l=!0}catch(e){}var i=K.call(e);return l&&(t?e[Y]=n:delete e[Y]),i}(e):function(e){return q.call(e)}(e)},$=function(e){return null!=e&&"object"==typeof e},Z=function(e){return"symbol"==typeof e||$(e)&&"[object Symbol]"==X(e)},Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,ee=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},te=function(e){if(!ee(e))return!1;var t=X(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ne=j["__core-js_shared__"],le=(k=/[^.]+$/.exec(ne&&ne.keys&&ne.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",ie=Function.prototype.toString,oe=function(e){if(null!=e){try{return ie.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ae=/^\[object .+?Constructor\]$/,re=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ue=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!ee(e)||(t=e,le&&le in t))&&(te(e)?re:ae).test(oe(e));var t}(n)?n:void 0},ce=ue(Object,"create"),se=Object.prototype.hasOwnProperty,de=Object.prototype.hasOwnProperty;function pe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}pe.prototype.clear=function(){this.__data__=ce?ce(null):{},this.size=0},pe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},pe.prototype.get=function(e){var t=this.__data__;if(ce){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return se.call(t,e)?t[e]:void 0},pe.prototype.has=function(e){var t=this.__data__;return ce?void 0!==t[e]:de.call(t,e)},pe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ce&&void 0===t?"__lodash_hash_undefined__":t,this};var ve=pe,me=function(e,t){return e===t||e!=e&&t!=t},fe=function(e,t){for(var n=e.length;n--;)if(me(e[n][0],t))return n;return-1},Ee=Array.prototype.splice;function _e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}_e.prototype.clear=function(){this.__data__=[],this.size=0},_e.prototype.delete=function(e){var t=this.__data__,n=fe(t,e);return!(n<0||(n==t.length-1?t.pop():Ee.call(t,n,1),--this.size,0))},_e.prototype.get=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]},_e.prototype.has=function(e){return fe(this.__data__,e)>-1},_e.prototype.set=function(e,t){var n=this.__data__,l=fe(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var he=_e,ge=ue(j,"Map"),Se=function(e,t){var n,l,i=e.__data__;return("string"==(l=typeof(n=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function ye(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}ye.prototype.clear=function(){this.size=0,this.__data__={hash:new ve,map:new(ge||he),string:new ve}},ye.prototype.delete=function(e){var t=Se(this,e).delete(e);return this.size-=t?1:0,t},ye.prototype.get=function(e){return Se(this,e).get(e)},ye.prototype.has=function(e){return Se(this,e).has(e)},ye.prototype.set=function(e,t){var n=Se(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Te=ye;function be(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");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(be.Cache||Te),n}be.Cache=Te;var Ae,Ce,De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ne=/\\(\\)?/g,Pe=(Ae=be(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(De,function(e,n,l,i){t.push(l?i.replace(Ne,"$1"):n||e)}),t},function(e){return 500===Ce.size&&Ce.clear(),e}),Ce=Ae.cache,Ae),Re=W?W.prototype:void 0,Ie=Re?Re.toString:void 0,Oe=function(e){if("string"==typeof e||Z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},xe=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return B(e)?e:function(e,t){if(B(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Z(e))||J.test(e)||!Q.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Pe(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(B(t))return function(e,t){for(var n=-1,l=null==e?0:e.length,i=Array(l);++n<l;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(Z(t))return Ie?Ie.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[Oe(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Le=["tenantId","payments"],we=e=>{let{t:n,currentPage:i,columns:o,data:a,getCellProps:r,disableSort:u,onSort:c,onNextPage:s,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:v,sortParams:m,totalRecords:f}=e;return l.createElement(t.Table,{t:n,data:a,currentPage:i,columns:o,getCellProps:r,onNextPage:s,onPrevPage:d,pageSizeLimit:v,disableSort:u,onPageSizeChange:p,onSort:c,sortParams:m,totalRecords:f})},Me=e=>{let{businessService:a}=e;const{t:r}=i.useTranslation(),u=[{text:"ES_TITLE_NEW_PET_REGISTRATION",link:"/digit-ui/employee/ptr/new-application",businessService:"ptr",roles:["PT_CEMP"]},{text:"PTR_SEARCH_PET",link:"/digit-ui/employee/ptr/search",businessService:"ptr",roles:[]},{text:"PTR_COMMON_APPLICATION_SEARCH",link:"/digit-ui/employee/ptr/application-search",businessService:"ptr",roles:[]}],[c,s]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===a).filter(e=>{let{roles:t}=e;return t.some(e=>d.map(e=>{let{code:t}=e;return t}).includes(e))||!(null!=t&&t.length)});s(e)},[]),l.createElement(t.Card,{className:"employeeCard filter inboxLinks"},l.createElement("div",{className:"complaint-links-container"},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.PropertyHouse,null))," ",l.createElement("span",{className:"text"},r("PET_SERVICE"))),l.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:i,hyperlink:a=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},a?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},r(i)))}))))},Fe={date:t.DatePicker,mobileNumber:t.MobileNumber},ke=e=>{var n;let{onSearch:o,type:r,onClose:c,searchFields:s,searchParams:d,isInboxPage:p,clearSearch:v}=e;const{t:m}=i.useTranslation(),{handleSubmit:f,reset:E,watch:_,control:h,formState:g,setValue:S}=a.useForm({defaultValues:p?d:u({locality:null,city:null},d)}),y=_(),T=innerWidth<=640;function b(){const e=s.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(E(e),p){const e=u({},d);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(u({},e))}else v()}const A=e=>l.createElement(t.LinkLabel,{style:u({display:"inline"},e?{margin:0}:{}),onClick:b},m("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:f(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],s.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(e),"mobile"===r&&c()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:p?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===r||T)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,m("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:c},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(p?"":"for-search"),style:{width:"100%",display:"grid"}},null==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,r;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,m(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(a.Controller,e.type?{render:t=>l.createElement(null==Fe?void 0:Fe[e.type],{formValue:y,setValue:S,onChange:t.onChange,value:t.value}),name:e.name,control:h,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:h,defaultValue:""})),null!=g&&null!==(i=g.dirtyFields)&&void 0!==i&&i[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==g||null===(o=g.errors)||void 0===o||null===(r=o[e.name])||void 0===r?void 0:r.message):null)}),p&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,A())),"desktop"===r&&!T&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:m("ES_COMMON_SEARCH"),disabled:!!Object.keys(g.errors).length||(()=>{var e;let t=!0;return Object.keys(y).forEach(e=>{!["locality","city"].includes(e)&&y[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=y&&null!==(e=y.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!p&&l.createElement("div",null,A()))))),("mobile"===r||T)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},A(T)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(g.errors).length,label:m("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},Be=["tableConfig","filterComponent"],Ue=e=>{let{tableConfig:o,filterComponent:a}=e,r=c(e,Be);const{data:u,useNewInboxAPI:s}=r,{t:d}=i.useTranslation(),[p,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a)}),[m,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r.EmptyResultInboxComp)}),[E,_]=n.useState(!1),h=l.useMemo(()=>r.isSearch?o.searchColumns(r):o.inboxColumns(r)||[],[]);let g;return r.isLoading?g=l.createElement(t.Loader,null):E?g=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?g=m&&l.createElement(m,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},d("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):l.createElement(t.Loader,null)):(null==u?void 0:u.length)>0&&(g=l.createElement(we,{t:d,data:u,columns:h,getCellProps:e=>({style:{minWidth:e.column.Header===d("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:r.onPageSizeChange,currentPage:r.currentPage,onNextPage:r.onNextPage,onPrevPage:r.onPrevPage,pageSizeLimit:r.pageSizeLimit,onSort:r.onSort,disableSort:r.disableSort,sortParams:r.sortParams,totalRecords:r.totalRecords})),l.createElement("div",{className:"inbox-container"},!r.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement(Me,{parentRoute:r.parentRoute,businessService:r.moduleCode}),l.createElement("div",null,l.createElement(p,{defaultSearchParams:r.defaultSearchParams,onFilterChange:r.onFilterChange,searchParams:r.searchParams,type:"desktop",useNewInboxAPI:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:r.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(ke,{defaultSearchParams:r.defaultSearchParams,onSearch:e=>{r.onSearch(e),_(!1)},type:"desktop",searchFields:r.searchFields,isInboxPage:!(null!=r&&r.isSearch),searchParams:r.searchParams,clearSearch:()=>_(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=r&&r.isSearch?"":"24px",flex:1}},g)))},He=e=>{const{t:o}=i.useTranslation(),[a,r]=n.useState(()=>{var t,n;return null!==(t=e.sortParams)&&void 0!==t&&null!==(n=t[0])&&void 0!==n&&n.desc?{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}});function u(){}return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading"},l.createElement("div",{className:"filter-label"},o("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:u},o("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:u},o("ES_COMMON_CLEAR_ALL")),"mobile"===e.type&&l.createElement("span",{onClick:e.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement(t.RadioButtons,{onSelect:function(t){e.onSort([{id:"createdTime",desc:"DESC"===t.code}]),e.onClose()},selectedOption:a,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},je=e=>{let{t:i,data:o,onFilterChange:a,onSearch:r,onSort:u,serviceRequestIdKey:c,isFstpOperator:s,isLoading:d,isSearch:p,searchParams:v,searchFields:m,sortParams:f,linkPrefix:E,filterComponent:_}=e;const[h,g]=n.useState(p?"SEARCH":""),[S,y]=n.useState(!!p),[T,b]=n.useState(f),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(_)});n.useEffect(()=>{h&&y(!0)},[h]);const C=()=>{y(!1),g(""),b(f)};if(d)return l.createElement(t.Loader,null);let D;return o&&0!==(null==o?void 0:o.length)?o&&(null==o?void 0:o.length)>0&&(D=l.createElement(t.DetailsCard,{data:o,serviceRequestIdKey:c,linkPrefix:E||"/digit-ui/employee/ptr/"})):D=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},r&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{g("SEARCH"),y(!0)}}),!p&&a&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{g("FILTER"),y(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{g("SORT"),y(!0)}})),D,S&&l.createElement(t.PopUp,null,"FILTER"===h&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{a(e),y(!1)},Close:C,type:"mobile",searchParams:v})),"SORT"===h&&l.createElement("div",{className:"popup-module"},l.createElement(He,{type:"mobile",sortParams:f,onClose:C,onSort:u})),"SEARCH"===h&&l.createElement("div",{className:"popup-module"},l.createElement(ke,{type:"mobile",onClose:C,onSearch:r,isFstpOperator:s,searchParams:v,searchFields:m}))))},We=e=>{let{linkPrefix:a,classNameForMobileView:r=""}=e;const{t:u}=i.useTranslation(),c=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:a+"/search"}],[s,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];c.forEach(t=>{var n;t.accessTo?(n=t.accessTo,p.filter(e=>n.includes(e.code)).length&&e.push(t)):e.push(t)}),d(e)},[]),l.createElement(t.Card,{className:"employeeCard filter"},l.createElement("div",{className:"complaint-links-container "+r},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.ShippingTruck,null))," ",l.createElement("span",{className:"text"},u("ES_TITLE_PET_REGISTRATION"))),l.createElement("div",{className:"body"},s.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},ze=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:a,onFilterChange:r,onSearch:u,onSort:c,parentRoute:s,searchParams:d,sortParams:p,linkPrefix:v,tableConfig:m,filterComponent:f}=e;const{t:E}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(We,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(je,{t:E,data:null==t?void 0:t.map(e=>{const t={};return(o?m.searchColumns():m.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:r,isLoading:n,isSearch:o,onSearch:u,onSort:c,searchParams:d,searchFields:a,linkPrefix:v,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:f}))))},Ve=["isFetching","isLoading","searchResponseKey","data","searchFields"],Ke=e=>{var o,a,r,s,d;let{useNewInboxAPI:p,parentRoute:v,moduleCode:m="PTR",initialStates:f={},filterComponent:E,isInbox:_,rawWfHandler:h,rawSearchHandler:g,combineResponse:S,wfConfig:y,searchConfig:T,middlewaresWf:b,middlewareSearch:A,EmptyResultInboxComp:C}=e;const D=Digit.ULBService.getCurrentTenantId(),{t:N}=i.useTranslation(),[P,R]=n.useState(()=>_?{}:{enabled:!1}),[I,O]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[x,L]=n.useState(f.pageOffset||0),[w,M]=n.useState(f.pageSize||10),[F,k]=n.useState(f.sortParams||[{id:"createdTime",desc:!0}]),[B,U]=n.useState(f.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),j=H?{limit:100,offset:0,sortBy:null==F||null===(o=F[0])||void 0===o?void 0:o.id,sortOrder:null!=F&&null!==(a=F[0])&&void 0!==a&&a.desc?"DESC":"ASC"}:{limit:w,offset:x,sortBy:null==F||null===(r=F[0])||void 0===r?void 0:r.id,sortOrder:null!=F&&null!==(s=F[0])&&void 0!==s&&s.desc?"DESC":"ASC"};const W=p?Digit.Hooks.useNewInboxGeneral({tenantId:D,ModuleCode:m,filters:u({},B,j,{sortParams:F})}):Digit.Hooks.useInboxGeneral({tenantId:D,businessService:m,isInbox:_,filters:u({},B,j,{sortParams:F}),rawWfHandler:h,rawSearchHandler:g,combineResponse:S,wfConfig:y,searchConfig:u({},P,T),middlewaresWf:b,middlewareSearch:A}),{isLoading:z,data:V,searchFields:K}=W,Y=c(W,Ve);n.useEffect(()=>{L(0)},[B]);const q=e=>{let t=e.delete,n=u({},B,e);t&&t.forEach(e=>delete n[e]),delete e.delete,U(u({},n)),R({enabled:!0})},G=n.useCallback(e=>{0!==e.length&&k(e)},[]);var X,$;if(null!==(null==Y||null===(d=Y.data)||void 0===d?void 0:d.length))return H?l.createElement(ze,{data:V,isLoading:z,isSearch:!_,searchFields:K,onFilterChange:q,onSearch:q,onSort:G,parentRoute:v,searchParams:B,sortParams:F,linkPrefix:v+"/application-details/",tableConfig:null!=Y&&Y.tableConfig?null===(X=res)||void 0===X?void 0:X.tableConfig:I(N).PTR,filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:p}):l.createElement("div",null,_&&l.createElement(t.Header,null,N("ES_COMMON_INBOX")),l.createElement(Ue,{moduleCode:m,data:V,tableConfig:I(N).PTR,isLoading:z,defaultSearchParams:f.searchParams,isSearch:!_,onFilterChange:q,searchFields:K,onSearch:q,onSort:G,onNextPage:()=>{L(e=>e+w)},onPrevPage:()=>{L(e=>e-w)},currentPage:Math.floor(x/w),pageSizeLimit:w,disableSort:!1,onPageSizeChange:e=>{M(Number(e.target.value))},parentRoute:v,searchParams:B,sortParams:F,totalRecords:Number(null==V||null===($=V[0])||void 0===$?void 0:$.totalCount),filterComponent:E,EmptyResultInboxComp:C,useNewInboxAPI:p}))},Ye=e=>{var i,r;let{isLoading:u,t:c,onSubmit:s,data:d,count:p,setShowToast:v}=e;const m=window.Digit.Utils.browser.isMobile(),{register:f,control:E,handleSubmit:_,setValue:h,getValues:g,reset:S,formState:y}=a.useForm({defaultValues:{offset:0,limit:!m&&10,sortBy:"commencementDate",sortOrder:"DESC"}});n.useEffect(()=>{f("offset",0),f("limit",10),f("sortBy","commencementDate"),f("sortOrder","DESC")},[f]);const T=[{code:"NEWAPPLICATION",i18nKey:"NEWAPPLICATION"},{code:"RENEWAPPLICATION",i18nKey:"RENEWAPPLICATION"}],b=Digit.ULBService.getStateId(),{data:A}=Digit.Hooks.ptr.usePTRPetMDMS(b,"PetService","PetType");let C=[];A&&A.map(e=>{C.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const D=e=>l.createElement("span",{className:"cell-text"},e),N=n.useMemo(()=>[{Header:c("PTR_APPLICATION_NUMBER"),accessor:"applicationNumber",disableSortBy:!0,Cell:e=>{let{row:t}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/employee/ptr/petservice/applicationsearch/application-details/"+t.original.applicationNumber},t.original.applicationNumber)))}},{Header:c("PTR_APPLICANT_NAME"),Cell:e=>{var t,n;return D(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.applicantName))},disableSortBy:!0},{Header:c("PTR_PET_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return D(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType))},disableSortBy:!0},{Header:c("PTR_BREED_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return D(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType))},disableSortBy:!0},{Header:c("PTR_MOBILE_NUMBER"),Cell:e=>{var t;let{row:n}=e;return D(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.mobileNumber))},disableSortBy:!0},{Header:c("PTR_APPLICATION_STATUS"),Cell:e=>{var t;let{row:n}=e;return D(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.status))},disableSortBy:!0}],[]),P=n.useCallback(e=>{0!==e.length&&(h("sortBy",e.id),h("sortOrder",e.desc?"DESC":"ASC"))},[]);function R(){h("offset",g("offset")-g("limit")),_(s)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,c("PTR_SEARCH_PET_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},c("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:s,handleSubmit:_},l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_APPLICATION_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:f({})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_SEARCH_PET_TYPE")),l.createElement(a.Controller,{control:E,name:"petType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:C,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_APPLICATION_TYPE")),l.createElement(a.Controller,{control:E,name:"applicationType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:T,optionKey:"i18nKey",t:c,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_OWNER_MOBILE_NO")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:c("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:c("CORE_COMMON_MOBILE_ERROR")}}),type:"number",componentInFront:l.createElement("div",{className:"employee-card-input employee-card-input--front"},"+91")}),l.createElement(t.CardLabelError,null,null==y||null===(i=y.errors)||void 0===i||null===(r=i.mobileNumber)||void 0===r?void 0:r.message)),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_FROM_DATE")),l.createElement(a.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"fromDate",control:E})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_TO_DATE")),l.createElement(a.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:E})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:c("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{S({applicationNumber:"",fromDate:"",toDate:"",petType:"",mobileNumber:"",status:"",breedType:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),R()}},c("ES_COMMON_CLEAR_ALL")))),!u&&null!=d&&d.display?l.createElement(t.Card,{style:{marginTop:20}},c(d.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):u||""===d?""!==d||u&&l.createElement(t.Loader,null):l.createElement(t.Table,{t:c,data:d,totalRecords:p,columns:N,getCellProps:e=>({style:{minWidth:e.column.Header===c("PTR_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){h("limit",Number(e.target.value)),_(s)()},currentPage:g("offset")/g("limit"),onNextPage:function(){h("offset",g("offset")+g("limit")),_(s)()},onPrevPage:R,pageSizeLimit:g("limit"),onSort:P,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})))},qe=e=>{o.useParams();const{t:a}=i.useTranslation(),r=Digit.ULBService.getCurrentTenantId(),[c,s]=n.useState({}),[d,p]=n.useState(null),v={enabled:!!(c&&Object.keys(c).length>0)},{isLoading:m,isSuccess:f,data:{PetRegistrationApplications:E,Count:_}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:r,filters:c},v);return l.createElement(l.Fragment,null,l.createElement(Ye,{t:a,isLoading:m,tenantId:r,setShowToast:p,onSubmit:function(e){var t=new Date(null==e?void 0:e.fromDate);null==t||t.setSeconds((null==t?void 0:t.getSeconds())-19800);var n=new Date(null==e?void 0:e.toDate);null==n||n.setSeconds((null==n?void 0:n.getSeconds())+86399-19800);const l=u({},e,e.toDate?{toDate:null==n?void 0:n.getTime()}:{},e.fromDate?{fromDate:null==t?void 0:t.getTime()}:{});let i=Object.keys(l).filter(e=>l[e]).reduce((e,t)=>u({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.entries(i).length>0)||i.applicationNumber||i.creationReason||i.fromDate||i.mobileNumber||i.applicationNumber||i.status||i.toDate?!(Object.entries(i).length>0&&(i.creationReason||i.status))||i.applicationNumber||i.fromDate||i.mobileNumber||i.applicationNumber||i.toDate?Object.entries(i).length>0&&i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?p({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):p({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):p({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:f&&!m?E.length>0?E:{display:"ES_COMMON_NO_DATA"}:"",count:_}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:a(d.label),isDleteBtn:!0,onClose:()=>{p(null)}}))},Ge=e=>{var n,a,r,c;let{path:s,userType:d}=e;const{t:p}=i.useTranslation(),v=o.useLocation();sessionStorage.removeItem("revalidateddone");const m=window.Digit.Utils.browser.isMobile(),f={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},E=e=>{let{location:n}=e;const{t:a}=i.useTranslation(),r=o.useLocation().search,u=(new URLSearchParams(r).get("from"),Digit.Hooks.useQueryParams(),[{path:"/digit-ui/employee",content:a("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/ptr/petservice/inbox",content:a("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/digit-ui/employee/ptr/petservice/my-applications",content:a("ES_COMMON_APPLICATION_SEARCH"),show:!(!n.pathname.includes("/ptr/petservice/my-applications")&&!n.pathname.includes("/ptr/applicationsearch/application-details/"))}]);return l.createElement(t.BreadCrumb,{style:m?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},_=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRNewApplication"),h=null===(r=Digit)||void 0===r||null===(c=r.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ApplicationDetails"),g=window.location.href.includes("ptr/response"),S=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return l.createElement(o.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},g?null:l.createElement("div",{style:S?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(E,{location:v})),l.createElement(t.PrivateRoute,{exact:!0,path:s+"/",component:()=>l.createElement(Xl,{matchPath:s,userType:d})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/inbox",component:()=>l.createElement(Ke,{useNewInboxAPI:!0,parentRoute:s,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:f,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/new-application",component:_}),l.createElement(t.PrivateRoute,{path:s+"/petservice/revised-application",component:_}),l.createElement(t.PrivateRoute,{path:s+"/petservice/application-details/:id",component:()=>l.createElement(h,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(h,{parentRoute:s})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:p,parentRoute:s}))}),l.createElement(t.PrivateRoute,{path:s+"/searchold",component:()=>l.createElement(Ke,{parentRoute:s,businessService:"ptr",middlewareSearch:searchMW,initialStates:f,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/my-applications",component:e=>l.createElement(qe,u({},e,{parentRoute:s}))}))))},Xe=e=>{var n;let{status:o,searchParams:a,onAssignmentChange:r,statusMap:c}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>r(u({},e,{state:o.state}),o),checked:null==a?void 0:a.applicationStatus.some(e=>e.uuid===o.uuid),label:o.name+" ("+((null==c||null===(n=c.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-")+")"})},$e=e=>{var o,a,r,c,s;let{onAssignmentChange:d,searchParams:p,businessServices:v,statusMap:m}=e;const{t:f}=i.useTranslation(),[E,_]=n.useState(!1),{data:h,isLoading:g}=Digit.Hooks.useApplicationStatusGeneral({businessServices:v},{}),{userRoleStates:S}=h||{},y=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_PTR_COMMON_STATUS_"+(e.state||"CREATED"));return g?l.createElement(t.Loader,null):null!=S&&S.filter(e=>!e.isTerminateState).length?l.createElement("div",{className:"status-container"},l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_INBOX_STATUS")),null==S||null===(o=S.filter(e=>!e.isTerminateState))||void 0===o||null===(a=o.slice(0,4))||void 0===a?void 0:a.map((e,t)=>l.createElement(Xe,{businessServices:v,key:t,onAssignmentChange:d,status:u({name:y(e,f),code:e.applicationStatus},e),searchParams:p,statusMap:m})),(null==S||null===(r=S.filter(e=>!e.isTerminateState))||void 0===r?void 0:r.slice(4).length)>0?l.createElement(l.Fragment,null,E&&(null==S||null===(c=S.filter(e=>!e.isTerminateState))||void 0===c||null===(s=c.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement(Xe,{businessServices:v,key:e.uuid,onAssignmentChange:d,status:u({name:y(e,f),code:e.applicationStatus},e),searchParams:p,statusMap:m}))),l.createElement("div",{className:"filter-button",onClick:()=>_(!E)}," ",f(E?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},Ze=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],Qe=e=>{var o;let{searchParams:a,onFilterChange:s,defaultSearchParams:d,statusMap:p,moduleCode:v}=e,m=c(e,Ze);const{t:f}=i.useTranslation(),E=r.useQueryClient(),[_,h]=n.useState(()=>u({},a,{services:[]})),g=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],S=e=>{let t=e.delete,n=u({},_,e);t&&t.forEach(e=>delete n[e]),delete e.delete,h(u({},n))},y=()=>{h(u({},d,{services:[]})),s(u({},d))},T=Digit.ULBService.getCurrentTenantId();return l.createElement(l.Fragment,null,l.createElement("div",{className:"filter"},l.createElement("div",{className:"filter-card"},l.createElement("div",{className:"heading",style:{alignItems:"center"}},l.createElement("div",{className:"filter-label",style:{display:"flex",alignItems:"center"}},l.createElement("span",null,l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M0.66666 2.48016C3.35999 5.9335 8.33333 12.3335 8.33333 12.3335V20.3335C8.33333 21.0668 8.93333 21.6668 9.66666 21.6668H12.3333C13.0667 21.6668 13.6667 21.0668 13.6667 20.3335V12.3335C13.6667 12.3335 18.6267 5.9335 21.32 2.48016C22 1.60016 21.3733 0.333496 20.2667 0.333496H1.71999C0.613327 0.333496 -0.01334 1.60016 0.66666 2.48016Z",fill:"#505A5F"}))),l.createElement("span",{style:{marginLeft:"8px",fontWeight:"normal"}},f("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:y},f("ES_COMMON_CLEAR_ALL")),"desktop"===m.type&&l.createElement("span",{className:"clear-search",onClick:y,style:{border:"1px solid #e0e0e0",padding:"6px"}},l.createElement("svg",{width:"17",height:"17",viewBox:"0 0 16 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M8 5V8L12 4L8 0V3C3.58 3 0 6.58 0 11C0 12.57 0.46 14.03 1.24 15.26L2.7 13.8C2.25 12.97 2 12.01 2 11C2 7.69 4.69 5 8 5ZM14.76 6.74L13.3 8.2C13.74 9.04 14 9.99 14 11C14 14.31 11.31 17 8 17V14L4 18L8 22V19C12.42 19 16 15.42 16 11C16 9.43 15.54 7.97 14.76 6.74Z",fill:"#505A5F"}))),"mobile"===m.type&&l.createElement("span",{onClick:m.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_INBOX_LOCALITY"),":"),l.createElement(t.Localities,{selectLocality:e=>{S({locality:[...(null==_?void 0:_.locality)||[],e]})},tenantId:T,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==_||null===(o=_.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:f(e.i18nkey),onClick:()=>{S({locality:null==_?void 0:_.locality.filter(t=>t.code!==e.code)})}})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},f("ES_PTR_APP_TYPE")),g.map((e,n)=>{var i;const o=null==_||null===(i=_.services)||void 0===i?void 0:i.includes(e.value);return l.createElement(t.CheckBox,{key:n+"service",label:f(e.label),value:e.label,checked:o,onChange:t=>((e,t)=>{var n;S(e.target.checked?{services:Array.isArray(_.services)?[..._.services,t]:[t]}:{services:_.services.filter(e=>e!==t),applicationStatus:null===(n=_.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement($e,{searchParams:_,businessServices:_.services,statusMap:p||E.getQueryData("INBOX_STATUS_MAP_"+v),moduleCode:v,onAssignmentChange:(e,t)=>{if(e.target.checked)S({applicationStatus:[...null==_?void 0:_.applicationStatus,t]});else{let e=null==_?void 0:_.applicationStatus.filter(e=>e.state!==t.state);S({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{s(0===_.services.length?u({},_,{services:g.map(e=>e.value)}):_)},label:f("ES_COMMON_APPLY")}))))))},Je=e=>l.createElement("span",{className:"cell-text"},e),et=e=>l.createElement("span",{className:"sla-cell"},e),tt=e=>l.createElement("h1",{className:"heading-m"},e.label),nt=()=>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"})),lt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nt,null)),it=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f,isLoading:E}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:_,data:h}=Digit.Hooks.pt.useMDMS(c,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,S]=n.useState({}),[T,b]=n.useState({}),[A,C]=n.useState([]),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,O]=n.useState(null),[x,L]=n.useState(null),[w,M]=n.useState([]),[F,k]=n.useState(null),[B,U]=n.useState(!1);function H(e){R(e.target.files[0])}return n.useEffect(()=>{var e;h&&h["egf-master"]&&M(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]),n.useEffect(()=>{var e;C(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{L(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)L(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",P,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?O(null==e||null===(l=e.data)||void 0===l||null===(i=l.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)}}()},[P]),n.useEffect(()=>{r&&S(null!=r&&r.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:a,setSelectedFinancialYear:r}=e;return{label:{heading:"WF_"+i.action+"_APPLICATION",submit:"WF_PT.CREATE_"+i.action,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:n("ES_PT_FINANCIAL_YEARS"),isMandatory:!0,type:"radio",populators:l.createElement(t.RadioButtons,{options:o,optionsKey:"name",onSelect:r,selectedOption:a})}]}]}})({t:a,action:r,financialYears:w,selectedFinancialYear:F,setSelectedFinancialYear:k}):(e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||"SENDBACKTOCITIZEN"===(null==o?void 0:o.action)?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("ES_PT_ATTACH_FILE")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:A,selectedApprover:D,setSelectedApprover:N,selectFile:H,uploadedFile:I,setUploadedFile:O,businessService:v}))},[r,A,w,F,I]),r&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tt,{label:a(g.label.heading)}),headerBarEnd:l.createElement(lt,{onClick:s}),actionCancelLabel:a(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:r.showFinancialYearsModal?!F:E||(null==r?void 0:r.docUploadRequired)&&!I,formId:"modal-action"},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==r?void 0:r.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};p.creationReason="STATUS",d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Property:u({},p,{workflow:t})})}else if(null!=r&&r.showFinancialYearsModal)d({customFunctionToExecute:null==r?void 0:r.customFunctionToExecute,Assessment:{financialYear:null==F?void 0:F.name,propertyId:null==p?void 0:p.propertyId,tenantId:c,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:m};t.assignes=null!=r&&r.isTerminateState||!D?[]:[D],I&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:I}]),d({Property:u({},p,{workflow:t})})}},defaultValues:T,formId:"modal-action"})):l.createElement(t.Loader,null)},ot=e=>l.createElement("h1",{className:"heading-m"},e.label),at=()=>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"})),rt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(at,null)),ut=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),{isLoading:f,data:E}=Digit.Hooks.pt.useMDMS(c,v,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[_,h]=n.useState({}),[g,S]=n.useState({}),[T,b]=n.useState([]),[A,C]=n.useState({}),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,O]=n.useState(null),[x,L]=n.useState([]),[w,M]=n.useState(null);function F(e){N(e.target.files[0])}return n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]),n.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]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",D,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.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)}}()},[D]),n.useEffect(()=>{r&&h((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d}=e,p=!0;return"SENDBACKTOCITIZEN"!=(null==i?void 0:i.action)&&"APPROVE"!=(null==i?void 0:i.action)||(p=!1),i.isTerminateState&&(p=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:p?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:p?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:p?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("TL_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:T,selectedApprover:A,setSelectedApprover:C,selectFile:F,uploadedFile:P,setUploadedFile:R,businessService:v}))},[r,T,x,w,P]),r&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ot,{label:a(_.label.heading)}),headerBarEnd:l.createElement(rt,{onClick:s}),actionCancelLabel:a(_.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(_.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=u({},p,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,wfDocuments:P?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null}),d({Licenses:[p]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},ct=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),st=()=>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"})),dt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(st,null)),pt=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,T]=n.useState([]),[b,A]=n.useState({}),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;T(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,Digit.ULBService.getStateId()||(null==c?void 0:c.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,approvers:o,selectedApprover:a,setSelectedApprover:r,selectFile:u,uploadedFile:c,setUploadedFile:s,businessService:d,error:p}=e,v=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(v=!1),i.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:v?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:r,selected:a}):null},{label:n("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("BPA_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:u,onDelete:()=>{s(null)},message:c?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:x,uploadedFile:N,setUploadedFile:P,businessService:v,error:R}))},[r,S,N,R]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ct,{label:a(E.label.heading)}),headerBarEnd:l.createElement(dt,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.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(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=u({},p,{action:null==r?void 0:r.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null}),d({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},vt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),mt=()=>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"})),ft=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(mt,null)),Et=e=>{var i,o,a,c,s,d,p,v,m,f,E,_;let{t:h,action:g,tenantId:S,closeModal:T,submitAction:b,applicationDetails:A,applicationData:C,businessService:D,workflowDetails:N}=e;Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(a=o.address)&&void 0!==a&&a.city?null===(c=C)||void 0===c||null===(s=c.landInfo)||void 0===s||null===(d=s.address)||void 0===d?void 0:d.city:S,!1);const{data:P,isLoading:R}=Digit.Hooks.useEmployeeSearch(S,{roles:null==N||null===(p=N.data)||void 0===p||null===(v=p.initialActionState)||void 0===v||null===(m=v.nextActions)||void 0===m||null===(f=m.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(_=E.assigneeRoles)||void 0===_?void 0:_.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[I,O]=(r.useQueryClient(),n.useState({})),[x,L]=n.useState({}),[w,M]=n.useState([]),[F,k]=n.useState({}),[B,U]=n.useState(null),[H,j]=n.useState(null),[W,z]=n.useState(null),[V,K]=n.useState(null),Y=!!Digit.Utils.browser.isMobile();function q(e){U(e.target.files[0])}n.useEffect(()=>{var e;M(null==P||null===(e=P.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[P]),n.useEffect(()=>{!function(){try{z(null);const e=function(){if(B){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(B.size>=5242880)z(h("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=B&&B.type&&!e.test(null==B?void 0:B.type))z(h("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",B,Digit.ULBService.getStateId()||(null==S?void 0:S.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?j(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):z(h("CS_FILE_UPLOAD_ERROR"))})},function(){z(h("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)}}()},[B]);const G=e=>{let t=[];return e&&e.map((e,n)=>{t.push({documentType:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_","."),fileStoreId:e.fileStoreId,fileStore:e.fileStoreId,fileName:"",dropDownValues:{value:(e.documentType+"_"+e.documentType.split("_")[1]).replaceAll("_",".")}})}),t},X=e=>{let t=[];var n;for(n=0;n<(null==e?void 0:e.questionLength);n++){var l;t.push({remarks:e["Remarks_"+n],question:null==e?void 0:e.questionList[n].question,value:null==e||null===(l=e["question_"+n])||void 0===l?void 0:l.code})}return t},$=e=>{var t,n;let l=[],i=[];var o,a;return(null==e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.fieldinspection_pending)||void 0===n?void 0:n.length)>0&&(i=null==e||null===(o=e.additionalDetails)||void 0===o?void 0:o.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(a=l)||void 0===a?void 0:a.length)>0&&l.map((e,t)=>{i.push({docs:G(e.Documents),date:e.InspectionDate,questions:X(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},Z=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,a,r;(null==e||null===(t=e.uploadedDocuments)||void 0===t||null===(l=t[0])||void 0===l||null===(i=l.values)||void 0===i?void 0:i.length)>0&&(n=[...n,...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&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},Q=()=>{var e;const t=Digit.SessionStorage.get("OBPS_APPROVAL_CHECKS"),n=Digit.SessionStorage.get("OBPS_NEW_APPROVALS");let l=null==t?void 0:t.reduce((e,t)=>null!=t&&t.checked?e.push(null==t?void 0:t.label)&&e:e,[]);return l=null===(e=l)||void 0===e?void 0:e.concat(null!==n?n.filter(e=>""!==e.label).map(e=>null==e?void 0:e.label):[]),l};return n.useEffect(()=>{g&&O((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:m}=e,f=!1;return"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"SKIP_PAYMENT"!=o.action&&"SEND_BACK_TO_CITIZEN"!=(null==o?void 0:o.action)&&"APPROVE"!=(null==o?void 0:o.action)||(f=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:o.isTerminateState||f?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||f?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:h,action:g,approvers:w,selectedApprover:F,setSelectedApprover:k,selectFile:q,uploadedFile:H,setUploadedFile:j,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:W}))},[g,w,V,H,W]),g&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vt,{label:h(I.label.heading)}),headerBarEnd:l.createElement(ft,{onClick:T}),actionCancelLabel:h(I.label.cancel),actionCancelOnSubmit:T,actionSaveLabel:h(I.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Y?{width:"720px"}:{},style:Y?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Y?{paddingLeft:"5px"}:{}},R?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,a;C=u({},C,{documents:Z(),additionalDetails:u({},null===(t=C)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:$(C),pendingapproval:Q()}),workflow:{action:null==g?void 0:g.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,assignes:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,varificationDocuments:H?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==B?void 0:B.name,fileStoreId:H}]:null},action:null==g?void 0:g.action,comment:null==e?void 0:e.comments,assignee:null!=F&&F.uuid?[null==F?void 0:F.uuid]:null,wfDocuments:H?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==B?void 0:B.name,fileStoreId:H}]:null});const r=null==A||null===(i=A.nocData)||void 0===i?void 0:i.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let c={sourceRefId:null==r||null===(o=r[0])||void 0===o||null===(a=o.Noc)||void 0===a?void 0:a.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,c)).then(function(e){var t;let n=!0,l=!0;null==e||null===(t=e.Noc)||void 0===t||t.map(e=>{var t,i,o,a,r;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(i=e.applicationStatus)||void 0===i?void 0:i.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"VOIDED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())||1!=n&&1!=l||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?n=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(l=!1))});let i=[];r&&r.map(e=>{var t,o,a,r,u,c,s,d,p,v,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(o=t.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(a=e.Noc)||void 0===a||null===(r=a.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(c=u.applicationStatus)||void 0===c?void 0:c.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(s=e.Noc)||void 0===s||null===(d=s.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(p=e.Noc)||void 0===p||null===(v=p.applicationStatus)||void 0===v?void 0:v.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&n||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&l)&&i.push(e)}),b({BPA:C},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:x,formId:"modal-action"})):l.createElement(t.Loader,null)},_t=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ht=()=>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"})),gt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ht,null)),St=e=>{var i,a;let{t:c,action:s,tenantId:d,closeModal:p,submitAction:v,applicationData:m,businessService:f}=e;const{data:E,isLoading:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(a=i.map)||void 0===a?void 0:a.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[h,g]=(r.useQueryClient(),n.useState({})),[S,T]=n.useState({}),[b,A]=n.useState([]),[C,D]=n.useState({}),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function w(e){P(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;A(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]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(N.size>=5242880)x(c("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=N&&N.type&&!e.test(null==N?void 0:N.type))x(c("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(c("CS_FILE_UPLOAD_ERROR"))})},function(){x(c("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{s&&g((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:m}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+v+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:f,populators:{name:"comments"}},{label:""+i("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:c,onDelete:()=>{d(null)},showHint:!0,message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:c,action:s,approvers:b,selectedApprover:C,setSelectedApprover:D,selectFile:w,uploadedFile:R,setUploadedFile:I,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:O}))},[s,b,R,O]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(_t,{label:c(h.label.heading)}),headerBarEnd:l.createElement(gt,{onClick:p}),actionCancelLabel:c(h.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:c(h.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"}:{}},_?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m=u({},m,{workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:R?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:R}]:null},documents:o}),v({Noc:m},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)};function yt(e){var t=this.__data__=new he(e);this.size=t.size}yt.prototype.clear=function(){this.__data__=new he,this.size=0},yt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},yt.prototype.get=function(e){return this.__data__.get(e)},yt.prototype.has=function(e){return this.__data__.has(e)},yt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof he){var l=n.__data__;if(!ge||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Te(l)}return n.set(e,t),this.size=n.size,this};var Tt=yt,bt=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),At=function(e,t,n){"__proto__"==t&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Ct=Object.prototype.hasOwnProperty,Dt=function(e,t,n){var l=e[t];Ct.call(e,t)&&me(l,n)&&(void 0!==n||t in e)||At(e,t,n)},Nt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var r=t[o],u=l?l(n[r],e[r],r,n,e):void 0;void 0===u&&(u=e[r]),i?At(n,r,u):Dt(n,r,u)}return n},Pt=function(e){return $(e)&&"[object Arguments]"==X(e)},Rt=Object.prototype,It=Rt.hasOwnProperty,Ot=Rt.propertyIsEnumerable,xt=Pt(function(){return arguments}())?Pt:function(e){return $(e)&&It.call(e,"callee")&&!Ot.call(e,"callee")},Lt=function(){return!1},wt=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?j.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Lt}),Mt=/^(?:0|[1-9]\d*)$/,Ft=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Mt.test(e))&&e>-1&&e%1==0&&e<t},kt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;var Ut=function(e){return function(t){return e(t)}},Ht=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&U.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),jt=Ht&&Ht.isTypedArray,Wt=jt?Ut(jt):function(e){return $(e)&&kt(e.length)&&!!Bt[X(e)]},zt=Object.prototype.hasOwnProperty,Vt=function(e,t){var n=B(e),l=!n&&xt(e),i=!n&&!l&&wt(e),o=!n&&!l&&!i&&Wt(e),a=n||l||i||o,r=a?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=r.length;for(var c in e)!t&&!zt.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ft(c,u))||r.push(c);return r},Kt=Object.prototype,Yt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Kt)},qt=function(e,t){return function(n){return e(t(n))}},Gt=qt(Object.keys,Object),Xt=Object.prototype.hasOwnProperty,$t=function(e){return null!=e&&kt(e.length)&&!te(e)},Zt=function(e){return $t(e)?Vt(e):function(e){if(!Yt(e))return Gt(e);var t=[];for(var n in Object(e))Xt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Qt=Object.prototype.hasOwnProperty,Jt=function(e){return $t(e)?Vt(e,!0):function(e){if(!ee(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=Yt(e),n=[];for(var l in e)("constructor"!=l||!t&&Qt.call(e,l))&&n.push(l);return n}(e)},en=v(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?j.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),tn=function(){return[]},nn=Object.prototype.propertyIsEnumerable,ln=Object.getOwnPropertySymbols,on=ln?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,a=[];++l<i;){var r=t[l];nn.call(e,r)&&(a[o++]=r)}return a}(ln(e)))}:tn,an=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},rn=qt(Object.getPrototypeOf,Object),un=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)an(t,on(e)),e=rn(e);return t}:tn,cn=function(e,t,n){var l=t(e);return B(e)?l:an(l,n(e))},sn=function(e){return cn(e,Zt,on)},dn=function(e){return cn(e,Jt,un)},pn=ue(j,"DataView"),vn=ue(j,"Promise"),mn=ue(j,"Set"),fn=ue(j,"WeakMap"),En=oe(pn),_n=oe(ge),hn=oe(vn),gn=oe(mn),Sn=oe(fn),yn=X;(pn&&"[object DataView]"!=yn(new pn(new ArrayBuffer(1)))||ge&&"[object Map]"!=yn(new ge)||vn&&"[object Promise]"!=yn(vn.resolve())||mn&&"[object Set]"!=yn(new mn)||fn&&"[object WeakMap]"!=yn(new fn))&&(yn=function(e){var t=X(e),n="[object Object]"==t?e.constructor:void 0,l=n?oe(n):"";if(l)switch(l){case En:return"[object DataView]";case _n:return"[object Map]";case hn:return"[object Promise]";case gn:return"[object Set]";case Sn:return"[object WeakMap]"}return t});var Tn=yn,bn=Object.prototype.hasOwnProperty,An=j.Uint8Array,Cn=function(e){var t=new e.constructor(e.byteLength);return new An(t).set(new An(e)),t},Dn=/\w*$/,Nn=W?W.prototype:void 0,Pn=Nn?Nn.valueOf:void 0,Rn=Object.create,In=function(){function e(){}return function(t){if(!ee(t))return{};if(Rn)return Rn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),On=Ht&&Ht.isMap,xn=On?Ut(On):function(e){return $(e)&&"[object Map]"==Tn(e)},Ln=Ht&&Ht.isSet,wn=Ln?Ut(Ln):function(e){return $(e)&&"[object Set]"==Tn(e)},Mn={};Mn["[object Arguments]"]=Mn["[object Array]"]=Mn["[object ArrayBuffer]"]=Mn["[object DataView]"]=Mn["[object Boolean]"]=Mn["[object Date]"]=Mn["[object Float32Array]"]=Mn["[object Float64Array]"]=Mn["[object Int8Array]"]=Mn["[object Int16Array]"]=Mn["[object Int32Array]"]=Mn["[object Map]"]=Mn["[object Number]"]=Mn["[object Object]"]=Mn["[object RegExp]"]=Mn["[object Set]"]=Mn["[object String]"]=Mn["[object Symbol]"]=Mn["[object Uint8Array]"]=Mn["[object Uint8ClampedArray]"]=Mn["[object Uint16Array]"]=Mn["[object Uint32Array]"]=!0,Mn["[object Error]"]=Mn["[object Function]"]=Mn["[object WeakMap]"]=!1;var Fn=function e(t,n,l,i,o,a){var r,u=1&n,c=2&n,s=4&n;if(l&&(r=o?l(t,i,o,a):l(t)),void 0!==r)return r;if(!ee(t))return t;var d=B(t);if(d){if(r=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&bn.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!u)return function(e,t){var n=-1,l=e.length;for(t||(t=Array(l));++n<l;)t[n]=e[n];return t}(t,r)}else{var p=Tn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(wt(t))return en(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(r=c||v?{}:function(e){return"function"!=typeof e.constructor||Yt(e)?{}:In(rn(e))}(t),!u)return c?function(e,t){return Nt(e,un(e),t)}(t,function(e,t){return e&&Nt(t,Jt(t),e)}(r,t)):function(e,t){return Nt(e,on(e),t)}(t,function(e,t){return e&&Nt(t,Zt(t),e)}(r,t))}else{if(!Mn[p])return o?t:{};r=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return Cn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?Cn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?Cn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Dn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return Pn?Object(Pn.call(e)):{}}}(t,p,u)}}a||(a=new Tt);var m=a.get(t);if(m)return m;a.set(t,r),wn(t)?t.forEach(function(i){r.add(e(i,n,l,i,t,a))}):xn(t)&&t.forEach(function(i,o){r.set(o,e(i,n,l,o,t,a))});var f=d?void 0:(s?c?dn:sn:c?Jt:Zt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),Dt(r,o,e(i,n,l,o,t,a))}),r},kn=function(e){return Fn(e,5)};const Bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Un=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Un,null)),jn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},Wn=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,T]=n.useState([]),[b,A]=n.useState({}),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),O=window.Digit.Utils.browser.isMobile(),x=window.location.href.includes("/employee");function L(e){D(e.target.files[0])}return n.useEffect(()=>{var e;T(null==m||null===(e=m.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[m]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(a("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",C,Digit.ULBService.getCurrentTenantId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{var e,n,i,o;"DisconnectWSConnection"==(null===(e=p)||void 0===e||null===(n=e.processInstance)||void 0===n?void 0:n.businessService)||"DisconnectSWConnection"==(null===(i=p)||void 0===i||null===(o=i.processInstance)||void 0===o?void 0:o.businessService)?r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:c,selectFile:s,uploadedFile:d,setUploadedFile:p,businessService:v,error:m}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==v?void 0:v.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:f?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:f?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:f?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:c,selected:r}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,u({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:v,error:R})):r&&_((e=>{var n;let{t:i,action:o,approvers:a,selectedApprover:r,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,businessService:p,error:v}=e,m=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(m=!1),o.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:m?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:a,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:r}):null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:c,onDelete:()=>{d(null)},message:s?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:v,error:R}))},[r,S,N,R]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:O&&x?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,a,s,v,m,f;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var E,_,h,g,S,y,T,A,D;const t=u({},null===(E=p)||void 0===E||null===(_=E.billAmendmentDetails)||void 0===_?void 0:_.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(h=p)||void 0===h?void 0:h.billAmendmentDetails,{workflow:{businessId:null===(g=p)||void 0===g||null===(S=g.billAmendmentDetails)||void 0===S?void 0:S.amendmentId,action:null==r?void 0:r.action,tenantId:c,businessService:null!==(y=p)&&void 0!==y&&null!==(T=y.applicationType)&&void 0!==T&&T.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(A=p)&&void 0!==A&&null!==(D=A.applicationType)&&void 0!==D&&D.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]}});d({AmendmentUpdate:n})}else{if(p=u({},p,{action:null==r?void 0:r.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:[],assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],wfDocuments:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null,processInstance:u({},null===(n=p)||void 0===n?void 0:n.processInstance,{action:null==r?void 0:r.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:[]})}),null!=e&&e.date&&null!==(l=p)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=kn(null==e?void 0:e.date);p.disconnectionExecutionDate=jn(t)}else if(null!=e&&e.date){const t=kn(null==e?void 0:e.date);p.connectionExecutionDate=jn(t)}var P;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(a=o.processInstance)||void 0===a?void 0:a.businessService)||"DisconnectSWConnection"==(null===(s=p)||void 0===s||null===(v=s.processInstance)||void 0===v?void 0:v.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(P=p)||void 0===P?void 0:P.serviceType)?d({WaterConnection:p,disconnectRequest:!0}):d({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(m=p)||void 0===m?void 0:m.applicationType))d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(f=p)||void 0===f?void 0:f.applicationType))d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var R,I,O,x,L,w,M,F,k,B,U,H,j;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenaltyReason)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebate)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(H=t.value)||void 0===H?void 0:H.adhocRebateReason)||""),"WATER"==(null===(j=p)||void 0===j?void 0:j.serviceType)?d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},zn=e=>l.createElement("h1",{className:"heading-m"},e.label),Vn=()=>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(Vn,null)),Yn=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;console.log("applicationData",p);const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,T]=n.useState([]),[b,A]=n.useState(null),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(!1);function L(e){D(e.target.files[0])}return n.useEffect(()=>{var e;T(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:n("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_PTR_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:v}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(zn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:N}]),d({PetRegistrationApplications:[u({},p,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},qn=e=>l.createElement("h1",{className:"heading-m"},e.label),Gn=()=>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(Gn,null)),$n=e=>{var i,a,r;let{t:c,action:s,tenantId:d,closeModal:p,submitAction:v,applicationData:m,businessService:f,moduleCode:E}=e;const{data:_}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(i=s.roles)||void 0===i||null===(a=i[0])||void 0===a||null===(r=a.map)||void 0===r?void 0:r.call(a,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),h=o.useHistory(),[g,S]=n.useState({}),[y,T]=n.useState({}),[b,A]=n.useState([]),[C,D]=n.useState(null),[N,P]=n.useState(null);return n.useEffect(()=>{var e;A(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}}))},[_]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?h.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):S((e=>{let{t:t,action:n,businessService:l}=e;return console.log("njhsegfdhjsbedwfdwe",n),{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:c,action:s,approvers:b,selectedApprover:C,setSelectedApprover:D,uploadedFile:N,setUploadedFile:P,businessService:f}))},[s,b,N]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(qn,{label:c(g.label.heading)}),headerBarEnd:l.createElement(Xn,{onClick:p}),actionCancelLabel:c(g.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:c(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};N&&(t.documents=[]),v({Asset:u({},m,{workflow:t})})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Zn=e=>l.createElement("h1",{className:"heading-m"},e.label),Qn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qn,null)),el=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;console.log("applicationData",p);const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,T]=n.useState([]),[b,A]=n.useState(null),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(!1);function L(e){D(e.target.files[0])}return n.useEffect(()=>{var e;T(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",C,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(a("CS_FILE_UPLOAD_ERROR"))})},function(){I(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_CHB_COMMON_CANCEL"},form:[{body:[{label:n("ES_CHB_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_CHB_ATTACH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:v}))},[r,S,N]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Zn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};N&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:N}]),d({hallsBookingApplication:[u({},p,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},tl=e=>l.createElement("h1",{className:"heading-m"},e.label),nl=()=>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"})),ll=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nl,null)),il=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;console.log("snjdskbjdfbjskfjkbs",r);const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=r&&r.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,T]=n.useState([]),[b,A]=n.useState(null),[C,D]=n.useState(null),[N,P]=n.useState(null),[R,I]=n.useState(null),[O,x]=n.useState(null),[L,w]=n.useState(!1);function M(e){P(e.target.files[0])}return n.useEffect(()=>{var e;T(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{x(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)x(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",N,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(a("CS_FILE_UPLOAD_ERROR"))})},function(){x(a("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{r&&_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,businessService:u}=e;console.log("action",i);const c=(new Date).toISOString().split("T")[0];return console.log("todayedsta ::",c),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+u+"_"+(null==i?void 0:i.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:["COMPLETIONPENDING"===(null==i?void 0:i.state)?{label:n("EW_PICKUP_DATE"),type:"date",isMandatory:!0,populators:{name:"date",min:(new Date).toISOString().split("T")[0],max:new Date(Date.now()+6048e5).toISOString().split("T")[0]}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:n("ES_EW_ACTION_TRANSACTION_ID"),type:"text",isMandatory:!0,populators:{name:"transactionId"}}:"null","REQUESTCOMPLETED"===(null==i?void 0:i.state)?{label:n("ES_EW_ACTION_FINALAMOUNT"),type:"text",isMandatory:!0,populators:{name:"finalAmount"}}:"null",{label:n("ES_EW_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:n("ES_EW_PHOTO")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:o,onDelete:()=>{r(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:a?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:b,setSelectedApprover:A,selectFile:M,uploadedFile:R,setUploadedFile:I,businessService:v}))},[r,S,R]),console.log("conggg",E),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tl,{label:a(E.label.heading)}),headerBarEnd:l.createElement(ll,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m};console.log("applicationData",e),R&&(t.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==N?void 0:N.name,filestoreId:R},{}]),p.pickUpDate=null==e?void 0:e.date,p.transactionId=null==e?void 0:e.transactionId,p.finalAmount=null==e?void 0:e.finalAmount,d({EwasteApplication:[u({},p,{workflow:t})]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},ol=e=>l.createElement("h1",{className:"heading-m"},e.label),al=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),rl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(al,null)),ul=e=>{var i,o;let{t:a,action:r,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v,moduleCode:m}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(c,{roles:null==r||null===(i=r.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==r?void 0:r.isTerminateState}),[E,_]=n.useState({}),[h,g]=n.useState({}),[S,b]=n.useState([]),[A,C]=n.useState(null),[D,N]=n.useState(null),[P,R]=n.useState(null),[I,O]=n.useState(null),[x,L]=n.useState(!1);function w(e){L(!0),N(e.target.files[0])}return n.useEffect(()=>{var e;b(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{O(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)O(a("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=T(function(){return y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",D,c)).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(a("CS_FILE_UPLOAD_ERROR"))})},function(){O(a("CS_FILE_UPLOAD_ERROR"))})},function(e,t){if(L(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),console.log("actyhdesh,jhfsefsef",r,p),n.useEffect(()=>{_((e=>{let{t:n,action:i,selectFile:o,uploadedFile:a,setUploadedFile:r,approvers:u,selectedApprover:c,setSelectedApprover:s,isUploading:d}=e;const p=()=>l.createElement("div",{className:"loading-spinner"});return console.log("isuploading ",d),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"SV_"+(null==i?void 0:i.action),cancel:"SV_COMMON_CANCEL"},form:[{body:["APPROVE"===(null==i?void 0:i.action)||"REJECT"===(null==i?void 0:i.action)||"SENDBACKTOCITIZEN"===(null==i?void 0:i.action)?"":{label:n("SV_ASSIGNEE"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:u,t:n,optionKey:"name",select:s,selected:c})},{label:n("SV_ACTION_COMMENTS"),isMandatory:!0,type:"textarea",populators:{name:"comments",validation:{required:!0}}},{label:n("SV_ATTATCH_FILE")+(i.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc-sv",onUpload:o,onDelete:()=>{r(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):a?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:a,action:r,approvers:S,selectedApprover:A,setSelectedApprover:C,selectFile:w,uploadedFile:P,setUploadedFile:R,businessService:v,isUploading:x}))},[r,S,P]),r&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ol,{label:a(E.label.heading)}),headerBarEnd:l.createElement(rl,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==r?void 0:r.action,comments:null==e?void 0:e.comments,businessService:v,moduleName:m,assignes:"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null};P&&(n.documents=[{documentType:(null==r?void 0:r.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]),d({streetVendingDetail:u({},p,{workflow:n})})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},cl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(it,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Yn,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(ut,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(pt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Et,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(St,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Wn,e):null!=e&&e.businessService.includes("asset-create")?l.createElement($n,e):null!=e&&e.businessService.includes("ewst")?l.createElement(il,e):null!=e&&e.businessService.includes("chb")?l.createElement(el,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(ul,e):void 0;function sl(e){let{documents:n,svgStyles:o={},isSendBackFlow:a=!1,isHrLine:r=!1,titleStyles:u}=e;const{t:c}=i.useTranslation(),s=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!s&&(null==n?void 0:n.map((e,i)=>{var o;return l.createElement(l.Fragment,{key:i},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(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===(o=e.values)||void 0===o?void 0:o.map((e,n)=>{var i;return l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"center",color:"#505A5F"}},c(null==e?void 0:e.title)),a?null!=e&&null!==(i=e.documentType)&&void 0!==i&&i.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},c(null==e?void 0:e.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},c(null==e?void 0:e.documentType)):"")}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))),r&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null)})),s&&(null==n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},c(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===(i=e.values)||void 0===i?void 0:i.map((e,n)=>l.createElement("a",{target:"_",href:null==e?void 0:e.url,style:{minWidth:null!=o&&o.minWidth?null==o?void 0:o.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},c(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+c(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400",textAlign:"center",color:"#505A5F"}},""+c(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,c("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const dl=e=>{var t,i;let{t:o,formData:a,applicationData:r,docs:u,bpaActionsDetails:c}=e;const s=(null==r?void 0:r.status)||"",d=(null==c||null===(t=c.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=n.useState((null==a||null===(i=a.documents)||void 0===i?void 0:i.documents)||[]),[f,E]=n.useState(null),[_,h]=n.useState([]),[g,S]=n.useState(!0),[y,T]=n.useState(!1),[b,A]=n.useState(!1),{isLoading:C,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:N,data:P}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var o,a;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(a=o.DocTypeMapping)||void 0===a?void 0:a.filter(e=>{var t,n;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===(n=r.additionalDetails)||void 0===n?void 0:n.applicationType)}));let c=[];null===(t=i)||void 0===t||null===(n=t[0])||void 0===n||null===(l=n.docTypes)||void 0===l||l.forEach(e=>{var t,n,l,i;let o=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==P||null===(t=P["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,o.length);o===n&&(e.hasDropdown=!0,t.i18nKey=t.code,e.dropdownData.push(t))}),e.uploadedDocuments[0]={},e.uploadedDocuments[0].values=[],null==u||null===(l=u[0])||void 0===l||null===(i=l.values)||void 0===i||i.map(t=>{var n,l;o===(null==t||null===(n=t.documentType)||void 0===n?void 0:n.split(".")[0])+"."+(null==t||null===(l=t.documentType)||void 0===l?void 0:l.split(".")[1])&&e.uploadedDocuments[0].values.push(t)}),c.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(c)),h(c)},[!C,!N]),n.useEffect(()=>{let e=0;_.map(t=>{let n=!1;v.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),S("0"!=e&&0!=e||!(v.length>0))},[v,y]),n.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==d?void 0:d.length)>0)},[r,c]),l.createElement("div",null,null==_?void 0:_.map((e,t)=>l.createElement("div",null,l.createElement(pl,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:m,documents:v,setCheckRequiredFields:T,applicationStatus:s,actions:d,bpaTaxDocuments:_,checkEnablingDocs:b}))))};function pl(e){var i,o;let{t:a,document:r,setDocuments:c,documents:s,index:d,bpaTaxDocuments:p,checkEnablingDocs:v}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],f=Digit.ULBService.getStateId(),[E,_]=n.useState(m?u({},m,{active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[h,g]=n.useState(null),[S,y]=n.useState(()=>(null==m?void 0:m.fileStoreId)||null),[T,b]=n.useState([]);return n.useEffect(()=>{null!=E&&E.code&&c(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==S?void 0:S.length)||null===S?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==S),{documentType:null==E?void 0:E.code,fileStoreId:S,documentUid:S,fileName:(null==h?void 0:h.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[S,E]),n.useEffect(()=>{try{T.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),r.newUploadedDocs=[],T.map(e=>{var t,n,l;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===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),p[d]=r,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[T,E]),n.useEffect(()=>{},[h]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+a(null==r?void 0:r.code)),(null==r||null===(o=r.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(sl,{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(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=r&&r.required?a(null==r?void 0:r.code)+"* ":""+a(null==r?void 0:r.code)),l.createElement(t.Dropdown,{className:"form-field",t:a,isMandatory:!1,option:null==r?void 0:r.dropdownData,selected:E,optionKey:"i18nKey",select:e=>_(e),style:{width:"100%"}})),l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{width:"100%"}}),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"BPA",tenantId:f,getFormState:e=>((e,t)=>{let n=Object.fromEntries(t),l=Object.values(n);var i;0!==Object.keys(n).length&&b(l),(i=l[l.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 vl(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+a("BPA_FI_REPORT")),n.map((e,i)=>{var o,r,u,c,s,d;return l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px",marginBottom:"24px"}},l.createElement(t.StatusTable,null,l.createElement(t.CardSectionHeader,{style:{fontSize:"20px"}},1==(null==n?void 0:n.length)?""+a("BPA_FI_REPORT"):a("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?(null===(o=e.date)||void 0===o?void 0:o.split("-")[2])+"/"+(null===(r=e.date)||void 0===r?void 0:r.split("-")[1])+"/"+(null===(u=e.date)||void 0===u?void 0:u.split("-")[0]):null==e?void 0:e.date:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(c=e.questions)||void 0===c?void 0:c.length)&&(null==e||null===(s=e.questions)||void 0===s?void 0:s.map(e=>l.createElement("div",{style:{background:"white",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",marginTop:"10px"}},l.createElement(t.Row,{className:"border-none",label:""+a(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+a("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(sl,{documents:(d=null==e?void 0:e.docs,[{title:"BPA_DOCUMENT_DETAILS_LABEL",values:null==d?void 0:d.map(e=>{var t;return{title:null==e||null===(t=e.documentType)||void 0===t?void 0:t.replaceAll(".","_"),documentType:null==e?void 0:e.documentType,documentUid:null==e?void 0:e.documentUid,fileStoreId:null==e?void 0:e.fileStoreId,id:null==e?void 0:e.id,url:null==e?void 0:e.url}})}]),svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}})))})))}function ml(e){let{t:i,document:o,setNocDocuments:a,setError:r,nocDocuments:u}=e;const c=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],s=Digit.ULBService.getStateId(),[d,p]=n.useState(),[v,m]=n.useState(null),[f,E]=n.useState(()=>(null==c?void 0:c.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=o&&null!==(e=o.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&a(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==o||null===(t=o.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==f?void 0:f.length)||null===f?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==f),{documentType:null==o||null===(t=o.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:f,documentUid:f,fileName:(null==v?void 0:v.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{r(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)r(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))r(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,o;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?E(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.fileStoreId):r(i("CS_FILE_UPLOAD_ERROR"))})},function(){r(i("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[v]),l.createElement("div",{style:{}},l.createElement(t.LabelFieldPair,{style:{width:"98%",marginRight:"10px"}},l.createElement(t.CardLabel,{style:{width:"100%"}},null!=o&&o.required?i("TL_BUTTON_UPLOAD FILE")+"*":""+i("TL_BUTTON_UPLOAD FILE")),l.createElement("div",{className:"field",style:{width:"100%"}},l.createElement(t.MultiUploadWrapper,{module:"NOC",tenantId:s,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&m(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const fl=e=>{var i;let{t:o,noc:a,docs:r,isNoc:u,applicationData:c,NOCdata:s,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==c?void 0:c.status)||"",m=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:f}=Digit.Hooks.obps.useMDMS(p,"NOC",["DocumentTypeMapping"],{enabled:u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:_}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[h,g]=n.useState([]),[S,y]=n.useState([]),[T,b]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==a?void 0:a.nocType,[]),[D,N]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;g(null==_||null===(e=_["common-masters"])||void 0===e?void 0:e.DocumentType)},[_]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,r,s,d;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(r=o.DocumentTypeMapping)||void 0===r?void 0:r.filter(e=>(null==e?void 0:e.applicationType)===(null==a?void 0:a.applicationType)&&(null==e?void 0:e.nocType)===(null==a?void 0:a.nocType)):null==E||null===(s=E.BPA)||void 0===s||null===(d=s.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==c?void 0:c.status)&&e.RiskType==(null==c?void 0:c.riskType)&&e.ServiceType==(null==c||null===(t=c.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==c||null===(n=c.additionalDetails)||void 0===n?void 0:n.applicationType)}),null!==(e=l)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&null!==(n=t.docTypes)&&void 0!==n&&n[0]&&(l[0].docTypes[0].nocType=l[0].nocType,l[0].docTypes[0].additionalDetails={submissionDetails:null==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(l[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==h||h.forEach(n=>{let l=n.code.slice(0,null==t?void 0:t.length);t===l&&(e.hasDropdown=!0,e.dropdownData.push(n))}),p.push(e)}),y(p))},[f,h]),n.useEffect(()=>{b("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[c,d]),l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px 0px 16px 8px",background:"#FAFAFA",borderRadius:"5px",marginBottom:"24px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:P?""+o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"):o("BPA_"+(null==a?void 0:a.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),s&&s.map((e,n)=>{if(null!=e&&e.value)return l.createElement(t.Row,"STATUS"==(null==e?void 0:e.field)?{className:"border-none",label:P?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA"),textStyle:"APPROVED"==(null==e?void 0:e.value)||"AUTO_APPROVED"==(null==e?void 0:e.value)?{color:"#00703C"}:{color:"#D4351C"}}:{className:"border-none",label:P?""+o(null==e?void 0:e.title):o(null==e?void 0:e.title),text:o(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(sl,{documents:r,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),T&&(null==S?void 0:S.map((e,t)=>l.createElement(ml,{key:t,document:e,t:o,error:D,setError:N,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:T}))))},El=e=>{let{permissions:i,t:o}=e;const[a,r,c]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,d,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const v=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==a?void 0:a.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:v?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;r(()=>null==a?void 0:a.map((e,t)=>n===t?u({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==s?void 0:s.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth:v?"96%":"830px",width:v?"96%":"830px"},style:v?{paddingRight:"10%"}:{},placeholder:o("BPA_ENTER_PERMIT_CONDITIONS_LABEL")}),l.createElement(t.LinkButton,{label:l.createElement("div",null,l.createElement("span",null,l.createElement(t.Close,{style:{float:"right",position:"relative",bottom:"32px",marginTop:"-22px",marginRight:v?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:v?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...s,{label:""}])}}))};function _l(e){let{documents:o,svgStyles:a={},isSendBackFlow:r=!1}=e;const{t:u}=i.useTranslation(),[c,s]=n.useState(()=>[]),[d,p]=(Digit.ULBService.getCurrentTenantId(),n.useState({}));n.useEffect(()=>{var e;let t=[];null==o||o.forEach((e,n,l)=>{t=[...t,...e.values?e.values:[]]}),s(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=c&&c.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(c,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=c&&c.length&&Digit.UploadServices.Filefetch(c,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[c]);const v=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),m=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!m&&(null==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:v?{marginTop:"32px",marginBottom:"18px",color:"#0B0C0C, 100%",fontSize:"24px",lineHeight:"30px"}:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i,o;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto"},key:n},l.createElement("div",{style:{display:"flex",justifyContent:"center"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:v?{marginTop:"8px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F",textAlign:"center"}:{marginTop:"8px",fontWeight:"bold"}},u(null==e?void 0:e.title)),r?null!=e&&null!==(o=e.documentType)&&void 0!==o&&o.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==o?void 0:o.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},null!=e&&e.title?l.createElement(t.CardSubHeader,{style:{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},u(null==e?void 0:e.title)):null,l.createElement("div",null,null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement("a",{target:"_",href:null===(i=d[e.fileStoreId])||void 0===i?void 0:i.split(",")[0],style:{minWidth:null!=a&&a.minWidth?null==a?void 0:a.minWidth:"160px",marginRight:"20px"},key:n},l.createElement("div",{style:{maxWidth:"940px",padding:"8px",borderRadius:"4px",border:"1px solid #D6D5D4",background:"#FAFAFA"}},l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",marginBottom:"10px"}},u(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+u(null==e?void 0:e.docInfo)):null,l.createElement(t.PDFSvg,null),l.createElement("p",{style:{marginTop:"8px",fontSize:"16px",lineHeight:"19px",color:"#505A5F",fontWeight:"400"}},""+u(null==e?void 0:e.title))))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,u("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}function hl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:a}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:a("ES_PT_TITLE_TAX_HEADS"),text:a("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==o?void 0:o.map((e,n)=>l.createElement(t.Row,{key:a(e.taxHeadCode),label:a(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==o?void 0:o.length)-1,className:"border-none",textStyle:{color:"#505A5F"},labelStyle:{color:"#505A5F"}})),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),l.createElement(t.Row,{label:a("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function gl(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function Sl(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:a}=i.useTranslation(),r=(null==n?void 0:n.length)||1;let c={marginTop:"19px"},s={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(r)>1?c={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(r)>1||(c={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(c=u({},c,{maxWidth:"950px"}),c=u({},c,{maxWidth:"950px"}),d={}),n.sort((e,t)=>{var n,l;return(null==e||null===(n=e.additionalDetails)||void 0===n?void 0:n.ownerSequence)-(null==t||null===(l=t.additionalDetails)||void 0===l?void 0:l.ownerSequence)}),l.createElement(l.Fragment,null,l.createElement("div",{className:"owner-details"},o.map((e,n)=>{var i;return l.createElement("div",{key:a(null==e?void 0:e.title),style:c,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(r)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(r)>1?a(null==e?void 0:e.title)+" "+(n+1):a(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:s},l.createElement("div",{style:{maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return!0===e.map&&"N/A"!==e.value?l.createElement(t.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(t.Row,{key:a(e.title),label:""+a(e.title),text:a(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const yl=e=>{var o,a,r;let{scrutinyDetails:u,paymentsList:c=[]}=e;const{t:s}=i.useTranslation(),d=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},s(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?s(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void s("NA");return l.createElement(n.Fragment,null,!(null!=u&&u.isChecklist)&&l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px"}},l.createElement(t.StatusTable,null,l.createElement("div",null,null==u||null===(o=u.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red"}:{},key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.value?d(e)+" "+s(null==e?void 0:e.isUnit):s("NA"),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):null==e||!e.isHeader||null!=e&&e.isUnit?null==e||!e.isSubTitle||null!=e&&e.isUnit?l.createElement(t.Row,{className:"border-none",textStyle:"Paid"===(null==e?void 0:e.value)?{color:"darkgreen",wordBreak:"break-all"}:"Unpaid"===(null==e?void 0:e.value)?{color:"red",wordBreak:"break-all"}:{wordBreak:"break-all"},key:""+e.title,label:""+s(""+e.title),text:d(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},s(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},s(null==e?void 0:e.title))),null==u||null===(a=u.permit)||void 0===a?void 0:a.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(r=u.scruntinyDetails)||void 0===r?void 0:r.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+s(null==e?void 0:e.title),labelStyle:{width:"150%"}}),l.createElement("a",{href:null==e?void 0:e.value}," ",l.createElement(t.PDFSvg,null)," "),l.createElement("p",{style:{margin:"8px 0px",fontWeight:"bold",fontSize:"16px",lineHeight:"19px",color:"#505A5F"}},s(null==e?void 0:e.text))))))))},Tl=e=>{var o,a,r,u,c;let{edcrDetails:s,applicationData:d}=e;const{t:p}=i.useTranslation(),v=window.Digit.Utils.browser.isMobile(),m=[{name:"BPA_TABLE_COL_FLOOR",id:"Floor"},{name:"BPA_TABLE_COL_LEVEL",id:"Level"},{name:"BPA_TABLE_COL_OCCUPANCY",id:"Occupancy"},{name:"BPA_TABLE_COL_BUILDUPAREA",id:"BuildupArea"},{name:"BPA_TABLE_COL_FLOORAREA",id:"FloorArea"},{name:"BPA_TABLE_COL_CARPETAREA",id:"CarpetArea"}],f=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function _(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,a,r,u,c;n.push({Floor:p("BPA_FLOOR_NAME_"+e.number),Level:e.number,Occupancy:p(""+(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===(c=u[0])||void 0===c?void 0:c.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function h(e){var t;let n=null==d||null===(t=d.landInfo)||void 0===t?void 0:t.unit,l="";if((null==n?void 0:n.length)>0){var i,o;let t=null===(i=n[e])||void 0===i||null===(o=i.usageCategory)||void 0===o?void 0:o.split(",");null!=t&&t.length&&(l=t.map(e=>e?""+p("BPA_SUBOCCUPANCYTYPE_"+function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;e.includes(t);)e=e.replace(t,n);return e}(null==e?void 0:e.toUpperCase(),"-","_")):"NA").join(", "))}return l||"NA"}return l.createElement(n.Fragment,null,l.createElement("div",{style:{background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}},l.createElement(t.StatusTable,null,null==s||null===(o=s.values)||void 0===o?void 0:o.map((e,n)=>null!=e&&e.isHeader?l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},p(null==e?void 0:e.title)):l.createElement(t.Row,{className:"border-none",labelStyle:{width:"100%",fontSize:"20px"},key:""+e.title,label:""+p(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),null==s||null===(a=s.subOccupancyTableDetails)||void 0===a||null===(r=a[0])||void 0===r||null===(u=r.value)||void 0===u||null===(c=u.planDetail)||void 0===c?void 0:c.blocks.map((e,n)=>{var i,o,a,r,u;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.value)||void 0===a||null===(r=a.planDetail)||void 0===r||null===(u=r.blocks)||void 0===u?void 0:u.length)>0?{marginBottom:"30px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px",borderRadius:"4px",maxWidth:"950px",minWidth:"280px"}:{marginBottom:"30px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"18px",lineHeight:"19px"}},p("BPA_BLOCK_SUBHEADER")," ",n+1),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",textStyle:{wordBreak:"break-word"},label:""+p("BPA_SUB_OCCUPANCY_LABEL"),text:h(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||v?{overflow:"scroll"}:{maxWidth:"950px",maxHeight:"280px"}},l.createElement(t.Table,{className:"customTable table-fixed-first-column table-border-style",t:p,disableSort:!1,autoSort:!0,manualPagination:!1,isPaginationRequired:!1,initSortId:"S N ",data:_(e),columns:E,getCellProps:e=>({style:{}})})))})))},bl=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))},Al=e=>{var n,o,a;let{data:r,OpenImage:u,privacy:c={}}=e;const{t:s}=i.useTranslation();return l.createElement("div",null,r.date&&l.createElement("p",null,r.date),l.createElement("p",null,r.name),r.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:r.mobileNumber,privacy:c}),l.createElement("p",null," ")),r.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+r.source.toUpperCase())),r.comment&&l.createElement(bl,{otherComment:null==r?void 0:r.otherComment,headComment:null==r?void 0:r.comment}),null!=r&&r.wfComment?l.createElement("div",null,null==r||null===(n=r.wfComment)||void 0===n?void 0:n.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==r||null===(o=r.thumbnailsToShow)||void 0===o||null===(a=o.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==r?void 0:r.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==r?void 0:r.thumbnailsToShow)}})):null)};function Cl(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Dl(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"9px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},o(null==e?void 0:e.title)+" "+(n+1)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"NA",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}const Nl=e=>{var o,a,r,u;let{wsAdditionalDetails:c}=e;const{t:s}=i.useTranslation();let d=(p=location.search)?(/^[?#]/.test(p)?p.slice(1):p).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var p;const v=null==d?void 0:d.mode;var{connectionDetails:m,plumberDetails:f,roadCuttingDetails:E,activationDetails:_}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[]};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},(null==c||null===(o=c.additionalDetails)||void 0===o?void 0:o.connectionDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_CONNECTION_DETAIL")),l.createElement("div",null,l.createElement("div",{className:"connection-details-new-value-wrapper"},null==m?void 0:m.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))),(null==c||null===(a=c.additionalDetails)||void 0===a?void 0:a.plumberDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==f?void 0:f.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+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==c||null===(r=c.additionalDetails)||void 0===r?void 0:r.roadCuttingDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==E?void 0:E.map(e=>{var n;return l.createElement("div",{style:(null==E?void 0:E.length)>1?{border:"1px solid #D6D5D4",background:"#FAFAFA",borderRadius:"4px",padding:"10px 10px 0px 10px",margin:"5px 0px"}:{}},null==e||null===(n=e.values)||void 0===n?void 0:n.map(e=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))})))),(null==c||null===(u=c.additionalDetails)||void 0===u?void 0:u.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},s("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==_?void 0:_.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+s(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},Pl=[{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"}],Rl=[{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"}],Il=e=>{var o,a,r,c;let{wsAdditionalDetails:s}=e;const{t:d}=i.useTranslation(),[p,v,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,h]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[S,y]=n.useState(!1),[T,b]=n.useState(p||{}),[A,C]=n.useState(null),[D,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[P,R]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=u({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var o,a,r,c,d,m,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(r=p.billDetails)||void 0===r||null===(c=r[0])||void 0===c?void 0:c.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(m=d[0])||void 0===m?void 0:m.taxAmount)}];R(e),N(null==p||null===(f=p.billDetails)||void 0===f?void 0:f[0])}else v(i),b(i)},[]);let O={};const x=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),w=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),M=function(e,t,n){void 0===t&&(t=!1);let l=u({},T);if("adhocPenalty"!=e&&"adhocRebate"!=e||!n.target.value)t?(l[e+"_data"]=n,l[e]=n.title,"PT_OTHERS"==n.title&&"adhocPenaltyReason"==e&&(l.adhocPenaltyComment=""),"PT_OTHERS"==n.title&&"adhocRebateReason"==e&&(l.adhocRebateComment="")):l[e]=n.target.value;else{var i,o;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(o=n.target)||void 0===o?void 0:o.value)||-1;l[e]=1==t?n.target.value:""}b(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},P&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==P?void 0:P.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.value?null==e?void 0:e.value:""}))),l.createElement("hr",{style:{border:"1px solid #D6D5D4",color:"#D6D5D4",margin:"16px 0px"}}),l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:"WS_COMMON_TOTAL_AMT",label:""+d("WS_COMMON_TOTAL_AMT"),text:l.createElement("span",null,"₹",(null==D?void 0:D.totalAmount)||0),textStyle:{fontSize:"24px",fontWeight:"700"}}),l.createElement(t.Row,{className:"border-none",key:"CS_INBOX_STATUS_FILTER",label:""+d("CS_INBOX_STATUS_FILTER"),text:d(g?"WS_COMMON_PAID_LABEL":"WS_COMMON_NOT_PAID"),textStyle:g?{color:"#00703C"}:{color:"#D4351C"}}))),null!=s&&null!==(a=s.additionalDetails)&&void 0!==a&&a.isAdhocRebate?l.createElement("div",{onClick:e=>{y(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,S&&l.createElement(t.Modal,{headerBarMain:l.createElement(x,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(w,{onClick:()=>{b(p),y(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{b(p),y(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=T&&T.adhocPenalty?Number(null==T?void 0:T.adhocPenalty):0,n=null!=T&&T.adhocRebate?Number(null==T?void 0:T.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))C({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,a,r,c,p,m,f,h,g,S;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(a=o.appDetails)||void 0===a?void 0:a.applicationNo,t=null==s||null===(r=s.additionalDetails)||void 0===r||null===(c=r.appDetails)||void 0===c?void 0:c.tenantId,n=u({},null==s||null===(p=s.additionalDetails)||void 0===p||null===(m=p.appDetails)||void 0===m?void 0:m.additionalDetails,T);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(h=f.appDetails)||void 0===h?void 0:h.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(g=s.additionalDetails)||void 0===g||null===(S=g.appDetails)||void 0===S?void 0:S.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,a,r,u,c,s,d,p,m,f,h,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.taxHeadEstimates)||void 0===g||g.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===(c=e.Calculation)||void 0===c||null===(s=c[0])||void 0===s?void 0:s.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount}];E(kn(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),R(S),T.billDetails=null==e?void 0:e.Calculation,v(T),y(!1)}).catch(e=>{var t,n,l,i,o,a;C({isError:!0,isWarning:!1,key:"error",message:null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(l=n.Errors[0])&&void 0!==l&&l.message?d(""+(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)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else C({isError:!1,isWarning:!0,key:"warning",message:d("ERR_WS_ENTER_ATLEAST_ONE_FIELD")})})(),hideSubmit:!1,popupStyles:{overflowY:"auto"}},l.createElement("div",null,l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_PENALTY")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Pl,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==T?void 0:T.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==T||null===(r=T.adhocPenaltyReason_data)||void 0===r?void 0:r.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==T?void 0:T.adhocPenaltyComment)||"",onChange:e=>M("adhocPenaltyComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")})))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==T?void 0:T.adhocPenalty)||"",onChange:e=>M("adhocPenalty",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))),l.createElement(t.Card,{style:{padding:"10px 10px 1px 10px",margin:"0px 0px 15px 0px"}},l.createElement(t.CardSectionHeader,{style:{fontSize:"16px",fontWeight:"700",lineHeight:"18px",padding:"0px",margin:"0px 0px 10px 0px"}},d("PT_AD_REBATE")),l.createElement(t.CardLabel,null,d("PT_TX_HEADS")),l.createElement("div",{className:"field"},l.createElement(t.Dropdown,{isMandatory:!0,option:Rl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==T?void 0:T.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==T||null===(c=T.adhocRebateReason_data)||void 0===c?void 0:c.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==T?void 0:T.adhocRebateComment)||"",onChange:e=>M("adhocRebateComment",!1,e)},O={isRequired:!0,pattern:"^[a-zA-Z ]*$",type:"text",title:d("TL_NAME_ERROR_MESSAGE")}))),l.createElement(t.CardLabel,null,d("PT_HEAD_AMT")),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==T?void 0:T.adhocRebate)||"",onChange:e=>M("adhocRebate",!1,e)},O={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),A&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==A?void 0:A.isWarning,error:null==A||!A.isWarning,label:d(null==A?void 0:A.message),onClose:()=>{C(!1)},isDleteBtn:!0})))},Ol=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},xl=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:a="",infoClickInfoLabel:r="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const c=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:c?{}:{width:"80%"}},l.createElement("div",{className:"info-banner-wrap",style:{color:"#3498DB",margin:"0px"}},l.createElement("div",null,l.createElement(t.InfoBannerIcon,null),l.createElement("h2",{style:{color:"#3498DB"}},n(o))),n(a)+" ",l.createElement(Ol,{style:{display:"inline",marginBottom:"5px"}})," "+n(r),l.createElement("div",null," "+n(u)))))},Ll=e=>{var o,a,r,u,c,s,d;let{wsAdditionalDetails:p}=e;const{t:v}=i.useTranslation(),[m,f]=n.useState(!1),[E,_]=n.useState({}),h=e=>l.createElement("h1",{className:"heading-m"},e.label),g=()=>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(g,null));return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},null!=p&&null!==(o=p.additionalDetails)&&void 0!==o&&o.isViewBreakup?l.createElement("div",{onClick:e=>(()=>{var e;let t=p.additionalDetails.data||{};const n=sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA"),l=n?JSON.parse(n):{};null!=l&&null!==(e=l.value)&&void 0!==e&&e.totalAmount&&(t=null==l?void 0:l.value),_(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,m&&l.createElement(t.Modal,{headerBarMain:l.createElement(h,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(S,{onClick:()=>{f(!1)}}),hideSubmit:!0,popupStyles:{overflowY:"auto"},headerBarMainStyle:{marginBottom:"0px"},popupModuleMianStyles:{paddingTop:"0px"}},l.createElement(t.StatusTable,{style:{padding:"10px",paddingTop:"0px"}},l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_APPLICATION_FEE_HEADER")),null==E||null===(a=E.billSlabData)||void 0===a||null===(r=a.FEE)||void 0===r?void 0:r.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT1",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.billSlabData)||void 0===u||null===(c=u.CHARGES)||void 0===c?void 0:c.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT2",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(s=E.billSlabData)||void 0===s||null===(d=s.TAX)||void 0===d?void 0:d.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+v(""+(null==e?void 0:e.taxHeadCode)),text:l.createElement("span",null,"₹",Number(null==e?void 0:e.amount)||0),textStyle:{textAlign:"right"}})),l.createElement("hr",{style:{color:"#cccccc",backgroundColor:"#cccccc",marginBottom:"10px"}}),l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:"PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT3",label:""+v("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},wl={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:{}},Ml=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:a=0}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:wl.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:wl.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:u({},wl.cell,wl.cellLeft,wl.cellHeader)},r("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:u({},wl.cell,n.length==t+1?wl.cellRight:{},wl.cellHeader),key:t},r(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:u({},wl.cell,wl.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:u({},wl.cell,{textAlign:"left"},n.length==i+1?wl.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:u({},wl.cell,wl.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:u({},wl.cell,wl.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},a):t==n.length-2?l.createElement("td",{style:u({},wl.cell,{textAlign:"left"}),key:t,numeric:!0},r("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:wl.cell,key:t,numeric:!0})))))))},Fl={buttonStyle:{display:"flex",justifyContent:"flex-end",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},kl=e=>{var t,o,a;let{bill:r={}}=e;const{t:u}=i.useTranslation();let c={},s=(null==r||null===(t=r.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const d=(null===(o=s)||void 0===o?void 0:o.reduce((e,t,n)=>0===n?e:e+t.amount,0))||0;let p="₹ "+((null==d||null===(a=d.toFixed)||void 0===a?void 0:a.call(d,0))||Number(0).toFixed(0));s.shift(),s.map(e=>{let t=function(e){var t,n,l;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===(n=e)||void 0===n?void 0:n.expiryDate)&&new Date(null===(l=e)||void 0===l?void 0:l.expiryDate).toLocaleDateString()||"NA",order:-1},i.TL_COMMON_TOTAL_AMT={value:e.amount,order:10},i}(e);c[((e,t)=>{const n=new Date(e),l=new Date(t);return l.getYear()-n.getYear()!=0?"FY"+(n.getYear()+1900)+"-"+(l.getYear()-100):n.toLocaleDateString()+"-"+l.toLocaleDateString()})(e.fromPeriod,e.toPeriod)]=t});let v={};!c||Object.keys(c).map((e,t)=>{Object.keys(c[e]).map(t=>{v[t]=c[e]&&c[e][t]&&c[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[t]);const[f,E]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Fl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Ml,{headers:[...m],values:c,arrears:p}),!f&&l.createElement("div",{style:Fl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Fl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))};function Bl(e){var a,r,u,c,s,d,p,v,m,f,E,h,g,S;let{applicationDetails:y,workflowDetails:T,isDataLoading:b,applicationData:A,timelineStatusPrefix:C,showTimeLine:D=!0,statusAttribute:N="status",paymentsList:P,oldValue:R,isInfoLabel:I=!1}=e;const{t:O}=i.useTranslation();function x(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",y);const[L,w]=n.useState({}),[M,F]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==A?void 0:A.status)||M.loading||M.loaded||M.canLoad||F({loading:!1,loaded:!1,canLoad:!0}),null==M||!M.canLoad||M.loading||M.loaded||(F({loading:!0,loaded:!1,canLoad:!0}),function(e,t,n,l){try{Promise.resolve(Digit.PTService.assessmentSearch({tenantId:e,filters:{propertyIds:t}})).then(function(i){function o(){n(a),l({loading:!1,loaded:!0,canLoad:!0})}let a={};const r=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.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==A?void 0:A.tenantId)||tenantId,null==A?void 0:A.propertyId,w,F));const k=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,l+"/"+n+"/"+t.getFullYear()},B=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:k(null==A||null===(i=A.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==A?void 0:A.channel)||""};return l.createElement(Al,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,a,r,u,c,s,d,p,v,m,f,E,h,g,S,T,b,C;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==y?void 0:y.tenantId,businessIds:null==y?void 0:y.applicationNo,history:!0},jsonPath:"ProcessInstances[0].assignes[0].mobileNumber",isArray:!1,d:e=>{let n="";return n="+91 "+_.get(e,"ProcessInstances["+t+"].assignes[0].mobileNumber"),n}}},D=n[t-1],N={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===(c=u[0])||void 0===c?void 0:c.name,mobileNumber:(null==A||null===(s=A.processInstance)||void 0===s||null===(d=s.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(v=e.assignes)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.uuid)&&null!=A&&null!==(f=A.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(h=E[0])&&void 0!==h&&h.mobileNumber?null==A||null===(g=A.processInstance)||void 0===g||null===(S=g.assignes)||void 0===S||null===(T=S[0])||void 0===T?void 0:T.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(C=b[0])||void 0===C?void 0:C.mobileNumber,comment:O(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Al,{data:N,OpenImage:x,privacy:i})}{var D,N,P,R,I;const t={date:k(null==A||null===(D=A.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(P=N[0])||void 0===P?void 0:P.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(R=e.assignes)||void 0===R||null===(I=R[0])||void 0===I?void 0:I.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Al,{data:t,OpenImage:x})}},U=(e,t)=>e?t?e:O(e):O("NA"),H=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),j=window.location.href.includes("employee/noc"),W=window.location.href.includes("employee/obps"),z=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||H?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),V=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?U(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+O(null==e?void 0:e.isUnit):O("N/A"):null!=e&&e.value?U(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):O("N/A"),[K,Y]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},I?l.createElement(xl,{t:O,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==y||null===(a=y.applicationDetails)||void 0===a?void 0:a.map((e,i)=>{var a,r,u,c,s,d,p,v,m,f,E,_,h,g,S,b,A,C,D,N,I,x,w,M,F,k,B,U,K,Y,q,G,X,$,Z,Q,J,ee,te;return l.createElement(l.Fragment,{key:i},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"}:H?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&H?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},j?""+O(e.title):O(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},O(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"}},O(e)))),null==e?void 0:e.tableRows.map((t,i)=>i===(null==e?void 0:e.tableRows.length)-1?l.createElement(n.Fragment,null,l.createElement("hr",{style:{width:"370%",marginTop:"15px"},className:"underline"}),l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{textAlign:"left"}},O(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},O(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||H?{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((n,i)=>{var a,r,u;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:O(n.title),label:O(n.title),text:l.createElement("img",{src:O(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:O(n.title),label:window.location.href.includes("tl")||window.location.href.includes("ws")?l.createElement("div",{style:{width:"200%"}},l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},O(null==n?void 0:n.title)))):j||W?""+O(n.title):O(n.title),text:l.createElement("div",null,l.createElement(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==n?void 0:n.value))),last:i===(null==e||null===(u=e.values)||void 0===u?void 0:u.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:z(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement("div",null,window.location.href.includes("modify")?l.createElement(t.Row,{className:"border-none",key:""+n.title,label:""+O(""+n.title),privacy:null==n?void 0:n.privacy,text:null!=n&&n.oldValue?null==n?void 0:n.oldValue:null!=n&&n.value?null==n?void 0:n.value:"",labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}):l.createElement(t.Row,{key:O(n.title),label:O(n.title),text:V(n),last:i===(null==e||null===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:z(),labelStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"},textStyle:{wordBreak:"break-all",fontWeight:n.isBold?"bold":"normal",fontStyle:n.isBold?"italic":"normal"}}),"PT_TOTAL_DUES"===n.title?l.createElement(kl,{bill:null===(r=L.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(yl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:P}),(null==y||null===(u=y.applicationData)||void 0===u||null===(c=u.additionalDetails)||void 0===c||null===(s=c.fieldinspection_pending)||void 0===s?void 0:s.length)>0&&(null==e||null===(d=e.additionalDetails)||void 0===d?void 0:d.fiReport)&&l.createElement(vl,{fiReport:null==y||null===(p=y.applicationData)||void 0===p||null===(v=p.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors)&&l.createElement(gl,{floors:null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(Sl,{owners:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.owners}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.units)&&l.createElement(Dl,{units:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&l.createElement(Cl,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==T||null===(C=T.data)||void 0===C||null===(D=C.nextActions)||void 0===D?void 0:D.length)>0&&l.createElement(El,{applicationData:null==y?void 0:y.applicationData,t:O,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(dl,{t:O,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.noc)&&l.createElement(fl,{t:O,isNoc:!0,NOCdata:e.values,applicationData:null==y?void 0:y.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:T}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.scruntinyDetails)&&l.createElement(yl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(yl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.subOccupancyTableDetails)&&l.createElement(Tl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==y?void 0:y.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(sl,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.documents)&&l.createElement(_l,{documents:null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.documents}),(null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation)&&l.createElement(hl,{taxHeadEstimatesCalculation:null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Nl,{wsAdditionalDetails:e,oldValue:R}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===($=e.additionalDetails)||void 0===$||null===(Z=$.redirectUrl)||void 0===Z?void 0:Z.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(Q=e.additionalDetails)||void 0===Q||null===(J=Q.redirectUrl)||void 0===J?void 0:J.title))),(null==e||null===(ee=e.additionalDetails)||void 0===ee?void 0:ee.estimationDetails)&&l.createElement(Il,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(te=e.additionalDetails)||void 0===te?void 0:te.estimationDetails)&&l.createElement(Ll,{wsAdditionalDetails:e,workflowDetails:T}))}),D&&(null==T||null===(r=T.data)||void 0===r||null===(u=r.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==T?void 0:T.isLoading)||b)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!b&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},O("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=T&&null!==(c=T.data)&&void 0!==c&&c.timeline&&1===(null==T||null===(s=T.data)||void 0===s||null===(d=s.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:O(""+C+(null==T||null===(p=T.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state)),customChild:B(null==T||null===(m=T.data)||void 0===m?void 0:m.timeline[0],null==T||null===(f=T.data)||void 0===f?void 0:f.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==T||null===(E=T.data)||void 0===E?void 0:E.timeline)&&(null==T||null===(h=T.data)||void 0===h?void 0:h.timeline.slice(0,K?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let a="";var r,u,c,s,d,p;return window.location.href.includes("/obps/")&&(a=null!=T&&null!==(r=T.data)&&void 0!==r&&null!==(u=r.timeline[n-1])&&void 0!==u&&null!==(c=u.state)&&void 0!==c&&c.includes("BACK_FROM")||null!=T&&null!==(s=T.data)&&void 0!==s&&null!==(d=s.timeline[n-1])&&void 0!==d&&null!==(p=d.state)&&void 0!==p&&p.includes("SEND_TO_CITIZEN")?"_NOT_DONE":"SEND_TO_ARCHITECT"===(null==e?void 0:e.performedAction)?"_BY_ARCHITECT_DONE":0==n?"":"_DONE"),l.createElement(l.Fragment,{key:n},l.createElement(t.CheckPoint,{keyValue:n,isCompleted:0===n,info:e.comment,label:O(""+C+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[N])+a),customChild:B(e,n,null==T||null===(o=T.data)||void 0===o?void 0:o.timeline)}))}))),(null==T||null===(g=T.data)||void 0===g||null===(S=g.timeline)||void 0===S?void 0:S.length)>2&&l.createElement(t.LinkButton,{label:O(K?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{Y(e=>!e)}})))))}function Ul(e){var n,i,o,a,r,u,c,s,d,p,v,m,f,E,_,h,g,S;let{t:y,showToast:T,closeToast:b,businessService:A}=e;if(null!=A&&A.includes("NewTL")||null!=A&&A.includes("TL")||null!=A&&A.includes("EDITRENEWAL")){var C;let e="";switch(null==T||null===(C=T.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==T?void 0:T.key)?null==T||null===(n=T.error)||void 0===n?void 0:n.message:y("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==T?void 0:T.key)?null==T||null===(i=T.error)||void 0===i?void 0:i.message:y("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==T?void 0:T.key)?null==T||null===(o=T.error)||void 0===o?void 0:o.message:y("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==T?void 0:T.key)?null==T||null===(a=T.error)||void 0===a?void 0:a.message:y("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==T?void 0:T.key)?null==T||null===(r=T.error)||void 0===r?void 0:r.message:y("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==T?void 0:T.key)?null==T||null===(u=T.error)||void 0===u?void 0:u.message:y("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==T?void 0:T.key)?null==T||null===(c=T.error)||void 0===c?void 0:c.message:y("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==T?void 0:T.key)?null==T||null===(s=T.error)||void 0===s?void 0:s.message:y("ES_"+A+"_"+(null==T||null===(d=T.action)||void 0===d?void 0:d.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,T&&l.createElement(t.Toast,{error:"error"===T.key,label:e,onClose:b}))}if(null!=A&&A.includes("BPA")||null!=A&&A.includes("BPA_LOW")||null!=A&&A.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=A&&A.includes("BPA_OC")?y(e[1]):y(e[0]),n};let n="";switch(null==T||null===(D=T.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==T?void 0:T.key)?null==T||null===(p=T.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==T?void 0:T.key)?null==T||null===(v=T.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==T?void 0:T.key)?null==T||null===(m=T.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==T?void 0:T.key)?null==T||null===(f=T.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==T?void 0:T.key)?null==T||null===(E=T.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==T?void 0:T.key)?null==T||null===(_=T.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==T?void 0:T.key)?null==T||null===(h=T.error)||void 0===h?void 0:h.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==T?void 0:T.key)?null==T||null===(g=T.error)||void 0===g?void 0:g.message:y("ES_"+A+"_"+(null==T||null===(S=T.action)||void 0===S?void 0:S.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,T&&l.createElement(t.Toast,{error:"error"===T.key,label:n,onClose:b}))}{var N,P;const e="error"===(null==T?void 0:T.key)?null==T||null===(N=T.error)||void 0===N?void 0:N.message:"ES_"+A+"_"+(null==T||null===(P=T.action)||void 0===P?void 0:P.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,T&&l.createElement(t.Toast,{error:"error"===T.key,label:y(e),onClose:b}))}}function Hl(e){var o,a,r,c,s,d,p,v,m,f,E,_,h,g,S,y,T,b,A;let{workflowDetails:C,displayMenu:D,onActionSelect:N,setDisplayMenu:P,businessService:R,forcedActionPrefix:I,ActionBarStyle:O={},MenuStyle:x={},isAction:L,applicationDetails:w}=e;const{t:M}=i.useTranslation();let F=Digit.UserService.getUser();const k=n.useRef();if(window.location.href.includes("/obps")||window.location.href.includes("/noc")){const e=sessionStorage.getItem("Digit.citizen.userRequestObject"),t=e?JSON.parse(e):{};F=null==t?void 0:t.value}const B=null===(o=F)||void 0===o||null===(a=o.info)||void 0===a||null===(r=a.roles)||void 0===r?void 0:r.map(e=>e.code);let U=!1,H=!1,j=(null==C||null===(c=C.data)||void 0===c||null===(s=c.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d?void 0:d.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==C||null===(p=C.data)||void 0===p||null===(v=p.nextActions)||void 0===v?void 0:v.filter(e=>(null==B?void 0:B.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(k,()=>{P(!1)},D),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==j?void 0:j.length)||null!=j&&null!==(m=j[0])&&void 0!==m&&null!==(f=m.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==j?void 0:j.length)?(H=!1,U=!0):(null==j?void 0:j.length)>0&&(H=!0,U=!1);const W=Digit.SessionStorage.get("User"),z=null==W||null===(E=W.info)||void 0===E?void 0:E.uuid,V=null==w||null===(_=w.applicationData)||void 0===_||null===(h=_.auditDetails)||void 0===h?void 0:h.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=C&&C.isLoading)&&H&&!U&&!L&&l.createElement(t.ActionBar,{style:u({},O)},D&&(null!=C&&null!==(g=C.data)&&void 0!==g&&null!==(S=g.actionState)&&void 0!==S&&S.nextActions||null!=C&&null!==(y=C.data)&&void 0!==y&&y.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:I||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase()),options:j,optionKey:"action",t:M,onSelect:N,style:x}):null,"ewst"===R?V===z||null==V?l.createElement(t.SubmitBar,{ref:k,label:M("WF_TAKE_ACTION"),onSubmit:()=>P(!D)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+M("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:k,label:M("WF_TAKE_ACTION"),onSubmit:()=>P(!D)})),!(null!=C&&C.isLoading)&&!H&&U&&!L&&l.createElement(t.ActionBar,{style:u({},O)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==j||null===(T=j[0])||void 0===T?void 0:T.action,value:null==j||null===(b=j[0])||void 0===b?void 0:b.action,onClick:e=>{N((null==j?void 0:j[0])||{})}},M((I||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase()))+"_"+(null==j||null===(A=j[0])||void 0===A?void 0:A.action)))))}const jl=()=>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"})),Wl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jl,null));function zl(e){let{action:n,closeWarningPopup:o}=e;const{t:a}=i.useTranslation(),r=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},a("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Wl,{onClick:()=>{o()}}),hideSubmit:!0,isDisabled:!1,popupStyles:r?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,a("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",a("PT_DUE_WARNING_MSG2"))),l.createElement(t.Row,{rowContainerStyle:{display:"flex"},labelStyle:{fontSize:"24px",fontWeight:"700",marginRight:"10%"},textStyle:{fontSize:"24px",fontWeight:"700",marginBottom:"20px"},label:""+a("PT_AMOUNT_DUE"),text:"₹"+a(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:a("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:a("PT_COLLECT"),onSubmit:()=>{var e;return window.location.assign(""+window.location.origin+(null==n||null===(e=n.redirectionUrl)||void 0===e?void 0:e.pathname))},style:{marginLeft:"10px"}})))),")")}const Vl=e=>{var a;const c=Digit.ULBService.getCurrentTenantId(),s=Digit.ULBService.getStateId(),{t:d}=i.useTranslation(),p=o.useHistory();let{id:v}=o.useParams();const[m,f]=n.useState(!1),[E,_]=n.useState(null),[h,g]=n.useState(!1),[S,T]=n.useState(!1),[b,A]=n.useState(!1),{applicationDetails:C,showToast:D,setShowToast:N,isLoading:P,isDataLoading:R,applicationData:I,mutate:O,nocMutation:x,workflowDetails:L,id:w,businessService:M,closeToast:F,moduleCode:k,timelineStatusPrefix:B,forcedActionPrefix:U,statusAttribute:H,ActionBarStyle:j,MenuStyle:W,paymentsList:z,showTimeLine:V=!0,oldValue:K,isInfoLabel:Y=!1,clearDataDetails:q,isAction:G=!1}=e;n.useEffect(()=>{D&&L.revalidate()},[D]);const X=r.useQueryClient(),$=()=>{_(null),g(!1)};return P||S?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,P?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Bl,{applicationDetails:C,id:w,workflowDetails:L,isDataLoading:R,applicationData:I,businessService:M,timelineStatusPrefix:B,statusAttribute:H,paymentsList:z,showTimeLine:V,oldValue:K,isInfoLabel:Y}),h?l.createElement(cl,{t:d,action:E,tenantId:c,state:s,id:v,applicationDetails:C,applicationData:null==C?void 0:C.applicationData,closeModal:$,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,a,r,c,s,v,m,f,_,h,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===(c=r[0])||void 0===c||null===(s=c.comment)||void 0===s?void 0:s.length)&&0!=(null==e||null===(v=e.WaterConnection)||void 0===v||null===(m=v.comment)||void 0===m?void 0:m.length)&&0!=(null==e||null===(f=e.SewerageConnection)||void 0===f||null===(_=f.comment)||void 0===_?void 0:_.length)&&0!=(null==e||null===(h=e.BPA)||void 0===h||null===(g=h.comment)||void 0===g?void 0:g.length)){function S(t){if(l)return t;O&&(T(!0),O(e,{onError:(e,t)=>{T(!1),N({key:"error",error:e}),setTimeout(F,5e3)},onSuccess:(e,t)=>{var l,i,o,a,r,u,c,s,v,m,f,_;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),T(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=E,p.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=E,p.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&p.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")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(s=c.workflow)&&void 0!==s&&s.action.includes("RE-SUBMIT")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(m=v.workflow)&&void 0!==m&&m.action.includes("APPROVE")?N({key:"success",label:d("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(_=f.workflow)&&void 0!==_&&_.action.includes("REJECT")&&N({key:"success",label:d("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(N({key:"success",action:E}),q&&setTimeout(q,3e3),setTimeout(F,5e3),X.clear(),X.refetchQueries("APPLICATION_SEARCH"))}})),$()}T(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&x){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==x?void 0:x.mutateAsync(e)),i=y(function(){return T(!0),Promise.resolve(Promise.all(n)).then(function(e){e&&e.map(e=>{var t,n;Digit.SessionStorage.del(null==e||null===(t=e.Noc)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.nocType)})})},function(e){var t,n,i,o,a,r,u,c,s,p,v,m;T(!1);let f=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(o=i[0])&&void 0!==o&&o.code?d(null==e||null===(a=e.response)||void 0===a||null===(r=a.data)||void 0===r||null===(u=r.Errors)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.code):(null==e||null===(s=e.response)||void 0===s||null===(p=s.data)||void 0===p||null===(v=p.Errors)||void 0===v||null===(m=v[0])||void 0===m?void 0:m.message)||e;$(),N({key:"error",error:{message:f}}),setTimeout(F,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(S):S(i)}alert("Please fill in the comments before submitting")}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==L||null===(a=L.data)||void 0===a?void 0:a.timeline,businessService:M,workflowDetails:L,moduleCode:k}):null,b?l.createElement(zl,{action:E,workflowDetails:L,businessService:M,isWarningPop:b,closeWarningPopup:()=>{A(!1)}}):null,l.createElement(Ul,{t:d,showToast:D,closeToast:F,businessService:M}),l.createElement(Hl,{isAction:G,workflowDetails:L,displayMenu:m,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)N({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(F,5e3);else if(null!=e&&e.isWarningPopUp)A(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,i,o;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))p.push(""+(null==e||null===(l=e.redirectionUrll)||void 0===l?void 0:l.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===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var a,r;p.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 c;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname))}}else if(null!=e&&e.redirectionUrl){var s,d;p.push({pathname:null===(s=e.redirectionUrl)||void 0===s?void 0:s.pathname,state:u({},null===(d=e.redirectionUrl)||void 0===d?void 0:d.state)})}else g(!0);_(e),f(!1)},setDisplayMenu:f,businessService:M,forcedActionPrefix:U,ActionBarStyle:j,MenuStyle:W,applicationDetails:C})))},Kl=["tenantId","payments"];var Yl=l.memo(()=>{var e,a,r,s,d,p,v,f,E,_,h,g,S,y;const{t:T}=i.useTranslation(),{data:b}=Digit.Hooks.useStore.getInitData(),A=Digit.ULBService.getCurrentTenantId(),{tenants:C}=b||{},{id:D}=o.useParams(),[N,P]=n.useState(null),[R,I]=n.useState({}),[O,L]=n.useState(!1),[w,M]=n.useState(!1),[F,k]=n.useState("ptr");o.useHistory();let B=!1;window.location.href.includes("applicationsearch")&&(B=!0),sessionStorage.setItem("applicationNoinAppDetails",D);const{isLoading:U,data:H}=Digit.Hooks.ptr.usePtrApplicationDetail(T,A,D),{mutate:j}=Digit.Hooks.ptr.usePTRApplicationAction(A);let W=Digit.Hooks.useWorkflowDetails({tenantId:(null==H||null===(e=H.applicationData)||void 0===e?void 0:e.tenantId)||A,id:null==H||null===(a=H.applicationData)||void 0===a||null===(r=a.applicationData)||void 0===r?void 0:r.applicationNumber,moduleCode:F,role:"PTR_CEMP"});var z,V;Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:D,audit:!0}}),n.useEffect(()=>{H&&I(m.cloneDeep(H))},[H]),n.useEffect(()=>{var e,t,n;null==W||null===(e=W.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==W||null===(t=W.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===F||k(null==W||null===(n=W.data)||void 0===n?void 0:n.applicationBusinessService)},[W.data]),!Digit.UserService.hasAccess(["PTR_CEMP"])||"ptr"!==(null==W||null===(s=W.data)||void 0===s?void 0:s.applicationBusinessService)||null==W||null===(d=W.data)||void 0===d||null===(p=d.actionState)||void 0===p||null===(v=p.nextActions)||void 0===v||!v.find(e=>"PAY"===e.action)||(W.data.actionState.nextActions=null==W||null===(z=W.data)||void 0===z||null===(V=z.actionState)||void 0===V?void 0:V.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"WF_PAY_APPLICATION",redirectionUrl:{pathname:"/digit-ui/employee/payment/collect/pet-services/"+(null==R||null===(t=R.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let K=[{order:1,label:T("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==R?void 0:R.applicationData,t=C.find(t=>t.code===e.tenantId);return Promise.resolve(x(e.applicationData,t,T)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:Y,isLoading:q}=Digit.Hooks.useRecieptSearch({tenantId:A,businessService:"pet-services",consumerCodes:null==R||null===(f=R.applicationData)||void 0===f||null===(E=f.applicationData)||void 0===E?void 0:E.applicationNumber,isEmployee:!1},{enabled:!(null==R||null===(_=R.applicationData)||void 0===_||null===(h=_.applicationData)||void 0===h||!h.applicationNumber)});return Y&&(null==Y?void 0:Y.Payments.length)>0&&0==q&&K.push({label:T("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,Kl);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"petservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==Y||null===(e=Y.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Y?void 0:Y.Payments[0]})}}),Y&&(null==Y?void 0:Y.Payments.length)>0&&0==q&&K.push({label:T("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(A,{PetRegistrationApplications:[null==H||null===(e=H.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(A,{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("div",null,l.createElement("div",{className:"employee-application-details",style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},T("PTR_PET_APPLICATION_DETAILS")),l.createElement("div",{style:{zIndex:"10",display:"flex",flexDirection:"row-reverse",alignItems:"center",marginTop:"-25px"}},l.createElement("div",{style:{zIndex:"10",position:"relative"}},K&&K.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>L(!O),displayOptions:O,options:K,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(Vl,{isAction:B,applicationDetails:null==R?void 0:R.applicationData,isLoading:U,isDataLoading:U,applicationData:null==R||null===(g=R.applicationData)||void 0===g?void 0:g.applicationData,mutate:j,workflowDetails:W,businessService:F,moduleCode:"pet-services",showToast:N,setShowToast:P,closeToast:()=>{P(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}),"Expired"==(null==R||null===(S=R.applicationData)||void 0===S||null===(y=S.applicationData)||void 0===y?void 0:y.status)&&l.createElement(o.Link,{to:"/digit-ui/employee/ptr/petservice/revised-application"},l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal"})))});const ql={PTRCheckPage:e=>{var o,a,r,u,c,s;let{onSubmit:p,value:v={}}=e;const{t:m}=i.useTranslation(),{address:E,pets:_,isEditPET:h,isUpdatePET:g,ownerss:S}=v,y=h||g?"edit-application":"new-application",[T,b]=n.useState(!1);return l.createElement(l.Fragment,null,l.createElement(d,{currentStep:5}),l.createElement(t.Card,null,l.createElement(t.CardHeader,null,m("PTR_CHECK_YOUR_DETAILS")),l.createElement("div",null,l.createElement("br",null),l.createElement(t.CardSubHeader,null,m("ES_TITILE_OWNER_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:m("PTR_APPLICANT_NAME"),text:""+m(f(null==S?void 0:S.applicantName)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:m("PTR_FATHER_HUSBAND_NAME"),text:""+m(f(null==S?void 0:S.fatherName)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:m("PTR_MOBILE_NUMBER"),text:""+m(f(null==S?void 0:S.mobileNumber)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:m("PTR_EMAIL_ID"),text:""+m(f(null==S?void 0:S.emailId)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,m("ES_TITILE_PET_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:m("PTR_SEARCH_PET_TYPE"),text:""+m(f(null==_||null===(o=_.petType)||void 0===o?void 0:o.value)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_SEARCH_BREED_TYPE"),text:""+m(f(null==_||null===(a=_.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_NAME"),text:""+m(f(null==_?void 0:_.petName)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_DOCTOR_NAME"),text:""+m(f(null==_?void 0:_.doctorName)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_CLINIC_NAME"),text:""+m(f(null==_?void 0:_.clinicName)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_VACCINATED_DATE"),text:""+m(f(null==_?void 0:_.lastVaccineDate)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_AGE"),text:""+m(f((null==_?void 0:_.petAge)+" Months")),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_SEX"),text:""+m(f(null==_||null===(r=_.petGender)||void 0===r?void 0:r.name)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_IDENTIFICATION_MARK"),text:""+m(f(null==_?void 0:_.identificationMark)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_PET_COLOR"),text:""+m(f(null==_||null===(u=_.petColor)||void 0===u?void 0:u.code)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_VACCINATION_NUMBER"),text:""+m(f(null==_?void 0:_.vaccinationNumber)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:m("PTR_SEARCH_BIRTH_ADOPTION"),text:""+m(f(null!=_&&_.adoptionDate?null==_?void 0:_.adoptionDate:null==_?void 0:_.birthDate)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,m("PTR_LOCATION_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:m("PTR_HOUSE_NO"),text:""+m(f(null==E?void 0:E.houseNo)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),(null==E?void 0:E.houseName)&&l.createElement(t.Row,{label:m("PTR_HOUSE_NAME"),text:""+m(f(null==E?void 0:E.houseName)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_STREET_NAME"),text:""+m(f(null==E?void 0:E.streetName)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_ADDRESS_LINE1"),text:""+m(f(null==E?void 0:E.addressline1)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),(null==E?void 0:E.addressline2)&&l.createElement(t.Row,{label:m("PTR_ADDRESS_LINE2"),text:""+m(f(null==E?void 0:E.addressline2)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_ADDRESS_PINCODE"),text:""+m(f(null==E?void 0:E.pincode)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("MYCITY_CODE_LABEL"),text:""+m(f(null==E||null===(c=E.city)||void 0===c?void 0:c.name)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_LOCALITY"),text:""+m(f(null==E||null===(s=E.locality)||void 0===s?void 0:s.i18nKey)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:m("PTR_LANDMARK"),text:""+m(f(null==E?void 0:E.landmark)),actionButton:l.createElement(R,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:m("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{b(!T)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:m("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:p,disabled:!T})))},PTRAcknowledgement:e=>{var a,r;let{data:c,onSuccess:s}=e;const{t:d}=i.useTranslation(),p=Digit.ULBService.getCitizenCurrentTenant(!0),v=Digit.UserService.getUser().info,m=Digit.Hooks.ptr.usePTRCreateAPI(null===(a=c.address)||void 0===a||null===(r=a.city)||void 0===r?void 0:r.code),{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:E}=f||{};return n.useEffect(()=>{try{c.tenantId=p;let e=(e=>{var t,n,l,i,o,a;return e=(e=>{let{ownerss:t}=e,n=u({},t);return e.ownerss=n,e})(e),{PetRegistrationApplications:[u({tenantId:(e=(e=>{var t,n,l,i;let{pets:o}=e,a={petType:null==o||null===(t=o.petType)||void 0===t?void 0:t.value,breedType:null==o||null===(n=o.breedType)||void 0===n?void 0:n.value,petGender:null==o||null===(l=o.petGender)||void 0===l?void 0:l.code,birthDate:null!=o&&o.birthDate?h(null==o?void 0:o.birthDate):null,adoptionDate:null!=o&&o.adoptionDate?h(null==o?void 0:o.adoptionDate):null,identificationMark:null==o?void 0:o.identificationMark,petColor:null==o||null===(i=o.petColor)||void 0===i?void 0:i.colourCode,clinicName:null==o?void 0:o.clinicName,petName:null==o?void 0:o.petName,doctorName:null==o?void 0:o.doctorName,lastVaccineDate:null==o?void 0:o.lastVaccineDate,petAge:null==o?void 0:o.petAge,vaccinationNumber:null==o?void 0:o.vaccinationNumber};return e.pets=a,e})(e=(e=>{var t,n,l;let{address:i}=e,o={pincode:null==i?void 0:i.pincode,landmark:null==i?void 0:i.landmark,city:null==i||null===(t=i.city)||void 0===t?void 0:t.name,doorNo:(null==i?void 0:i.houseNo)||null,street:(null==i?void 0:i.streetName)||null,locality:{code:(null==i||null===(n=i.locality)||void 0===n?void 0:n.i18nKey)||"NA",area:null==i||null===(l=i.locality)||void 0===l?void 0:l.name},buildingName:null==i?void 0:i.houseName,addressLine1:null==i?void 0:i.addressline1,addressLine2:null==i?void 0:i.addressline2};return e.address=o,e})(e))).tenantId},null===(t=e)||void 0===t?void 0:t.ownerss,{applicationType:sessionStorage.getItem("applicationType"),validityDate:(null===(n=e)||void 0===n?void 0:n.validityDate)||null,status:(null===(l=e)||void 0===l?void 0:l.status)||null,expireflag:!1,petToken:sessionStorage.getItem("petToken")||"",previousapplicationnumber:sessionStorage.getItem("petId"),address:e.address,petDetails:e.pets},null===(i=e)||void 0===i?void 0:i.documents,{propertyId:null===(o=e)||void 0===o||null===(a=o.propertyDetails)||void 0===a?void 0:a.propertyId,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}})]}})(c);m.mutate(e,{onSuccess:s})}catch(e){}},[]),m.isLoading||m.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(M,{t:d,data:m.data,isSuccess:m.isSuccess,isLoading:m.isIdle||m.isLoading}),l.createElement(t.StatusTable,null,m.isSuccess&&l.createElement(t.Row,{rowContainerStyle:w,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),m.isSuccess&&l.createElement(t.SubmitBar,{label:d("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=m.data;let t=e&&e[0]||{};const n=E.find(e=>e.code===t.tenantId);return Promise.resolve(x(u({},t),n,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,"CITIZEN"===(null==v?void 0:v.type)?{to:"/digit-ui/citizen"}:{to:"/digit-ui/employee"},l.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:A,PTRNewApplication:e=>{var n,a,c,s;const d=r.useQueryClient(),p=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:m}=o.useLocation(),f=o.useHistory();Digit.ULBService.getStateId();let E=[];const[_,h,g]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:y,isLoading:T}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"CommonFieldsConfig"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.CommonFieldsConfigEmp}});const b=sessionStorage.getItem("petId")?sessionStorage.getItem("petId"):null;sessionStorage.setItem("applicationType",m.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const A=Digit.ULBService.getCitizenCurrentTenant(!0),{data:C}=Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:b}});let D=null==C?void 0:C.PetRegistrationApplications[0];function N(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=_.owners||[];n[l]=t,h(u({},_,{[e]:[...n]}))}else if("units"===e){let e=_.units||[];e=t,h(u({},_,{units:e}))}else h(u({},_,{[e]:u({},_[e],t)}));((e,t,n,l)=>{let i,o=m.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),r=!0):(o=m.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=E.find(e=>e.route===(o||"0")),c=f.push;if(e&&(c=f.replace),n&&(u=l),null===u)return c(p.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,c(i)})(n,l,i,e)}_&&Object.keys(_).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(g(),d.invalidateQueries("PTR_CREATE_PET"));const P=()=>{},R=()=>{};if(T)return l.createElement(t.Loader,null);y=y||S,y.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const I=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRCheckPage"),O=null===(c=Digit)||void 0===c||null===(s=c.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:a,key:r},onSelect:N,onSkip:P,t:v,formData:_,onAdd:R,renewApplication:m.includes("new-application")?{}:D}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(I,{onSubmit:function(){try{return f.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(O,{data:_,onSuccess:()=>{g(),d.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"])}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+E.indexRoute})))},ApplicationDetails:Yl,PTRMyApplications:()=>{const{t:e}=i.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),a=Digit.UserService.getUser().info;let r,u,c=window.location.href.split("/").pop();isNaN(parseInt(c))?r=4:(u=c,r=parseInt(c)+50);let s=isNaN(parseInt(c))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",mobileNumber:null==a?void 0:a.mobileNumber,tenantId:n}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:n};const{isLoading:d,data:p}=Digit.Hooks.ptr.usePTRSearch({filters:s},{filters:s}),{PetRegistrationApplications:v}=p||{};let m=(null==v?void 0:v.length)>0?null==v?void 0:v.map(e=>null==e?void 0:e.applicationNumber):[],f={tenantId:n,referenceIds:m};const{isLoading:E,data:_}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:f}},{filters:{serviceSearchArgs:f},enabled:(null==m?void 0:m.length)>0,cacheTime:0});function h(t){var n;let l=null==_||null===(n=_.Service)||void 0===n?void 0:n.find(e=>{var n;return null==e||null===(n=e.referenceId)||void 0===n?void 0:n.includes(null==t?void 0:t.applicationNumber)});return e(l?"CS_CF_VIEW":"CS_CF_TRACK")}return d||E?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("CS_TITLE_MY_APPLICATIONS")+" "+(v?"("+v.length+")":"")),l.createElement("div",null,(null==v?void 0:v.length)>0&&v.map((e,t)=>l.createElement("div",{key:t},l.createElement(F,{application:e,tenantId:null==a?void 0:a.permanentCity,buttonLabel:h(e)}))),!(null!=v&&v.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_NO_APPLICATION_FOUND_MSG")),0!==(null==v?void 0:v.length)&&l.createElement("div",null,l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},l.createElement("span",{className:"link"},l.createElement(o.Link,{to:"/digit-ui/citizen/ptr/petservice/my-application/"+r},e("PTR_LOAD_MORE_MSG")))))),l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION")," ",l.createElement("span",{className:"link",style:{display:"block"}},l.createElement(o.Link,{to:"/digit-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,a,r,s,d,p,v,m,f,_,h,g,S,y,T,b,A,D,N,P;const{t:R}=i.useTranslation(),{acknowledgementIds:I,tenantId:O}=o.useParams(),[L,w]=n.useState(!1),[M,F]=n.useState(!1),[k,B]=n.useState(null),{data:U}=Digit.Hooks.useStore.getInitData(),{tenants:H}=U||{},{isLoading:j,data:W}=Digit.Hooks.ptr.usePTRSearch({tenantId:O,filters:{applicationNumber:I}}),[z,V]=n.useState(null),K=xe(W,"PetRegistrationApplications",[]),Y=xe(W,"PetRegistrationApplications[0].applicationNumber",[]);let q=K&&K.length>0&&K[0]||{};const G=q;sessionStorage.setItem("ptr-pet",JSON.stringify(G));const[X,$]=n.useState(!1);n.useEffect(()=>{!function(){try{$(!0),Promise.resolve(Digit.PaymentService.fetchBill(O,{businessService:"pet-services",consumerCode:I})).then(function(e){V(e),$(!1)})}catch(e){return Promise.reject(e)}}()},[O,I]);const{isLoading:Z}=Digit.Hooks.ptr.usePTRSearch({tenantId:O,filters:{applicationNumber:Y,audit:!0}},{enabled:!0}),{data:Q,isLoading:J}=Digit.Hooks.useRecieptSearch({tenantId:O,businessService:"pet-services",consumerCodes:I,isEmployee:!1},{enabled:!!I});if(q.workflow||(q.workflow={id:null,tenantId:O,businessService:"pet-services",businessId:null==G?void 0:G.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),j||Z)return l.createElement(t.Loader,null);let ee=[];return ee.push({label:R("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=G||{},t=H.find(t=>t.code===e.tenantId);return Promise.resolve(x(u({},e),t,R)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),Q&&(null==Q?void 0:Q.Payments.length)>0&&0==J&&ee.push({label:R("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;c(e,Le);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[u({},n)]},"petservice-receipt")).then(function(n){return e=n,Promise.resolve(Digit.PaymentService.printReciept(t,{fileStoreIds:e.filestoreIds[0]})).then(function(t){var n;window.open(t[null===(n=e)||void 0===n?void 0:n.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}({tenantId:null==Q||null===(e=Q.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Q?void 0:Q.Payments[0]})}}),Q&&(null==Q?void 0:Q.Payments.length)>0&&0==J&&ee.push({label:R("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(O,{PetRegistrationApplications:[null==W||null===(e=W.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(O,{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(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},R("PTR_PET_APPLICATION_DETAILS")),ee&&ee.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>w(!L),displayOptions:L,options:ee})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICATION_NO_LABEL"),text:null==q?void 0:q.applicationNumber})),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_VALIDITY_DATE"),text:(te=null==q?void 0:q.validityDate,te?new Date(1e3*te).getDate()+"/"+(new Date(1e3*te).getMonth()+1)+"/"+new Date(1e3*te).getFullYear().toString():"NA")})),(null==q?void 0:q.petToken)&&(null==q?void 0:q.petToken.length)>0&&l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_TOKEN"),text:null==q?void 0:q.petToken})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_PINCODE"),text:(null==q||null===(e=q.address)||void 0===e?void 0:e.pincode)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_CITY"),text:(null==q||null===(a=q.address)||void 0===a?void 0:a.city)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_STREET_NAME"),text:(null==q||null===(r=q.address)||void 0===r?void 0:r.street)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_HOUSE_NO"),text:(null==q||null===(s=q.address)||void 0===s?void 0:s.doorNo)||R("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_NAME"),text:(null==q?void 0:q.applicantName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_FATHER/HUSBAND_NAME"),text:(null==q?void 0:q.fatherName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_MOBILE_NO"),text:(null==q?void 0:q.mobileNumber)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_APPLICANT_EMAILID"),text:(null==q?void 0:q.emailId)||R("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},R("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_TYPE"),text:(null==q||null===(d=q.petDetails)||void 0===d?void 0:d.petType)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_BREED_TYPE"),text:(null==q||null===(p=q.petDetails)||void 0===p?void 0:p.breedType)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_DOCTOR_NAME"),text:(null==q||null===(v=q.petDetails)||void 0===v?void 0:v.doctorName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_CLINIC_NAME"),text:(null==q||null===(m=q.petDetails)||void 0===m?void 0:m.clinicName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATED_DATE"),text:(null==q||null===(f=q.petDetails)||void 0===f?void 0:f.lastVaccineDate)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATION_NUMBER"),text:(null==q||null===(_=q.petDetails)||void 0===_?void 0:_.vaccinationNumber)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_NAME"),text:(null==q||null===(h=q.petDetails)||void 0===h?void 0:h.petName)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_AGE"),text:(null==q||null===(g=q.petDetails)||void 0===g?void 0:g.petAge)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_PET_SEX"),text:(null==q||null===(S=q.petDetails)||void 0===S?void 0:S.petGender)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_IDENTIFICATION_MARK"),text:(null==q||null===(y=q.petDetails)||void 0===y?void 0:y.identificationMark)||R("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:R("PTR_VACCINATION_NUMBER"),text:(null==q||null===(T=q.petDetails)||void 0===T?void 0:T.vaccinationNumber)||R("CS_NA")}),null!=q&&null!==(b=q.petDetails)&&void 0!==b&&b.birthDate?(null==q||null===(A=q.petDetails)||void 0===A?void 0:A.birthDate)&&l.createElement(t.Row,{className:"border-none",label:R("PTR_BIRTH"),text:E(null==q||null===(D=q.petDetails)||void 0===D?void 0:D.birthDate)||R("CS_NA")}):(null==q||null===(N=q.petDetails)||void 0===N?void 0:N.adoptionDate)&&l.createElement(t.Row,{className:"border-none",label:R("PTR_ADOPTION"),text:E(null==q||null===(P=q.petDetails)||void 0===P?void 0:P.adoptionDate)||R("CS_NA")})),l.createElement(C,{application:G,id:null==G?void 0:G.applicationNumber,userType:"citizen"}),k&&l.createElement(t.Toast,{error:k.key,label:R(k.label),style:{bottom:"0px"},onClose:()=>{B(null)}})),M&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:F,setShowToast:B,data:W})));var te},PTRCreatePet:e=>{var n,a,c,s;const d=r.useQueryClient(),p=o.useRouteMatch(),{t:v}=i.useTranslation(),{pathname:m}=o.useLocation(),f=o.useHistory();Digit.ULBService.getStateId();let E=[];const[_,h,g]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:y,isLoading:T}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"CommonFieldsConfig"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.CommonFieldsConfigEmp}});const b=sessionStorage.getItem("petId")?sessionStorage.getItem("petId"):null;sessionStorage.setItem("applicationType",m.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const A=Digit.ULBService.getCitizenCurrentTenant(!0),{data:C}=Digit.Hooks.ptr.usePTRSearch({tenantId:A,filters:{applicationNumber:b}});let D=null==C?void 0:C.PetRegistrationApplications[0];function N(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=_.owners||[];n[l]=t,h(u({},_,{[e]:[...n]}))}else if("units"===e){let e=_.units||[];e=t,h(u({},_,{units:e}))}else h(u({},_,{[e]:u({},_[e],t)}));((e,t,n,l)=>{let i,o=m.split("/").pop(),a=o.charAt(o.length-1),r=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),r=!0):(o=m.slice(0,-2),o=o.split("/").pop(),r=!0):r=!1,isNaN(a)||(r=!0);let{nextStep:u={}}=E.find(e=>e.route===(o||"0")),c=f.push;if(e&&(c=f.replace),n&&(u=l),null===u)return c(p.path+"/check");i=isNaN(u.split("/").pop())&&r&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,c(i)})(n,l,i,e)}_&&Object.keys(_).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(g(),d.invalidateQueries("PTR_CREATE_PET"));const P=()=>{},R=()=>{};if(T)return l.createElement(t.Loader,null);y=y||S,y.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const I=null===(n=Digit)||void 0===n||null===(a=n.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRCheckPage"),O=null===(c=Digit)||void 0===c||null===(s=c.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:a,key:r}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:a,key:r},onSelect:N,onSkip:P,t:v,formData:_,onAdd:R,renewApplication:m.includes("new-application")?{}:D}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(I,{onSubmit:function(){try{return f.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:_})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(O,{data:_,onSuccess:()=>{g(),d.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"]),sessionStorage.removeItem("petToken")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+E.indexRoute})))},PTRCitizenDetails:e=>{var i,o,a,r,c;let{t:s,config:p,onSelect:v,userType:m,formData:f,renewApplication:E}=e;const _=Digit.UserService.getUser().info,h={width:"EMPLOYEE"===_.type?"50%":"86%"};let g={};const[S,y]=n.useState((null==E?void 0:E.applicantName)||("EMPLOYEE"===_.type?"":null==_?void 0:_.name)||(null==f||null===(i=f.ownerss)||void 0===i?void 0:i.applicantName)||""),[T,b]=n.useState((null==E?void 0:E.emailId)||(null==f||null===(o=f.ownerss)||void 0===o?void 0:o.emailId)||""),[A,C]=n.useState((null==E?void 0:E.mobileNumber)||("EMPLOYEE"===_.type?"":null==_?void 0:_.mobileNumber)||(null==f||null===(a=f.ownerss)||void 0===a?void 0:a.mobileNumber)||""),[D,N]=n.useState((null==f||null===(r=f.ownerss)||void 0===r?void 0:r.alternateNumber)||""),[P,R]=n.useState((null==E?void 0:E.fatherName)||(null==f||null===(c=f.ownerss)||void 0===c?void 0:c.fatherName)||""),I=()=>{let e,t=f.ownerss;"citizen"===m?(e=u({},t,{applicantName:S,mobileNumber:A,alternateNumber:D,fatherName:P,emailId:T}),v(p.key,u({},f[p.key],e),!1)):(e=u({},t,{applicantName:S,mobileNumber:A,alternateNumber:D,fatherName:P,emailId:T}),v(p.key,e,!1))};return n.useEffect(()=>{"citizen"===m&&I()},[S,A,P,T]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:1}),l.createElement(t.FormStep,{config:p,onSelect:I,onSkip:()=>v(),t:s,isDisabled:!(S&&A&&P&&T)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+s("PTR_APPLICANT_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:S,style:h,onChange:function(e){y(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:s("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+s("PTR_MOBILE_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.MobileNumber,{value:A,name:"mobileNumber",onChange:e=>{C({value:e}.value)},style:{width:"EMPLOYEE"===_.type?"49%":"86%"},required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:s("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+s("PTR_ALT_MOBILE_NUMBER")),l.createElement(t.MobileNumber,{value:D,name:"alternateNumber",onChange:e=>{N({value:e}.value)},style:{width:"EMPLOYEE"===_.type?"49%":"86%"},required:!1,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:s("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+s("PTR_FATHER_HUSBAND_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",style:h,value:P,onChange:function(e){R(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:s("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+s("PTR_EMAIL_ID")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:s,type:"email",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:T,style:h,onChange:function(e){b(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",type:"email",title:s("PT_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var i,o,r,c,s,p,v,m,f,_,h,g,S,y,T,b,A,C,D,N,P,R,I,O,x,L,w,M,F,k,B,U,H;let{t:j,config:W,onSelect:z,userType:V,formData:K,renewApplication:Y}=e;const q=Digit.UserService.getUser().info,G=e=>e?{i18nKey:e,code:e,value:e}:null;let X={},{data:$}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"PetService",[{name:"PetColor"}],{select:e=>{var t;return null==e||null===(t=e.PetService)||void 0===t?void 0:t.PetColor.map(e=>({i18nKey:""+e.colourName,colourCode:""+e.colourCode,code:""+e.colourName,active:""+e.active}))}});const Z={width:"EMPLOYEE"===q.type?"50%":"86%"},[Q,J]=n.useState(G(null==Y||null===(i=Y.petDetails)||void 0===i?void 0:i.petType)||(null==K||null===(o=K.pets)||void 0===o?void 0:o.petType)||""),[ee,te]=n.useState(G(null==Y||null===(r=Y.petDetails)||void 0===r?void 0:r.breedType)||(null==K||null===(c=K.pets)||void 0===c?void 0:c.breedType)||""),[ne,le]=n.useState(G(null==Y||null===(s=Y.petDetails)||void 0===s?void 0:s.petGender)||(null==K||null===(p=K.pets)||void 0===p?void 0:p.petGender)||""),[ie,oe]=n.useState((null==Y||null===(v=Y.petDetails)||void 0===v?void 0:v.petName)||(null==K||null===(m=K.pets)||void 0===m?void 0:m.petName)||""),[ae,re]=n.useState((null==Y||null===(f=Y.petDetails)||void 0===f?void 0:f.petAge)||(null==K||null===(_=K.pets)||void 0===_?void 0:_.petAge)||""),[ue,ce]=n.useState((null==Y||null===(h=Y.petDetails)||void 0===h?void 0:h.petName)||(null==K||null===(g=K.pets)||void 0===g?void 0:g.doctorName)||""),[se,de]=n.useState((null==Y||null===(S=Y.petDetails)||void 0===S?void 0:S.clinicName)||(null==K||null===(y=K.pets)||void 0===y?void 0:y.clinicName)||""),[pe,ve]=n.useState((null==Y||null===(T=Y.petDetails)||void 0===T?void 0:T.vaccinationNumber)||(null==K||null===(b=K.pets)||void 0===b?void 0:b.vaccinationNumber)||""),[me,fe]=n.useState((null==Y||null===(A=Y.petDetails)||void 0===A?void 0:A.lastVaccineDate)||(null==K||null===(C=K.pets)||void 0===C?void 0:C.lastVaccineDate)||""),[Ee,_e]=n.useState((null==K||null===(D=K.pets)||void 0===D?void 0:D.petColor)||""),[he,ge]=n.useState((null==Y||null===(N=Y.petDetails)||void 0===N?void 0:N.identificationMark)||(null==K||null===(P=K.pets)||void 0===P?void 0:P.identificationMark)||""),[Se,ye]=n.useState(G(null!=Y&&null!==(R=Y.petDetails)&&void 0!==R&&R.birthDate||null!=Y&&null!==(I=Y.petDetails)&&void 0!==I&&I.adoptionDate?null!=Y&&null!==(O=Y.petDetails)&&void 0!==O&&O.birthDate?"Birth":"Adoption":null)||G(null!=K&&null!==(x=K.pets)&&void 0!==x&&x.birthDate||null!=K&&null!==(L=K.pets)&&void 0!==L&&L.adoptionDate?null!=K&&null!==(w=K.pets)&&void 0!==w&&w.birthDate?"Birth":"Adoption":null)||[{i18nKey:"",code:""}]),[Te,be]=n.useState(E(null==Y||null===(M=Y.petDetails)||void 0===M?void 0:M.birthDate)||(null==K||null===(F=K.pets)||void 0===F?void 0:F.birthDate)||""),[Ae,Ce]=n.useState(E(null==Y||null===(k=Y.petDetails)||void 0===k?void 0:k.adoptionDate)||(null==K||null===(B=K.pets)||void 0===B?void 0:B.adoptionDate)||""),De=Digit.ULBService.getStateId(),{data:Ne}=Digit.Hooks.ptr.usePTRPetMDMS(De,"PetService","PetType"),{data:Pe}=Digit.Hooks.ptr.useBreedTypeMDMS(De,"PetService","BreedType");let Re=[],Ie=[];Ne&&Ne.map(e=>{Re.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:Oe}=a.useForm();Pe&&Pe.map(e=>{e.PetType==(null==Q?void 0:Q.code)&&Ie.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})}),n.useEffect(()=>{var e;null!=Y&&Y.petDetails&&_e(null==$||null===(e=$.filter(e=>{var t;return(null==e?void 0:e.colourCode)===(null==Y||null===(t=Y.petDetails)||void 0===t?void 0:t.petColor)}))||void 0===e?void 0:e[0])},[$]);const{data:xe}=Digit.Hooks.ptr.usePTRGenderMDMS(De,"common-masters","GenderType");let Le=[];xe&&xe.map(e=>{"TRANSGENDER"!==e.code&&Le.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{if(Te){const[e,t,n]=Te.split("-").map(Number),l=new Date(e,t-1,n),i=new Date;let o=i.getFullYear()-l.getFullYear(),a=i.getMonth()-l.getMonth();a<0&&(o-=1,a+=12),re(12*o+a)}},[Te]);const we=()=>{let e;e=u({},K.pets,{petType:Q,breedType:ee,petGender:ne,petName:ie,petAge:ae,doctorName:ue,clinicName:se,lastVaccineDate:me,vaccinationNumber:pe,birthDate:Te,adoptionDate:Ae,identificationMark:he,petColor:Ee}),z(W.key,e,!1)};return n.useEffect(()=>{"citizen"===V&&we()},[Q,ee,ne,ie,ae,ue,me,Te,Ae,he,Ee]),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:2}),l.createElement(t.FormStep,{config:W,onSelect:we,onSkip:()=>z(),t:j,isDisabled:!(Q&&ee&&ne&&ie&&ae&&ue&&se&&me&&pe&&(!Te&&Ae||!Ae&&Te))},l.createElement("div",null,l.createElement(t.CardLabel,null,""+j("PTR_SEARCH_PET_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:Oe,name:"petType",defaultValue:Q,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Q,select:J,option:Re,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_SEARCH_BREED_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:Oe,name:"breedType",defaultValue:ee,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ee,select:te,option:Ie,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_PET_SEX")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:Oe,name:"petGender",defaultValue:ne,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ne,select:le,option:Le,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_PET_COLOR")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(a.Controller,{control:Oe,name:"petColor",defaultValue:Ee,rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Ee,select:_e,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},option:$,optionKey:"i18nKey",t:j,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+j("PTR_SELECT_BIRTH_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:j,options:[{i18nKey:"Birth",code:"Birth"},{i18nKey:"Adoption",code:"Adoption"}],optionsKey:"code",name:"selectBirthAdoption",value:Se,selectedOption:Se,innerStyles:{display:"inline-block",marginLeft:"20px",paddingBottom:"2px",marginBottom:"2px"},onSelect:ye,isDependent:!0}),("Birth"===(null==Se?void 0:Se.code)||(null==Y||null===(U=Y.petDetails)||void 0===U?void 0:U.birth))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+j("PTR_BIRTH")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"birthDate",value:Te,onChange:function(e){Ce(null),be(e.target.value)},style:Z,max:(new Date).toISOString().split("T")[0],rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||j("ERR_DEFAULT_INPUT_FIELD_MSG")}})),("Adoption"===(null==Se?void 0:Se.code)||(null==Y||null===(H=Y.petDetails)||void 0===H?void 0:H.adoption))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+j("PTR_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"adoptionDate",value:Ae,onChange:function(e){be(null),Ce(e.target.value)},style:Z,max:(new Date).toISOString().split("T")[0],rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||j("ERR_DEFAULT_INPUT_FIELD_MSG")}})),l.createElement(t.CardLabel,null,""+j("PTR_PET_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:ie,onChange:function(e){oe(e.target.value)},style:Z,ValidationRequired:!1},X={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:j("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+j("PTR_IDENTIFICATION_MARK")),l.createElement(t.TextInput,{t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"identificationMark",value:he,onChange:function(e){ge(e.target.value)},style:Z,ValidationRequired:!1}),l.createElement(t.CardLabel,null,j("PTR_PET_AGE")+" (in months)"," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:ae,onChange:function(e){re(e.target.value)},style:Z,placeholder:"in months",ValidationRequired:!0},X={isRequired:!0,pattern:"^(?:[1-9][0-9]?|[1-3][0-9]{2}|400)$",type:"tel",title:j("PT_NAME_ERROR_MESSAGE")})),null!=ae&&ae>=0&&l.createElement("div",null,Math.floor(ae/12)," ",1===Math.floor(ae/12)?"YEAR":"YEARS"," ",ae%12," ",ae%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+j("PTR_DOCTOR_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:ue,onChange:function(e){ce(e.target.value)},style:Z,ValidationRequired:!1},X={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:j("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+j("PTR_CLINIC_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:se,onChange:function(e){de(e.target.value)},style:Z,ValidationRequired:!1},X={isRequired:!0,pattern:"^[a-zA-Z0-9 .,?!'\"-]+$",type:"text",title:j("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+j("PTR_VACCINATED_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:me,onChange:function(e){fe(e.target.value)},style:Z,max:(new Date).toISOString().split("T")[0],rules:{required:j("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||j("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+j("PTR_VACCINATION_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:j,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:pe,onChange:function(e){ve(e.target.value)},style:Z}))))},PTRSelectAddress:e=>{var i,r,c,s,p,v,m,f,E,_,h,g,S,y,T,b,A,C,D,N,P,R,I;let{t:O,config:x,onSelect:L,formData:w,renewApplication:M}=e;const F=e=>e?{i18nKey:e,code:e,value:e}:null,k=Digit.Hooks.ptr.useTenants(),{pathname:B}=o.useLocation();let U={};const{control:H}=a.useForm(),j=Digit.UserService.getUser().info,[W,z]=n.useState((null==M||null===(i=M.address)||void 0===i?void 0:i.pincode)||(null==w||null===(r=w.address)||void 0===r?void 0:r.pincode)||""),[V,K]=n.useState((null==w||null===(c=w.address)||void 0===c?void 0:c.city)||F(null==M||null===(s=M.address)||void 0===s?void 0:s.city)||""),[Y,q]=n.useState(F(null==M||null===(p=M.address)||void 0===p?void 0:p.locality)||(null==w||null===(v=w.address)||void 0===v?void 0:v.locality)||""),[G,X]=n.useState((null==M||null===(m=M.address)||void 0===m?void 0:m.streetName)||(null==M||null===(f=M.address)||void 0===f?void 0:f.street)||(null==w||null===(E=w.address)||void 0===E?void 0:E.streetName)||""),[$,Z]=n.useState((null==M||null===(_=M.address)||void 0===_?void 0:_.houseNo)||(null==M||null===(h=M.address)||void 0===h?void 0:h.doorNo)||(null==w||null===(g=w.address)||void 0===g?void 0:g.houseNo)||""),[Q,J]=n.useState((null==M||null===(S=M.address)||void 0===S?void 0:S.landmark)||(null==w||null===(y=w.address)||void 0===y?void 0:y.landmark)||""),[ee,te]=n.useState((null==M||null===(T=M.address)||void 0===T?void 0:T.houseName)||(null==M||null===(b=M.address)||void 0===b?void 0:b.buildingName)||(null==w||null===(A=w.address)||void 0===A?void 0:A.houseName)||""),[ne,le]=n.useState((null==M||null===(C=M.address)||void 0===C?void 0:C.addressline1)||(null==M||null===(D=M.address)||void 0===D?void 0:D.addressLine1)||(null==w||null===(N=w.address)||void 0===N?void 0:N.addressline1)||""),[ie,oe]=n.useState((null==M||null===(P=M.address)||void 0===P?void 0:P.addressline2)||(null==M||null===(R=M.address)||void 0===R?void 0:R.addressLine2)||(null==w||null===(I=w.address)||void 0===I?void 0:I.addressline2)||""),{data:ae}=Digit.Hooks.useBoundaryLocalities(null==V?void 0:V.code,"revenue",{enabled:!!V},O);let re=[];return ae&&ae.map((e,t)=>{re.push({i18nKey:e.i18nkey,code:e.code,label:e.label})}),l.createElement(l.Fragment,null,l.createElement(d,{currentStep:3}),l.createElement(t.FormStep,{config:x,onSelect:()=>{let e=u({},w.address,{pincode:W,city:V,locality:Y,streetName:G,houseNo:$,landmark:Q,houseName:ee,addressline1:ne,addressline2:ie});L(x.key,u({},w[x.key],e),!1)},onSkip:()=>L(),t:O,isDisabled:!(W&&V&&G&&$&&Q&&(B.includes("revised")||B.includes("renew")||Y)&&ne)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+O("PTR_HOUSE_NO")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseNo",value:$,placeholder:"Enter House No",onChange:e=>{Z(e.target.value)},style:{width:"EMPLOYEE"===j.type?"50%":"86%"},ValidationRequired:!0},U={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:O("PTR_HOUSE_NO_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_HOUSE_NAME")),l.createElement(t.TextInput,{t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"houseName",value:ee,placeholder:"Enter House Name",onChange:e=>{te(e.target.value)},style:{width:"EMPLOYEE"===j.type?"50%":"86%"},ValidationRequired:!1}),l.createElement(t.CardLabel,null,""+O("PTR_STREET_NAME")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"streetName",value:G,placeholder:"Enter Street Name",onChange:e=>{X(e.target.value)},style:{width:"EMPLOYEE"===j.type?"50%":"86%"},ValidationRequired:!0},U={pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"text",title:O("PTR_STREET_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_ADDRESS_LINE1")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline1",value:ne,placeholder:"Enter Address",onChange:e=>{le(e.target.value)},style:{width:"EMPLOYEE"===j.type?"50%":"86%"},ValidationRequired:!0},U={isRequired:!1,pattern:"^[a-zA-Z0-9 .,?!'\"-]+$",type:"textarea",title:O("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_ADDRESS_LINE2")),l.createElement(t.TextInput,u({t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"addressline2",value:ie,placeholder:"Enter Address",onChange:e=>{oe(e.target.value)},style:{width:"EMPLOYEE"===j.type?"50%":"86%"},ValidationRequired:!0},U={isRequired:!1,pattern:"^[a-zA-Z ]*$",type:"textarea",title:O("SV_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_LANDMARK")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextArea,u({t:O,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"landmark",value:Q,placeholder:"Enter Landmark",onChange:e=>{J(e.target.value)},style:{width:"50%"},ValidationRequired:!0},U={isRequired:!0,pattern:"^[a-zA-Z0-9 ,\\-]+$",type:"textarea",title:O("PTR_LANDMARK_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+O("PTR_CITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(a.Controller,{control:H,name:"city",defaultValue:V,rules:{required:O("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:V,select:K,option:k,optionKey:"i18nKey",t:O,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+O("PTR_LOCALITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(a.Controller,{control:H,name:"locality",defaultValue:Y,rules:{required:O("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Y,select:q,option:re,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},optionKey:"i18nKey",t:O,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+O("PTR_ADDRESS_PINCODE")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(t.TextInput,{t:O,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:W,onChange:e=>{const t=e.target.value.slice(0,6);z(t)},placeholder:"Enter Pincode",style:{width:"EMPLOYEE"===j.type?"50%":"86%"},ValidationRequired:!0,validation:{required:!1,pattern:"^[0-9]{6}$",type:"tel",title:O("SV_ADDRESS_PINCODE_INVALID")},maxLength:6}))))},PTRSelectProofIdentity:e=>{var i,a,r;let{t:c,config:s,onSelect:p,formData:v,renewApplication:m}=e;const[f,E]=n.useState((null==v||null===(i=v.documents)||void 0===i?void 0:i.documents)||[]),[_,h]=n.useState(null),[g,S]=n.useState(!0),[y,T]=n.useState(!1),{pathname:A}=o.useLocation(),C=Digit.UserService.getUser().info,D=Digit.ULBService.getStateId(),{isLoading:N,data:P}=Digit.Hooks.ptr.usePetMDMS(D,"PetService","Documents"),R=e=>{if(e.length>0){const t={documentType:"PET.PETPHOTO",filestoreId:e[0],documentUid:e[0]};E(e=>[...e.filter(e=>"PET.PETPHOTO"!==e.documentType),t])}};return n.useEffect(()=>{var e,t;let n=0;null==P||null===(e=P.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.forEach(e=>{let t=!1;f.forEach(n=>{var l;e.required&&null!=n&&null!==(l=n.documentType)&&void 0!==l&&l.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),0===n&&f.length>0&&f.some(e=>"PET.PETPHOTO"===e.documentType)?S(!0):S(!1)},[f,y]),l.createElement("div",null,l.createElement(d,{currentStep:4}),N?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:c,config:s,onSelect:()=>{let e=u({},v.documents,{documents:f});p(s.key,e)},onSkip:()=>p(),isDisabled:!g},null==P||null===(a=P.PetService)||void 0===a||null===(r=a.Documents)||void 0===r?void 0:r.map((e,n)=>"PET.PETPHOTO"!==(null==e?void 0:e.code)||A.includes("revised-application")?l.createElement(b,{key:n,document:e,t:c,error:_,setError:h,setDocuments:E,documents:f,setCheckRequiredFields:T,renewApplication:m,user:C}):l.createElement("div",{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},c("PET_PETPHOTO"),l.createElement("span",{style:{color:"#b0242c"}},c("PET_ONLY_PNG_ALLOWED")," ")),l.createElement("div",{style:{marginLeft:"EMPLOYEE"===(null==C?void 0:C.type)?"37%":""}},l.createElement(t.ImageUploadHandler,{tenantId:D,uploadedImages:f.filter(e=>"PET.PETPHOTO"===e.documentType).map(e=>e.filestoreId),onPhotoChange:R,t:c,error:_,setError:h,maxImages:1})))),_&&l.createElement(t.Toast,{label:_,onClose:()=>h(null),error:!0})))},PTRServiceDoc:e=>{var n;let{t:i,config:o,onSelect:a}=e;Digit.ULBService.getCurrentTenantId();const r=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:u,data:c={}}=Digit.Hooks.ptr.usePetMDMS(r,"PetService","Documents");let s=null==c||null===(n=c.PetService)||void 0===n?void 0:n.Documents;return l.createElement(l.Fragment,null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,i(o.isMutation?"PT_REQIURED_DOC_TRANSFER_OWNERSHIP":"PTR_DOC_REQ_SCREEN_HEADER")),l.createElement("div",null,l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_SUB_HEADER")),l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_TEXT")),l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_SUB_TEXT")),l.createElement(t.CardSubHeader,null,i("PTR_DOC_REQ_SCREEN_LABEL")),l.createElement(t.CardText,{className:"primaryColor"},i("PTR_DOC_REQ_SCREEN_LABEL_TEXT")),l.createElement(t.CardText,{style:{color:"red"}},i("PTR_PDF_AND_JPG_BOTH_FORMAT_ACCEPTED_IN_DOCUMENT_UPLOAD")),l.createElement("div",null,u&&l.createElement(t.Loader,null),Array.isArray(s)?s.map(null!=o&&o.isMutation?(e,n)=>{let{code:o,dropdownData:a}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(o)),l.createElement(t.CardText,{className:"primaryColor"},a.map(e=>i(null==e?void 0:e.code)).join(", ")))}:(e,n)=>{let{code:o,dropdownData:a}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(g(o,".","_"))),a.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(g(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("PTR_COMMON_NEXT"),onSubmit:a}))))},PTRWFApplicationTimeline:C,PropertySearch:e=>{var i,o,r,c,s,d,p,v,m;let{t:f,config:E,onSelect:_,userType:h,formData:g,renewApplication:S}=e;const{control:y}=a.useForm(),T=Digit.UserService.getUser().info;let b={};const[A,C]=n.useState((null==S?void 0:S.propertyId)||(null==g||null===(i=g.propertyDetails)||void 0===i?void 0:i.propertyId)||""),[D,N]=n.useState((null==g||null===(o=g.propertyDetails)||void 0===o?void 0:o.buildingName)||""),[P,R]=n.useState((null==g||null===(r=g.propertyDetails)||void 0===r?void 0:r.doorNo)||""),[I,O]=n.useState((null==g||null===(c=g.propertyDetails)||void 0===c?void 0:c.city)||""),[x,L]=n.useState((null==g||null===(s=g.propertyDetails)||void 0===s?void 0:s.street)||""),[w,M]=n.useState((null==g||null===(d=g.propertyDetails)||void 0===d?void 0:d.locality)||""),[F,k]=n.useState((null==g||null===(p=g.propertyDetails)||void 0===p?void 0:p.pincode)||""),[B,U]=n.useState((null==g||null===(v=g.propertyDetails)||void 0===v?void 0:v.firestationId)||""),[H,j]=n.useState((null==g||null===(m=g.propertyDetails)||void 0===m?void 0:m.gisCode)||""),[W,z]=n.useState(!1),V=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),K=Digit.ULBService.getStateId(),Y=Digit.Hooks.ptr.useTenants(),q={width:"EMPLOYEE"===T.type?"50%":"86%"},G=e=>e?{i18nKey:e,code:e,value:e}:null;let X=[];Y&&Y.map(e=>{X.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name,pinCode:""+e.pincode})});const{data:$}=Digit.Hooks.useBoundaryLocalities(V,"revenue",{enabled:!!V},f);let Z=[];$&&$.map(e=>{Z.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{isLoading:Q,isError:J,data:ee,error:te}=Digit.Hooks.pt.useApplicationDetail(f,K,A,W);n.useEffect(()=>{if(W){if(Q)alert("Loading application details...");else if(J)alert("Error fetching application details");else if(ee){var e,t,n,l,i,o,a,r,u,c,s;const d=null==ee||null===(e=ee.applicationData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.street,p=null==ee||null===(n=ee.applicationData)||void 0===n||null===(l=n.address)||void 0===l?void 0:l.doorNo,v=null==ee||null===(i=ee.applicationData)||void 0===i||null===(o=i.address)||void 0===o?void 0:o.pincode,m=null==ee||null===(a=ee.applicationData)||void 0===a||null===(r=a.address)||void 0===r?void 0:r.city,f=null==ee||null===(u=ee.applicationData)||void 0===u||null===(c=u.address)||void 0===c||null===(s=c.locality)||void 0===s?void 0:s.name;d&&p&&v&&m&&f&&(R(p),L(d),k(v),O(G(m)),M(G(f)))}z(!1)}},[W,Q,J,ee,te]);const{data:ne}=Digit.Hooks.useCustomMDMS(K,"firenoc",[{name:"FireStations"}],{select:e=>{var t;const n=null==e||null===(t=e.firenoc)||void 0===t?void 0:t.FireStations;return null==n?void 0:n.filter(e=>e.baseTenantId===V)}});let le=[];ne&&ne.map(e=>{le.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const ie=()=>{let e;e=u({},g.propertyDetails,{propertyId:A,street:x,buildingName:D,city:I,doorNo:P,locality:w,pincode:F,firestationId:B,gisCode:H}),_(E.key,u({},g[E.key],e),!1)};return n.useEffect(()=>{"citizen"===h&&ie()},[A,I,P,x,w,D,F,B,H]),l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:E,onSelect:ie,onSkip:()=>_(),t:f,isDisabled:!I||!w||!B},l.createElement("div",null,l.createElement("style",null,"\n .select-wrap .options-card {\n width: 100% !important;\n -webkit-box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n position: absolute;\n z-index: 20;\n margin-top: 4px;\n --bg-opacity: 1;\n background-color: #fff;\n background-color: rgba(255, 255, 255, var(--bg-opacity));\n overflow: scroll;\n max-height: 250px; \n min-height:50px;\n } "),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_ID_LABEL")),l.createElement("div",{className:"field-container"},l.createElement(t.TextInput,u({t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"propertyId",value:A,onChange:function(e){C(e.target.value)},style:q,ValidationRequired:!1},b={isRequired:!0,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:f("PT_NAME_ERROR_MESSAGE")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"EMPLOYEE"===T.type?"52%":"95px",marginTop:"-14px",marginRight:"-20px",cursor:"pointer"},onClick:()=>{A?z(!0):console.log("Property ID is required")}}," ",l.createElement(t.SearchIcon,null)," ")),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_DETAILS_BLDG_NAME_LABEL")),l.createElement(t.TextInput,u({t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"buildingName",value:D,onChange:function(e){N(e.target.value)},style:q,ValidationRequired:!1},b={isRequired:!0,pattern:"^[a-zA-Z0-9 ]*$",type:"text",title:f("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_PLOT_NO_LABEL")),l.createElement(t.TextInput,u({t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doorNo",value:P,onChange:function(e){R(e.target.value)},style:q,ValidationRequired:!1},b={isRequired:!0,pattern:"^[0-9/-]*$",type:"text",title:f("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_CITY_LABEL")),l.createElement(a.Controller,{control:y,name:"city",defaultValue:I,rules:{required:f("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:I,select:O,option:X,optionKey:"i18nKey",placeholder:"Select",t:f})}),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_DETAILS_SRT_NAME_LABEL")),l.createElement(t.TextInput,u({t:f,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"street",value:x,defaultValue:x,onChange:function(e){L(e.target.value)},style:q,ValidationRequired:!1},b={isRequired:!0,pattern:"^[a-zA-Z]*$",type:"text",title:f("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_DETAILS_MOHALLA_LABEL")),l.createElement(a.Controller,{control:y,name:"locality",defaultValue:w,rules:{required:f("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:w,select:M,option:Z,optionKey:"i18nKey",placeholder:"Select",t:f})}),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_DETAILS_PIN_LABEL")),l.createElement(t.TextInput,u({t:f,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:F,onChange:function(e){k(e.target.value)},style:q,ValidationRequired:!1},b={isRequired:!1,pattern:"^[0-9]{0,6}*$",type:"text",title:f("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_DETAILS_FIRESTATION_LABEL")),l.createElement(a.Controller,{control:y,name:"firestationId",defaultValue:B,rules:{required:f("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:B,select:U,option:le,optionKey:"i18nKey",placeholder:"Select",t:f})}),l.createElement(t.CardLabel,null,""+f("NOC_PROPERTY_DETAILS_GIS_CORD_LABEL")),l.createElement(t.TextInput,u({t:f,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"gisCode",value:H,onChange:function(e){j(e.target.value)},style:q,ValidationRequired:!1},b={isRequired:!1,type:"text",title:f("PT_NAME_ERROR_MESSAGE")})))))}},Gl=e=>{let{stateCode:t,userType:i,tenants:a}=e;const{path:r,url:u}=o.useRouteMatch(),c=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:c}),Object.entries(ql).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PTR_TENANTS",a),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(Ge,{path:r,url:u,userType:i}):l.createElement(P,null)},Xl=e=>{const{t:o}=i.useTranslation(),[a,r,u]=Digit.Hooks.useSessionStorage("PTR_PET",{});return n.useEffect(()=>{u()},[]),l.createElement(t.CitizenHomeCard,{header:o("ACTION_TEST_PTR"),links:[],Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=i.useTranslation(),[o,a]=n.useState("-"),{data:r,isLoading:u,isFetching:c,isSuccess:s}=Digit.Hooks.useNewInboxGeneral({tenantId:Digit.ULBService.getCurrentTenantId(),ModuleCode:"PTR",filters:{limit:10,offset:0,services:["ptr"]},config:{select:e=>({totalCount:null==e?void 0:e.totalCount,nearingSlaCount:null==e?void 0:e.nearingSlaCount}||"-"),enabled:Digit.Utils.ptrAccess()}});if(n.useEffect(()=>{!c&&s&&a(r)},[c]),!Digit.Utils.ptrAccess())return null;const d=[{count:u?"-":null==o?void 0:o.totalCount,label:e("ES_COMMON_INBOX"),link:"/digit-ui/employee/ptr/petservice/inbox"},{label:e("PTR_TITLE_NEW_PET_REGISTRATION"),link:"/digit-ui/employee/ptr/petservice/new-application",role:"PTR_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/ptr/petservice/my-applications"}],p=Digit.UserService.hasAccess(["PTR_APPROVER","PTR_CEMP","PTR_VERIFIER"])||!1,v={Icon:l.createElement(t.PropertyHouse,null),moduleName:e("PTR_TITLE_PET_REGISTRATION"),kpis:[{count:null==o?void 0:o.totalCount,label:e("ES_TITLE_INBOX"),link:"/digit-ui/employee/ptr/petservice/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||p)};return l.createElement(t.EmployeeModuleCard,v)},PTRModule:Gl,PTRLinks:Xl,PTR_INBOX_FILTER:e=>l.createElement(Qe,e),PTRInboxTableConfig:e=>({PTR:{inboxColumns:t=>[{Header:e("PTR_APPLICATION_NUMBER"),Cell:e=>{var n,i,a,r;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(o.Link,{to:t.parentRoute+"/petservice/application-details/"+(null==u||null===(n=u.original)||void 0===n||null===(i=n.searchData)||void 0===i?void 0:i.applicationNumber)},null===(a=u.original)||void 0===a||null===(r=a.searchData)||void 0===r?void 0:r.applicationNumber)))},mobileCell:e=>{var t;return et(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationNumber)}},{Header:e("PTR_APPLICANT_NAME"),Cell:e=>{var t,n,l,i;return Je(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.applicantName))},mobileCell:e=>{var t;return et(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicantName)}},{Header:e("PTR_PET_TYPE"),Cell:e=>{var t,n,l;let{row:i}=e;return Je(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.petType))},mobileCell:e=>{var t,n;return et(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType)}},{Header:e("PTR_BREED_TYPE"),Cell:e=>{var t,n,l;let{row:i}=e;return Je(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.breedType))},mobileCell:e=>{var t,n;return et(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType)}},{Header:e("PTR_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Je(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return et(e("ES_PTR_COMMON_STATUS_"+(null==t||null===(n=t.workflowData)||void 0===n||null===(l=n.state)||void 0===l?void 0:l.applicationStatus)))}}],serviceRequestIdKey:t=>{var n,l;return null==t||null===(n=t[e("PTR_INBOX_UNIQUE_APPLICATION_NUMBER")])||void 0===n||null===(l=n.props)||void 0===l?void 0:l.children}}})},exports.PTRLinks=Xl,exports.PTRModule=Gl;
|