@upyog/upyog-ui-module-ptr 3.0.0 → 3.0.1

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 CHANGED
@@ -1 +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({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),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;
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"),r=require("react-router-dom"),o=require("react-hook-form"),a=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)}let c=[];const s=e=>{let{currentStep:n=1,flow:r=""}=e;const{t:o}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":c=[];break;default:c=["ES_TITILE_OWNER_DETAILS","ES_TITILE_PET_DETAILS","PTR_LOCATION_DETAILS","ES_TITILE_DOCUMENT_DETAILS","PTR_SUMMARY"]}})(r),l.createElement("div",{className:"timeline-container",style:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},c.map((e,i,r)=>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"},o(e))),i<r.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))};var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var v=p(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]],r="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",p="[object GeneratorFunction]",v="[object Map]",f="[object Number]",m="[object Object]",E="[object RegExp]",_="[object Set]",h="[object String]",g="[object Symbol]",y="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",A="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",R="[object Uint8Array]",P="[object Uint16Array]",I="[object Uint32Array]",O=/\b__p \+= '';/g,w=/\b(__p \+=) '' \+/g,x=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,k=RegExp(L.source),F=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,V=RegExp($.source),K=/^\s+/,Y=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,X=/[^\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\]$/,re=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\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+"]",fe="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ae="(?:"+ve+"|"+_e+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[he,ge,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",De="(?:"+["[\\u2700-\\u27bf]",ge,ye].join("|")+")"+Ce,Ne="(?:"+[he+ve+"?",ve,ge,ye,"[\\ud800-\\udfff]"].join("|")+")",Re=RegExp("['’]","g"),Pe=RegExp(ve,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Ne+Ce,"g"),Oe=RegExp([Se+"?"+me+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fe,De].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["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,ke={};ke[T]=ke[A]=ke[C]=ke[D]=ke[N]=ke[R]=ke["[object Uint8ClampedArray]"]=ke[P]=ke[I]=!0,ke[r]=ke[o]=ke[S]=ke[a]=ke[b]=ke[u]=ke[c]=ke[s]=ke[v]=ke[f]=ke[m]=ke[E]=ke[_]=ke[h]=ke[y]=!1;var Fe={};Fe[r]=Fe[o]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[A]=Fe[C]=Fe[D]=Fe[N]=Fe[v]=Fe[f]=Fe[m]=Fe[E]=Fe[_]=Fe[h]=Fe[g]=Fe[R]=Fe["[object Uint8ClampedArray]"]=Fe[P]=Fe[I]=!0,Fe[c]=Fe[s]=Fe[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof d&&d&&d.Object===Object&&d,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),$e=t&&!t.nodeType&&t,Ve=$e&&e&&!e.nodeType&&e,Ke=Ve&&Ve.exports===$e,Ye=Ke&&He.process,qe=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),Ge=qe&&qe.isArrayBuffer,Ze=qe&&qe.isDate,Xe=qe&&qe.isMap,Qe=qe&&qe.isRegExp,Je=qe&&qe.isSet,et=qe&&qe.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,r=null==e?0:e.length;++i<r;){var o=e[i];t(l,o,n(o),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 rt(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 ot(e,t){for(var n=-1,l=null==e?0:e.length,i=0,r=[];++n<l;){var o=e[n];t(o,n,e)&&(r[i++]=o)}return r}function at(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,r=null==e?0:e.length;for(l&&r&&(n=e[++i]);++i<r;)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 ft=St("length");function mt(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,r=n+(l?1:-1);l?r--:++r<i;)if(t(e[r],r,e))return r;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,r=e.length;++i<r;)if(l(e[i],t))return i;return-1}function gt(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,i){return i(e,function(e,i,r){n=l?(l=!1,e):t(n,e,i,r)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var r=t(e[l]);void 0!==r&&(n=void 0===n?r:n+r)}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,$t(e)+1).replace(K,""):e}function Nt(e){return function(t){return e(t)}}function Rt(e,t){return ct(t,function(t){return e[t]})}function Pt(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 wt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var xt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Lt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Be[e]}function kt(e){return we.test(e)}function Ft(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,r=0,o=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,o[r++]=n)}return o}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Wt(e){return kt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):ft(e)}function zt(e){return kt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function $t(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var Vt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Kt=function e(t){var d,Y=(t=null==t?ze:Kt.defaults(ze.Object(),t,Kt.pick(ze,Le))).Array,se=t.Date,de=t.Error,pe=t.Function,ve=t.Math,fe=t.Object,me=t.RegExp,Ee=t.String,_e=t.TypeError,he=Y.prototype,ge=fe.prototype,ye=t["__core-js_shared__"],Se=pe.prototype.toString,be=ge.hasOwnProperty,Te=0,Ae=(d=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Ce=ge.toString,De=Se.call(fe),Ne=ze._,Ie=me("^"+Se.call(be).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ke?t.Buffer:void 0,Be=t.Symbol,He=t.Uint8Array,We=we?we.allocUnsafe:void 0,$e=Bt(fe.getPrototypeOf,fe),Ve=fe.create,Ye=ge.propertyIsEnumerable,qe=he.splice,ft=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Yt=Be?Be.toStringTag:void 0,qt=function(){try{var e=Qi(fe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Gt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Zt=se&&se.now!==ze.Date.now&&se.now,Xt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Qt=ve.ceil,Jt=ve.floor,en=fe.getOwnPropertySymbols,tn=we?we.isBuffer:void 0,nn=t.isFinite,ln=he.join,rn=Bt(fe.keys,fe),on=ve.max,an=ve.min,un=se.now,cn=t.parseInt,sn=ve.random,dn=he.reverse,pn=Qi(t,"DataView"),vn=Qi(t,"Map"),fn=Qi(t,"Promise"),mn=Qi(t,"Set"),En=Qi(t,"WeakMap"),_n=Qi(fe,"create"),hn=En&&new En,gn={},yn=Nr(pn),Sn=Nr(vn),bn=Nr(fn),Tn=Nr(mn),An=Nr(En),Cn=Be?Be.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,Nn=Cn?Cn.toString:void 0;function Rn(e){if(Vo(e)&&!Lo(e)&&!(e instanceof wn)){if(e instanceof On)return e;if(be.call(e,"__wrapped__"))return Rr(e)}return new On(e)}var Pn=function(){function e(){}return function(t){if(!$o(t))return{};if(Ve)return Ve(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 wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function xn(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 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 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 kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function Fn(e){var t=this.__data__=new Ln(e);this.size=t.size}function Bn(e,t){var n=Lo(e),l=!n&&xo(e),i=!n&&!l&&Bo(e),r=!n&&!l&&!i&&Jo(e),o=n||l||i||r,a=o?Ct(e.length,Ee):[],u=a.length;for(var c in e)!t&&!be.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||rr(c,u))||a.push(c);return a}function Un(e){var t=e.length;return t?e[Ml(0,t-1)]:void 0}function jn(e,t){return br(Ei(e),Gn(t,0,e.length))}function Hn(e){return br(Ei(e))}function Wn(e,t,n){(void 0!==n&&!Io(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&Io(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function $n(e,t){for(var n=e.length;n--;)if(Io(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return el(e,function(e,i,r){t(l,e,n(e),r)}),l}function Kn(e,t){return e&&_i(t,Sa(t),e)}function Yn(e,t,n){"__proto__"==t&&qt?qt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function qn(e,t){for(var n=-1,l=t.length,i=Y(l),r=null==e;++n<l;)i[n]=r?void 0:Ea(e,t[n]);return i}function Gn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Zn(e,t,n,l,i,o){var c,d=1&t,y=2&t,O=4&t;if(n&&(c=i?n(e,l,i,o):n(e)),void 0!==c)return c;if(!$o(e))return e;var w=Lo(e);if(w){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&be.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!d)return Ei(e,c)}else{var x=tr(e),L=x==s||x==p;if(Bo(e))return si(e,d);if(x==m||x==r||L&&!i){if(c=y||L?{}:lr(e),!d)return y?function(e,t){return _i(e,er(e),t)}(e,function(e,t){return e&&_i(t,ba(t),e)}(c,e)):function(e,t){return _i(e,Ji(e),t)}(e,Kn(c,e))}else{if(!Fe[x])return i?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case S:return di(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case A:case C:case D:case N:case R:case"[object Uint8ClampedArray]":case P:case I:return pi(e,n);case v:return new l;case f: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?fe(Dn.call(e)):{}}}(e,x,d)}}o||(o=new Fn);var M=o.get(e);if(M)return M;o.set(e,c),Zo(e)?e.forEach(function(l){c.add(Zn(l,t,n,l,e,o))}):Ko(e)&&e.forEach(function(l,i){c.set(i,Zn(l,t,n,i,e,o))});var k=w?void 0:(O?y?Vi:$i:y?ba:Sa)(e);return lt(k||e,function(l,i){k&&(l=e[i=l]),zn(c,i,Zn(l,t,n,i,e,o))}),c}function Xn(e,t,n){var l=n.length;if(null==e)return!l;for(e=fe(e);l--;){var i=n[l],r=e[i];if(void 0===r&&!(i in e)||!(0,t[i])(r))return!1}return!0}function Qn(e,t,l){if("function"!=typeof e)throw new _e(n);return hr(function(){e.apply(void 0,l)},t)}function Jn(e,t,n,l){var i=-1,r=at,o=!0,a=e.length,u=[],c=t.length;if(!a)return u;n&&(t=ct(t,Nt(n))),l?(r=ut,o=!1):t.length>=200&&(r=Pt,o=!1,t=new kn(t));e:for(;++i<a;){var s=e[i],d=null==n?s:n(s);if(s=l||0!==s?s:0,o&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;u.push(s)}else r(t,d,l)||u.push(s)}return u}Rn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:Rn}},(Rn.prototype=In.prototype).constructor=Rn,(On.prototype=Pn(In.prototype)).constructor=On,(wn.prototype=Pn(In.prototype)).constructor=wn,xn.prototype.clear=function(){this.__data__=_n?_n(null):{},this.size=0},xn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xn.prototype.get=function(e){var t=this.__data__;if(_n){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return _n?void 0!==t[e]:be.call(t,e)},xn.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},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=$n(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=$n(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return $n(this.__data__,e)>-1},Ln.prototype.set=function(e,t){var n=this.__data__,l=$n(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 xn,map:new(vn||Ln),string:new xn}},Mn.prototype.delete=function(e){var t=Zi(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Zi(this,e).get(e)},Mn.prototype.has=function(e){return Zi(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Zi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.clear=function(){this.__data__=new Ln,this.size=0},Fn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Fn.prototype.get=function(e){return this.__data__.get(e)},Fn.prototype.has=function(e){return this.__data__.has(e)},Fn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ln){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=yi(ul),tl=yi(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 r=e[l],o=t(r);if(null!=o&&(void 0===a?o==o&&!Qo(o):n(o,a)))var a=o,u=r}return u}function il(e,t){var n=[];return el(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function rl(e,t,n,l,i){var r=-1,o=e.length;for(n||(n=ir),i||(i=[]);++r<o;){var a=e[r];t>0&&n(a)?t>1?rl(a,t-1,n,l,i):st(i,a):l||(i[i.length]=a)}return i}var ol=Si(),al=Si(!0);function ul(e,t){return e&&ol(e,t,Sa)}function cl(e,t){return e&&al(e,t,Sa)}function sl(e,t){return ot(t,function(t){return Ho(e[t])})}function dl(e,t){for(var n=0,l=(t=oi(t,e)).length;null!=e&&n<l;)e=e[Dr(t[n++])];return n&&n==l?e:void 0}function pl(e,t,n){var l=t(e);return Lo(e)?l:st(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Yt&&Yt in fe(e)?function(e){var t=be.call(e,Yt),n=e[Yt];try{e[Yt]=void 0;var l=!0}catch(e){}var i=Ce.call(e);return l&&(t?e[Yt]=n:delete e[Yt]),i}(e):function(e){return Ce.call(e)}(e)}function fl(e,t){return e>t}function ml(e,t){return null!=e&&be.call(e,t)}function El(e,t){return null!=e&&t in fe(e)}function _l(e,t,n){for(var l=n?ut:at,i=e[0].length,r=e.length,o=r,a=Y(r),u=Infinity,c=[];o--;){var s=e[o];o&&t&&(s=ct(s,Nt(t))),u=an(s.length,u),a[o]=!n&&(t||i>=120&&s.length>=120)?new kn(o&&s):void 0}s=e[0];var d=-1,p=a[0];e:for(;++d<i&&c.length<u;){var v=s[d],f=t?t(v):v;if(v=n||0!==v?v:0,!(p?Pt(p,f):l(c,f,n))){for(o=r;--o;){var m=a[o];if(!(m?Pt(m,f):l(e[o],f,n)))continue e}p&&p.push(f),c.push(v)}}return c}function hl(e,t,n){var l=null==(e=fr(e,t=oi(t,e)))?e:e[Dr(Ur(t))];return null==l?void 0:tt(l,e,n)}function gl(e){return Vo(e)&&vl(e)==r}function yl(e,t,n,l,i){return e===t||(null==e||null==t||!Vo(e)&&!Vo(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=Lo(e),p=Lo(t),y=d?o:tr(e),T=p?o:tr(t),A=(y=y==r?m:y)==m,C=(T=T==r?m:T)==m,D=y==T;if(D&&Bo(e)){if(!Bo(t))return!1;d=!0,A=!1}if(D&&!A)return s||(s=new Fn),d||Jo(e)?Wi(e,t,n,l,i,s):function(e,t,n,l,i,r,o){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!r(new He(e),new He(t)));case a:case u:case f:return Io(+e,+t);case c:return e.name==t.name&&e.message==t.message;case E:case h:return e==t+"";case v:var s=Ft;case _:if(s||(s=jt),e.size!=t.size&&!(1&l))return!1;var d=o.get(e);if(d)return d==t;l|=2,o.set(e,t);var p=Wi(s(e),s(t),l,i,r,o);return o.delete(e),p;case g:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,y,n,l,i,s);if(!(1&n)){var N=A&&be.call(e,"__wrapped__"),R=C&&be.call(t,"__wrapped__");if(N||R){var P=N?e.value():e,I=R?t.value():t;return s||(s=new Fn),i(P,I,n,l,s)}}return!!D&&(s||(s=new Fn),function(e,t,n,l,i,r){var o=1&n,a=$i(e),u=a.length;if(u!=$i(t).length&&!o)return!1;for(var c=u;c--;){var s=a[c];if(!(o?s in t:be.call(t,s)))return!1}var d=r.get(e),p=r.get(t);if(d&&p)return d==t&&p==e;var v=!0;r.set(e,t),r.set(t,e);for(var f=o;++c<u;){var m=e[s=a[c]],E=t[s];if(l)var _=o?l(E,m,s,t,e,r):l(m,E,s,e,t,r);if(!(void 0===_?m===E||i(m,E,n,l,r):_)){v=!1;break}f||(f="constructor"==s)}if(v&&!f){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 r.delete(e),r.delete(t),v}(e,t,n,l,i,s))}(e,t,n,l,yl,i))}function Sl(e,t,n,l){var i=n.length,r=i,o=!l;if(null==e)return!r;for(e=fe(e);i--;){var a=n[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<r;){var u=(a=n[i])[0],c=e[u],s=a[1];if(o&&a[2]){if(void 0===c&&!(u in e))return!1}else{var d=new Fn;if(l)var p=l(c,s,u,e,t,d);if(!(void 0===p?yl(s,c,3,l,d):p))return!1}}return!0}function bl(e){return!(!$o(e)||(t=e,Ae&&Ae in t))&&(Ho(e)?Ie:ie).test(Nr(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ya:"object"==typeof e?Lo(e)?Rl(e[0],e[1]):Nl(e):nu(e)}function Al(e){if(!sr(e))return rn(e);var t=[];for(var n in fe(e))be.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=ko(e)?Y(e.length):[];return el(e,function(e,i,r){l[++n]=t(e,i,r)}),l}function Nl(e){var t=Xi(e);return 1==t.length&&t[0][2]?pr(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Rl(e,t){return ar(e)&&dr(t)?pr(Dr(e),t):function(n){var l=Ea(n,e);return void 0===l&&l===t?_a(n,e):yl(t,l,3)}}function Pl(e,t,n,l,i){e!==t&&ol(t,function(r,o){if(i||(i=new Fn),$o(r))!function(e,t,n,l,i,r,o){var a=Er(e,n),u=Er(t,n),c=o.get(u);if(c)Wn(e,n,c);else{var s=r?r(a,u,n+"",e,t,o):void 0,d=void 0===s;if(d){var p=Lo(u),v=!p&&Bo(u),f=!p&&!v&&Jo(u);s=u,p||v||f?Lo(a)?s=a:Fo(a)?s=Ei(a):v?(d=!1,s=si(u,!0)):f?(d=!1,s=pi(u,!0)):s=[]:qo(u)||xo(u)?(s=a,xo(a)?s=aa(a):$o(a)&&!Ho(a)||(s=lr(u))):d=!1}d&&(o.set(u,s),i(s,u,l,r,o),o.delete(u)),Wn(e,n,s)}}(e,t,o,n,Pl,l,i);else{var a=l?l(Er(e,o),r,o+"",e,t,i):void 0;void 0===a&&(a=r),Wn(e,o,a)}},ba)}function Il(e,t){var n=e.length;if(n)return rr(t+=t<0?n:0,n)?e[t]:void 0}function Ol(e,t,n){t=t.length?ct(t,function(e){return Lo(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Ya];var l=-1;return t=ct(t,Nt(Gi())),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,r=t.criteria,o=i.length,a=n.length;++l<o;){var u=vi(i[l],r[l]);if(u)return l>=a?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 wl(e,t,n){for(var l=-1,i=t.length,r={};++l<i;){var o=t[l],a=dl(e,o);n(a,o)&&jl(r,oi(o,e),a)}return r}function xl(e,t,n,l){var i=l?ht:_t,r=-1,o=t.length,a=e;for(e===t&&(t=Ei(t)),n&&(a=ct(e,Nt(n)));++r<o;)for(var u=0,c=t[r],s=n?n(c):c;(u=i(a,s,u,l))>-1;)a!==e&&qe.call(a,u,1),qe.call(e,u,1);return e}function Ll(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==r){var r=i;rr(i)?qe.call(e,i,1):Ql(e,i)}}return e}function Ml(e,t){return e+Jt(sn()*(t-e+1))}function kl(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 Fl(e,t){return gr(vr(e,t,Ya),e+"")}function Bl(e){return Un(Ia(e))}function Ul(e,t){var n=Ia(e);return br(n,Gn(t,0,n.length))}function jl(e,t,n,l){if(!$o(e))return e;for(var i=-1,r=(t=oi(t,e)).length,o=r-1,a=e;null!=a&&++i<r;){var u=Dr(t[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=o){var s=a[u];void 0===(c=l?l(s,u,a):void 0)&&(c=$o(s)?s:rr(t[i+1])?[]:{})}zn(a,u,c),a=a[u]}return e}var Hl=hn?function(e,t){return hn.set(e,t),e}:Ya,Wl=qt?function(e,t){return qt(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:Ya;function zl(e){return br(Ia(e))}function $l(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 r=Y(i);++l<i;)r[l]=e[l+t];return r}function Vl(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Kl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var r=l+i>>>1,o=e[r];null!==o&&!Qo(o)&&(n?o<=t:o<t)?l=r+1:i=r}return i}return Yl(e,t,Ya,n)}function Yl(e,t,n,l){var i=0,r=null==e?0:e.length;if(0===r)return 0;for(var o=(t=n(t))!=t,a=null===t,u=Qo(t),c=void 0===t;i<r;){var s=Jt((i+r)/2),d=n(e[s]),p=void 0!==d,v=null===d,f=d==d,m=Qo(d);if(o)var E=l||f;else E=c?f&&(l||p):a?f&&p&&(l||!v):u?f&&p&&!v&&(l||!m):!v&&!m&&(l?d<=t:d<t);E?i=s+1:r=s}return an(r,4294967294)}function ql(e,t){for(var n=-1,l=e.length,i=0,r=[];++n<l;){var o=e[n],a=t?t(o):o;if(!n||!Io(a,u)){var u=a;r[i++]=0===o?0:o}}return r}function Gl(e){return"number"==typeof e?e:Qo(e)?NaN:+e}function Zl(e){if("string"==typeof e)return e;if(Lo(e))return ct(e,Zl)+"";if(Qo(e))return Nn?Nn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xl(e,t,n){var l=-1,i=at,r=e.length,o=!0,a=[],u=a;if(n)o=!1,i=ut;else if(r>=200){var c=t?null:ki(e);if(c)return jt(c);o=!1,i=Pt,u=new kn}else u=t?[]:a;e:for(;++l<r;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,o&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(s)}else i(u,d,n)||(u!==a&&u.push(d),a.push(s))}return a}function Ql(e,t){return null==(e=fr(e,t=oi(t,e)))||delete e[Dr(Ur(t))]}function Jl(e,t,n,l){return jl(e,t,n(dl(e,t)),l)}function ei(e,t,n,l){for(var i=e.length,r=l?i:-1;(l?r--:++r<i)&&t(e[r],r,e););return n?$l(e,l?0:r,l?r+1:i):$l(e,l?r+1:0,l?i:r)}function ti(e,t){var n=e;return n instanceof wn&&(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?Xl(e[0]):[];for(var i=-1,r=Y(l);++i<l;)for(var o=e[i],a=-1;++a<l;)a!=i&&(r[i]=Jn(r[i]||o,e[a],t,n));return Xl(rl(r,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,r=t.length,o={};++l<i;)n(o,e[l],l<r?t[l]:void 0);return o}function ii(e){return Fo(e)?e:[]}function ri(e){return"function"==typeof e?e:Ya}function oi(e,t){return Lo(e)?e:ar(e,t)?[e]:Cr(ua(e))}var ai=Fl;function ui(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:$l(e,t,n)}var ci=Gt||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 He(t).set(new He(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,r=Qo(e),o=void 0!==t,a=null===t,u=t==t,c=Qo(t);if(!a&&!c&&!r&&e>t||r&&o&&u&&!a&&!c||l&&o&&u||!n&&u||!i)return 1;if(!l&&!r&&!c&&e<t||c&&n&&i&&!l&&!r||a&&n&&i||!o&&i||!u)return-1}return 0}function fi(e,t,n,l){for(var i=-1,r=e.length,o=n.length,a=-1,u=t.length,c=on(r-o,0),s=Y(u+c),d=!l;++a<u;)s[a]=t[a];for(;++i<o;)(d||i<r)&&(s[n[i]]=e[i]);for(;c--;)s[a++]=e[i++];return s}function mi(e,t,n,l){for(var i=-1,r=e.length,o=-1,a=n.length,u=-1,c=t.length,s=on(r-a,0),d=Y(s+c),p=!l;++i<s;)d[i]=e[i];for(var v=i;++u<c;)d[v+u]=t[u];for(;++o<a;)(p||i<r)&&(d[v+n[o]]=e[i++]);return d}function Ei(e,t){var n=-1,l=e.length;for(t||(t=Y(l));++n<l;)t[n]=e[n];return t}function _i(e,t,n,l){var i=!n;n||(n={});for(var r=-1,o=t.length;++r<o;){var a=t[r],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Yn(n,a,u):zn(n,a,u)}return n}function hi(e,t){return function(n,l){var i=Lo(n)?nt:Vn,r=t?t():{};return i(n,e,Gi(l,2),r)}}function gi(e){return Fl(function(t,n){var l=-1,i=n.length,r=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(i--,r):void 0,o&&or(n[0],n[1],o)&&(r=i<3?void 0:r,i=1),t=fe(t);++l<i;){var a=n[l];a&&e(t,a,l,r)}return t})}function yi(e,t){return function(n,l){if(null==n)return n;if(!ko(n))return e(n,l);for(var i=n.length,r=t?i:-1,o=fe(n);(t?r--:++r<i)&&!1!==l(o[r],r,o););return n}}function Si(e){return function(t,n,l){for(var i=-1,r=fe(t),o=l(t),a=o.length;a--;){var u=o[e?a:++i];if(!1===n(r[u],u,r))break}return t}}function bi(e){return function(t){var n=kt(t=ua(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 Ti(e){return function(t){return dt(Ha(xa(t).replace(Re,"")),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=Pn(e.prototype),l=e.apply(n,t);return $o(l)?l:n}}function Ci(e){return function(t,n,l){var i=fe(t);if(!ko(t)){var r=Gi(n,3);t=Sa(t),n=function(e){return r(i[e],e,i)}}var o=e(t,n,l);return o>-1?i[r?t[o]:o]:void 0}}function Di(e){return zi(function(t){var l=t.length,i=l,r=On.prototype.thru;for(e&&t.reverse();i--;){var o=t[i];if("function"!=typeof o)throw new _e(n);if(r&&!a&&"wrapper"==Yi(o))var a=new On([],!0)}for(i=a?i:l;++i<l;){var u=Yi(o=t[i]),c="wrapper"==u?Ki(o):void 0;a=c&&ur(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Yi(c[0])].apply(a,c[3]):1==o.length&&ur(o)?a[u]():a.thru(o)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Lo(n))return a.plant(n).value();for(var i=0,r=l?t[i].apply(this,e):n;++i<l;)r=t[i].call(this,r);return r}})}function Ni(e,t,n,l,i,r,o,a,u,c){var s=128&t,d=1&t,p=2&t,v=24&t,f=512&t,m=p?void 0:Ai(e);return function E(){for(var _=arguments.length,h=Y(_),g=_;g--;)h[g]=arguments[g];if(v)var y=qi(E),S=wt(h,y);if(l&&(h=fi(h,l,i,v)),r&&(h=mi(h,r,o,v)),_-=S,v&&_<c){var b=Ut(h,y);return Li(e,t,Ni,E.placeholder,n,h,b,a,u,c-_)}var T=d?n:this,A=p?T[e]:e;return _=h.length,a?h=mr(h,a):f&&_>1&&h.reverse(),s&&u<_&&(h.length=u),this&&this!==ze&&this instanceof E&&(A=m||Ai(A)),A.apply(T,h)}}function Ri(e,t){return function(n,l){return function(e,t,n,l){return ul(e,function(e,i,r){t(l,n(e),i,r)}),l}(n,e,t(l),{})}}function Pi(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=Zl(n),l=Zl(l)):(n=Gl(n),l=Gl(l)),i=e(n,l)}return i}}function Ii(e){return zi(function(t){return t=ct(t,Nt(Gi())),Fl(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?" ":Zl(t)).length;if(n<2)return n?kl(t,e):t;var l=kl(t,Qt(e/Wt(t)));return kt(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&or(t,n,l)&&(n=l=void 0),t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n,l){for(var i=-1,r=on(Qt((t-e)/(n||1)),0),o=Y(r);r--;)o[l?r:++i]=e,e+=n;return o}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function xi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=oa(t),n=oa(n)),e(t,n)}}function Li(e,t,n,l,i,r,o,a,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,i,s?r:void 0,s?o:void 0,s?void 0:r,s?void 0:o,a,u,c],p=n.apply(void 0,d);return ur(e)&&_r(p,d),p.placeholder=l,yr(p,e,t)}function Mi(e){var t=ve[e];return function(e,n){if(e=oa(e),(n=null==n?0:an(ia(n),292))&&nn(e)){var l=(ua(e)+"e").split("e");return+((l=(ua(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var ki=mn&&1/jt(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:Qa;function Fi(e){return function(t){var n=tr(t);return n==v?Ft(t):n==_?Ht(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,r,o,a,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new _e(n);var d=r?r.length:0;if(d||(t&=-97,r=o=void 0),u=void 0===u?u:on(ia(u),0),c=void 0===c?c:ia(c),d-=o?o.length:0,64&t){var p=r,v=o;r=o=void 0}var f=s?void 0:Ki(e),m=[e,t,i,r,o,p,v,a,u,c];if(f&&function(e,t){var n=e[1],i=t[1],r=n|i;if(!(r<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],r|=1&n?0:4);var o=t[3];if(o){var a=e[3];e[3]=a?fi(a,o,t[4]):o,e[4]=a?Ut(e[3],l):t[4]}(o=t[5])&&(e[5]=(a=e[5])?mi(a,o,t[6]):o,e[6]=a?Ut(e[5],l):t[6]),(o=t[7])&&(e[7]=o),128&i&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r}(m,f),e=m[0],t=m[1],i=m[2],r=m[3],o=m[4],!(c=m[9]=void 0===m[9]?s?0:e.length:on(m[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 r=arguments.length,o=Y(r),a=r,u=qi(i);a--;)o[a]=arguments[a];var c=r<3&&o[0]!==u&&o[r-1]!==u?[]:Ut(o,u);if((r-=c.length)<n)return Li(e,t,Ni,i.placeholder,void 0,o,c,void 0,void 0,n-r);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,o)}}(e,t,c):32!=t&&33!=t||o.length?Ni.apply(void 0,m):function(e,t,n,l){var i=1&t,r=Ai(e);return function t(){for(var o=-1,a=arguments.length,u=-1,c=l.length,s=Y(c+a),d=this&&this!==ze&&this instanceof t?r:e;++u<c;)s[u]=l[u];for(;a--;)s[u++]=arguments[++o];return tt(d,i?n:this,s)}}(e,t,i,r);else var E=function(e,t,n){var l=1&t,i=Ai(e);return function t(){var r=this&&this!==ze&&this instanceof t?i:e;return r.apply(l?n:this,arguments)}}(e,t,i);return yr((f?Hl:_r)(E,m),e,t)}function Ui(e,t,n,l){return void 0===e||Io(e,ge[n])&&!be.call(l,n)?t:e}function ji(e,t,n,l,i,r){return $o(e)&&$o(t)&&(r.set(t,e),Pl(e,t,void 0,ji,r),r.delete(t)),e}function Hi(e){return qo(e)?void 0:e}function Wi(e,t,n,l,i,r){var o=1&n,a=e.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var c=r.get(e),s=r.get(t);if(c&&s)return c==t&&s==e;var d=-1,p=!0,v=2&n?new kn:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var f=e[d],m=t[d];if(l)var E=o?l(m,f,d,t,e,r):l(f,m,d,e,t,r);if(void 0!==E){if(E)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Pt(v,t)&&(f===e||i(f,e,n,l,r)))return v.push(t)})){p=!1;break}}else if(f!==m&&!i(f,m,n,l,r)){p=!1;break}}return r.delete(e),r.delete(t),p}function zi(e){return gr(vr(e,void 0,Lr),e+"")}function $i(e){return pl(e,Sa,Ji)}function Vi(e){return pl(e,ba,er)}var Ki=hn?function(e){return hn.get(e)}:Qa;function Yi(e){for(var t=e.name+"",n=gn[t],l=be.call(gn,t)?n.length:0;l--;){var i=n[l],r=i.func;if(null==r||r==e)return i.name}return t}function qi(e){return(be.call(Rn,"placeholder")?Rn:e).placeholder}function Gi(){var e=Rn.iteratee||qa;return e=e===qa?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Zi(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 Xi(e){for(var t=Sa(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,dr(i)]}return t}function Qi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Ji=en?function(e){return null==e?[]:(e=fe(e),ot(en(e),function(t){return Ye.call(e,t)}))}:ru,er=en?function(e){for(var t=[];e;)st(t,Ji(e)),e=$e(e);return t}:ru,tr=vl;function nr(e,t,n){for(var l=-1,i=(t=oi(t,e)).length,r=!1;++l<i;){var o=Dr(t[l]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++l!=i?r:!!(i=null==e?0:e.length)&&zo(i)&&rr(o,i)&&(Lo(e)||xo(e))}function lr(e){return"function"!=typeof e.constructor||sr(e)?{}:Pn($e(e))}function ir(e){return Lo(e)||xo(e)||!!(ft&&e&&e[ft])}function rr(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function or(e,t,n){if(!$o(n))return!1;var l=typeof t;return!!("number"==l?ko(n)&&rr(t,n.length):"string"==l&&t in n)&&Io(n[t],e)}function ar(e,t){if(Lo(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qo(e))||W.test(e)||!H.test(e)||null!=t&&e in fe(t)}function ur(e){var t=Yi(e),n=Rn[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=Ki(n);return!!l&&e===l[0]}(pn&&tr(new pn(new ArrayBuffer(1)))!=b||vn&&tr(new vn)!=v||fn&&"[object Promise]"!=tr(fn.resolve())||mn&&tr(new mn)!=_||En&&tr(new En)!=y)&&(tr=function(e){var t=vl(e),n=t==m?e.constructor:void 0,l=n?Nr(n):"";if(l)switch(l){case yn:return b;case Sn:return v;case bn:return"[object Promise]";case Tn:return _;case An:return y}return t});var cr=ye?Ho:ou;function sr(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ge)}function dr(e){return e==e&&!$o(e)}function pr(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in fe(n))}}function vr(e,t,n){return t=on(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,r=on(l.length-t,0),o=Y(r);++i<r;)o[i]=l[t+i];i=-1;for(var a=Y(t+1);++i<t;)a[i]=l[i];return a[t]=n(o),tt(e,this,a)}}function fr(e,t){return t.length<2?e:dl(e,$l(t,0,-1))}function mr(e,t){for(var n=e.length,l=an(t.length,n),i=Ei(e);l--;){var r=t[l];e[l]=rr(r,n)?i[r]:void 0}return e}function Er(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var _r=Sr(Hl),hr=Xt||function(e,t){return ze.setTimeout(e,t)},gr=Sr(Wl);function yr(e,t,n){var l=t+"";return gr(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(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(G);return t?t[1].split(Z):[]}(l),n)))}function Sr(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 br(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var r=Ml(n,i),o=e[r];e[r]=e[n],e[n]=o}return e.length=t,e}var Tr,Ar,Cr=(Tr=Ao(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===Ar.size&&Ar.clear(),e}),Ar=Tr.cache,Tr);function Dr(e){if("string"==typeof e||Qo(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Nr(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Rr(e){if(e instanceof wn)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 Pr=Fl(function(e,t){return Fo(e)?Jn(e,rl(t,1,Fo,!0)):[]}),Ir=Fl(function(e,t){var n=Ur(t);return Fo(n)&&(n=void 0),Fo(e)?Jn(e,rl(t,1,Fo,!0),Gi(n,2)):[]}),Or=Fl(function(e,t){var n=Ur(t);return Fo(n)&&(n=void 0),Fo(e)?Jn(e,rl(t,1,Fo,!0),void 0,n):[]});function wr(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ia(n);return i<0&&(i=on(l+i,0)),Et(e,Gi(t,3),i)}function xr(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ia(n),i=n<0?on(l+i,0):an(i,l-1)),Et(e,Gi(t,3),i,!0)}function Lr(e){return null!=e&&e.length?rl(e,1):[]}function Mr(e){return e&&e.length?e[0]:void 0}var kr=Fl(function(e){var t=ct(e,ii);return t.length&&t[0]===e[0]?_l(t):[]}),Fr=Fl(function(e){var t=Ur(e),n=ct(e,ii);return t===Ur(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?_l(n,Gi(t,2)):[]}),Br=Fl(function(e){var t=Ur(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 Ur(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jr=Fl(Hr);function Hr(e,t){return e&&e.length&&t&&t.length?xl(e,t):e}var Wr=zi(function(e,t){var n=null==e?0:e.length,l=qn(e,t);return Ll(e,ct(t,function(e){return rr(e,n)?+e:e}).sort(vi)),l});function zr(e){return null==e?e:dn.call(e)}var $r=Fl(function(e){return Xl(rl(e,1,Fo,!0))}),Vr=Fl(function(e){var t=Ur(e);return Fo(t)&&(t=void 0),Xl(rl(e,1,Fo,!0),Gi(t,2))}),Kr=Fl(function(e){var t=Ur(e);return t="function"==typeof t?t:void 0,Xl(rl(e,1,Fo,!0),void 0,t)});function Yr(e){if(!e||!e.length)return[];var t=0;return e=ot(e,function(e){if(Fo(e))return t=on(e.length,t),!0}),Ct(t,function(t){return ct(e,St(t))})}function qr(e,t){if(!e||!e.length)return[];var n=Yr(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var Gr=Fl(function(e,t){return Fo(e)?Jn(e,t):[]}),Zr=Fl(function(e){return ni(ot(e,Fo))}),Xr=Fl(function(e){var t=Ur(e);return Fo(t)&&(t=void 0),ni(ot(e,Fo),Gi(t,2))}),Qr=Fl(function(e){var t=Ur(e);return t="function"==typeof t?t:void 0,ni(ot(e,Fo),void 0,t)}),Jr=Fl(Yr),eo=Fl(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,qr(e,n)});function to(e){var t=Rn(e);return t.__chain__=!0,t}function no(e,t){return t(e)}var lo=zi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return qn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&rr(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:no,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)}),io=hi(function(e,t,n){be.call(e,n)?++e[n]:Yn(e,n,1)}),ro=Ci(wr),oo=Ci(xr);function ao(e,t){return(Lo(e)?lt:el)(e,Gi(t,3))}function uo(e,t){return(Lo(e)?it:tl)(e,Gi(t,3))}var co=hi(function(e,t,n){be.call(e,n)?e[n].push(t):Yn(e,n,[t])}),so=Fl(function(e,t,n){var l=-1,i="function"==typeof t,r=ko(e)?Y(e.length):[];return el(e,function(e){r[++l]=i?tt(t,e,n):hl(e,t,n)}),r}),po=hi(function(e,t,n){Yn(e,n,t)});function vo(e,t){return(Lo(e)?ct:Dl)(e,Gi(t,3))}var fo=hi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),mo=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&or(e,t[0],t[1])?t=[]:n>2&&or(t[0],t[1],t[2])&&(t=[t[0]]),Ol(e,rl(t,1),[])}),Eo=Zt||function(){return ze.Date.now()};function _o(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 ho(e,t){var l;if("function"!=typeof t)throw new _e(n);return e=ia(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var go=Fl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,qi(go));l|=32}return Bi(e,l,t,n,i)}),yo=Fl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,qi(yo));l|=32}return Bi(t,l,e,n,i)});function So(e,t,l){var i,r,o,a,u,c,s=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new _e(n);function f(t){var n=i,l=r;return i=r=void 0,s=t,a=e.apply(l,n)}function m(e){return s=e,u=hr(_,t),d?f(e):a}function E(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-s>=o}function _(){var e=Eo();if(E(e))return h(e);u=hr(_,function(e){var n=t-(e-c);return p?an(n,o-(e-s)):n}(e))}function h(e){return u=void 0,v&&i?f(e):(i=r=void 0,a)}function g(){var e=Eo(),n=E(e);if(i=arguments,r=this,c=e,n){if(void 0===u)return m(c);if(p)return ci(u),u=hr(_,t),f(c)}return void 0===u&&(u=hr(_,t)),a}return t=oa(t)||0,$o(l)&&(d=!!l.leading,o=(p="maxWait"in l)?on(oa(l.maxWait)||0,t):o,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&ci(u),s=0,i=c=r=u=void 0},g.flush=function(){return void 0===u?a:h(Eo())},g}var bo=Fl(function(e,t){return Qn(e,1,t)}),To=Fl(function(e,t,n){return Qn(e,oa(t)||0,n)});function Ao(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],r=l.cache;if(r.has(i))return r.get(i);var o=e.apply(this,n);return l.cache=r.set(i,o)||r,o};return l.cache=new(Ao.Cache||Mn),l}function Co(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)}}Ao.Cache=Mn;var Do=ai(function(e,t){var n=(t=1==t.length&&Lo(t[0])?ct(t[0],Nt(Gi())):ct(rl(t,1),Nt(Gi()))).length;return Fl(function(l){for(var i=-1,r=an(l.length,n);++i<r;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),No=Fl(function(e,t){return Bi(e,32,void 0,t,Ut(t,qi(No)))}),Ro=Fl(function(e,t){return Bi(e,64,void 0,t,Ut(t,qi(Ro)))}),Po=zi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function Io(e,t){return e===t||e!=e&&t!=t}var Oo=xi(fl),wo=xi(function(e,t){return e>=t}),xo=gl(function(){return arguments}())?gl:function(e){return Vo(e)&&be.call(e,"callee")&&!Ye.call(e,"callee")},Lo=Y.isArray,Mo=Ge?Nt(Ge):function(e){return Vo(e)&&vl(e)==S};function ko(e){return null!=e&&zo(e.length)&&!Ho(e)}function Fo(e){return Vo(e)&&ko(e)}var Bo=tn||ou,Uo=Ze?Nt(Ze):function(e){return Vo(e)&&vl(e)==u};function jo(e){if(!Vo(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!qo(e)}function Ho(e){if(!$o(e))return!1;var t=vl(e);return t==s||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wo(e){return"number"==typeof e&&e==ia(e)}function zo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $o(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vo(e){return null!=e&&"object"==typeof e}var Ko=Xe?Nt(Xe):function(e){return Vo(e)&&tr(e)==v};function Yo(e){return"number"==typeof e||Vo(e)&&vl(e)==f}function qo(e){if(!Vo(e)||vl(e)!=m)return!1;var t=$e(e);if(null===t)return!0;var n=be.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==De}var Go=Qe?Nt(Qe):function(e){return Vo(e)&&vl(e)==E},Zo=Je?Nt(Je):function(e){return Vo(e)&&tr(e)==_};function Xo(e){return"string"==typeof e||!Lo(e)&&Vo(e)&&vl(e)==h}function Qo(e){return"symbol"==typeof e||Vo(e)&&vl(e)==g}var Jo=et?Nt(et):function(e){return Vo(e)&&zo(e.length)&&!!ke[vl(e)]},ea=xi(Cl),ta=xi(function(e,t){return e<=t});function na(e){if(!e)return[];if(ko(e))return Xo(e)?zt(e):Ei(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=tr(e);return(t==v?Ft:t==_?jt:Ia)(e)}function la(e){return e?(e=oa(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ia(e){var t=la(e),n=t%1;return t==t?n?t-n:t:0}function ra(e){return e?Gn(ia(e),0,4294967295):0}function oa(e){if("number"==typeof e)return e;if(Qo(e))return NaN;if($o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||re.test(e)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return _i(e,ba(e))}function ua(e){return null==e?"":Zl(e)}var ca=gi(function(e,t){if(sr(t)||ko(t))_i(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),sa=gi(function(e,t){_i(t,ba(t),e)}),da=gi(function(e,t,n,l){_i(t,ba(t),e,l)}),pa=gi(function(e,t,n,l){_i(t,Sa(t),e,l)}),va=zi(qn),fa=Fl(function(e,t){e=fe(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&or(t[0],t[1],i)&&(l=1);++n<l;)for(var r=t[n],o=ba(r),a=-1,u=o.length;++a<u;){var c=o[a],s=e[c];(void 0===s||Io(s,ge[c])&&!be.call(e,c))&&(e[c]=r[c])}return e}),ma=Fl(function(e){return e.push(void 0,ji),tt(Aa,void 0,e)});function Ea(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function _a(e,t){return null!=e&&nr(e,t,El)}var ha=Ri(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n},$a(Ya)),ga=Ri(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Gi),ya=Fl(hl);function Sa(e){return ko(e)?Bn(e):Al(e)}function ba(e){return ko(e)?Bn(e,!0):function(e){if(!$o(e))return function(e){var t=[];if(null!=e)for(var n in fe(e))t.push(n);return t}(e);var t=sr(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=gi(function(e,t,n){Pl(e,t,n)}),Aa=gi(function(e,t,n,l){Pl(e,t,n,l)}),Ca=zi(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=oi(t,e),l||(l=t.length>1),t}),_i(e,Vi(e),n),l&&(n=Zn(n,7,Hi));for(var i=t.length;i--;)Ql(n,t[i]);return n}),Da=zi(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return _a(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=ct(Vi(e),function(e){return[e]});return t=Gi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Ra=Fi(Sa),Pa=Fi(ba);function Ia(e){return null==e?[]:Rt(e,Sa(e))}var Oa=Ti(function(e,t,n){return t=t.toLowerCase(),e+(n?wa(t):t)});function wa(e){return ja(ua(e).toLowerCase())}function xa(e){return(e=ua(e))&&e.replace(ae,xt).replace(Pe,"")}var La=Ti(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ma=Ti(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),ka=bi("toLowerCase"),Fa=Ti(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ba=Ti(function(e,t,n){return e+(n?" ":"")+ja(t)}),Ua=Ti(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),ja=bi("toUpperCase");function Ha(e,t,n){return e=ua(e),void 0===(t=n?void 0:t)?function(e){return xe.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Wa=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return jo(e)?e:new de(e)}}),za=zi(function(e,t){return lt(t,function(t){t=Dr(t),Yn(e,t,go(e[t],e))}),e});function $a(e){return function(){return e}}var Va=Di(),Ka=Di(!0);function Ya(e){return e}function qa(e){return Tl("function"==typeof e?e:Zn(e,1))}var Ga=Fl(function(e,t){return function(n){return hl(n,e,t)}}),Za=Fl(function(e,t){return function(n){return hl(e,n,t)}});function Xa(e,t,n){var l=Sa(t),i=sl(t,l);null!=n||$o(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=sl(t,Sa(t)));var r=!($o(n)&&"chain"in n&&!n.chain),o=Ho(e);return lt(i,function(n){var l=t[n];e[n]=l,o&&(e.prototype[n]=function(){var t=this.__chain__;if(r||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 Qa(){}var Ja=Ii(ct),eu=Ii(rt),tu=Ii(vt);function nu(e){return ar(e)?St(Dr(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=wi(),iu=wi(!0);function ru(){return[]}function ou(){return!1}var au,uu=Pi(function(e,t){return e+t},0),cu=Mi("ceil"),su=Pi(function(e,t){return e/t},1),du=Mi("floor"),pu=Pi(function(e,t){return e*t},1),vu=Mi("round"),fu=Pi(function(e,t){return e-t},0);return Rn.after=function(e,t){if("function"!=typeof t)throw new _e(n);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},Rn.ary=_o,Rn.assign=ca,Rn.assignIn=sa,Rn.assignInWith=da,Rn.assignWith=pa,Rn.at=va,Rn.before=ho,Rn.bind=go,Rn.bindAll=za,Rn.bindKey=yo,Rn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lo(e)?e:[e]},Rn.chain=to,Rn.chunk=function(e,t,n){t=(n?or(e,t,n):void 0===t)?1:on(ia(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,r=0,o=Y(Qt(l/t));i<l;)o[r++]=$l(e,i,i+=t);return o},Rn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var r=e[t];r&&(i[l++]=r)}return i},Rn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Y(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(Lo(n)?Ei(n):[n],rl(t,1))},Rn.cond=function(e){var t=null==e?0:e.length,l=Gi();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new _e(n);return[l(e[0]),e[1]]}):[],Fl(function(n){for(var l=-1;++l<t;){var i=e[l];if(tt(i[0],this,n))return tt(i[1],this,n)}})},Rn.conforms=function(e){return function(e){var t=Sa(e);return function(n){return Xn(n,e,t)}}(Zn(e,1))},Rn.constant=$a,Rn.countBy=io,Rn.create=function(e,t){var n=Pn(e);return null==t?n:Kn(n,t)},Rn.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},Rn.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},Rn.debounce=So,Rn.defaults=fa,Rn.defaultsDeep=ma,Rn.defer=bo,Rn.delay=To,Rn.difference=Pr,Rn.differenceBy=Ir,Rn.differenceWith=Or,Rn.drop=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,(t=n||void 0===t?1:ia(t))<0?0:t,l):[]},Rn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,0,(t=l-(t=n||void 0===t?1:ia(t)))<0?0:t):[]},Rn.dropRightWhile=function(e,t){return e&&e.length?ei(e,Gi(t,3),!0,!0):[]},Rn.dropWhile=function(e,t){return e&&e.length?ei(e,Gi(t,3),!0):[]},Rn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&or(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ia(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ia(l))<0&&(l+=i),l=n>l?0:ra(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Rn.filter=function(e,t){return(Lo(e)?ot:il)(e,Gi(t,3))},Rn.flatMap=function(e,t){return rl(vo(e,t),1)},Rn.flatMapDeep=function(e,t){return rl(vo(e,t),1/0)},Rn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ia(n),rl(vo(e,t),n)},Rn.flatten=Lr,Rn.flattenDeep=function(e){return null!=e&&e.length?rl(e,1/0):[]},Rn.flattenDepth=function(e,t){return null!=e&&e.length?rl(e,t=void 0===t?1:ia(t)):[]},Rn.flip=function(e){return Bi(e,512)},Rn.flow=Va,Rn.flowRight=Ka,Rn.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},Rn.functions=function(e){return null==e?[]:sl(e,Sa(e))},Rn.functionsIn=function(e){return null==e?[]:sl(e,ba(e))},Rn.groupBy=co,Rn.initial=function(e){return null!=e&&e.length?$l(e,0,-1):[]},Rn.intersection=kr,Rn.intersectionBy=Fr,Rn.intersectionWith=Br,Rn.invert=ha,Rn.invertBy=ga,Rn.invokeMap=so,Rn.iteratee=qa,Rn.keyBy=po,Rn.keys=Sa,Rn.keysIn=ba,Rn.map=vo,Rn.mapKeys=function(e,t){var n={};return t=Gi(t,3),ul(e,function(e,l,i){Yn(n,t(e,l,i),e)}),n},Rn.mapValues=function(e,t){var n={};return t=Gi(t,3),ul(e,function(e,l,i){Yn(n,l,t(e,l,i))}),n},Rn.matches=function(e){return Nl(Zn(e,1))},Rn.matchesProperty=function(e,t){return Rl(e,Zn(t,1))},Rn.memoize=Ao,Rn.merge=Ta,Rn.mergeWith=Aa,Rn.method=Ga,Rn.methodOf=Za,Rn.mixin=Xa,Rn.negate=Co,Rn.nthArg=function(e){return e=ia(e),Fl(function(t){return Il(t,e)})},Rn.omit=Ca,Rn.omitBy=function(e,t){return Na(e,Co(Gi(t)))},Rn.once=function(e){return ho(2,e)},Rn.orderBy=function(e,t,n,l){return null==e?[]:(Lo(t)||(t=null==t?[]:[t]),Lo(n=l?void 0:n)||(n=null==n?[]:[n]),Ol(e,t,n))},Rn.over=Ja,Rn.overArgs=Do,Rn.overEvery=eu,Rn.overSome=tu,Rn.partial=No,Rn.partialRight=Ro,Rn.partition=fo,Rn.pick=Da,Rn.pickBy=Na,Rn.property=nu,Rn.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},Rn.pull=jr,Rn.pullAll=Hr,Rn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,Gi(n,2)):e},Rn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?xl(e,t,void 0,n):e},Rn.pullAt=Wr,Rn.range=lu,Rn.rangeRight=iu,Rn.rearg=Po,Rn.reject=function(e,t){return(Lo(e)?ot:il)(e,Co(Gi(t,3)))},Rn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],r=e.length;for(t=Gi(t,3);++l<r;){var o=e[l];t(o,l,e)&&(n.push(o),i.push(l))}return Ll(e,i),n},Rn.rest=function(e,t){if("function"!=typeof e)throw new _e(n);return Fl(e,t=void 0===t?t:ia(t))},Rn.reverse=zr,Rn.sampleSize=function(e,t,n){return t=(n?or(e,t,n):void 0===t)?1:ia(t),(Lo(e)?jn:Ul)(e,t)},Rn.set=function(e,t,n){return null==e?e:jl(e,t,n)},Rn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:jl(e,t,n,l)},Rn.shuffle=function(e){return(Lo(e)?Hn:zl)(e)},Rn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&or(e,t,n)?(t=0,n=l):(t=null==t?0:ia(t),n=void 0===n?l:ia(n)),$l(e,t,n)):[]},Rn.sortBy=mo,Rn.sortedUniq=function(e){return e&&e.length?ql(e):[]},Rn.sortedUniqBy=function(e,t){return e&&e.length?ql(e,Gi(t,2)):[]},Rn.split=function(e,t,n){return n&&"number"!=typeof n&&or(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Go(t))&&!(t=Zl(t))&&kt(e)?ui(zt(e),0,n):e.split(t,n):[]},Rn.spread=function(e,t){if("function"!=typeof e)throw new _e(n);return t=null==t?0:on(ia(t),0),Fl(function(n){var l=n[t],i=ui(n,0,t);return l&&st(i,l),tt(e,this,i)})},Rn.tail=function(e){var t=null==e?0:e.length;return t?$l(e,1,t):[]},Rn.take=function(e,t,n){return e&&e.length?$l(e,0,(t=n||void 0===t?1:ia(t))<0?0:t):[]},Rn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?$l(e,(t=l-(t=n||void 0===t?1:ia(t)))<0?0:t,l):[]},Rn.takeRightWhile=function(e,t){return e&&e.length?ei(e,Gi(t,3),!1,!0):[]},Rn.takeWhile=function(e,t){return e&&e.length?ei(e,Gi(t,3)):[]},Rn.tap=function(e,t){return t(e),e},Rn.throttle=function(e,t,l){var i=!0,r=!0;if("function"!=typeof e)throw new _e(n);return $o(l)&&(i="leading"in l?!!l.leading:i,r="trailing"in l?!!l.trailing:r),So(e,t,{leading:i,maxWait:t,trailing:r})},Rn.thru=no,Rn.toArray=na,Rn.toPairs=Ra,Rn.toPairsIn=Pa,Rn.toPath=function(e){return Lo(e)?ct(e,Dr):Qo(e)?[e]:Ei(Cr(ua(e)))},Rn.toPlainObject=aa,Rn.transform=function(e,t,n){var l=Lo(e),i=l||Bo(e)||Jo(e);if(t=Gi(t,4),null==n){var r=e&&e.constructor;n=i?l?new r:[]:$o(e)&&Ho(r)?Pn($e(e)):{}}return(i?lt:ul)(e,function(e,l,i){return t(n,e,l,i)}),n},Rn.unary=function(e){return _o(e,1)},Rn.union=$r,Rn.unionBy=Vr,Rn.unionWith=Kr,Rn.uniq=function(e){return e&&e.length?Xl(e):[]},Rn.uniqBy=function(e,t){return e&&e.length?Xl(e,Gi(t,2)):[]},Rn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Xl(e,void 0,t):[]},Rn.unset=function(e,t){return null==e||Ql(e,t)},Rn.unzip=Yr,Rn.unzipWith=qr,Rn.update=function(e,t,n){return null==e?e:Jl(e,t,ri(n))},Rn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Jl(e,t,ri(n),l)},Rn.values=Ia,Rn.valuesIn=function(e){return null==e?[]:Rt(e,ba(e))},Rn.without=Gr,Rn.words=Ha,Rn.wrap=function(e,t){return No(ri(t),e)},Rn.xor=Zr,Rn.xorBy=Xr,Rn.xorWith=Qr,Rn.zip=Jr,Rn.zipObject=function(e,t){return li(e||[],t||[],zn)},Rn.zipObjectDeep=function(e,t){return li(e||[],t||[],jl)},Rn.zipWith=eo,Rn.entries=Ra,Rn.entriesIn=Pa,Rn.extend=sa,Rn.extendWith=da,Xa(Rn,Rn),Rn.add=uu,Rn.attempt=Wa,Rn.camelCase=Oa,Rn.capitalize=wa,Rn.ceil=cu,Rn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==t&&(t=(t=oa(t))==t?t:0),Gn(oa(e),t,n)},Rn.clone=function(e){return Zn(e,4)},Rn.cloneDeep=function(e){return Zn(e,5)},Rn.cloneDeepWith=function(e,t){return Zn(e,5,t="function"==typeof t?t:void 0)},Rn.cloneWith=function(e,t){return Zn(e,4,t="function"==typeof t?t:void 0)},Rn.conformsTo=function(e,t){return null==t||Xn(e,t,Sa(t))},Rn.deburr=xa,Rn.defaultTo=function(e,t){return null==e||e!=e?t:e},Rn.divide=su,Rn.endsWith=function(e,t,n){e=ua(e),t=Zl(t);var l=e.length,i=n=void 0===n?l:Gn(ia(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Rn.eq=Io,Rn.escape=function(e){return(e=ua(e))&&F.test(e)?e.replace(M,Lt):e},Rn.escapeRegExp=function(e){return(e=ua(e))&&V.test(e)?e.replace($,"\\$&"):e},Rn.every=function(e,t,n){var l=Lo(e)?rt:nl;return n&&or(e,t,n)&&(t=void 0),l(e,Gi(t,3))},Rn.find=ro,Rn.findIndex=wr,Rn.findKey=function(e,t){return mt(e,Gi(t,3),ul)},Rn.findLast=oo,Rn.findLastIndex=xr,Rn.findLastKey=function(e,t){return mt(e,Gi(t,3),cl)},Rn.floor=du,Rn.forEach=ao,Rn.forEachRight=uo,Rn.forIn=function(e,t){return null==e?e:ol(e,Gi(t,3),ba)},Rn.forInRight=function(e,t){return null==e?e:al(e,Gi(t,3),ba)},Rn.forOwn=function(e,t){return e&&ul(e,Gi(t,3))},Rn.forOwnRight=function(e,t){return e&&cl(e,Gi(t,3))},Rn.get=Ea,Rn.gt=Oo,Rn.gte=wo,Rn.has=function(e,t){return null!=e&&nr(e,t,ml)},Rn.hasIn=_a,Rn.head=Mr,Rn.identity=Ya,Rn.includes=function(e,t,n,l){e=ko(e)?e:Ia(e),n=n&&!l?ia(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Xo(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Rn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ia(n);return i<0&&(i=on(l+i,0)),_t(e,t,i)},Rn.inRange=function(e,t,n){return t=la(t),void 0===n?(n=t,t=0):n=la(n),function(e,t,n){return e>=an(t,n)&&e<on(t,n)}(e=oa(e),t,n)},Rn.invoke=ya,Rn.isArguments=xo,Rn.isArray=Lo,Rn.isArrayBuffer=Mo,Rn.isArrayLike=ko,Rn.isArrayLikeObject=Fo,Rn.isBoolean=function(e){return!0===e||!1===e||Vo(e)&&vl(e)==a},Rn.isBuffer=Bo,Rn.isDate=Uo,Rn.isElement=function(e){return Vo(e)&&1===e.nodeType&&!qo(e)},Rn.isEmpty=function(e){if(null==e)return!0;if(ko(e)&&(Lo(e)||"string"==typeof e||"function"==typeof e.splice||Bo(e)||Jo(e)||xo(e)))return!e.length;var t=tr(e);if(t==v||t==_)return!e.size;if(sr(e))return!Al(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Rn.isEqual=function(e,t){return yl(e,t)},Rn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?yl(e,t,void 0,n):!!l},Rn.isError=jo,Rn.isFinite=function(e){return"number"==typeof e&&nn(e)},Rn.isFunction=Ho,Rn.isInteger=Wo,Rn.isLength=zo,Rn.isMap=Ko,Rn.isMatch=function(e,t){return e===t||Sl(e,t,Xi(t))},Rn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Xi(t),n)},Rn.isNaN=function(e){return Yo(e)&&e!=+e},Rn.isNative=function(e){if(cr(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},Rn.isNil=function(e){return null==e},Rn.isNull=function(e){return null===e},Rn.isNumber=Yo,Rn.isObject=$o,Rn.isObjectLike=Vo,Rn.isPlainObject=qo,Rn.isRegExp=Go,Rn.isSafeInteger=function(e){return Wo(e)&&e>=-9007199254740991&&e<=9007199254740991},Rn.isSet=Zo,Rn.isString=Xo,Rn.isSymbol=Qo,Rn.isTypedArray=Jo,Rn.isUndefined=function(e){return void 0===e},Rn.isWeakMap=function(e){return Vo(e)&&tr(e)==y},Rn.isWeakSet=function(e){return Vo(e)&&"[object WeakSet]"==vl(e)},Rn.join=function(e,t){return null==e?"":ln.call(e,t)},Rn.kebabCase=La,Rn.last=Ur,Rn.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=ia(n))<0?on(l+i,0):an(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)},Rn.lowerCase=Ma,Rn.lowerFirst=ka,Rn.lt=ea,Rn.lte=ta,Rn.max=function(e){return e&&e.length?ll(e,Ya,fl):void 0},Rn.maxBy=function(e,t){return e&&e.length?ll(e,Gi(t,2),fl):void 0},Rn.mean=function(e){return yt(e,Ya)},Rn.meanBy=function(e,t){return yt(e,Gi(t,2))},Rn.min=function(e){return e&&e.length?ll(e,Ya,Cl):void 0},Rn.minBy=function(e,t){return e&&e.length?ll(e,Gi(t,2),Cl):void 0},Rn.stubArray=ru,Rn.stubFalse=ou,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=pu,Rn.nth=function(e,t){return e&&e.length?Il(e,ia(t)):void 0},Rn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Rn.noop=Qa,Rn.now=Eo,Rn.pad=function(e,t,n){e=ua(e);var l=(t=ia(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)},Rn.padEnd=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?e+Oi(t-l,n):e},Rn.padStart=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?Oi(t-l,n)+e:e},Rn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),cn(ua(e).replace(K,""),t||0)},Rn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&or(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=la(e),void 0===t?(t=e,e=0):t=la(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=sn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Ml(e,t)},Rn.reduce=function(e,t,n){var l=Lo(e)?dt:Tt,i=arguments.length<3;return l(e,Gi(t,4),n,i,el)},Rn.reduceRight=function(e,t,n){var l=Lo(e)?pt:Tt,i=arguments.length<3;return l(e,Gi(t,4),n,i,tl)},Rn.repeat=function(e,t,n){return t=(n?or(e,t,n):void 0===t)?1:ia(t),kl(ua(e),t)},Rn.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rn.result=function(e,t,n){var l=-1,i=(t=oi(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var r=null==e?void 0:e[Dr(t[l])];void 0===r&&(l=i,r=n),e=Ho(r)?r.call(e):r}return e},Rn.round=vu,Rn.runInContext=e,Rn.sample=function(e){return(Lo(e)?Un:Bl)(e)},Rn.size=function(e){if(null==e)return 0;if(ko(e))return Xo(e)?Wt(e):e.length;var t=tr(e);return t==v||t==_?e.size:Al(e).length},Rn.snakeCase=Fa,Rn.some=function(e,t,n){var l=Lo(e)?vt:Vl;return n&&or(e,t,n)&&(t=void 0),l(e,Gi(t,3))},Rn.sortedIndex=function(e,t){return Kl(e,t)},Rn.sortedIndexBy=function(e,t,n){return Yl(e,t,Gi(n,2))},Rn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Kl(e,t);if(l<n&&Io(e[l],t))return l}return-1},Rn.sortedLastIndex=function(e,t){return Kl(e,t,!0)},Rn.sortedLastIndexBy=function(e,t,n){return Yl(e,t,Gi(n,2),!0)},Rn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Kl(e,t,!0)-1;if(Io(e[n],t))return n}return-1},Rn.startCase=Ba,Rn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Gn(ia(n),0,e.length),t=Zl(t),e.slice(n,n+t.length)==t},Rn.subtract=fu,Rn.sum=function(e){return e&&e.length?At(e,Ya):0},Rn.sumBy=function(e,t){return e&&e.length?At(e,Gi(t,2)):0},Rn.template=function(e,t,n){var l=Rn.templateSettings;n&&or(e,t,n)&&(t=void 0),e=ua(e),t=da({},t,l,Ui);var i,r,o=da({},t.imports,l.imports,Ui),a=Sa(o),u=Rt(o,a),c=0,s=t.interpolate||ue,d="__p += '",p=me((t.escape||ue).source+"|"+s.source+"|"+(s===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(p,function(t,n,l,o,a,u){return l||(l=o),d+=e.slice(c,u).replace(ce,Mt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(r=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var f=be.call(t,"variable")&&t.variable;if(f){if(Q.test(f))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(r?d.replace(O,""):d).replace(w,"$1").replace(x,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(r?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Wa(function(){return pe(a,v+"return "+d).apply(void 0,u)});if(m.source=d,jo(m))throw m;return m},Rn.times=function(e,t){if((e=ia(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=Ct(l,t=Gi(t));++n<e;)t(n);return i},Rn.toFinite=la,Rn.toInteger=ia,Rn.toLength=ra,Rn.toLower=function(e){return ua(e).toLowerCase()},Rn.toNumber=oa,Rn.toSafeInteger=function(e){return e?Gn(ia(e),-9007199254740991,9007199254740991):0===e?e:0},Rn.toString=ua,Rn.toUpper=function(e){return ua(e).toUpperCase()},Rn.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Zl(t)))return e;var l=zt(e),i=zt(t);return ui(l,It(l,i),Ot(l,i)+1).join("")},Rn.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,$t(e)+1);if(!e||!(t=Zl(t)))return e;var l=zt(e);return ui(l,0,Ot(l,zt(t))+1).join("")},Rn.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(K,"");if(!e||!(t=Zl(t)))return e;var l=zt(e);return ui(l,It(l,zt(t))).join("")},Rn.truncate=function(e,t){var n=30,l="...";if($o(t)){var i="separator"in t?t.separator:i;n="length"in t?ia(t.length):n,l="omission"in t?Zl(t.omission):l}var r=(e=ua(e)).length;if(kt(e)){var o=zt(e);r=o.length}if(n>=r)return e;var a=n-Wt(l);if(a<1)return l;var u=o?ui(o,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(o&&(a+=u.length-a),Go(i)){if(e.slice(a).search(i)){var c,s=u;for(i.global||(i=me(i.source,ua(te.exec(i))+"g")),i.lastIndex=0;c=i.exec(s);)var d=c.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Zl(i),a)!=a){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},Rn.unescape=function(e){return(e=ua(e))&&k.test(e)?e.replace(L,Vt):e},Rn.uniqueId=function(e){var t=++Te;return ua(e)+t},Rn.upperCase=Ua,Rn.upperFirst=ja,Rn.each=ao,Rn.eachRight=uo,Rn.first=Mr,Xa(Rn,(au={},ul(Rn,function(e,t){be.call(Rn.prototype,t)||(au[t]=e)}),au),{chain:!1}),Rn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Rn[e].placeholder=Rn}),lt(["drop","take"],function(e,t){wn.prototype[e]=function(n){n=void 0===n?1:on(ia(n),0);var l=this.__filtered__&&!t?new wn(this):this.clone();return l.__filtered__?l.__takeCount__=an(n,l.__takeCount__):l.__views__.push({size:an(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},wn.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;wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Gi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");wn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");wn.prototype[e]=function(){return this.__filtered__?new wn(this):this[n](1)}}),wn.prototype.compact=function(){return this.filter(Ya)},wn.prototype.find=function(e){return this.filter(e).head()},wn.prototype.findLast=function(e){return this.reverse().find(e)},wn.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new wn(this):this.map(function(n){return hl(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Co(Gi(e)))},wn.prototype.slice=function(e,t){e=ia(e);var n=this;return n.__filtered__&&(e>0||t<0)?new wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ia(t))<0?n.dropRight(-t):n.take(t-e)),n)},wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},wn.prototype.toArray=function(){return this.take(4294967295)},ul(wn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Rn[l?"take"+("last"==t?"Right":""):t],r=l||/^find/.test(t);i&&(Rn.prototype[t]=function(){var t=this.__wrapped__,o=l?[1]:arguments,a=t instanceof wn,u=o[0],c=a||Lo(t),s=function(e){var t=i.apply(Rn,st([e],o));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var d=this.__chain__,p=!!this.__actions__.length,v=r&&!d,f=a&&!p;if(!r&&c){t=f?t:new wn(this);var m=e.apply(t,o);return m.__actions__.push({func:no,args:[s],thisArg:void 0}),new On(m,d)}return v&&f?e.apply(this,o):(m=this.thru(s),v?l?m.value()[0]:m.value():m)})}),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);Rn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Lo(i)?i:[],e)}return this[n](function(n){return t.apply(Lo(n)?n:[],e)})}}),ul(wn.prototype,function(e,t){var n=Rn[t];if(n){var l=n.name+"";be.call(gn,l)||(gn[l]=[]),gn[l].push({name:t,func:n})}}),gn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(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},wn.prototype.reverse=function(){if(this.__filtered__){var e=new wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Lo(e),l=t<0,i=n?e.length:0,r=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var r=n[l],o=r.size;switch(r.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=an(t,e+o);break;case"takeRight":e=on(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=r.start,a=r.end,u=a-o,c=l?a:o-1,s=this.__iteratees__,d=s.length,p=0,v=an(u,this.__takeCount__);if(!n||!l&&i==u&&v==u)return ti(e,this.__actions__);var f=[];e:for(;u--&&p<v;){for(var m=-1,E=e[c+=t];++m<d;){var _=s[m],h=_.type,g=(0,_.iteratee)(E);if(2==h)E=g;else if(!g){if(1==h)continue e;break e}}f[p++]=E}return f},Rn.prototype.at=lo,Rn.prototype.chain=function(){return to(this)},Rn.prototype.commit=function(){return new On(this.value(),this.__chain__)},Rn.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Rn.prototype.plant=function(e){for(var t,n=this;n instanceof In;){var l=Rr(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},Rn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:no,args:[zr],thisArg:void 0}),new On(t,this.__chain__)}return this.thru(zr)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,bt&&(Rn.prototype[bt]=function(){return this}),Rn}();Ve?((Ve.exports=Kt)._=Kt,$e._=Kt):ze._=Kt}).call(d)});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"},m=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},E=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}},h=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},g=[{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){var i,r;let{t:o,document:a,setDocuments:u,setError:c,documents:s,id:d,renewApplication:p,user:v}=e;const f=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],m=null==p||null===(i=p.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==a?void 0:a.code)}),[E,_]=n.useState(!1),[h,g]=n.useState(m?{...m,active:!0===(null==a?void 0:a.active),code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}:1===(null==a||null===(r=a.dropdownData)||void 0===r?void 0:r.length)?null==a?void 0:a.dropdownData[0]:{...f,active:!0===(null==a?void 0:a.active),code:null==f?void 0:f.documentType,i18nKey:null==f?void 0:f.documentType.replaceAll(".","_")}),y=()=>l.createElement("div",{className:"loading-spinner"}),[S,b]=n.useState(null),[T,A]=n.useState(()=>(null==f?void 0:f.filestoreId)||null),{dropdownData:C}=a;var D=C;const[N,R]=n.useState(!1);return n.useEffect(()=>{var e;null==p||null===(e=p.documents)||void 0===e||e.map((e,t)=>{null!=e&&e.documentType.includes(null==a?void 0:a.code)&&A(e)})},[null==p?void 0:p.documents]),n.useEffect(()=>{null!=h&&h.code&&null!=p&&p.applicationNumber?u(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==T?void 0:T.length)||null===T?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==T),{documentType:null==h?void 0:h.code,filestoreId:null==T?void 0:T.documentUid,documentUid:null==T?void 0:T.documentUid}]}):null!=h&&h.code&&u(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==T?void 0:T.length)||null===T?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==T),{documentType:null==h?void 0:h.code,filestoreId:T,documentUid:T}]})},[T,h]),n.useEffect(()=>{!function(){try{c(null);const e=function(){if(S){const e=function(){if(S.size>=5242880)c(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=function(e,t){try{var n=(A(null),_(!0),Promise.resolve(Digit.UploadServices.Filestorage("PTR",S,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?A(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):c(o("CS_FILE_UPLOAD_ERROR"))}))}catch(e){return t()}return n&&n.then?n.then(void 0,t):n}(0,function(){c(o("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(_(!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)}}()},[S]),n.useEffect(()=>{N&&A(null)},[N]),l.createElement("div",{style:{marginBottom:"24px"}},null!=a&&a.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.code.replaceAll(".","_"))," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.Dropdown,{className:"form-field",selected:h,style:{width:"EMPLOYEE"===(null==v?void 0:v.type)?"50%":"100%"},option:D.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>g(e),optionKey:"i18nKey",t:o})):l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==a?void 0:a.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){b(e.target.files[0])},onDelete:()=>{A(null)},id:d,message:E?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(y,null),l.createElement("span",null,"Uploading...")):T?"1 File Uploaded":"No File Uploaded",textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!T}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const S=e=>{var n,r,o;let{data:a,OpenImage:u}=e;const{t:c}=i.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement(t.TelePhone,{mobile:a.mobileNumber}),a.source&&l.createElement("p",null,c("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(Reason,{otherComment:null==a?void 0:a.otherComment,headComment:null==a?void 0:a.comment}),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.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==a||null===(r=a.thumbnailsToShow)||void 0===r||null===(o=r.thumbs)||void 0===o?void 0:o.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,c("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)},b=e=>{var o,a,u,c,s,d,p;const{t:v}=i.useTranslation(),f=null==e||null===(o=e.application)||void 0===o||null===(a=o.workflow)||void 0===a?void 0:a.businessService,{isLoading:m,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:f});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 r={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(S,{data:r})}if(t.state){var r,o,a,u,c;const e={date:null==t||null===(r=t.auditDetails)||void 0===r?void 0:r.lastModified,name:null==t||null===(o=t.assignes)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.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(S,{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(S,{data:n})}};return m?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!m&&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_${f}_${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 r;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===(r=E.processInstances[n].state)||void 0===r?void 0:r.state)),customChild:h(e)}))})))),E&&(n=>{var i,o,a;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(r.Link,{to:{pathname:`/upyog-ui/citizen/payment/my-bills/${f}/${null==e||null===(o=e.application)||void 0===o?void 0:o.applicationNumber}`,state:{tenantId:e.application.tenantId,applicationNumber:null==e||null===(a=e.application)||void 0===a?void 0:a.applicationNumber}}},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;default:return null}})(null==E?void 0:E.nextActions))},T=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],A=()=>{var e,n,o,a,c,s;const{path:d,...p}=r.useRouteMatch(),{t:v}=i.useTranslation(),f=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRCreatePet"),m=null===(o=Digit)||void 0===o||null===(a=o.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRApplicationDetails"),E=null===(c=Digit)||void 0===c||null===(s=c.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRMyApplications");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(r.Switch,null,l.createElement(t.AppContainer,null,(void 0===(_=T)&&(_=[]),_.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:d+"/petservice/new-application",component:f}),l.createElement(t.PrivateRoute,{path:d+"/petservice/revised-application",component:f}),l.createElement(t.PrivateRoute,{path:d+"/petservice/application/:acknowledgementIds/:tenantId",component:m}),l.createElement(t.PrivateRoute,{path:d+"/petservice/my-applications",component:E}),l.createElement(t.PrivateRoute,{path:d+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:v,parentRoute:d}))}))));var _},C=e=>{let{jumpTo:n}=e;const{t:o}=i.useTranslation(),a=r.useHistory();return l.createElement(t.LinkButton,{label:o("CS_COMMON_CHANGE"),className:"check-page-link-button",onClick:function(){a.push(n)}})},D=e=>e.substr(0,1).toUpperCase()+e.substr(1),N=(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}},R=function(e,t,n){try{var l;function i(l){var i,r,o,a,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(D).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===(r=e.auditDetails)||void 0===r?void 0:r.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}]},N(e,n),{title:n("PTR_LOCATION_DETAILS"),values:[{title:n("PTR_PINCODE"),value:null==e||null===(o=e.address)||void 0===o?void 0:o.pincode},{title:n("PTR_CITY"),value:null==e||null===(a=e.address)||void 0===a?void 0:a.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 r=null==e||null===(l=e.documents)||void 0===l?void 0:l.map(e=>null==e?void 0:e.fileStoreId);return Promise.resolve((null==r?void 0:r.length)>0?Promise.resolve(Digit.UploadServices.Filefetch(r,Digit.ULBService.getStateId())).then(i):i())}catch(e){return Promise.reject(e)}},P=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")},I={padding:"4px 0px",justifyContent:"space-between"},O=e=>{var n;return l.createElement(t.Banner,{message:P(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%"}})},w=e=>{var n;let{application:o,buttonLabel:a}=e;const{t:u}=i.useTranslation(),c=r.useHistory();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_NO_LABEL"),note:null==o?void 0:o.applicationNumber}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICANT_NAME"),note:null==o?void 0:o.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_TYPE"),note:null==o?void 0:o.applicationType}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_STATUS"),note:null==o?void 0:o.status}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==o||null===(n=o.petDetails)||void 0===n?void 0:n.petType}),"Expired"==(null==o?void 0:o.status)&&l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal",onSubmit:()=>{var e;sessionStorage.setItem("petId",null==o?void 0:o.applicationNumber),null!=o&&o.petToken&&(null==o||null===(e=o.petToken)||void 0===e?void 0:e.length)>0&&sessionStorage.setItem("petToken",null==o?void 0:o.petToken),c.push("/upyog-ui/citizen/ptr/petservice/revised-application")}}),l.createElement(r.Link,{to:`/upyog-ui/citizen/ptr/petservice/application/${null==o?void 0:o.applicationNumber}/${null==o?void 0:o.tenantId}`},l.createElement(t.SubmitBar,{label:a})))};var x,L=Array.isArray,M="object"==typeof self&&self&&self.Object===Object&&self,k="object"==typeof d&&d&&d.Object===Object&&d||M||Function("return this")(),F=k.Symbol,B=Object.prototype,U=B.hasOwnProperty,j=B.toString,H=F?F.toStringTag:void 0,W=Object.prototype.toString,z=F?F.toStringTag:void 0,$=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":z&&z in Object(e)?function(e){var t=U.call(e,H),n=e[H];try{e[H]=void 0;var l=!0}catch(e){}var i=j.call(e);return l&&(t?e[H]=n:delete e[H]),i}(e):function(e){return W.call(e)}(e)},V=function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==$(e)},K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,q=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},G=k["__core-js_shared__"],Z=(x=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",X=Function.prototype.toString,Q=/^\[object .+?Constructor\]$/,J=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!q(e)||(t=e,Z&&Z in t))&&(function(e){if(!q(e))return!1;var t=$(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?J:Q).test(function(e){if(null!=e){try{return X.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}(n)?n:void 0},te=ee(Object,"create"),ne=Object.prototype.hasOwnProperty,le=Object.prototype.hasOwnProperty;function ie(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])}}ie.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ie.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ie.prototype.get=function(e){var t=this.__data__;if(te){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ne.call(t,e)?t[e]:void 0},ie.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:le.call(t,e)},ie.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=te&&void 0===t?"__lodash_hash_undefined__":t,this};var re=ie,oe=function(e,t){for(var n=e.length;n--;)if((l=e[n][0])===(i=t)||l!=l&&i!=i)return n;var l,i;return-1},ae=Array.prototype.splice;function ue(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])}}ue.prototype.clear=function(){this.__data__=[],this.size=0},ue.prototype.delete=function(e){var t=this.__data__,n=oe(t,e);return!(n<0||(n==t.length-1?t.pop():ae.call(t,n,1),--this.size,0))},ue.prototype.get=function(e){var t=this.__data__,n=oe(t,e);return n<0?void 0:t[n][1]},ue.prototype.has=function(e){return oe(this.__data__,e)>-1},ue.prototype.set=function(e,t){var n=this.__data__,l=oe(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var ce=ue,se=ee(k,"Map"),de=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 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.size=0,this.__data__={hash:new re,map:new(se||ce),string:new re}},pe.prototype.delete=function(e){var t=de(this,e).delete(e);return this.size-=t?1:0,t},pe.prototype.get=function(e){return de(this,e).get(e)},pe.prototype.has=function(e){return de(this,e).has(e)},pe.prototype.set=function(e,t){var n=de(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var ve=pe;function fe(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],r=n.cache;if(r.has(i))return r.get(i);var o=e.apply(this,l);return n.cache=r.set(i,o)||r,o};return n.cache=new(fe.Cache||ve),n}fe.Cache=ve;var me,Ee,_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,he=/\\(\\)?/g,ge=(me=fe(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(_e,function(e,n,l,i){t.push(l?i.replace(he,"$1"):n||e)}),t},function(e){return 500===Ee.size&&Ee.clear(),e}),Ee=me.cache,me),ye=F?F.prototype:void 0,Se=ye?ye.toString:void 0,be=function(e){if("string"==typeof e||V(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Te=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return L(e)?e:function(e,t){if(L(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!V(e))||Y.test(e)||!K.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:ge(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(L(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(V(t))return Se?Se.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[be(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Ae=e=>{let{t:n,currentPage:i,columns:r,data:o,getCellProps:a,disableSort:u,onSort:c,onNextPage:s,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:v,sortParams:f,totalRecords:m}=e;return l.createElement(t.Table,{t:n,data:o,currentPage:i,columns:r,getCellProps:a,onNextPage:s,onPrevPage:d,pageSizeLimit:v,disableSort:u,onPageSizeChange:p,onSort:c,sortParams:f,totalRecords:m})},Ce=e=>{let{businessService:o}=e;const{t:a}=i.useTranslation(),u=[{text:"ES_TITLE_NEW_PET_REGISTRATION",link:"/upyog-ui/employee/ptr/new-application",businessService:"ptr",roles:["PT_CEMP"]},{text:"PTR_SEARCH_PET",link:"/upyog-ui/employee/ptr/search",businessService:"ptr",roles:[]},{text:"PTR_COMMON_APPLICATION_SEARCH",link:"/upyog-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===o).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"},a("PET_SERVICE"))),l.createElement("div",{className:"body"},c.map((e,t)=>{let{link:n,text:i,hyperlink:o=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},o?l.createElement("a",{href:n},i):l.createElement(r.Link,{to:n},a(i)))}))))},De={date:t.DatePicker,mobileNumber:t.MobileNumber},Ne=e=>{var n;let{onSearch:r,type:a,onClose:u,searchFields:c,searchParams:s,isInboxPage:d,clearSearch:p}=e;const{t:v}=i.useTranslation(),{handleSubmit:f,reset:m,watch:E,control:_,formState:h,setValue:g}=o.useForm({defaultValues:d?s:{locality:null,city:null,...s}}),y=E(),S=innerWidth<=640;function b(){const e=c.reduce((e,t)=>({...e,[null==t?void 0:t.name]:""}),{});if(m(e),d){const e={...s};e.delete=[],c.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),r({...e})}else p()}const T=e=>l.createElement(t.LinkLabel,{style:{display:"inline",...e?{margin:0}:{}},onClick:b},v("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:f(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],c.forEach(t=>{e[t.name]||e.delete.push(t.name)}),r(e),"mobile"===a&&u()})},l.createElement(l.Fragment,null,l.createElement("div",{className:"search-container",style:{width:"auto",marginLeft:d?"24px":"revert"}},l.createElement("div",{className:"search-complaint-container"},("mobile"===a||S)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,v("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:u},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(d?"":"for-search"),style:{width:"100%",display:"grid"}},null==c||null===(n=c.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,r,a;return l.createElement("div",{key:e.name,className:"input-fields"},l.createElement("span",{className:"mobile-input"},l.createElement(t.Label,null,v(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(o.Controller,e.type?{render:t=>l.createElement(null==De?void 0:De[e.type],{formValue:y,setValue:g,onChange:t.onChange,value:t.value}),name:e.name,control:_,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:_,defaultValue:""})),null!=h&&null!==(i=h.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==h||null===(r=h.errors)||void 0===r||null===(a=r[e.name])||void 0===a?void 0:a.message):null)}),d&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,T())),"desktop"===a&&!S&&l.createElement("div",{style:{maxWidth:"unset",marginLeft:"unset"},className:"search-submit-wrapper"},l.createElement(t.SubmitBar,{className:"submit-bar-search",label:v("ES_COMMON_SEARCH"),disabled:!!Object.keys(h.errors).length||(()=>{var e;let t=!0;return Object.keys(y).forEach(e=>{!["locality","city"].includes(e)&&y[e]&&(t=!1)}),null==c||!c.find(e=>"locality"===e.name)||null!=y&&null!==(e=y.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!d&&l.createElement("div",null,T()))))),("mobile"===a||S)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},T(S)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(h.errors).length,label:v("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},Re=e=>{let{tableConfig:r,filterComponent:o,...a}=e;const{data:u,useNewInboxAPI:c}=a,{t:s}=i.useTranslation(),[d,p]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(o)}),[v,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[m,E]=n.useState(!1),_=l.useMemo(()=>a.isSearch?r.searchColumns(a):r.inboxColumns(a)||[],[]);let h;return a.isLoading?h=l.createElement(t.Loader,null):m?h=null:!u||0===(null==u?void 0:u.length)||c&&null!=u&&u[0].dataEmpty?h=v&&l.createElement(v,{data:u})||(0===(null==u?void 0:u.length)||c&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},s("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&&(h=l.createElement(Ae,{t:s,data:u,columns:_,getCellProps:e=>({style:{minWidth:e.column.Header===s("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:a.onPageSizeChange,currentPage:a.currentPage,onNextPage:a.onNextPage,onPrevPage:a.onPrevPage,pageSizeLimit:a.pageSizeLimit,onSort:a.onSort,disableSort:a.disableSort,sortParams:a.sortParams,totalRecords:a.totalRecords})),l.createElement("div",{className:"inbox-container"},!a.isSearch&&l.createElement("div",{className:"filters-container"},l.createElement(Ce,{parentRoute:a.parentRoute,businessService:a.moduleCode}),l.createElement("div",null,l.createElement(d,{defaultSearchParams:a.defaultSearchParams,onFilterChange:a.onFilterChange,searchParams:a.searchParams,type:"desktop",useNewInboxAPI:c,statusMap:c?null==u?void 0:u[0].statusMap:null,moduleCode:a.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(Ne,{defaultSearchParams:a.defaultSearchParams,onSearch:e=>{a.onSearch(e),E(!1)},type:"desktop",searchFields:a.searchFields,isInboxPage:!(null!=a&&a.isSearch),searchParams:a.searchParams,clearSearch:()=>E(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=a&&a.isSearch?"":"24px",flex:1}},h)))},Pe=e=>{const{t:r}=i.useTranslation(),[o,a]=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:r("ES_INBOX_DATE_LATEST_FIRST")}:{code:"ASC",name:r("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"},r("SORT_BY"),":"),l.createElement("div",{className:"clearAll",onClick:u},r("ES_COMMON_CLEAR_ALL")),"desktop"===e.type&&l.createElement("span",{className:"clear-search",onClick:u},r("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:o,optionsKey:"name",options:[{code:"DESC",name:r("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:r("ES_INBOX_DATE_LATEST_LAST")}]})))))},Ie=e=>{let{t:i,data:r,onFilterChange:o,onSearch:a,onSort:u,serviceRequestIdKey:c,isFstpOperator:s,isLoading:d,isSearch:p,searchParams:v,searchFields:f,sortParams:m,linkPrefix:E,filterComponent:_}=e;const[h,g]=n.useState(p?"SEARCH":""),[y,S]=n.useState(!!p),[b,T]=n.useState(m),[A]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(_)});n.useEffect(()=>{h&&S(!0)},[h]);const C=()=>{S(!1),g(""),T(m)};if(d)return l.createElement(t.Loader,null);let D;return r&&0!==(null==r?void 0:r.length)?r&&(null==r?void 0:r.length)>0&&(D=l.createElement(t.DetailsCard,{data:r,serviceRequestIdKey:c,linkPrefix:E||"/upyog-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"},a&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{g("SEARCH"),S(!0)}}),!p&&o&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{g("FILTER"),S(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{g("SORT"),S(!0)}})),D,y&&l.createElement(t.PopUp,null,"FILTER"===h&&l.createElement("div",{className:"popup-module"},l.createElement(A,{onFilterChange:e=>{o(e),S(!1)},Close:C,type:"mobile",searchParams:v})),"SORT"===h&&l.createElement("div",{className:"popup-module"},l.createElement(Pe,{type:"mobile",sortParams:m,onClose:C,onSort:u})),"SEARCH"===h&&l.createElement("div",{className:"popup-module"},l.createElement(Ne,{type:"mobile",onClose:C,onSearch:a,isFstpOperator:s,searchParams:v,searchFields:f}))))},Oe=e=>{let{linkPrefix:o,classNameForMobileView:a=""}=e;const{t:u}=i.useTranslation(),c=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/upyog-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:o+"/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 "+a},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(r.Link,{to:n},i))}))))},we=e=>{let{data:t,isLoading:n,isSearch:r,searchFields:o,onFilterChange:a,onSearch:u,onSort:c,parentRoute:s,searchParams:d,sortParams:p,linkPrefix:v,tableConfig:f,filterComponent:m}=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"},!r&&l.createElement(Oe,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:s,isMobile:!0}),l.createElement(Ie,{t:E,data:null==t?void 0:t.map(e=>{const t={};return(r?f.searchColumns():f.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:a,isLoading:n,isSearch:r,onSearch:u,onSort:c,searchParams:d,searchFields:o,linkPrefix:v,sortParams:p,serviceRequestIdKey:null==f?void 0:f.serviceRequestIdKey,filterComponent:m}))))},xe=e=>{var r,o,a,u,c;let{useNewInboxAPI:s,parentRoute:d,moduleCode:p="PTR",initialStates:v={},filterComponent:f,isInbox:m,rawWfHandler:E,rawSearchHandler:_,combineResponse:h,wfConfig:g,searchConfig:y,middlewaresWf:S,middlewareSearch:b,EmptyResultInboxComp:T}=e;const A=Digit.ULBService.getCurrentTenantId(),{t:C}=i.useTranslation(),[D,N]=n.useState(()=>m?{}:{enabled:!1}),[R,P]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[I,O]=n.useState(v.pageOffset||0),[w,x]=n.useState(v.pageSize||10),[L,M]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[k,F]=n.useState(v.searchParams||{});let B=window.Digit.Utils.browser.isMobile(),U=B?{limit:100,offset:0,sortBy:null==L||null===(r=L[0])||void 0===r?void 0:r.id,sortOrder:null!=L&&null!==(o=L[0])&&void 0!==o&&o.desc?"DESC":"ASC"}:{limit:w,offset:I,sortBy:null==L||null===(a=L[0])||void 0===a?void 0:a.id,sortOrder:null!=L&&null!==(u=L[0])&&void 0!==u&&u.desc?"DESC":"ASC"};const{isLoading:j,data:H,searchFields:W,...z}=s?Digit.Hooks.useNewInboxGeneral({tenantId:A,ModuleCode:p,filters:{...k,...U,sortParams:L}}):Digit.Hooks.useInboxGeneral({tenantId:A,businessService:p,isInbox:m,filters:{...k,...U,sortParams:L},rawWfHandler:E,rawSearchHandler:_,combineResponse:h,wfConfig:g,searchConfig:{...D,...y},middlewaresWf:S,middlewareSearch:b});n.useEffect(()=>{O(0)},[k]);const $=e=>{let t=e.delete,n={...k,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,F({...n}),N({enabled:!0})},V=n.useCallback(e=>{0!==e.length&&M(e)},[]);var K,Y;if(null!==(null==z||null===(c=z.data)||void 0===c?void 0:c.length))return B?l.createElement(we,{data:H,isLoading:j,isSearch:!m,searchFields:W,onFilterChange:$,onSearch:$,onSort:V,parentRoute:d,searchParams:k,sortParams:L,linkPrefix:d+"/application-details/",tableConfig:null!=z&&z.tableConfig?null===(K=res)||void 0===K?void 0:K.tableConfig:R(C).PTR,filterComponent:f,EmptyResultInboxComp:T,useNewInboxAPI:s}):l.createElement("div",null,m&&l.createElement(t.Header,null,C("ES_COMMON_INBOX")),l.createElement(Re,{moduleCode:p,data:H,tableConfig:R(C).PTR,isLoading:j,defaultSearchParams:v.searchParams,isSearch:!m,onFilterChange:$,searchFields:W,onSearch:$,onSort:V,onNextPage:()=>{O(e=>e+w)},onPrevPage:()=>{O(e=>e-w)},currentPage:Math.floor(I/w),pageSizeLimit:w,disableSort:!1,onPageSizeChange:e=>{x(Number(e.target.value))},parentRoute:d,searchParams:k,sortParams:L,totalRecords:Number(null==H||null===(Y=H[0])||void 0===Y?void 0:Y.totalCount),filterComponent:f,EmptyResultInboxComp:T,useNewInboxAPI:s}))},Le=e=>{var i,a;let{isLoading:u,t:c,onSubmit:s,data:d,count:p,setShowToast:v}=e;const f=window.Digit.Utils.browser.isMobile(),{register:m,control:E,handleSubmit:_,setValue:h,getValues:g,reset:y,formState:S}=o.useForm({defaultValues:{offset:0,limit:!f&&10,sortBy:"commencementDate",sortOrder:"DESC"}});n.useEffect(()=>{m("offset",0),m("limit",10),m("sortBy","commencementDate"),m("sortOrder","DESC")},[m]);const b=[{code:"NEWAPPLICATION",i18nKey:"NEWAPPLICATION"},{code:"RENEWAPPLICATION",i18nKey:"RENEWAPPLICATION"}],T=Digit.ULBService.getStateId(),{data:A}=Digit.Hooks.ptr.usePTRPetMDMS(T,"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(r.Link,{to:"/upyog-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}],[]),R=n.useCallback(e=>{0!==e.length&&(h("sortBy",e.id),h("sortOrder",e.desc?"DESC":"ASC"))},[]);function P(){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:m({})})),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_SEARCH_PET_TYPE")),l.createElement(o.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(o.Controller,{control:E,name:"applicationType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:b,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:m({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==S||null===(i=S.errors)||void 0===i||null===(a=i.mobileNumber)||void 0===a?void 0:a.message)),l.createElement(t.SearchField,null,l.createElement("label",null,c("PTR_FROM_DATE")),l.createElement(o.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(o.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:()=>{y({applicationNumber:"",fromDate:"",toDate:"",petType:"",mobileNumber:"",status:"",breedType:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),P()}},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:P,pageSizeLimit:g("limit"),onSort:R,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})))},Me=e=>{r.useParams();const{t:o}=i.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,c]=n.useState({}),[s,d]=n.useState(null),p={enabled:!!(u&&Object.keys(u).length>0)},{isLoading:v,isSuccess:f,data:{PetRegistrationApplications:m,Count:E}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:u},p);return l.createElement(l.Fragment,null,l.createElement(Le,{t:o,isLoading:v,tenantId:a,setShowToast:d,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={...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)=>({...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?d({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):c(i):d({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):d({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:f&&!v?m.length>0?m:{display:"ES_COMMON_NO_DATA"}:"",count:E}),s&&l.createElement(t.Toast,{error:s.error,warning:s.warning,label:o(s.label),isDleteBtn:!0,onClose:()=>{d(null)}}))},ke=e=>{var n,o,a,c;let{path:s,userType:d}=e;const{t:p}=i.useTranslation(),v=r.useLocation();sessionStorage.removeItem("revalidateddone");const f=window.Digit.Utils.browser.isMobile(),m={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},E=e=>{let{location:n}=e;const{t:o}=i.useTranslation(),a=r.useLocation().search,u=(new URLSearchParams(a).get("from"),Digit.Hooks.useQueryParams(),[{path:"/upyog-ui/employee",content:o("ES_COMMON_HOME"),show:!0},{path:"/upyog-ui/employee/ptr/petservice/inbox",content:o("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/upyog-ui/employee/ptr/petservice/my-applications",content:o("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:f?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},_=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRNewApplication"),h=null===(a=Digit)||void 0===a||null===(c=a.ComponentRegistryService)||void 0===c?void 0:c.getComponent("ApplicationDetails"),g=window.location.href.includes("ptr/response"),y=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return l.createElement(r.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},g?null:l.createElement("div",{style:y?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(E,{location:v})),l.createElement(t.PrivateRoute,{exact:!0,path:s+"/",component:()=>l.createElement(hi,{matchPath:s,userType:d})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/inbox",component:()=>l.createElement(xe,{useNewInboxAPI:!0,parentRoute:s,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:m,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(xe,{parentRoute:s,businessService:"ptr",middlewareSearch:searchMW,initialStates:m,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:s+"/petservice/my-applications",component:e=>l.createElement(Me,u({},e,{parentRoute:s}))}))))},Fe=e=>{var n;let{status:r,searchParams:o,onAssignmentChange:a,statusMap:u}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>a({...e,state:r.state},r),checked:null==o?void 0:o.applicationStatus.some(e=>e.uuid===r.uuid),label:`${r.name} (${(null==u||null===(n=u.find(e=>e.statusid===r.uuid))||void 0===n?void 0:n.count)||"-"})`})},Be=e=>{var r,o,a,u,c;let{onAssignmentChange:s,searchParams:d,businessServices:p,statusMap:v}=e;const{t:f}=i.useTranslation(),[m,E]=n.useState(!1),{data:_,isLoading:h}=Digit.Hooks.useApplicationStatusGeneral({businessServices:p},{}),{userRoleStates:g}=_||{},y=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_PTR_COMMON_STATUS_"+(e.state||"CREATED"));return h?l.createElement(t.Loader,null):null!=g&&g.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==g||null===(r=g.filter(e=>!e.isTerminateState))||void 0===r||null===(o=r.slice(0,4))||void 0===o?void 0:o.map((e,t)=>l.createElement(Fe,{businessServices:p,key:t,onAssignmentChange:s,status:{name:y(e,f),code:e.applicationStatus,...e},searchParams:d,statusMap:v})),(null==g||null===(a=g.filter(e=>!e.isTerminateState))||void 0===a?void 0:a.slice(4).length)>0?l.createElement(l.Fragment,null,m&&(null==g||null===(u=g.filter(e=>!e.isTerminateState))||void 0===u||null===(c=u.slice(4))||void 0===c?void 0:c.map((e,t)=>l.createElement(Fe,{businessServices:p,key:e.uuid,onAssignmentChange:s,status:{name:y(e,f),code:e.applicationStatus,...e},searchParams:d,statusMap:v}))),l.createElement("div",{className:"filter-button",onClick:()=>E(!m)}," ",f(m?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},Ue=e=>{var r;let{searchParams:o,onFilterChange:u,defaultSearchParams:c,statusMap:s,moduleCode:d,...p}=e;const{t:v}=i.useTranslation(),f=a.useQueryClient(),[m,E]=n.useState(()=>({...o,services:[]})),_=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],h=e=>{let t=e.delete,n={...m,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,E({...n})},g=()=>{E({...c,services:[]}),u({...c})},y=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"}},v("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:g},v("ES_COMMON_CLEAR_ALL")),"desktop"===p.type&&l.createElement("span",{className:"clear-search",onClick:g,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"===p.type&&l.createElement("span",{onClick:p.onClose},l.createElement(t.CloseSvg,null))),l.createElement("div",null,l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_INBOX_LOCALITY"),":"),l.createElement(t.Localities,{selectLocality:e=>{h({locality:[...(null==m?void 0:m.locality)||[],e]})},tenantId:y,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==m||null===(r=m.locality)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:v(e.i18nkey),onClick:()=>{h({locality:null==m?void 0:m.locality.filter(t=>t.code!==e.code)})}})))),l.createElement("div",null,l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},v("ES_PTR_APP_TYPE")),_.map((e,n)=>{var i;const r=null==m||null===(i=m.services)||void 0===i?void 0:i.includes(e.value);return l.createElement(t.CheckBox,{key:n+"service",label:v(e.label),value:e.label,checked:r,onChange:t=>((e,t)=>{var n;h(e.target.checked?{services:Array.isArray(m.services)?[...m.services,t]:[t]}:{services:m.services.filter(e=>e!==t),applicationStatus:null===(n=m.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(Be,{searchParams:m,businessServices:m.services,statusMap:s||f.getQueryData("INBOX_STATUS_MAP_"+d),moduleCode:d,onAssignmentChange:(e,t)=>{if(e.target.checked)h({applicationStatus:[...null==m?void 0:m.applicationStatus,t]});else{let e=null==m?void 0:m.applicationStatus.filter(e=>e.state!==t.state);h({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{u(0===m.services.length?{...m,services:_.map(e=>e.value)}:m)},label:v("ES_COMMON_APPLY")}))))))},je=e=>l.createElement("span",{className:"cell-text"},e),He=e=>l.createElement("span",{className:"sla-cell"},e);function We(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const ze=e=>l.createElement("h1",{className:"heading-m"},e.label),$e=()=>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"})),Ve=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($e,null)),Ke=e=>{var i,r;let{t:o,action:a,tenantId:u,closeModal:c,submitAction:s,applicationData:d,businessService:p,moduleCode:v}=e;const{data:f,isLoading:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:E,data:_}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[h,g]=n.useState({}),[y,S]=n.useState({}),[b,T]=n.useState([]),[A,C]=n.useState(null),[D,N]=n.useState(null),[R,P]=n.useState(null),[I,O]=n.useState(null),[w,x]=n.useState([]),[L,M]=n.useState(null),[k,F]=n.useState(!1);function B(e){N(e.target.files[0])}return n.useEffect(()=>{var e;_&&_["egf-master"]&&x(null===(e=_["egf-master"])||void 0===e?void 0:e.FinancialYear)},[_]),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{O(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)O(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=We(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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(o("CS_FILE_UPLOAD_ERROR"))})},function(){O(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[D]),n.useEffect(()=>{a&&g(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:r,selectedFinancialYear:o,setSelectedFinancialYear:a}=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:r,optionsKey:"name",onSelect:a,selectedOption:o})}]}]}})({t:o,action:a,financialYears:w,selectedFinancialYear:L,setSelectedFinancialYear:M}):(e=>{var n;let{t:i,action:r,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v}=e;return{label:{heading:`WF_${null==r?void 0:r.action}_APPLICATION`,submit:`WF_${v}_${null==r?void 0:r.action}`,cancel:"ES_PT_COMMON_CANCEL"},form:[{body:[{label:r.isTerminateState||"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?null:i(p||"WF_ROLE_"+(null===(n=r.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:r.isTerminateState||"SENDBACKTOCITIZEN"===(null==r?void 0:r.action)?null:l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("ES_PT_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:`${i("ES_PT_ATTACH_FILE")}${r.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:o,action:a,approvers:b,selectedApprover:A,setSelectedApprover:C,selectFile:B,uploadedFile:R,setUploadedFile:P,businessService:p}))},[a,b,w,L,R]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ze,{label:o(h.label.heading)}),headerBarEnd:l.createElement(Ve,{onClick:c}),actionCancelLabel:o(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(h.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!L:m||(null==a?void 0:a.docUploadRequired)&&!R,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==a?void 0:a.action)){let t={action:"OPEN",comment:null==e?void 0:e.comments,businessService:"PT.CREATE",moduleName:"PT"};d.creationReason="STATUS",s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:{...d,workflow:t}})}else if(null!=a&&a.showFinancialYearsModal)s({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==L?void 0:L.name,propertyId:null==d?void 0:d.propertyId,tenantId:u,source:null==d?void 0:d.source,channel:null==d?void 0:d.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!A?[]:[A],R&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:R}]),s({Property:{...d,workflow:t}})}},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Ye=e=>l.createElement("h1",{className:"heading-m"},e.label),qe=()=>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"})),Ge=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qe,null)),Ze=e=>{var i,r;let{t:o,action:a,tenantId:u,closeModal:c,submitAction:s,applicationData:d,businessService:p}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:f,data:m}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,_]=n.useState({}),[h,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState({}),[A,C]=n.useState(null),[D,N]=n.useState(null),[R,P]=n.useState(null),[I,O]=n.useState([]),[w,x]=n.useState(null);function L(e){C(e.target.files[0])}return n.useEffect(()=>{var e;m&&m["egf-master"]&&O(null===(e=m["egf-master"])||void 0===e?void 0:e.FinancialYear)},[m]),n.useEffect(()=>{var e;S(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)P(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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):P(o("CS_FILE_UPLOAD_ERROR"))})},function(){P(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{a&&_((e=>{let{t:n,action:i,approvers:r,selectedApprover:o,setSelectedApprover:a,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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:o}):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:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:L,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,y,I,w,D]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Ye,{label:o(E.label.heading)}),headerBarEnd:l.createElement(Ge,{onClick:c}),actionCancelLabel:o(E.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:null},s({Licenses:[d]})},defaultValues:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Xe=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Qe=()=>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"})),Je=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qe,null)),et=e=>{var i,r;let{t:o,action:a,tenantId:u,closeModal:c,submitAction:s,applicationData:d,businessService:p}=e;const{data:v,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[m,E]=n.useState({}),[_,h]=n.useState({}),[g,y]=n.useState([]),[S,b]=n.useState({}),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,R]=n.useState(null),P=!!Digit.Utils.browser.isMobile();function I(e){A(e.target.files[0])}return n.useEffect(()=>{var e;y(null==v||null===(e=v.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}}))},[v]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(T){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(T.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=T&&T.type&&!e.test(null==T?void 0:T.type))R(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",T,Digit.ULBService.getStateId()||(null==u?void 0:u.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?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:i,approvers:r,selectedApprover:o,setSelectedApprover:a,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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:o}):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:o,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:I,uploadedFile:C,setUploadedFile:D,businessService:p,error:N}))},[a,g,C,N]),a&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xe,{label:o(m.label.heading)}),headerBarEnd:l.createElement(Je,{onClick:c}),actionCancelLabel:o(m.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:P?{width:"720px"}:{},style:P?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:P?{paddingLeft:"5px"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:m.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null,wfDocuments:C?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:C}]:null},s({Licenses:[d]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},tt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-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,r,o,u,c,s,d,p,v,f,m,E;let{t:_,action:h,tenantId:g,closeModal:y,submitAction:S,applicationDetails:b,applicationData:T,businessService:A,workflowDetails:C}=e;Digit.Hooks.obps.useObpsAPI(null!==(i=T)&&void 0!==i&&null!==(r=i.landInfo)&&void 0!==r&&null!==(o=r.address)&&void 0!==o&&o.city?null===(u=T)||void 0===u||null===(c=u.landInfo)||void 0===c||null===(s=c.address)||void 0===s?void 0:s.city:g,!1);const{data:D,isLoading:N}=Digit.Hooks.useEmployeeSearch(g,{roles:null==C||null===(d=C.data)||void 0===d||null===(p=d.initialActionState)||void 0===p||null===(v=p.nextActions)||void 0===v||null===(f=v.filter(e=>(null==e?void 0:e.action)==(null==h?void 0:h.action)))||void 0===f||null===(m=f[0])||void 0===m||null===(E=m.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=h&&h.isTerminateState)}),[R,P]=(a.useQueryClient(),n.useState({})),[I,O]=n.useState({}),[w,x]=n.useState([]),[L,M]=n.useState({}),[k,F]=n.useState(null),[B,U]=n.useState(null),[j,H]=n.useState(null),[W,z]=n.useState(null),$=!!Digit.Utils.browser.isMobile();function V(e){F(e.target.files[0])}n.useEffect(()=>{var e;x(null==D||null===(e=D.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}}))},[D]),n.useEffect(()=>{!function(){try{H(null);const e=function(){if(k){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(k.size>=5242880)H(_("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=k&&k.type&&!e.test(null==k?void 0:k.type))H(_("NOT_SUPPORTED_FILE_TYPE"));else{const e=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",k,Digit.ULBService.getStateId()||(null==g?void 0:g.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?U(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):H(_("CS_FILE_UPLOAD_ERROR"))})},function(){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)}}()},[k]);const K=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},Y=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},q=e=>{var t,n;let l=[],i=[];var r,o;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===(r=e.additionalDetails)||void 0===r?void 0:r.fieldinspection_pending),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(o=l)||void 0===o?void 0:o.length)>0&&l.map((e,t)=>{i.push({docs:K(e.Documents),date:e.InspectionDate,questions:Y(e),time:null==e?void 0:e.InspectionTime})}),i=i.filter(e=>e.docs&&e.docs.length>0)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},G=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,r,o,a;(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===(r=e.uploadedDocuments)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},Z=()=>{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(()=>{h&&P((e=>{var n;let{t:i,action:r,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:f}=e,m=!1;return"REVOCATE"!=(null==r?void 0:r.action)&&"REJECT"!=(null==r?void 0:r.action)&&"SKIP_PAYMENT"!=r.action&&"SEND_BACK_TO_CITIZEN"!=(null==r?void 0:r.action)&&"APPROVE"!=(null==r?void 0:r.action)||(m=!0),{label:{heading:`WF_${null==r?void 0:r.action}_APPLICATION`,submit:`WF_${v}_${null==r?void 0:r.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:r.isTerminateState||m?null:i(p||"WF_ROLE_"+(null===(n=r.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:r.isTerminateState||m?null:l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{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:f})}]}]}})({t:_,action:h,approvers:w,selectedApprover:L,setSelectedApprover:M,selectFile:V,uploadedFile:B,setUploadedFile:U,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:j}))},[h,w,W,B,j]),h&&R.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tt,{label:_(R.label.heading)}),headerBarEnd:l.createElement(lt,{onClick:y}),actionCancelLabel:_(R.label.cancel),actionCancelOnSubmit:y,actionSaveLabel:_(R.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:$?{width:"720px"}:{},style:$?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:$?{paddingLeft:"5px"}:{}},N?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:R.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,r,o;T={...T,documents:G(),additionalDetails:{...null===(t=T)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:q(T),pendingapproval:Z()},workflow:{action:null==h?void 0:h.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!=L&&L.uuid?[null==L?void 0:L.uuid]:null,assignes:null!=L&&L.uuid?[null==L?void 0:L.uuid]:null,varificationDocuments:B?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==k?void 0:k.name,fileStoreId:B}]:null},action:null==h?void 0:h.action,comment:null==e?void 0:e.comments,assignee:null!=L&&L.uuid?[null==L?void 0:L.uuid]:null,wfDocuments:B?[{documentType:(null==h?void 0:h.action)+" DOC",fileName:null==k?void 0:k.name,fileStoreId:B}]:null};const a=null==b||null===(i=b.nocData)||void 0===i?void 0:i.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let u={sourceRefId:null==a||null===(r=a[0])||void 0===r||null===(o=r.Noc)||void 0===o?void 0:o.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(g,u)).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,r,o,a;"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===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.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=[];a&&a.map(e=>{var t,r,o,a,u,c,s,d,p,v,f,m;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(r=t.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(o=e.Noc)||void 0===o||null===(a=o.applicationStatus)||void 0===a?void 0:a.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===(f=e.Noc)||void 0===f?void 0:f.nocType)&&n||"FIRE_NOC"===(null==e||null===(m=e.Noc)||void 0===m?void 0:m.nocType)&&l)&&i.push(e)}),S({BPA:T},(null==i?void 0:i.length)>0&&i,{isStakeholder:!1,bpa:!0})})}catch(e){return Promise.reject(e)}},defaultValues:I,formId:"modal-action"})):l.createElement(t.Loader,null)},rt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ot=()=>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"})),at=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ot,null)),ut=e=>{var i,o;let{t:u,action:c,tenantId:s,closeModal:d,submitAction:p,applicationData:v,businessService:f}=e;const{data:m,isLoading:E}=Digit.Hooks.useEmployeeSearch(s,{roles:null==c||null===(i=c.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),[_,h]=(a.useQueryClient(),n.useState({})),[g,y]=n.useState({}),[S,b]=n.useState([]),[T,A]=n.useState({}),[C,D]=n.useState(null),[N,R]=n.useState(null),[P,I]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function w(e){D(e.target.files[0])}return r.useHistory(),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{I(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)I(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))I(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",C,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?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(u("CS_FILE_UPLOAD_ERROR"))})},function(){I(u("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{c&&h((e=>{var n;let{t:i,action:r,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,assigneeLabel:p,businessService:v,error:f}=e,m=!1;"REVOCATE"!=(null==r?void 0:r.action)&&"REJECT"!=(null==r?void 0:r.action)||(m=!0);let E=!1;return"APPROVE"!=(null==r?void 0:r.action)&&"REJECT"!=(null==r?void 0:r.action)&&"AUTO_APPROVE"!=r.action&&"AUTO_REJECT"!=r.action||(E=!0),{label:{heading:`WF_${null==r?void 0:r.action}_APPLICATION`,submit:`WF_${v}_${null==r?void 0:r.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:r.isTerminateState||E?null:i(p||"WF_ROLE_"+(null===(n=r.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:r.isTerminateState||E?null:l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{label:i("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:m,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:f})}]}]}})({t:u,action:c,approvers:S,selectedApprover:T,setSelectedApprover:A,selectFile:w,uploadedFile:N,setUploadedFile:R,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:P}))},[c,S,N,P]),c&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(rt,{label:u(_.label.heading)}),headerBarEnd:l.createElement(at,{onClick:d}),actionCancelLabel:u(_.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(_.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"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.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")),r=(null===(t=v)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=v)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{r.push(e)}),v={...v,workflow:{action:null==c?void 0:c.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,documents:N?[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:N}]:null},documents:r},p({Noc:v},!1,{isNoc:!0})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)};var ct=function(e,t){return e===t||e!=e&&t!=t},st=function(e,t){for(var n=e.length;n--;)if(ct(e[n][0],t))return n;return-1},dt=Array.prototype.splice;function pt(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])}}pt.prototype.clear=function(){this.__data__=[],this.size=0},pt.prototype.delete=function(e){var t=this.__data__,n=st(t,e);return!(n<0||(n==t.length-1?t.pop():dt.call(t,n,1),--this.size,0))},pt.prototype.get=function(e){var t=this.__data__,n=st(t,e);return n<0?void 0:t[n][1]},pt.prototype.has=function(e){return st(this.__data__,e)>-1},pt.prototype.set=function(e,t){var n=this.__data__,l=st(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var vt=pt,ft="object"==typeof d&&d&&d.Object===Object&&d,mt="object"==typeof self&&self&&self.Object===Object&&self,Et=ft||mt||Function("return this")(),_t=Et.Symbol,ht=Object.prototype,gt=ht.hasOwnProperty,yt=ht.toString,St=_t?_t.toStringTag:void 0,bt=Object.prototype.toString,Tt=_t?_t.toStringTag:void 0,At=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Tt&&Tt in Object(e)?function(e){var t=gt.call(e,St),n=e[St];try{e[St]=void 0;var l=!0}catch(e){}var i=yt.call(e);return l&&(t?e[St]=n:delete e[St]),i}(e):function(e){return bt.call(e)}(e)},Ct=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Dt=function(e){if(!Ct(e))return!1;var t=At(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Nt=Et["__core-js_shared__"],Rt=function(){var e=/[^.]+$/.exec(Nt&&Nt.keys&&Nt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Pt=Function.prototype.toString,It=function(e){if(null!=e){try{return Pt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Ot=/^\[object .+?Constructor\]$/,wt=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ct(e)||(t=e,Rt&&Rt in t))&&(Dt(e)?wt:Ot).test(It(e));var t}(n)?n:void 0},Lt=xt(Et,"Map"),Mt=xt(Object,"create"),kt=Object.prototype.hasOwnProperty,Ft=Object.prototype.hasOwnProperty;function Bt(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])}}Bt.prototype.clear=function(){this.__data__=Mt?Mt(null):{},this.size=0},Bt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Bt.prototype.get=function(e){var t=this.__data__;if(Mt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return kt.call(t,e)?t[e]:void 0},Bt.prototype.has=function(e){var t=this.__data__;return Mt?void 0!==t[e]:Ft.call(t,e)},Bt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mt&&void 0===t?"__lodash_hash_undefined__":t,this};var Ut=Bt,jt=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 Ht(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])}}Ht.prototype.clear=function(){this.size=0,this.__data__={hash:new Ut,map:new(Lt||vt),string:new Ut}},Ht.prototype.delete=function(e){var t=jt(this,e).delete(e);return this.size-=t?1:0,t},Ht.prototype.get=function(e){return jt(this,e).get(e)},Ht.prototype.has=function(e){return jt(this,e).has(e)},Ht.prototype.set=function(e,t){var n=jt(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Wt=Ht;function zt(e){var t=this.__data__=new vt(e);this.size=t.size}zt.prototype.clear=function(){this.__data__=new vt,this.size=0},zt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},zt.prototype.get=function(e){return this.__data__.get(e)},zt.prototype.has=function(e){return this.__data__.has(e)},zt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof vt){var l=n.__data__;if(!Lt||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wt(l)}return n.set(e,t),this.size=n.size,this};var $t=zt,Vt=function(){try{var e=xt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=function(e,t,n){"__proto__"==t&&Vt?Vt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Yt=Object.prototype.hasOwnProperty,qt=function(e,t,n){var l=e[t];Yt.call(e,t)&&ct(l,n)&&(void 0!==n||t in e)||Kt(e,t,n)},Gt=function(e,t,n,l){var i=!n;n||(n={});for(var r=-1,o=t.length;++r<o;){var a=t[r],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Kt(n,a,u):qt(n,a,u)}return n},Zt=function(e){return null!=e&&"object"==typeof e},Xt=function(e){return Zt(e)&&"[object Arguments]"==At(e)},Qt=Object.prototype,Jt=Qt.hasOwnProperty,en=Qt.propertyIsEnumerable,tn=Xt(function(){return arguments}())?Xt:function(e){return Zt(e)&&Jt.call(e,"callee")&&!en.call(e,"callee")},nn=Array.isArray,ln=function(){return!1},rn=p(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Et.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||ln}),on=/^(?:0|[1-9]\d*)$/,an=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&on.test(e))&&e>-1&&e%1==0&&e<t},un=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},cn={};cn["[object Float32Array]"]=cn["[object Float64Array]"]=cn["[object Int8Array]"]=cn["[object Int16Array]"]=cn["[object Int32Array]"]=cn["[object Uint8Array]"]=cn["[object Uint8ClampedArray]"]=cn["[object Uint16Array]"]=cn["[object Uint32Array]"]=!0,cn["[object Arguments]"]=cn["[object Array]"]=cn["[object ArrayBuffer]"]=cn["[object Boolean]"]=cn["[object DataView]"]=cn["[object Date]"]=cn["[object Error]"]=cn["[object Function]"]=cn["[object Map]"]=cn["[object Number]"]=cn["[object Object]"]=cn["[object RegExp]"]=cn["[object Set]"]=cn["[object String]"]=cn["[object WeakMap]"]=!1;var sn=function(e){return function(t){return e(t)}},dn=p(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&ft.process,r=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=r}),pn=dn&&dn.isTypedArray,vn=pn?sn(pn):function(e){return Zt(e)&&un(e.length)&&!!cn[At(e)]},fn=Object.prototype.hasOwnProperty,mn=function(e,t){var n=nn(e),l=!n&&tn(e),i=!n&&!l&&rn(e),r=!n&&!l&&!i&&vn(e),o=n||l||i||r,a=o?function(e,t){for(var n=-1,l=Array(e);++n<e;)l[n]=t(n);return l}(e.length,String):[],u=a.length;for(var c in e)!t&&!fn.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||an(c,u))||a.push(c);return a},En=Object.prototype,_n=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||En)},hn=function(e,t){return function(n){return e(t(n))}},gn=hn(Object.keys,Object),yn=Object.prototype.hasOwnProperty,Sn=function(e){return null!=e&&un(e.length)&&!Dt(e)},bn=function(e){return Sn(e)?mn(e):function(e){if(!_n(e))return gn(e);var t=[];for(var n in Object(e))yn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Tn=Object.prototype.hasOwnProperty,An=function(e){return Sn(e)?mn(e,!0):function(e){if(!Ct(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=_n(e),n=[];for(var l in e)("constructor"!=l||!t&&Tn.call(e,l))&&n.push(l);return n}(e)},Cn=p(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?Et.Buffer:void 0,r=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=r?r(n):new e.constructor(n);return e.copy(l),l}}),Dn=function(){return[]},Nn=Object.prototype.propertyIsEnumerable,Rn=Object.getOwnPropertySymbols,Pn=Rn?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,r=0,o=[];++l<i;){var a=t[l];Nn.call(e,a)&&(o[r++]=a)}return o}(Rn(e)))}:Dn,In=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},On=hn(Object.getPrototypeOf,Object),wn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)In(t,Pn(e)),e=On(e);return t}:Dn,xn=function(e,t,n){var l=t(e);return nn(e)?l:In(l,n(e))},Ln=function(e){return xn(e,bn,Pn)},Mn=function(e){return xn(e,An,wn)},kn=xt(Et,"DataView"),Fn=xt(Et,"Promise"),Bn=xt(Et,"Set"),Un=xt(Et,"WeakMap"),jn=It(kn),Hn=It(Lt),Wn=It(Fn),zn=It(Bn),$n=It(Un),Vn=At;(kn&&"[object DataView]"!=Vn(new kn(new ArrayBuffer(1)))||Lt&&"[object Map]"!=Vn(new Lt)||Fn&&"[object Promise]"!=Vn(Fn.resolve())||Bn&&"[object Set]"!=Vn(new Bn)||Un&&"[object WeakMap]"!=Vn(new Un))&&(Vn=function(e){var t=At(e),n="[object Object]"==t?e.constructor:void 0,l=n?It(n):"";if(l)switch(l){case jn:return"[object DataView]";case Hn:return"[object Map]";case Wn:return"[object Promise]";case zn:return"[object Set]";case $n:return"[object WeakMap]"}return t});var Kn=Vn,Yn=Object.prototype.hasOwnProperty,qn=Et.Uint8Array,Gn=function(e){var t=new e.constructor(e.byteLength);return new qn(t).set(new qn(e)),t},Zn=/\w*$/,Xn=_t?_t.prototype:void 0,Qn=Xn?Xn.valueOf:void 0,Jn=Object.create,el=function(){function e(){}return function(t){if(!Ct(t))return{};if(Jn)return Jn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),tl=dn&&dn.isMap,nl=tl?sn(tl):function(e){return Zt(e)&&"[object Map]"==Kn(e)},ll=dn&&dn.isSet,il=ll?sn(ll):function(e){return Zt(e)&&"[object Set]"==Kn(e)},rl={};rl["[object Arguments]"]=rl["[object Array]"]=rl["[object ArrayBuffer]"]=rl["[object DataView]"]=rl["[object Boolean]"]=rl["[object Date]"]=rl["[object Float32Array]"]=rl["[object Float64Array]"]=rl["[object Int8Array]"]=rl["[object Int16Array]"]=rl["[object Int32Array]"]=rl["[object Map]"]=rl["[object Number]"]=rl["[object Object]"]=rl["[object RegExp]"]=rl["[object Set]"]=rl["[object String]"]=rl["[object Symbol]"]=rl["[object Uint8Array]"]=rl["[object Uint8ClampedArray]"]=rl["[object Uint16Array]"]=rl["[object Uint32Array]"]=!0,rl["[object Error]"]=rl["[object Function]"]=rl["[object WeakMap]"]=!1;var ol=function e(t,n,l,i,r,o){var a,u=1&n,c=2&n,s=4&n;if(l&&(a=r?l(t,i,r,o):l(t)),void 0!==a)return a;if(!Ct(t))return t;var d=nn(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Yn.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,a)}else{var p=Kn(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(rn(t))return Cn(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!r){if(a=c||v?{}:function(e){return"function"!=typeof e.constructor||_n(e)?{}:el(On(e))}(t),!u)return c?function(e,t){return Gt(e,wn(e),t)}(t,function(e,t){return e&&Gt(t,An(t),e)}(a,t)):function(e,t){return Gt(e,Pn(e),t)}(t,function(e,t){return e&&Gt(t,bn(t),e)}(a,t))}else{if(!rl[p])return r?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return Gn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?Gn(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?Gn(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,Zn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return Qn?Object(Qn.call(e)):{}}}(t,p,u)}}o||(o=new $t);var f=o.get(t);if(f)return f;o.set(t,a),il(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,o))}):nl(t)&&t.forEach(function(i,r){a.set(r,e(i,n,l,r,t,o))});var m=d?void 0:(s?c?Mn:Ln:c?An:bn)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(m||t,function(i,r){m&&(i=t[r=i]),qt(a,r,e(i,n,l,r,t,o))}),a},al=function(e){return ol(e,5)};const ul=e=>l.createElement("h1",{className:"heading-m"},e.label),cl=()=>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"})),sl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(cl,null)),dl=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}},pl=e=>{var i,r;let{t:o,action:a,tenantId:c,closeModal:s,submitAction:d,applicationData:p,businessService:v}=e;const{data:f,isLoading:m}=Digit.Hooks.useEmployeeSearch(c,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[E,_]=n.useState({}),[h,g]=n.useState({}),[y,S]=n.useState([]),[b,T]=n.useState({}),[A,C]=n.useState(null),[D,N]=n.useState(null),[R,P]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),O=window.location.href.includes("/employee");function w(e){C(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{P(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)P(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))P(o("NOT_SUPPORTED_FILE_TYPE"));else{const e=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("WS",A,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?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):P(o("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),P(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{var e,n,i,r;"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===(r=i.processInstance)||void 0===r?void 0:r.businessService)?a&&_((e=>{var n;let{t:i,action:r,approvers:o,selectedApprover:a,setSelectedApprover:c,selectFile:s,uploadedFile:d,setUploadedFile:p,businessService:v,error:f}=e,m=!0,E=!1;return(null!=r&&null!==(n=r.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==r?void 0:r.action)||"RESUBMIT_APPLICATION"==(null==r?void 0:r.action))&&(m=!1),r.isTerminateState&&(m=!1),"EXECUTE_DISCONNECTION"!=(null==r?void 0:r.action)&&"DISCONNECTION_EXECUTED"!=(null==r?void 0:r.action)||(E=!0),{label:{heading:`WF_${null==r?void 0:r.action}_APPLICATION`,submit:`WF_${null==v?void 0:v.toUpperCase()}_${null==r?void 0:r.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:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:c,selected:a}):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:f,iserror:f,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:v,error:R})):a&&_((e=>{var n;let{t:i,action:r,approvers:o,selectedApprover:a,setSelectedApprover:u,selectFile:c,uploadedFile:s,setUploadedFile:d,businessService:p,error:v}=e,f=!0;return(null!=r&&null!==(n=r.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==r?void 0:r.action))&&(f=!1),r.isTerminateState&&(f=!1),{label:{heading:`WF_${null==r?void 0:r.action}_APPLICATION`,submit:`WF_${null==p?void 0:p.toUpperCase()}_${null==r?void 0:r.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:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a}):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:o,action:a,approvers:y,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:v,error:R}))},[a,y,D,R]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ul,{label:o(E.label.heading)}),headerBarEnd:l.createElement(sl,{onClick:s}),actionCancelLabel:o(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:o(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&O?{width:"100%",height:"auto"}:{}},m?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,r,o,u,s,v,f;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var m,E,_,h,g,y,S,T,C;const t={...null===(m=p)||void 0===m||null===(E=m.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(_=p)||void 0===_?void 0:_.billAmendmentDetails,workflow:{businessId:null===(h=p)||void 0===h||null===(g=h.billAmendmentDetails)||void 0===g?void 0:g.amendmentId,action:null==a?void 0:a.action,tenantId:c,businessService:null!==(y=p)&&void 0!==y&&null!==(S=y.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(T=p)&&void 0!==T&&null!==(C=T.applicationType)&&void 0!==C&&C.includes("WATER")?"WS":"SW",assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:[]}};d({AmendmentUpdate:n})}else{if(p={...p,action:null==a?void 0:a.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:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:null,processInstance:{...null===(n=p)||void 0===n?void 0:n.processInstance,action:null==a?void 0:a.action,assignes:null!=b&&b.uuid?[{uuid:null==b?void 0:b.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:D}]:[]}},null!=e&&e.date&&null!==(l=p)&&void 0!==l&&null!==(i=l.applicationType)&&void 0!==i&&i.includes("DISCONNECT")){const t=al(null==e?void 0:e.date);p.disconnectionExecutionDate=dl(t)}else if(null!=e&&e.date){const t=al(null==e?void 0:e.date);p.connectionExecutionDate=dl(t)}var N;if("DisconnectWSConnection"==(null===(r=p)||void 0===r||null===(o=r.processInstance)||void 0===o?void 0:o.businessService)||"DisconnectSWConnection"==(null===(u=p)||void 0===u||null===(s=u.processInstance)||void 0===s?void 0:s.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(N=p)||void 0===N?void 0:N.serviceType)?d({WaterConnection:p,disconnectRequest:!0}):d({SewerageConnection:p,disconnectRequest:!0});else if("SEWERAGE_RECONNECTION"==(null===(v=p)||void 0===v?void 0:v.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,P,I,O,w,x,L,M,k,F,B,U,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===(P=t.value)||void 0===P?void 0:P.adhocPenalty)||""),null!=t&&null!==(I=t.value)&&void 0!==I&&I.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyComment)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenaltyReason)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(B=t.value)&&void 0!==B&&B.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(U=t.value)||void 0===U?void 0:U.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)},vl=e=>l.createElement("h1",{className:"heading-m"},e.label),fl=()=>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"})),ml=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(fl,null)),El=e=>{var i,r;let{t:o,action:a,tenantId:u,closeModal:c,submitAction:s,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[m,E]=n.useState({}),[_,h]=n.useState({}),[g,y]=n.useState([]),[S,b]=n.useState(null),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,R]=n.useState(null),[P,I]=n.useState(!1);function O(e){A(e.target.files[0])}return n.useEffect(()=>{var e;y(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PTR",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:i,selectFile:r,uploadedFile:o,setUploadedFile:a,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:r,onDelete:()=>{a(null)},showHint:!0,hintText:n("PTR_ATTACH_RESTRICTIONS_SIZE"),message:o?"1 "+n("ES_PTR_ACTION_FILEUPLOADED"):n("ES_PTR_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:O,uploadedFile:C,setUploadedFile:D,businessService:p}))},[a,g,C]),a&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vl,{label:o(m.label.heading)}),headerBarEnd:l.createElement(ml,{onClick:c}),actionCancelLabel:o(m.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};C&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:C}]),s({PetRegistrationApplications:[{...d,workflow:t}]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},_l=e=>l.createElement("h1",{className:"heading-m"},e.label),hl=()=>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"})),gl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(hl,null)),yl=e=>{var i,o,a;let{t:u,action:c,tenantId:s,closeModal:d,submitAction:p,applicationData:v,businessService:f,moduleCode:m}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(s,{roles:null==c||null===(i=c.roles)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.map)||void 0===a?void 0:a.call(o,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),_=r.useHistory(),[h,g]=n.useState({}),[y,S]=n.useState({}),[b,T]=n.useState([]),[A,C]=n.useState(null),[D,N]=n.useState(null);return n.useEffect(()=>{var e;T(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(()=>{"INITIATED"===(null==c?void 0:c.state)?_.push("/upyog-ui/employee/asset/assetservice/edit/"+(null==v?void 0:v.applicationNo)):g((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:u,action:c,approvers:b,selectedApprover:A,setSelectedApprover:C,uploadedFile:D,setUploadedFile:N,businessService:f}))},[c,b,D]),c&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(_l,{label:u(h.label.heading)}),headerBarEnd:l.createElement(gl,{onClick:d}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==c?void 0:c.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:m};D&&(t.documents=[]),p({Asset:{...v,workflow:t}})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Sl=e=>l.createElement("h1",{className:"heading-m"},e.label),bl=()=>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"})),Tl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(bl,null)),Al=e=>{var i,r;let{t:o,action:a,tenantId:u,closeModal:c,submitAction:s,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[m,E]=n.useState({}),[_,h]=n.useState({}),[g,y]=n.useState([]),[S,b]=n.useState(null),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,R]=n.useState(null),[P,I]=n.useState(!1);function O(e){A(e.target.files[0])}return n.useEffect(()=>{var e;y(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",T,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?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:i,selectFile:r,uploadedFile:o,setUploadedFile:a,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:r,onDelete:()=>{a(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:o?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:O,uploadedFile:C,setUploadedFile:D,businessService:p}))},[a,g,C]),a&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Sl,{label:o(m.label.heading)}),headerBarEnd:l.createElement(Tl,{onClick:c}),actionCancelLabel:o(m.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};C&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,filestoreId:C}]),s({hallsBookingApplication:[{...d,workflow:t}]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Cl=e=>l.createElement("h1",{className:"heading-m"},e.label),Dl=()=>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"})),Nl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Dl,null)),Rl=e=>{var i,r;let{t:o,action:a,tenantId:u,closeModal:c,submitAction:s,applicationData:d,businessService:p,moduleCode:v}=e;console.log("snjdskbjdfbjskfjkbs",a);const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[m,E]=n.useState({}),[_,h]=n.useState({}),[g,y]=n.useState([]),[S,b]=n.useState(null),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,R]=n.useState(null),[P,I]=n.useState(null),[O,w]=n.useState(!1);function x(e){D(e.target.files[0])}return n.useEffect(()=>{var e;y(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)I(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=We(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?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(o("CS_FILE_UPLOAD_ERROR"))})},function(){I(o("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:i,selectFile:r,uploadedFile:o,setUploadedFile:a,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:r,onDelete:()=>{a(null)},showHint:!0,hintText:n("EW_ATTACH_RESTRICTIONS_SIZE"),message:o?"1 "+n("ES_EW_ACTION_FILEUPLOADED"):n("ES_EW_ACTION_NO_FILEUPLOADED")})}]}]}})({t:o,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:x,uploadedFile:N,setUploadedFile:R,businessService:p}))},[a,g,N]),console.log("conggg",m),a&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Cl,{label:o(m.label.heading)}),headerBarEnd:l.createElement(Nl,{onClick:c}),actionCancelLabel:o(m.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};console.log("applicationData",e),N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:N},{}]),d.pickUpDate=null==e?void 0:e.date,d.transactionId=null==e?void 0:e.transactionId,d.finalAmount=null==e?void 0:e.finalAmount,s({EwasteApplication:[{...d,workflow:t}]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},Pl=e=>l.createElement("h1",{className:"heading-m"},e.label),Il=()=>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"})),Ol=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Il,null)),wl=e=>{var i,r;let{t:o,action:a,tenantId:u,closeModal:c,submitAction:s,applicationData:d,businessService:p,moduleCode:v}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[m,E]=n.useState({}),[_,h]=n.useState({}),[g,y]=n.useState([]),[S,b]=n.useState(null),[T,A]=n.useState(null),[C,D]=n.useState(null),[N,R]=n.useState(null),[P,I]=n.useState(!1);function O(e){I(!0),A(e.target.files[0])}return n.useEffect(()=>{var e;y(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(T){const e=function(){if(T.size>=5242880)R(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=We(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",T,u)).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?D(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(o("CS_FILE_UPLOAD_ERROR"))})},function(){R(o("CS_FILE_UPLOAD_ERROR"))})}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,n)}(0,function(e,t){if(I(!1),e)throw t;return t});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[T]),console.log("actyhdesh,jhfsefsef",a,d),n.useEffect(()=>{E((e=>{let{t:n,action:i,selectFile:r,uploadedFile:o,setUploadedFile:a,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:r,onDelete:()=>{a(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):o?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:o,action:a,approvers:g,selectedApprover:S,setSelectedApprover:b,selectFile:O,uploadedFile:C,setUploadedFile:D,businessService:p,isUploading:P}))},[a,g,C]),a&&m.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Pl,{label:o(m.label.heading)}),headerBarEnd:l.createElement(Ol,{onClick:c}),actionCancelLabel:o(m.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:o(m.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:m.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==d||null===(t=d.auditDetails)||void 0===t?void 0:t.createdBy]:null!=S&&S.uuid?[null==S?void 0:S.uuid]:null};C&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==T?void 0:T.name,fileStoreId:C}]),s({streetVendingDetail:{...d,workflow:n}})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},xl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Ke,e):null!=e&&e.businessService.includes("ptr")?l.createElement(El,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(Ze,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(et,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(it,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(ut,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(pl,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(yl,e):null!=e&&e.businessService.includes("ewst")?l.createElement(Rl,e):null!=e&&e.businessService.includes("chb")?l.createElement(Al,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(wl,e):void 0;function Ll(e){let{documents:n,svgStyles:r={},isSendBackFlow:o=!1,isHrLine:a=!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 r;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===(r=e.values)||void 0===r?void 0:r.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)),o?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")))),a&&(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!=r&&r.minWidth?null==r?void 0:r.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")))))})))}p(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]],r="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",s="[object Function]",p="[object GeneratorFunction]",v="[object Map]",f="[object Number]",m="[object Object]",E="[object RegExp]",_="[object Set]",h="[object String]",g="[object Symbol]",y="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",A="[object Float64Array]",C="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",R="[object Uint8Array]",P="[object Uint16Array]",I="[object Uint32Array]",O=/\b__p \+= '';/g,w=/\b(__p \+=) '' \+/g,x=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,M=/[&<>"']/g,k=RegExp(L.source),F=RegExp(M.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,V=RegExp($.source),K=/^\s+/,Y=/\s/,q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,G=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,X=/[^\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\]$/,re=/^0o[0-7]+$/i,oe=/^(?:0|[1-9]\d*)$/,ae=/[\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+"]",fe="\\d+",me="[a-z\\xdf-\\xf6\\xf8-\\xff]",Ee="[^\\ud800-\\udfff"+de+fe+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_e="\\ud83c[\\udffb-\\udfff]",he="[^\\ud800-\\udfff]",ge="(?:\\ud83c[\\udde6-\\uddff]){2}",ye="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+me+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ae="(?:"+ve+"|"+_e+")?",Ce="[\\ufe0e\\ufe0f]?"+Ae+"(?:\\u200d(?:"+[he,ge,ye].join("|")+")[\\ufe0e\\ufe0f]?"+Ae+")*",De="(?:"+["[\\u2700-\\u27bf]",ge,ye].join("|")+")"+Ce,Ne="(?:"+[he+ve+"?",ve,ge,ye,"[\\ud800-\\udfff]"].join("|")+")",Re=RegExp("['’]","g"),Pe=RegExp(ve,"g"),Ie=RegExp(_e+"(?="+_e+")|"+Ne+Ce,"g"),Oe=RegExp([Se+"?"+me+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[pe,Se,"$"].join("|")+")",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[pe,Se+be,"$"].join("|")+")",Se+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Se+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",fe,De].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+se+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["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,ke={};ke[T]=ke[A]=ke[C]=ke[D]=ke[N]=ke[R]=ke["[object Uint8ClampedArray]"]=ke[P]=ke[I]=!0,ke[r]=ke[o]=ke[S]=ke[a]=ke[b]=ke[u]=ke[c]=ke[s]=ke[v]=ke[f]=ke[m]=ke[E]=ke[_]=ke[h]=ke[y]=!1;var Fe={};Fe[r]=Fe[o]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[A]=Fe[C]=Fe[D]=Fe[N]=Fe[v]=Fe[f]=Fe[m]=Fe[E]=Fe[_]=Fe[h]=Fe[g]=Fe[R]=Fe["[object Uint8ClampedArray]"]=Fe[P]=Fe[I]=!0,Fe[c]=Fe[s]=Fe[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof d&&d&&d.Object===Object&&d,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),$e=t&&!t.nodeType&&t,Ve=$e&&e&&!e.nodeType&&e,Ke=Ve&&Ve.exports===$e,Ye=Ke&&He.process,qe=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),Ge=qe&&qe.isArrayBuffer,Ze=qe&&qe.isDate,Xe=qe&&qe.isMap,Qe=qe&&qe.isRegExp,Je=qe&&qe.isSet,et=qe&&qe.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,r=null==e?0:e.length;++i<r;){var o=e[i];t(l,o,n(o),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 rt(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 ot(e,t){for(var n=-1,l=null==e?0:e.length,i=0,r=[];++n<l;){var o=e[n];t(o,n,e)&&(r[i++]=o)}return r}function at(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,r=null==e?0:e.length;for(l&&r&&(n=e[++i]);++i<r;)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 ft=St("length");function mt(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,r=n+(l?1:-1);l?r--:++r<i;)if(t(e[r],r,e))return r;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,r=e.length;++i<r;)if(l(e[i],t))return i;return-1}function gt(e){return e!=e}function yt(e,t){var n=null==e?0:e.length;return n?At(e,t)/n:NaN}function St(e){return function(t){return null==t?void 0:t[e]}}function bt(e){return function(t){return null==e?void 0:e[t]}}function Tt(e,t,n,l,i){return i(e,function(e,i,r){n=l?(l=!1,e):t(n,e,i,r)}),n}function At(e,t){for(var n,l=-1,i=e.length;++l<i;){var r=t(e[l]);void 0!==r&&(n=void 0===n?r:n+r)}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,$t(e)+1).replace(K,""):e}function Nt(e){return function(t){return e(t)}}function Rt(e,t){return ct(t,function(t){return e[t]})}function Pt(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 wt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var xt=bt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Lt=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Mt(e){return"\\"+Be[e]}function kt(e){return we.test(e)}function Ft(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,r=0,o=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,o[r++]=n)}return o}function jt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Ht(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Wt(e){return kt(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):ft(e)}function zt(e){return kt(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function $t(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var Vt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Kt=function e(t){var d=(t=null==t?ze:Kt.defaults(ze.Object(),t,Kt.pick(ze,Le))).Array,Y=t.Date,se=t.Error,de=t.Function,pe=t.Math,ve=t.Object,fe=t.RegExp,me=t.String,Ee=t.TypeError,_e=d.prototype,he=ve.prototype,ge=t["__core-js_shared__"],ye=de.prototype.toString,Se=he.hasOwnProperty,be=0,Te=function(){var e=/[^.]+$/.exec(ge&&ge.keys&&ge.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ae=he.toString,Ce=ye.call(ve),De=ze._,Ne=fe("^"+ye.call(Se).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ke?t.Buffer:void 0,we=t.Symbol,Be=t.Uint8Array,He=Ie?Ie.allocUnsafe:void 0,We=Bt(ve.getPrototypeOf,ve),$e=ve.create,Ve=he.propertyIsEnumerable,Ye=_e.splice,qe=we?we.isConcatSpreadable:void 0,ft=we?we.iterator:void 0,bt=we?we.toStringTag:void 0,Yt=function(){try{var e=Xi(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),qt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Gt=Y&&Y.now!==ze.Date.now&&Y.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Xt=pe.ceil,Qt=pe.floor,Jt=ve.getOwnPropertySymbols,en=Ie?Ie.isBuffer:void 0,tn=t.isFinite,nn=_e.join,ln=Bt(ve.keys,ve),rn=pe.max,on=pe.min,an=Y.now,un=t.parseInt,cn=pe.random,sn=_e.reverse,dn=Xi(t,"DataView"),pn=Xi(t,"Map"),vn=Xi(t,"Promise"),fn=Xi(t,"Set"),mn=Xi(t,"WeakMap"),En=Xi(ve,"create"),_n=mn&&new mn,hn={},gn=Ar(dn),yn=Ar(pn),Sn=Ar(vn),bn=Ar(fn),Tn=Ar(mn),An=we?we.prototype:void 0,Cn=An?An.valueOf:void 0,Dn=An?An.toString:void 0;function Nn(e){if(Wo(e)&&!Oo(e)&&!(e instanceof On)){if(e instanceof In)return e;if(Se.call(e,"__wrapped__"))return Cr(e)}return new In(e)}var Rn=function(){function e(){}return function(t){if(!Ho(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Pn(){}function In(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}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 xn(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 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 Mn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ln;++t<n;)this.add(e[t])}function kn(e){var t=this.__data__=new xn(e);this.size=t.size}function Fn(e,t){var n=Oo(e),l=!n&&Io(e),i=!n&&!l&&Mo(e),r=!n&&!l&&!i&&Zo(e),o=n||l||i||r,a=o?Ct(e.length,me):[],u=a.length;for(var c in e)!t&&!Se.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ir(c,u))||a.push(c);return a}function Bn(e){var t=e.length;return t?e[Ll(0,t-1)]:void 0}function Un(e,t){return Sr(mi(e),qn(t,0,e.length))}function jn(e){return Sr(mi(e))}function Hn(e,t,n){(void 0!==n&&!No(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function Wn(e,t,n){var l=e[t];Se.call(e,t)&&No(l,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function zn(e,t){for(var n=e.length;n--;)if(No(e[n][0],t))return n;return-1}function $n(e,t,n,l){return Jn(e,function(e,i,r){t(l,e,n(e),r)}),l}function Vn(e,t){return e&&Ei(t,ha(t),e)}function Kn(e,t,n){"__proto__"==t&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,l=t.length,i=d(l),r=null==e;++n<l;)i[n]=r?void 0:va(e,t[n]);return i}function qn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Gn(e,t,n,l,i,o){var c,d=1&t,y=2&t,O=4&t;if(n&&(c=i?n(e,l,i,o):n(e)),void 0!==c)return c;if(!Ho(e))return e;var w=Oo(e);if(w){if(c=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Se.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!d)return mi(e,c)}else{var x=er(e),L=x==s||x==p;if(Mo(e))return ci(e,d);if(x==m||x==r||L&&!i){if(c=y||L?{}:nr(e),!d)return y?function(e,t){return Ei(e,Ji(e),t)}(e,function(e,t){return e&&Ei(t,ga(t),e)}(c,e)):function(e,t){return Ei(e,Qi(e),t)}(e,Vn(c,e))}else{if(!Fe[x])return i?e:{};c=function(e,t,n){var l=e.constructor;switch(t){case S:return si(e);case a:case u:return new l(+e);case b:return function(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case A:case C:case D:case N:case R:case"[object Uint8ClampedArray]":case P:case I:return di(e,n);case v:return new l;case f: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 Cn?ve(Cn.call(e)):{}}}(e,x,d)}}o||(o=new kn);var M=o.get(e);if(M)return M;o.set(e,c),Yo(e)?e.forEach(function(l){c.add(Gn(l,t,n,l,e,o))}):zo(e)&&e.forEach(function(l,i){c.set(i,Gn(l,t,n,i,e,o))});var k=w?void 0:(O?y?$i:zi:y?ga:ha)(e);return lt(k||e,function(l,i){k&&(l=e[i=l]),Wn(c,i,Gn(l,t,n,i,e,o))}),c}function Zn(e,t,n){var l=n.length;if(null==e)return!l;for(e=ve(e);l--;){var i=n[l],r=e[i];if(void 0===r&&!(i in e)||!(0,t[i])(r))return!1}return!0}function Xn(e,t,l){if("function"!=typeof e)throw new Ee(n);return _r(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,r=at,o=!0,a=e.length,u=[],c=t.length;if(!a)return u;n&&(t=ct(t,Nt(n))),l?(r=ut,o=!1):t.length>=200&&(r=Pt,o=!1,t=new Mn(t));e:for(;++i<a;){var s=e[i],d=null==n?s:n(s);if(s=l||0!==s?s:0,o&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;u.push(s)}else r(t,d,l)||u.push(s)}return u}Nn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:Nn}},(Nn.prototype=Pn.prototype).constructor=Nn,(In.prototype=Rn(Pn.prototype)).constructor=In,(On.prototype=Rn(Pn.prototype)).constructor=On,wn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},wn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},wn.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Se.call(t,e)?t[e]:void 0},wn.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:Se.call(t,e)},wn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&void 0===t?"__lodash_hash_undefined__":t,this},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.prototype.delete=function(e){var t=this.__data__,n=zn(t,e);return!(n<0||(n==t.length-1?t.pop():Ye.call(t,n,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,n=zn(t,e);return n<0?void 0:t[n][1]},xn.prototype.has=function(e){return zn(this.__data__,e)>-1},xn.prototype.set=function(e,t){var n=this.__data__,l=zn(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this},Ln.prototype.clear=function(){this.size=0,this.__data__={hash:new wn,map:new(pn||xn),string:new wn}},Ln.prototype.delete=function(e){var t=Gi(this,e).delete(e);return this.size-=t?1:0,t},Ln.prototype.get=function(e){return Gi(this,e).get(e)},Ln.prototype.has=function(e){return Gi(this,e).has(e)},Ln.prototype.set=function(e,t){var n=Gi(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this},Mn.prototype.add=Mn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Mn.prototype.has=function(e){return this.__data__.has(e)},kn.prototype.clear=function(){this.__data__=new xn,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 xn){var l=n.__data__;if(!pn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ln(l)}return n.set(e,t),this.size=n.size,this};var Jn=gi(al),el=gi(ul,!0);function tl(e,t){var n=!0;return Jn(e,function(e,l,i){return n=!!t(e,l,i)}),n}function nl(e,t,n){for(var l=-1,i=e.length;++l<i;){var r=e[l],o=t(r);if(null!=o&&(void 0===a?o==o&&!Go(o):n(o,a)))var a=o,u=r}return u}function ll(e,t){var n=[];return Jn(e,function(e,l,i){t(e,l,i)&&n.push(e)}),n}function il(e,t,n,l,i){var r=-1,o=e.length;for(n||(n=lr),i||(i=[]);++r<o;){var a=e[r];t>0&&n(a)?t>1?il(a,t-1,n,l,i):st(i,a):l||(i[i.length]=a)}return i}var rl=yi(),ol=yi(!0);function al(e,t){return e&&rl(e,t,ha)}function ul(e,t){return e&&ol(e,t,ha)}function cl(e,t){return ot(t,function(t){return Bo(e[t])})}function sl(e,t){for(var n=0,l=(t=ri(t,e)).length;null!=e&&n<l;)e=e[Tr(t[n++])];return n&&n==l?e:void 0}function dl(e,t,n){var l=t(e);return Oo(e)?l:st(l,n(e))}function pl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":bt&&bt in ve(e)?function(e){var t=Se.call(e,bt),n=e[bt];try{e[bt]=void 0;var l=!0}catch(e){}var i=Ae.call(e);return l&&(t?e[bt]=n:delete e[bt]),i}(e):function(e){return Ae.call(e)}(e)}function vl(e,t){return e>t}function fl(e,t){return null!=e&&Se.call(e,t)}function ml(e,t){return null!=e&&t in ve(e)}function El(e,t,n){for(var l=n?ut:at,i=e[0].length,r=e.length,o=r,a=d(r),u=Infinity,c=[];o--;){var s=e[o];o&&t&&(s=ct(s,Nt(t))),u=on(s.length,u),a[o]=!n&&(t||i>=120&&s.length>=120)?new Mn(o&&s):void 0}s=e[0];var p=-1,v=a[0];e:for(;++p<i&&c.length<u;){var f=s[p],m=t?t(f):f;if(f=n||0!==f?f:0,!(v?Pt(v,m):l(c,m,n))){for(o=r;--o;){var E=a[o];if(!(E?Pt(E,m):l(e[o],m,n)))continue e}v&&v.push(m),c.push(f)}}return c}function _l(e,t,n){var l=null==(e=vr(e,t=ri(t,e)))?e:e[Tr(kr(t))];return null==l?void 0:tt(l,e,n)}function hl(e){return Wo(e)&&pl(e)==r}function gl(e,t,n,l,i){return e===t||(null==e||null==t||!Wo(e)&&!Wo(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=Oo(e),p=Oo(t),y=d?o:er(e),T=p?o:er(t),A=(y=y==r?m:y)==m,C=(T=T==r?m:T)==m,D=y==T;if(D&&Mo(e)){if(!Mo(t))return!1;d=!0,A=!1}if(D&&!A)return s||(s=new kn),d||Zo(e)?Hi(e,t,n,l,i,s):function(e,t,n,l,i,r,o){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case S:return!(e.byteLength!=t.byteLength||!r(new Be(e),new Be(t)));case a:case u:case f:return No(+e,+t);case c:return e.name==t.name&&e.message==t.message;case E:case h:return e==t+"";case v:var s=Ft;case _:if(s||(s=jt),e.size!=t.size&&!(1&l))return!1;var d=o.get(e);if(d)return d==t;l|=2,o.set(e,t);var p=Hi(s(e),s(t),l,i,r,o);return o.delete(e),p;case g:if(Cn)return Cn.call(e)==Cn.call(t)}return!1}(e,t,y,n,l,i,s);if(!(1&n)){var N=A&&Se.call(e,"__wrapped__"),R=C&&Se.call(t,"__wrapped__");if(N||R){var P=N?e.value():e,I=R?t.value():t;return s||(s=new kn),i(P,I,n,l,s)}}return!!D&&(s||(s=new kn),function(e,t,n,l,i,r){var o=1&n,a=zi(e),u=a.length;if(u!=zi(t).length&&!o)return!1;for(var c=u;c--;){var s=a[c];if(!(o?s in t:Se.call(t,s)))return!1}var d=r.get(e),p=r.get(t);if(d&&p)return d==t&&p==e;var v=!0;r.set(e,t),r.set(t,e);for(var f=o;++c<u;){var m=e[s=a[c]],E=t[s];if(l)var _=o?l(E,m,s,t,e,r):l(m,E,s,e,t,r);if(!(void 0===_?m===E||i(m,E,n,l,r):_)){v=!1;break}f||(f="constructor"==s)}if(v&&!f){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 r.delete(e),r.delete(t),v}(e,t,n,l,i,s))}(e,t,n,l,gl,i))}function yl(e,t,n,l){var i=n.length,r=i,o=!l;if(null==e)return!r;for(e=ve(e);i--;){var a=n[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<r;){var u=(a=n[i])[0],c=e[u],s=a[1];if(o&&a[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?gl(s,c,3,l,d):p))return!1}}return!0}function Sl(e){return!(!Ho(e)||(t=e,Te&&Te in t))&&(Bo(e)?Ne:ie).test(Ar(e));var t}function bl(e){return"function"==typeof e?e:null==e?$a:"object"==typeof e?Oo(e)?Nl(e[0],e[1]):Dl(e):Ja(e)}function Tl(e){if(!cr(e))return ln(e);var t=[];for(var n in ve(e))Se.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Cl(e,t){var n=-1,l=xo(e)?d(e.length):[];return Jn(e,function(e,i,r){l[++n]=t(e,i,r)}),l}function Dl(e){var t=Zi(e);return 1==t.length&&t[0][2]?dr(t[0][0],t[0][1]):function(n){return n===e||yl(n,e,t)}}function Nl(e,t){return or(e)&&sr(t)?dr(Tr(e),t):function(n){var l=va(n,e);return void 0===l&&l===t?fa(n,e):gl(t,l,3)}}function Rl(e,t,n,l,i){e!==t&&rl(t,function(r,o){if(i||(i=new kn),Ho(r))!function(e,t,n,l,i,r,o){var a=mr(e,n),u=mr(t,n),c=o.get(u);if(c)Hn(e,n,c);else{var s=r?r(a,u,n+"",e,t,o):void 0,d=void 0===s;if(d){var p=Oo(u),v=!p&&Mo(u),f=!p&&!v&&Zo(u);s=u,p||v||f?Oo(a)?s=a:Lo(a)?s=mi(a):v?(d=!1,s=ci(u,!0)):f?(d=!1,s=di(u,!0)):s=[]:Vo(u)||Io(u)?(s=a,Io(a)?s=ia(a):Ho(a)&&!Bo(a)||(s=nr(u))):d=!1}d&&(o.set(u,s),i(s,u,l,r,o),o.delete(u)),Hn(e,n,s)}}(e,t,o,n,Rl,l,i);else{var a=l?l(mr(e,o),r,o+"",e,t,i):void 0;void 0===a&&(a=r),Hn(e,o,a)}},ga)}function Pl(e,t){var n=e.length;if(n)return ir(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?ct(t,function(e){return Oo(e)?function(t){return sl(t,1===e.length?e[0]:e)}:e}):[$a];var l=-1;return t=ct(t,Nt(qi())),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,r=t.criteria,o=i.length,a=n.length;++l<o;){var u=pi(i[l],r[l]);if(u)return l>=a?u:u*("desc"==n[l]?-1:1)}return e.index-t.index}(e,t,n)});l--;)e[l]=e[l].value;return e}(Cl(e,function(e,n,i){return{criteria:ct(t,function(t){return t(e)}),index:++l,value:e}}))}function Ol(e,t,n){for(var l=-1,i=t.length,r={};++l<i;){var o=t[l],a=sl(e,o);n(a,o)&&Ul(r,ri(o,e),a)}return r}function wl(e,t,n,l){var i=l?ht:_t,r=-1,o=t.length,a=e;for(e===t&&(t=mi(t)),n&&(a=ct(e,Nt(n)));++r<o;)for(var u=0,c=t[r],s=n?n(c):c;(u=i(a,s,u,l))>-1;)a!==e&&Ye.call(a,u,1),Ye.call(e,u,1);return e}function xl(e,t){for(var n=e?t.length:0,l=n-1;n--;){var i=t[n];if(n==l||i!==r){var r=i;ir(i)?Ye.call(e,i,1):Xl(e,i)}}return e}function Ll(e,t){return e+Qt(cn()*(t-e+1))}function Ml(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function kl(e,t){return hr(pr(e,t,$a),e+"")}function Fl(e){return Bn(Na(e))}function Bl(e,t){var n=Na(e);return Sr(n,qn(t,0,n.length))}function Ul(e,t,n,l){if(!Ho(e))return e;for(var i=-1,r=(t=ri(t,e)).length,o=r-1,a=e;null!=a&&++i<r;){var u=Tr(t[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=o){var s=a[u];void 0===(c=l?l(s,u,a):void 0)&&(c=Ho(s)?s:ir(t[i+1])?[]:{})}Wn(a,u,c),a=a[u]}return e}var jl=_n?function(e,t){return _n.set(e,t),e}:$a,Hl=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Ha(t),writable:!0})}:$a;function Wl(e){return Sr(Na(e))}function zl(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 r=d(i);++l<i;)r[l]=e[l+t];return r}function $l(e,t){var n;return Jn(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Vl(e,t,n){var l=0,i=null==e?l:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;l<i;){var r=l+i>>>1,o=e[r];null!==o&&!Go(o)&&(n?o<=t:o<t)?l=r+1:i=r}return i}return Kl(e,t,$a,n)}function Kl(e,t,n,l){var i=0,r=null==e?0:e.length;if(0===r)return 0;for(var o=(t=n(t))!=t,a=null===t,u=Go(t),c=void 0===t;i<r;){var s=Qt((i+r)/2),d=n(e[s]),p=void 0!==d,v=null===d,f=d==d,m=Go(d);if(o)var E=l||f;else E=c?f&&(l||p):a?f&&p&&(l||!v):u?f&&p&&!v&&(l||!m):!v&&!m&&(l?d<=t:d<t);E?i=s+1:r=s}return on(r,4294967294)}function Yl(e,t){for(var n=-1,l=e.length,i=0,r=[];++n<l;){var o=e[n],a=t?t(o):o;if(!n||!No(a,u)){var u=a;r[i++]=0===o?0:o}}return r}function ql(e){return"number"==typeof e?e:Go(e)?NaN:+e}function Gl(e){if("string"==typeof e)return e;if(Oo(e))return ct(e,Gl)+"";if(Go(e))return Dn?Dn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Zl(e,t,n){var l=-1,i=at,r=e.length,o=!0,a=[],u=a;if(n)o=!1,i=ut;else if(r>=200){var c=t?null:Mi(e);if(c)return jt(c);o=!1,i=Pt,u=new Mn}else u=t?[]:a;e:for(;++l<r;){var s=e[l],d=t?t(s):s;if(s=n||0!==s?s:0,o&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(s)}else i(u,d,n)||(u!==a&&u.push(d),a.push(s))}return a}function Xl(e,t){return null==(e=vr(e,t=ri(t,e)))||delete e[Tr(kr(t))]}function Ql(e,t,n,l){return Ul(e,t,n(sl(e,t)),l)}function Jl(e,t,n,l){for(var i=e.length,r=l?i:-1;(l?r--:++r<i)&&t(e[r],r,e););return n?zl(e,l?0:r,l?r+1:i):zl(e,l?r+1:0,l?i:r)}function ei(e,t){var n=e;return n instanceof On&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,st([e],t.args))},n)}function ti(e,t,n){var l=e.length;if(l<2)return l?Zl(e[0]):[];for(var i=-1,r=d(l);++i<l;)for(var o=e[i],a=-1;++a<l;)a!=i&&(r[i]=Qn(r[i]||o,e[a],t,n));return Zl(il(r,1),t,n)}function ni(e,t,n){for(var l=-1,i=e.length,r=t.length,o={};++l<i;)n(o,e[l],l<r?t[l]:void 0);return o}function li(e){return Lo(e)?e:[]}function ii(e){return"function"==typeof e?e:$a}function ri(e,t){return Oo(e)?e:or(e,t)?[e]:br(ra(e))}var oi=kl;function ai(e,t,n){var l=e.length;return n=void 0===n?l:n,!t&&n>=l?e:zl(e,t,n)}var ui=qt||function(e){return ze.clearTimeout(e)};function ci(e,t){if(t)return e.slice();var n=e.length,l=He?He(n):new e.constructor(n);return e.copy(l),l}function si(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function di(e,t){var n=t?si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,r=Go(e),o=void 0!==t,a=null===t,u=t==t,c=Go(t);if(!a&&!c&&!r&&e>t||r&&o&&u&&!a&&!c||l&&o&&u||!n&&u||!i)return 1;if(!l&&!r&&!c&&e<t||c&&n&&i&&!l&&!r||a&&n&&i||!o&&i||!u)return-1}return 0}function vi(e,t,n,l){for(var i=-1,r=e.length,o=n.length,a=-1,u=t.length,c=rn(r-o,0),s=d(u+c),p=!l;++a<u;)s[a]=t[a];for(;++i<o;)(p||i<r)&&(s[n[i]]=e[i]);for(;c--;)s[a++]=e[i++];return s}function fi(e,t,n,l){for(var i=-1,r=e.length,o=-1,a=n.length,u=-1,c=t.length,s=rn(r-a,0),p=d(s+c),v=!l;++i<s;)p[i]=e[i];for(var f=i;++u<c;)p[f+u]=t[u];for(;++o<a;)(v||i<r)&&(p[f+n[o]]=e[i++]);return p}function mi(e,t){var n=-1,l=e.length;for(t||(t=d(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var r=-1,o=t.length;++r<o;){var a=t[r],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Kn(n,a,u):Wn(n,a,u)}return n}function _i(e,t){return function(n,l){var i=Oo(n)?nt:$n,r=t?t():{};return i(n,e,qi(l,2),r)}}function hi(e){return kl(function(t,n){var l=-1,i=n.length,r=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(i--,r):void 0,o&&rr(n[0],n[1],o)&&(r=i<3?void 0:r,i=1),t=ve(t);++l<i;){var a=n[l];a&&e(t,a,l,r)}return t})}function gi(e,t){return function(n,l){if(null==n)return n;if(!xo(n))return e(n,l);for(var i=n.length,r=t?i:-1,o=ve(n);(t?r--:++r<i)&&!1!==l(o[r],r,o););return n}}function yi(e){return function(t,n,l){for(var i=-1,r=ve(t),o=l(t),a=o.length;a--;){var u=o[e?a:++i];if(!1===n(r[u],u,r))break}return t}}function Si(e){return function(t){var n=kt(t=ra(t))?zt(t):void 0,l=n?n[0]:t.charAt(0),i=n?ai(n,1).join(""):t.slice(1);return l[e]()+i}}function bi(e){return function(t){return dt(Ba(Ia(t).replace(Re,"")),e,"")}}function Ti(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 Ho(l)?l:n}}function Ai(e){return function(t,n,l){var i=ve(t);if(!xo(t)){var r=qi(n,3);t=ha(t),n=function(e){return r(i[e],e,i)}}var o=e(t,n,l);return o>-1?i[r?t[o]:o]:void 0}}function Ci(e){return Wi(function(t){var l=t.length,i=l,r=In.prototype.thru;for(e&&t.reverse();i--;){var o=t[i];if("function"!=typeof o)throw new Ee(n);if(r&&!a&&"wrapper"==Ki(o))var a=new In([],!0)}for(i=a?i:l;++i<l;){var u=Ki(o=t[i]),c="wrapper"==u?Vi(o):void 0;a=c&&ar(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Ki(c[0])].apply(a,c[3]):1==o.length&&ar(o)?a[u]():a.thru(o)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Oo(n))return a.plant(n).value();for(var i=0,r=l?t[i].apply(this,e):n;++i<l;)r=t[i].call(this,r);return r}})}function Di(e,t,n,l,i,r,o,a,u,c){var s=128&t,p=1&t,v=2&t,f=24&t,m=512&t,E=v?void 0:Ti(e);return function _(){for(var h=arguments.length,g=d(h),y=h;y--;)g[y]=arguments[y];if(f)var S=Yi(_),b=wt(g,S);if(l&&(g=vi(g,l,i,f)),r&&(g=fi(g,r,o,f)),h-=b,f&&h<c){var T=Ut(g,S);return xi(e,t,Di,_.placeholder,n,g,T,a,u,c-h)}var A=p?n:this,C=v?A[e]:e;return h=g.length,a?g=fr(g,a):m&&h>1&&g.reverse(),s&&u<h&&(g.length=u),this&&this!==ze&&this instanceof _&&(C=E||Ti(C)),C.apply(A,g)}}function Ni(e,t){return function(n,l){return function(e,t,n,l){return al(e,function(e,i,r){t(l,n(e),i,r)}),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=Gl(n),l=Gl(l)):(n=ql(n),l=ql(l)),i=e(n,l)}return i}}function Pi(e){return Wi(function(t){return t=ct(t,Nt(qi())),kl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ii(e,t){var n=(t=void 0===t?" ":Gl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Xt(e/Wt(t)));return kt(t)?ai(zt(l),0,e).join(""):l.slice(0,e)}function Oi(e){return function(t,n,l){return l&&"number"!=typeof l&&rr(t,n,l)&&(n=l=void 0),t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n,l){for(var i=-1,r=rn(Xt((t-e)/(n||1)),0),o=d(r);r--;)o[l?r:++i]=e,e+=n;return o}(t,n,l=void 0===l?t<n?1:-1:ea(l),e)}}function wi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=la(t),n=la(n)),e(t,n)}}function xi(e,t,n,l,i,r,o,a,u,c){var s=8&t;t|=s?32:64,4&(t&=~(s?64:32))||(t&=-4);var d=[e,t,i,s?r:void 0,s?o:void 0,s?void 0:r,s?void 0:o,a,u,c],p=n.apply(void 0,d);return ar(e)&&Er(p,d),p.placeholder=l,gr(p,e,t)}function Li(e){var t=pe[e];return function(e,n){if(e=la(e),(n=null==n?0:on(ta(n),292))&&tn(e)){var l=(ra(e)+"e").split("e");return+((l=(ra(t(l[0]+"e"+(+l[1]+n)))+"e").split("e"))[0]+"e"+(+l[1]-n))}return t(e)}}var Mi=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ga;function ki(e){return function(t){var n=er(t);return n==v?Ft(t):n==_?Ht(t):function(e,t){return ct(t,function(t){return[t,e[t]]})}(t,e(t))}}function Fi(e,t,i,r,o,a,u,c){var s=2&t;if(!s&&"function"!=typeof e)throw new Ee(n);var p=r?r.length:0;if(p||(t&=-97,r=o=void 0),u=void 0===u?u:rn(ta(u),0),c=void 0===c?c:ta(c),p-=o?o.length:0,64&t){var v=r,f=o;r=o=void 0}var m=s?void 0:Vi(e),E=[e,t,i,r,o,v,f,a,u,c];if(m&&function(e,t){var n=e[1],i=t[1],r=n|i;if(!(r<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],r|=1&n?0:4);var o=t[3];if(o){var a=e[3];e[3]=a?vi(a,o,t[4]):o,e[4]=a?Ut(e[3],l):t[4]}(o=t[5])&&(e[5]=(a=e[5])?fi(a,o,t[6]):o,e[6]=a?Ut(e[5],l):t[6]),(o=t[7])&&(e[7]=o),128&i&&(e[8]=null==e[8]?t[8]:on(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r}(E,m),e=E[0],t=E[1],i=E[2],r=E[3],o=E[4],!(c=E[9]=void 0===E[9]?s?0:e.length:rn(E[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,n){var l=Ti(e);return function i(){for(var r=arguments.length,o=d(r),a=r,u=Yi(i);a--;)o[a]=arguments[a];var c=r<3&&o[0]!==u&&o[r-1]!==u?[]:Ut(o,u);if((r-=c.length)<n)return xi(e,t,Di,i.placeholder,void 0,o,c,void 0,void 0,n-r);var s=this&&this!==ze&&this instanceof i?l:e;return tt(s,this,o)}}(e,t,c):32!=t&&33!=t||o.length?Di.apply(void 0,E):function(e,t,n,l){var i=1&t,r=Ti(e);return function t(){for(var o=-1,a=arguments.length,u=-1,c=l.length,s=d(c+a),p=this&&this!==ze&&this instanceof t?r:e;++u<c;)s[u]=l[u];for(;a--;)s[u++]=arguments[++o];return tt(p,i?n:this,s)}}(e,t,i,r);else var _=function(e,t,n){var l=1&t,i=Ti(e);return function t(){var r=this&&this!==ze&&this instanceof t?i:e;return r.apply(l?n:this,arguments)}}(e,t,i);return gr((m?jl:Er)(_,E),e,t)}function Bi(e,t,n,l){return void 0===e||No(e,he[n])&&!Se.call(l,n)?t:e}function Ui(e,t,n,l,i,r){return Ho(e)&&Ho(t)&&(r.set(t,e),Rl(e,t,void 0,Ui,r),r.delete(t)),e}function ji(e){return Vo(e)?void 0:e}function Hi(e,t,n,l,i,r){var o=1&n,a=e.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var c=r.get(e),s=r.get(t);if(c&&s)return c==t&&s==e;var d=-1,p=!0,v=2&n?new Mn:void 0;for(r.set(e,t),r.set(t,e);++d<a;){var f=e[d],m=t[d];if(l)var E=o?l(m,f,d,t,e,r):l(f,m,d,e,t,r);if(void 0!==E){if(E)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!Pt(v,t)&&(f===e||i(f,e,n,l,r)))return v.push(t)})){p=!1;break}}else if(f!==m&&!i(f,m,n,l,r)){p=!1;break}}return r.delete(e),r.delete(t),p}function Wi(e){return hr(pr(e,void 0,Or),e+"")}function zi(e){return dl(e,ha,Qi)}function $i(e){return dl(e,ga,Ji)}var Vi=_n?function(e){return _n.get(e)}:Ga;function Ki(e){for(var t=e.name+"",n=hn[t],l=Se.call(hn,t)?n.length:0;l--;){var i=n[l],r=i.func;if(null==r||r==e)return i.name}return t}function Yi(e){return(Se.call(Nn,"placeholder")?Nn:e).placeholder}function qi(){var e=Nn.iteratee||Va;return e=e===Va?bl:e,arguments.length?e(arguments[0],arguments[1]):e}function Gi(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=ha(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,sr(i)]}return t}function Xi(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Sl(n)?n:void 0}var Qi=Jt?function(e){return null==e?[]:(e=ve(e),ot(Jt(e),function(t){return Ve.call(e,t)}))}:nu,Ji=Jt?function(e){for(var t=[];e;)st(t,Qi(e)),e=We(e);return t}:nu,er=pl;function tr(e,t,n){for(var l=-1,i=(t=ri(t,e)).length,r=!1;++l<i;){var o=Tr(t[l]);if(!(r=null!=e&&n(e,o)))break;e=e[o]}return r||++l!=i?r:!!(i=null==e?0:e.length)&&jo(i)&&ir(o,i)&&(Oo(e)||Io(e))}function nr(e){return"function"!=typeof e.constructor||cr(e)?{}:Rn(We(e))}function lr(e){return Oo(e)||Io(e)||!!(qe&&e&&e[qe])}function ir(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function rr(e,t,n){if(!Ho(n))return!1;var l=typeof t;return!!("number"==l?xo(n)&&ir(t,n.length):"string"==l&&t in n)&&No(n[t],e)}function or(e,t){if(Oo(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Go(e))||W.test(e)||!H.test(e)||null!=t&&e in ve(t)}function ar(e){var t=Ki(e),n=Nn[t];if("function"!=typeof n||!(t in On.prototype))return!1;if(e===n)return!0;var l=Vi(n);return!!l&&e===l[0]}(dn&&er(new dn(new ArrayBuffer(1)))!=b||pn&&er(new pn)!=v||vn&&"[object Promise]"!=er(vn.resolve())||fn&&er(new fn)!=_||mn&&er(new mn)!=y)&&(er=function(e){var t=pl(e),n=t==m?e.constructor:void 0,l=n?Ar(n):"";if(l)switch(l){case gn:return b;case yn:return v;case Sn:return"[object Promise]";case bn:return _;case Tn:return y}return t});var ur=ge?Bo:lu;function cr(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||he)}function sr(e){return e==e&&!Ho(e)}function dr(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function pr(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,r=rn(l.length-t,0),o=d(r);++i<r;)o[i]=l[t+i];i=-1;for(var a=d(t+1);++i<t;)a[i]=l[i];return a[t]=n(o),tt(e,this,a)}}function vr(e,t){return t.length<2?e:sl(e,zl(t,0,-1))}function fr(e,t){for(var n=e.length,l=on(t.length,n),i=mi(e);l--;){var r=t[l];e[l]=ir(r,n)?i[r]:void 0}return e}function mr(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Er=yr(jl),_r=Zt||function(e,t){return ze.setTimeout(e,t)},hr=yr(Hl);function gr(e,t,n){var l=t+"";return hr(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(q,"{\n/* [wrapped with "+t+"] */\n")}(l,function(e,t){return lt(i,function(n){var l="_."+n[0];t&n[1]&&!at(e,l)&&e.push(l)}),e.sort()}(function(e){var t=e.match(G);return t?t[1].split(Z):[]}(l),n)))}function yr(e){var t=0,n=0;return function(){var l=an(),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 Sr(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var r=Ll(n,i),o=e[r];e[r]=e[n],e[n]=o}return e.length=t,e}var br=function(e){var t=So(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===n.size&&n.clear(),e}),n=t.cache;return t}();function Tr(e){if("string"==typeof e||Go(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ar(e){if(null!=e){try{return ye.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Cr(e){if(e instanceof On)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=mi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Dr=kl(function(e,t){return Lo(e)?Qn(e,il(t,1,Lo,!0)):[]}),Nr=kl(function(e,t){var n=kr(t);return Lo(n)&&(n=void 0),Lo(e)?Qn(e,il(t,1,Lo,!0),qi(n,2)):[]}),Rr=kl(function(e,t){var n=kr(t);return Lo(n)&&(n=void 0),Lo(e)?Qn(e,il(t,1,Lo,!0),void 0,n):[]});function Pr(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ta(n);return i<0&&(i=rn(l+i,0)),Et(e,qi(t,3),i)}function Ir(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=l-1;return void 0!==n&&(i=ta(n),i=n<0?rn(l+i,0):on(i,l-1)),Et(e,qi(t,3),i,!0)}function Or(e){return null!=e&&e.length?il(e,1):[]}function wr(e){return e&&e.length?e[0]:void 0}var xr=kl(function(e){var t=ct(e,li);return t.length&&t[0]===e[0]?El(t):[]}),Lr=kl(function(e){var t=kr(e),n=ct(e,li);return t===kr(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,qi(t,2)):[]}),Mr=kl(function(e){var t=kr(e),n=ct(e,li);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function kr(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Fr=kl(Br);function Br(e,t){return e&&e.length&&t&&t.length?wl(e,t):e}var Ur=Wi(function(e,t){var n=null==e?0:e.length,l=Yn(e,t);return xl(e,ct(t,function(e){return ir(e,n)?+e:e}).sort(pi)),l});function jr(e){return null==e?e:sn.call(e)}var Hr=kl(function(e){return Zl(il(e,1,Lo,!0))}),Wr=kl(function(e){var t=kr(e);return Lo(t)&&(t=void 0),Zl(il(e,1,Lo,!0),qi(t,2))}),zr=kl(function(e){var t=kr(e);return t="function"==typeof t?t:void 0,Zl(il(e,1,Lo,!0),void 0,t)});function $r(e){if(!e||!e.length)return[];var t=0;return e=ot(e,function(e){if(Lo(e))return t=rn(e.length,t),!0}),Ct(t,function(t){return ct(e,St(t))})}function Vr(e,t){if(!e||!e.length)return[];var n=$r(e);return null==t?n:ct(n,function(e){return tt(t,void 0,e)})}var Kr=kl(function(e,t){return Lo(e)?Qn(e,t):[]}),Yr=kl(function(e){return ti(ot(e,Lo))}),qr=kl(function(e){var t=kr(e);return Lo(t)&&(t=void 0),ti(ot(e,Lo),qi(t,2))}),Gr=kl(function(e){var t=kr(e);return t="function"==typeof t?t:void 0,ti(ot(e,Lo),void 0,t)}),Zr=kl($r),Xr=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,Vr(e,n)});function Qr(e){var t=Nn(e);return t.__chain__=!0,t}function Jr(e,t){return t(e)}var eo=Wi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof On&&ir(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:Jr,args:[i],thisArg:void 0}),new In(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),to=_i(function(e,t,n){Se.call(e,n)?++e[n]:Kn(e,n,1)}),no=Ai(Pr),lo=Ai(Ir);function io(e,t){return(Oo(e)?lt:Jn)(e,qi(t,3))}function ro(e,t){return(Oo(e)?it:el)(e,qi(t,3))}var oo=_i(function(e,t,n){Se.call(e,n)?e[n].push(t):Kn(e,n,[t])}),ao=kl(function(e,t,n){var l=-1,i="function"==typeof t,r=xo(e)?d(e.length):[];return Jn(e,function(e){r[++l]=i?tt(t,e,n):_l(e,t,n)}),r}),uo=_i(function(e,t,n){Kn(e,n,t)});function co(e,t){return(Oo(e)?ct:Cl)(e,qi(t,3))}var so=_i(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),po=kl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&rr(e,t[0],t[1])?t=[]:n>2&&rr(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,il(t,1),[])}),vo=Gt||function(){return ze.Date.now()};function fo(e,t,n){return t=n?void 0:t,Fi(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function mo(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=ta(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var Eo=kl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,Yi(Eo));l|=32}return Fi(e,l,t,n,i)}),_o=kl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,Yi(_o));l|=32}return Fi(t,l,e,n,i)});function ho(e,t,l){var i,r,o,a,u,c,s=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new Ee(n);function f(t){var n=i,l=r;return i=r=void 0,s=t,a=e.apply(l,n)}function m(e){return s=e,u=_r(_,t),d?f(e):a}function E(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-s>=o}function _(){var e=vo();if(E(e))return h(e);u=_r(_,function(e){var n=t-(e-c);return p?on(n,o-(e-s)):n}(e))}function h(e){return u=void 0,v&&i?f(e):(i=r=void 0,a)}function g(){var e=vo(),n=E(e);if(i=arguments,r=this,c=e,n){if(void 0===u)return m(c);if(p)return ui(u),u=_r(_,t),f(c)}return void 0===u&&(u=_r(_,t)),a}return t=la(t)||0,Ho(l)&&(d=!!l.leading,o=(p="maxWait"in l)?rn(la(l.maxWait)||0,t):o,v="trailing"in l?!!l.trailing:v),g.cancel=function(){void 0!==u&&ui(u),s=0,i=c=r=u=void 0},g.flush=function(){return void 0===u?a:h(vo())},g}var go=kl(function(e,t){return Xn(e,1,t)}),yo=kl(function(e,t,n){return Xn(e,la(t)||0,n)});function So(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var l=function(){var n=arguments,i=t?t.apply(this,n):n[0],r=l.cache;if(r.has(i))return r.get(i);var o=e.apply(this,n);return l.cache=r.set(i,o)||r,o};return l.cache=new(So.Cache||Ln),l}function bo(e){if("function"!=typeof e)throw new Ee(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)}}So.Cache=Ln;var To=oi(function(e,t){var n=(t=1==t.length&&Oo(t[0])?ct(t[0],Nt(qi())):ct(il(t,1),Nt(qi()))).length;return kl(function(l){for(var i=-1,r=on(l.length,n);++i<r;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Ao=kl(function(e,t){return Fi(e,32,void 0,t,Ut(t,Yi(Ao)))}),Co=kl(function(e,t){return Fi(e,64,void 0,t,Ut(t,Yi(Co)))}),Do=Wi(function(e,t){return Fi(e,256,void 0,void 0,void 0,t)});function No(e,t){return e===t||e!=e&&t!=t}var Ro=wi(vl),Po=wi(function(e,t){return e>=t}),Io=hl(function(){return arguments}())?hl:function(e){return Wo(e)&&Se.call(e,"callee")&&!Ve.call(e,"callee")},Oo=d.isArray,wo=Ge?Nt(Ge):function(e){return Wo(e)&&pl(e)==S};function xo(e){return null!=e&&jo(e.length)&&!Bo(e)}function Lo(e){return Wo(e)&&xo(e)}var Mo=en||lu,ko=Ze?Nt(Ze):function(e){return Wo(e)&&pl(e)==u};function Fo(e){if(!Wo(e))return!1;var t=pl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Vo(e)}function Bo(e){if(!Ho(e))return!1;var t=pl(e);return t==s||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Uo(e){return"number"==typeof e&&e==ta(e)}function jo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ho(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Wo(e){return null!=e&&"object"==typeof e}var zo=Xe?Nt(Xe):function(e){return Wo(e)&&er(e)==v};function $o(e){return"number"==typeof e||Wo(e)&&pl(e)==f}function Vo(e){if(!Wo(e)||pl(e)!=m)return!1;var t=We(e);if(null===t)return!0;var n=Se.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ye.call(n)==Ce}var Ko=Qe?Nt(Qe):function(e){return Wo(e)&&pl(e)==E},Yo=Je?Nt(Je):function(e){return Wo(e)&&er(e)==_};function qo(e){return"string"==typeof e||!Oo(e)&&Wo(e)&&pl(e)==h}function Go(e){return"symbol"==typeof e||Wo(e)&&pl(e)==g}var Zo=et?Nt(et):function(e){return Wo(e)&&jo(e.length)&&!!ke[pl(e)]},Xo=wi(Al),Qo=wi(function(e,t){return e<=t});function Jo(e){if(!e)return[];if(xo(e))return qo(e)?zt(e):mi(e);if(ft&&e[ft])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[ft]());var t=er(e);return(t==v?Ft:t==_?jt:Na)(e)}function ea(e){return e?(e=la(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ta(e){var t=ea(e),n=t%1;return t==t?n?t-n:t:0}function na(e){return e?qn(ta(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if(Go(e))return NaN;if(Ho(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ho(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Dt(e);var n=le.test(e);return n||re.test(e)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function ia(e){return Ei(e,ga(e))}function ra(e){return null==e?"":Gl(e)}var oa=hi(function(e,t){if(cr(t)||xo(t))Ei(t,ha(t),e);else for(var n in t)Se.call(t,n)&&Wn(e,n,t[n])}),aa=hi(function(e,t){Ei(t,ga(t),e)}),ua=hi(function(e,t,n,l){Ei(t,ga(t),e,l)}),ca=hi(function(e,t,n,l){Ei(t,ha(t),e,l)}),sa=Wi(Yn),da=kl(function(e,t){e=ve(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&rr(t[0],t[1],i)&&(l=1);++n<l;)for(var r=t[n],o=ga(r),a=-1,u=o.length;++a<u;){var c=o[a],s=e[c];(void 0===s||No(s,he[c])&&!Se.call(e,c))&&(e[c]=r[c])}return e}),pa=kl(function(e){return e.push(void 0,Ui),tt(Sa,void 0,e)});function va(e,t,n){var l=null==e?void 0:sl(e,t);return void 0===l?n:l}function fa(e,t){return null!=e&&tr(e,t,ml)}var ma=Ni(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Ha($a)),Ea=Ni(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),Se.call(e,t)?e[t].push(n):e[t]=[n]},qi),_a=kl(_l);function ha(e){return xo(e)?Fn(e):Tl(e)}function ga(e){return xo(e)?Fn(e,!0):function(e){if(!Ho(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=cr(e),n=[];for(var l in e)("constructor"!=l||!t&&Se.call(e,l))&&n.push(l);return n}(e)}var ya=hi(function(e,t,n){Rl(e,t,n)}),Sa=hi(function(e,t,n,l){Rl(e,t,n,l)}),ba=Wi(function(e,t){var n={};if(null==e)return n;var l=!1;t=ct(t,function(t){return t=ri(t,e),l||(l=t.length>1),t}),Ei(e,$i(e),n),l&&(n=Gn(n,7,ji));for(var i=t.length;i--;)Xl(n,t[i]);return n}),Ta=Wi(function(e,t){return null==e?{}:function(e,t){return Ol(e,t,function(t,n){return fa(e,n)})}(e,t)});function Aa(e,t){if(null==e)return{};var n=ct($i(e),function(e){return[e]});return t=qi(t),Ol(e,n,function(e,n){return t(e,n[0])})}var Ca=ki(ha),Da=ki(ga);function Na(e){return null==e?[]:Rt(e,ha(e))}var Ra=bi(function(e,t,n){return t=t.toLowerCase(),e+(n?Pa(t):t)});function Pa(e){return Fa(ra(e).toLowerCase())}function Ia(e){return(e=ra(e))&&e.replace(ae,xt).replace(Pe,"")}var Oa=bi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),wa=bi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),xa=Si("toLowerCase"),La=bi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ma=bi(function(e,t,n){return e+(n?" ":"")+Fa(t)}),ka=bi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Fa=Si("toUpperCase");function Ba(e,t,n){return e=ra(e),void 0===(t=n?void 0:t)?function(e){return xe.test(e)}(e)?function(e){return e.match(Oe)||[]}(e):function(e){return e.match(X)||[]}(e):e.match(t)||[]}var Ua=kl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fo(e)?e:new se(e)}}),ja=Wi(function(e,t){return lt(t,function(t){t=Tr(t),Kn(e,t,Eo(e[t],e))}),e});function Ha(e){return function(){return e}}var Wa=Ci(),za=Ci(!0);function $a(e){return e}function Va(e){return bl("function"==typeof e?e:Gn(e,1))}var Ka=kl(function(e,t){return function(n){return _l(n,e,t)}}),Ya=kl(function(e,t){return function(n){return _l(e,n,t)}});function qa(e,t,n){var l=ha(t),i=cl(t,l);null!=n||Ho(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=cl(t,ha(t)));var r=!(Ho(n)&&"chain"in n&&!n.chain),o=Bo(e);return lt(i,function(n){var l=t[n];e[n]=l,o&&(e.prototype[n]=function(){var t=this.__chain__;if(r||t){var n=e(this.__wrapped__),i=n.__actions__=mi(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 Ga(){}var Za=Pi(ct),Xa=Pi(rt),Qa=Pi(vt);function Ja(e){return or(e)?St(Tr(e)):function(e){return function(t){return sl(t,e)}}(e)}var eu=Oi(),tu=Oi(!0);function nu(){return[]}function lu(){return!1}var iu,ru=Ri(function(e,t){return e+t},0),ou=Li("ceil"),au=Ri(function(e,t){return e/t},1),uu=Li("floor"),cu=Ri(function(e,t){return e*t},1),su=Li("round"),du=Ri(function(e,t){return e-t},0);return Nn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ta(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=fo,Nn.assign=oa,Nn.assignIn=aa,Nn.assignInWith=ua,Nn.assignWith=ca,Nn.at=sa,Nn.before=mo,Nn.bind=Eo,Nn.bindAll=ja,Nn.bindKey=_o,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Oo(e)?e:[e]},Nn.chain=Qr,Nn.chunk=function(e,t,n){t=(n?rr(e,t,n):void 0===t)?1:rn(ta(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,r=0,o=d(Xt(l/t));i<l;)o[r++]=zl(e,i,i+=t);return o},Nn.compact=function(e){for(var t=-1,n=null==e?0:e.length,l=0,i=[];++t<n;){var r=e[t];r&&(i[l++]=r)}return i},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=d(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return st(Oo(n)?mi(n):[n],il(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,l=qi();return e=t?ct(e,function(e){if("function"!=typeof e[1])throw new Ee(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)}})},Nn.conforms=function(e){return function(e){var t=ha(e);return function(n){return Zn(n,e,t)}}(Gn(e,1))},Nn.constant=Ha,Nn.countBy=to,Nn.create=function(e,t){var n=Rn(e);return null==t?n:Vn(n,t)},Nn.curry=function e(t,n,l){var i=Fi(t,8,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Nn.curryRight=function e(t,n,l){var i=Fi(t,16,void 0,void 0,void 0,void 0,void 0,n=l?void 0:n);return i.placeholder=e.placeholder,i},Nn.debounce=ho,Nn.defaults=da,Nn.defaultsDeep=pa,Nn.defer=go,Nn.delay=yo,Nn.difference=Dr,Nn.differenceBy=Nr,Nn.differenceWith=Rr,Nn.drop=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=n||void 0===t?1:ta(t))<0?0:t,l):[]},Nn.dropRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,0,(t=l-(t=n||void 0===t?1:ta(t)))<0?0:t):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?Jl(e,qi(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?Jl(e,qi(t,3),!0):[]},Nn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&rr(e,t,n)&&(n=0,l=i),function(e,t,n,l){var i=e.length;for((n=ta(n))<0&&(n=-n>i?0:i+n),(l=void 0===l||l>i?i:ta(l))<0&&(l+=i),l=n>l?0:na(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Nn.filter=function(e,t){return(Oo(e)?ot:ll)(e,qi(t,3))},Nn.flatMap=function(e,t){return il(co(e,t),1)},Nn.flatMapDeep=function(e,t){return il(co(e,t),1/0)},Nn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ta(n),il(co(e,t),n)},Nn.flatten=Or,Nn.flattenDeep=function(e){return null!=e&&e.length?il(e,1/0):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?il(e,t=void 0===t?1:ta(t)):[]},Nn.flip=function(e){return Fi(e,512)},Nn.flow=Wa,Nn.flowRight=za,Nn.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},Nn.functions=function(e){return null==e?[]:cl(e,ha(e))},Nn.functionsIn=function(e){return null==e?[]:cl(e,ga(e))},Nn.groupBy=oo,Nn.initial=function(e){return null!=e&&e.length?zl(e,0,-1):[]},Nn.intersection=xr,Nn.intersectionBy=Lr,Nn.intersectionWith=Mr,Nn.invert=ma,Nn.invertBy=Ea,Nn.invokeMap=ao,Nn.iteratee=Va,Nn.keyBy=uo,Nn.keys=ha,Nn.keysIn=ga,Nn.map=co,Nn.mapKeys=function(e,t){var n={};return t=qi(t,3),al(e,function(e,l,i){Kn(n,t(e,l,i),e)}),n},Nn.mapValues=function(e,t){var n={};return t=qi(t,3),al(e,function(e,l,i){Kn(n,l,t(e,l,i))}),n},Nn.matches=function(e){return Dl(Gn(e,1))},Nn.matchesProperty=function(e,t){return Nl(e,Gn(t,1))},Nn.memoize=So,Nn.merge=ya,Nn.mergeWith=Sa,Nn.method=Ka,Nn.methodOf=Ya,Nn.mixin=qa,Nn.negate=bo,Nn.nthArg=function(e){return e=ta(e),kl(function(t){return Pl(t,e)})},Nn.omit=ba,Nn.omitBy=function(e,t){return Aa(e,bo(qi(t)))},Nn.once=function(e){return mo(2,e)},Nn.orderBy=function(e,t,n,l){return null==e?[]:(Oo(t)||(t=null==t?[]:[t]),Oo(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Nn.over=Za,Nn.overArgs=To,Nn.overEvery=Xa,Nn.overSome=Qa,Nn.partial=Ao,Nn.partialRight=Co,Nn.partition=so,Nn.pick=Ta,Nn.pickBy=Aa,Nn.property=Ja,Nn.propertyOf=function(e){return function(t){return null==e?void 0:sl(e,t)}},Nn.pull=Fr,Nn.pullAll=Br,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?wl(e,t,qi(n,2)):e},Nn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?wl(e,t,void 0,n):e},Nn.pullAt=Ur,Nn.range=eu,Nn.rangeRight=tu,Nn.rearg=Do,Nn.reject=function(e,t){return(Oo(e)?ot:ll)(e,bo(qi(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],r=e.length;for(t=qi(t,3);++l<r;){var o=e[l];t(o,l,e)&&(n.push(o),i.push(l))}return xl(e,i),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return kl(e,t=void 0===t?t:ta(t))},Nn.reverse=jr,Nn.sampleSize=function(e,t,n){return t=(n?rr(e,t,n):void 0===t)?1:ta(t),(Oo(e)?Un:Bl)(e,t)},Nn.set=function(e,t,n){return null==e?e:Ul(e,t,n)},Nn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ul(e,t,n,l)},Nn.shuffle=function(e){return(Oo(e)?jn:Wl)(e)},Nn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&rr(e,t,n)?(t=0,n=l):(t=null==t?0:ta(t),n=void 0===n?l:ta(n)),zl(e,t,n)):[]},Nn.sortBy=po,Nn.sortedUniq=function(e){return e&&e.length?Yl(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?Yl(e,qi(t,2)):[]},Nn.split=function(e,t,n){return n&&"number"!=typeof n&&rr(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ra(e))&&("string"==typeof t||null!=t&&!Ko(t))&&!(t=Gl(t))&&kt(e)?ai(zt(e),0,n):e.split(t,n):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:rn(ta(t),0),kl(function(n){var l=n[t],i=ai(n,0,t);return l&&st(i,l),tt(e,this,i)})},Nn.tail=function(e){var t=null==e?0:e.length;return t?zl(e,1,t):[]},Nn.take=function(e,t,n){return e&&e.length?zl(e,0,(t=n||void 0===t?1:ta(t))<0?0:t):[]},Nn.takeRight=function(e,t,n){var l=null==e?0:e.length;return l?zl(e,(t=l-(t=n||void 0===t?1:ta(t)))<0?0:t,l):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?Jl(e,qi(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?Jl(e,qi(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,l){var i=!0,r=!0;if("function"!=typeof e)throw new Ee(n);return Ho(l)&&(i="leading"in l?!!l.leading:i,r="trailing"in l?!!l.trailing:r),ho(e,t,{leading:i,maxWait:t,trailing:r})},Nn.thru=Jr,Nn.toArray=Jo,Nn.toPairs=Ca,Nn.toPairsIn=Da,Nn.toPath=function(e){return Oo(e)?ct(e,Tr):Go(e)?[e]:mi(br(ra(e)))},Nn.toPlainObject=ia,Nn.transform=function(e,t,n){var l=Oo(e),i=l||Mo(e)||Zo(e);if(t=qi(t,4),null==n){var r=e&&e.constructor;n=i?l?new r:[]:Ho(e)&&Bo(r)?Rn(We(e)):{}}return(i?lt:al)(e,function(e,l,i){return t(n,e,l,i)}),n},Nn.unary=function(e){return fo(e,1)},Nn.union=Hr,Nn.unionBy=Wr,Nn.unionWith=zr,Nn.uniq=function(e){return e&&e.length?Zl(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?Zl(e,qi(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Zl(e,void 0,t):[]},Nn.unset=function(e,t){return null==e||Xl(e,t)},Nn.unzip=$r,Nn.unzipWith=Vr,Nn.update=function(e,t,n){return null==e?e:Ql(e,t,ii(n))},Nn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,ii(n),l)},Nn.values=Na,Nn.valuesIn=function(e){return null==e?[]:Rt(e,ga(e))},Nn.without=Kr,Nn.words=Ba,Nn.wrap=function(e,t){return Ao(ii(t),e)},Nn.xor=Yr,Nn.xorBy=qr,Nn.xorWith=Gr,Nn.zip=Zr,Nn.zipObject=function(e,t){return ni(e||[],t||[],Wn)},Nn.zipObjectDeep=function(e,t){return ni(e||[],t||[],Ul)},Nn.zipWith=Xr,Nn.entries=Ca,Nn.entriesIn=Da,Nn.extend=aa,Nn.extendWith=ua,qa(Nn,Nn),Nn.add=ru,Nn.attempt=Ua,Nn.camelCase=Ra,Nn.capitalize=Pa,Nn.ceil=ou,Nn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=la(n))==n?n:0),void 0!==t&&(t=(t=la(t))==t?t:0),qn(la(e),t,n)},Nn.clone=function(e){return Gn(e,4)},Nn.cloneDeep=function(e){return Gn(e,5)},Nn.cloneDeepWith=function(e,t){return Gn(e,5,t="function"==typeof t?t:void 0)},Nn.cloneWith=function(e,t){return Gn(e,4,t="function"==typeof t?t:void 0)},Nn.conformsTo=function(e,t){return null==t||Zn(e,t,ha(t))},Nn.deburr=Ia,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=au,Nn.endsWith=function(e,t,n){e=ra(e),t=Gl(t);var l=e.length,i=n=void 0===n?l:qn(ta(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Nn.eq=No,Nn.escape=function(e){return(e=ra(e))&&F.test(e)?e.replace(M,Lt):e},Nn.escapeRegExp=function(e){return(e=ra(e))&&V.test(e)?e.replace($,"\\$&"):e},Nn.every=function(e,t,n){var l=Oo(e)?rt:tl;return n&&rr(e,t,n)&&(t=void 0),l(e,qi(t,3))},Nn.find=no,Nn.findIndex=Pr,Nn.findKey=function(e,t){return mt(e,qi(t,3),al)},Nn.findLast=lo,Nn.findLastIndex=Ir,Nn.findLastKey=function(e,t){return mt(e,qi(t,3),ul)},Nn.floor=uu,Nn.forEach=io,Nn.forEachRight=ro,Nn.forIn=function(e,t){return null==e?e:rl(e,qi(t,3),ga)},Nn.forInRight=function(e,t){return null==e?e:ol(e,qi(t,3),ga)},Nn.forOwn=function(e,t){return e&&al(e,qi(t,3))},Nn.forOwnRight=function(e,t){return e&&ul(e,qi(t,3))},Nn.get=va,Nn.gt=Ro,Nn.gte=Po,Nn.has=function(e,t){return null!=e&&tr(e,t,fl)},Nn.hasIn=fa,Nn.head=wr,Nn.identity=$a,Nn.includes=function(e,t,n,l){e=xo(e)?e:Na(e),n=n&&!l?ta(n):0;var i=e.length;return n<0&&(n=rn(i+n,0)),qo(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&_t(e,t,n)>-1},Nn.indexOf=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ta(n);return i<0&&(i=rn(l+i,0)),_t(e,t,i)},Nn.inRange=function(e,t,n){return t=ea(t),void 0===n?(n=t,t=0):n=ea(n),function(e,t,n){return e>=on(t,n)&&e<rn(t,n)}(e=la(e),t,n)},Nn.invoke=_a,Nn.isArguments=Io,Nn.isArray=Oo,Nn.isArrayBuffer=wo,Nn.isArrayLike=xo,Nn.isArrayLikeObject=Lo,Nn.isBoolean=function(e){return!0===e||!1===e||Wo(e)&&pl(e)==a},Nn.isBuffer=Mo,Nn.isDate=ko,Nn.isElement=function(e){return Wo(e)&&1===e.nodeType&&!Vo(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(xo(e)&&(Oo(e)||"string"==typeof e||"function"==typeof e.splice||Mo(e)||Zo(e)||Io(e)))return!e.length;var t=er(e);if(t==v||t==_)return!e.size;if(cr(e))return!Tl(e).length;for(var n in e)if(Se.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return gl(e,t)},Nn.isEqualWith=function(e,t,n){var l=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===l?gl(e,t,void 0,n):!!l},Nn.isError=Fo,Nn.isFinite=function(e){return"number"==typeof e&&tn(e)},Nn.isFunction=Bo,Nn.isInteger=Uo,Nn.isLength=jo,Nn.isMap=zo,Nn.isMatch=function(e,t){return e===t||yl(e,t,Zi(t))},Nn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,yl(e,t,Zi(t),n)},Nn.isNaN=function(e){return $o(e)&&e!=+e},Nn.isNative=function(e){if(ur(e))throw new se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Sl(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=$o,Nn.isObject=Ho,Nn.isObjectLike=Wo,Nn.isPlainObject=Vo,Nn.isRegExp=Ko,Nn.isSafeInteger=function(e){return Uo(e)&&e>=-9007199254740991&&e<=9007199254740991},Nn.isSet=Yo,Nn.isString=qo,Nn.isSymbol=Go,Nn.isTypedArray=Zo,Nn.isUndefined=function(e){return void 0===e},Nn.isWeakMap=function(e){return Wo(e)&&er(e)==y},Nn.isWeakSet=function(e){return Wo(e)&&"[object WeakSet]"==pl(e)},Nn.join=function(e,t){return null==e?"":nn.call(e,t)},Nn.kebabCase=Oa,Nn.last=kr,Nn.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=ta(n))<0?rn(l+i,0):on(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)},Nn.lowerCase=wa,Nn.lowerFirst=xa,Nn.lt=Xo,Nn.lte=Qo,Nn.max=function(e){return e&&e.length?nl(e,$a,vl):void 0},Nn.maxBy=function(e,t){return e&&e.length?nl(e,qi(t,2),vl):void 0},Nn.mean=function(e){return yt(e,$a)},Nn.meanBy=function(e,t){return yt(e,qi(t,2))},Nn.min=function(e){return e&&e.length?nl(e,$a,Al):void 0},Nn.minBy=function(e,t){return e&&e.length?nl(e,qi(t,2),Al):void 0},Nn.stubArray=nu,Nn.stubFalse=lu,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=cu,Nn.nth=function(e,t){return e&&e.length?Pl(e,ta(t)):void 0},Nn.noConflict=function(){return ze._===this&&(ze._=De),this},Nn.noop=Ga,Nn.now=vo,Nn.pad=function(e,t,n){e=ra(e);var l=(t=ta(t))?Wt(e):0;if(!t||l>=t)return e;var i=(t-l)/2;return Ii(Qt(i),n)+e+Ii(Xt(i),n)},Nn.padEnd=function(e,t,n){e=ra(e);var l=(t=ta(t))?Wt(e):0;return t&&l<t?e+Ii(t-l,n):e},Nn.padStart=function(e,t,n){e=ra(e);var l=(t=ta(t))?Wt(e):0;return t&&l<t?Ii(t-l,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),un(ra(e).replace(K,""),t||0)},Nn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&rr(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=ea(e),void 0===t?(t=e,e=0):t=ea(t)),e>t){var l=e;e=t,t=l}if(n||e%1||t%1){var i=cn();return on(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return Ll(e,t)},Nn.reduce=function(e,t,n){var l=Oo(e)?dt:Tt,i=arguments.length<3;return l(e,qi(t,4),n,i,Jn)},Nn.reduceRight=function(e,t,n){var l=Oo(e)?pt:Tt,i=arguments.length<3;return l(e,qi(t,4),n,i,el)},Nn.repeat=function(e,t,n){return t=(n?rr(e,t,n):void 0===t)?1:ta(t),Ml(ra(e),t)},Nn.replace=function(){var e=arguments,t=ra(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,n){var l=-1,i=(t=ri(t,e)).length;for(i||(i=1,e=void 0);++l<i;){var r=null==e?void 0:e[Tr(t[l])];void 0===r&&(l=i,r=n),e=Bo(r)?r.call(e):r}return e},Nn.round=su,Nn.runInContext=e,Nn.sample=function(e){return(Oo(e)?Bn:Fl)(e)},Nn.size=function(e){if(null==e)return 0;if(xo(e))return qo(e)?Wt(e):e.length;var t=er(e);return t==v||t==_?e.size:Tl(e).length},Nn.snakeCase=La,Nn.some=function(e,t,n){var l=Oo(e)?vt:$l;return n&&rr(e,t,n)&&(t=void 0),l(e,qi(t,3))},Nn.sortedIndex=function(e,t){return Vl(e,t)},Nn.sortedIndexBy=function(e,t,n){return Kl(e,t,qi(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Vl(e,t);if(l<n&&No(e[l],t))return l}return-1},Nn.sortedLastIndex=function(e,t){return Vl(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return Kl(e,t,qi(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Vl(e,t,!0)-1;if(No(e[n],t))return n}return-1},Nn.startCase=Ma,Nn.startsWith=function(e,t,n){return e=ra(e),n=null==n?0:qn(ta(n),0,e.length),t=Gl(t),e.slice(n,n+t.length)==t},Nn.subtract=du,Nn.sum=function(e){return e&&e.length?At(e,$a):0},Nn.sumBy=function(e,t){return e&&e.length?At(e,qi(t,2)):0},Nn.template=function(e,t,n){var l=Nn.templateSettings;n&&rr(e,t,n)&&(t=void 0),e=ra(e),t=ua({},t,l,Bi);var i,r,o=ua({},t.imports,l.imports,Bi),a=ha(o),u=Rt(o,a),c=0,s=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+s.source+"|"+(s===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(Se.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(p,function(t,n,l,o,a,u){return l||(l=o),d+=e.slice(c,u).replace(ce,Mt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(r=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var f=Se.call(t,"variable")&&t.variable;if(f){if(Q.test(f))throw new se("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(r?d.replace(O,""):d).replace(w,"$1").replace(x,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(r?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Ua(function(){return de(a,v+"return "+d).apply(void 0,u)});if(m.source=d,Fo(m))throw m;return m},Nn.times=function(e,t){if((e=ta(e))<1||e>9007199254740991)return[];var n=4294967295,l=on(e,4294967295);e-=4294967295;for(var i=Ct(l,t=qi(t));++n<e;)t(n);return i},Nn.toFinite=ea,Nn.toInteger=ta,Nn.toLength=na,Nn.toLower=function(e){return ra(e).toLowerCase()},Nn.toNumber=la,Nn.toSafeInteger=function(e){return e?qn(ta(e),-9007199254740991,9007199254740991):0===e?e:0},Nn.toString=ra,Nn.toUpper=function(e){return ra(e).toUpperCase()},Nn.trim=function(e,t,n){if((e=ra(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Gl(t)))return e;var l=zt(e),i=zt(t);return ai(l,It(l,i),Ot(l,i)+1).join("")},Nn.trimEnd=function(e,t,n){if((e=ra(e))&&(n||void 0===t))return e.slice(0,$t(e)+1);if(!e||!(t=Gl(t)))return e;var l=zt(e);return ai(l,0,Ot(l,zt(t))+1).join("")},Nn.trimStart=function(e,t,n){if((e=ra(e))&&(n||void 0===t))return e.replace(K,"");if(!e||!(t=Gl(t)))return e;var l=zt(e);return ai(l,It(l,zt(t))).join("")},Nn.truncate=function(e,t){var n=30,l="...";if(Ho(t)){var i="separator"in t?t.separator:i;n="length"in t?ta(t.length):n,l="omission"in t?Gl(t.omission):l}var r=(e=ra(e)).length;if(kt(e)){var o=zt(e);r=o.length}if(n>=r)return e;var a=n-Wt(l);if(a<1)return l;var u=o?ai(o,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(o&&(a+=u.length-a),Ko(i)){if(e.slice(a).search(i)){var c,s=u;for(i.global||(i=fe(i.source,ra(te.exec(i))+"g")),i.lastIndex=0;c=i.exec(s);)var d=c.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Gl(i),a)!=a){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},Nn.unescape=function(e){return(e=ra(e))&&k.test(e)?e.replace(L,Vt):e},Nn.uniqueId=function(e){var t=++be;return ra(e)+t},Nn.upperCase=ka,Nn.upperFirst=Fa,Nn.each=io,Nn.eachRight=ro,Nn.first=wr,qa(Nn,(iu={},al(Nn,function(e,t){Se.call(Nn.prototype,t)||(iu[t]=e)}),iu),{chain:!1}),Nn.VERSION="4.17.21",lt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nn[e].placeholder=Nn}),lt(["drop","take"],function(e,t){On.prototype[e]=function(n){n=void 0===n?1:rn(ta(n),0);var l=this.__filtered__&&!t?new On(this):this.clone();return l.__filtered__?l.__takeCount__=on(n,l.__takeCount__):l.__views__.push({size:on(n,4294967295),type:e+(l.__dir__<0?"Right":"")}),l},On.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;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:qi(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}}),On.prototype.compact=function(){return this.filter($a)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=kl(function(e,t){return"function"==typeof e?new On(this):this.map(function(n){return _l(n,e,t)})}),On.prototype.reject=function(e){return this.filter(bo(qi(e)))},On.prototype.slice=function(e,t){e=ta(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=ta(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},al(On.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),l=/^(?:head|last)$/.test(t),i=Nn[l?"take"+("last"==t?"Right":""):t],r=l||/^find/.test(t);i&&(Nn.prototype[t]=function(){var t=this.__wrapped__,o=l?[1]:arguments,a=t instanceof On,u=o[0],c=a||Oo(t),s=function(e){var t=i.apply(Nn,st([e],o));return l&&d?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var d=this.__chain__,p=!!this.__actions__.length,v=r&&!d,f=a&&!p;if(!r&&c){t=f?t:new On(this);var m=e.apply(t,o);return m.__actions__.push({func:Jr,args:[s],thisArg:void 0}),new In(m,d)}return v&&f?e.apply(this,o):(m=this.thru(s),v?l?m.value()[0]:m.value():m)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=_e[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",l=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(l&&!this.__chain__){var i=this.value();return t.apply(Oo(i)?i:[],e)}return this[n](function(n){return t.apply(Oo(n)?n:[],e)})}}),al(On.prototype,function(e,t){var n=Nn[t];if(n){var l=n.name+"";Se.call(hn,l)||(hn[l]=[]),hn[l].push({name:t,func:n})}}),hn[Di(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=mi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mi(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Oo(e),l=t<0,i=n?e.length:0,r=function(e,t,n){for(var l=-1,i=n.length;++l<i;){var r=n[l],o=r.size;switch(r.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=on(t,e+o);break;case"takeRight":e=rn(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=r.start,a=r.end,u=a-o,c=l?a:o-1,s=this.__iteratees__,d=s.length,p=0,v=on(u,this.__takeCount__);if(!n||!l&&i==u&&v==u)return ei(e,this.__actions__);var f=[];e:for(;u--&&p<v;){for(var m=-1,E=e[c+=t];++m<d;){var _=s[m],h=_.type,g=(0,_.iteratee)(E);if(2==h)E=g;else if(!g){if(1==h)continue e;break e}}f[p++]=E}return f},Nn.prototype.at=eo,Nn.prototype.chain=function(){return Qr(this)},Nn.prototype.commit=function(){return new In(this.value(),this.__chain__)},Nn.prototype.next=function(){void 0===this.__values__&&(this.__values__=Jo(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,n=this;n instanceof Pn;){var l=Cr(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},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:Jr,args:[jr],thisArg:void 0}),new In(t,this.__chain__)}return this.thru(jr)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,ft&&(Nn.prototype[ft]=function(){return this}),Nn}();Ve?((Ve.exports=Kt)._=Kt,$e._=Kt):ze._=Kt}).call(d)});const Ml=e=>{var t,i;let{t:r,formData:o,applicationData:a,docs:u,bpaActionsDetails:c}=e;const s=(null==a?void 0:a.status)||"",d=(null==c||null===(t=c.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,f]=n.useState((null==o||null===(i=o.documents)||void 0===i?void 0:i.documents)||[]),[m,E]=n.useState(null),[_,h]=n.useState([]),[g,y]=n.useState(!0),[S,b]=n.useState(!1),[T,A]=n.useState(!1),{isLoading:C,data:D}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"]),{isLoading:N,data:R}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]);return n.useEffect(()=>{var e,t,n,l;let i=[];var r,o;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(r=D.BPA)||void 0===r||null===(o=r.DocTypeMapping)||void 0===o?void 0:o.filter(e=>{var t,n;return e.WFState==(null==a?void 0:a.status)?null==a?void 0:a.status:e.RiskType==(null==a?void 0:a.riskType)&&e.ServiceType==(null==a||null===(t=a.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==a||null===(n=a.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 r=e.code;e.dropdownData=[],e.uploadedDocuments=[],null==R||null===(t=R["common-masters"])||void 0===t||null===(n=t.DocumentType)||void 0===n||n.forEach(t=>{let n=t.code.slice(0,r.length);r===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;r===`${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)}),y("0"!=e&&0!=e||!(v.length>0))},[v,S]),n.useEffect(()=>{A("DOC_VERIFICATION_INPROGRESS"===s&&(null==d?void 0:d.length)>0)},[a,c]),l.createElement("div",null,null==_?void 0:_.map((e,t)=>l.createElement("div",null,l.createElement(kl,{key:t,index:t,document:e,t:r,error:m,setError:E,setDocuments:f,documents:v,setCheckRequiredFields:b,applicationStatus:s,actions:d,bpaTaxDocuments:_,checkEnablingDocs:T}))))};function kl(e){var i,r;let{t:o,document:a,setDocuments:u,documents:c,index:s,bpaTaxDocuments:d,checkEnablingDocs:p}=e;const v=null==c?void 0:c.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],f=Digit.ULBService.getStateId(),[m,E]=n.useState(v?{...v,active:!0,code:null==v?void 0:v.documentType,i18nKey:null==v?void 0:v.documentType}:1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{}),[_,h]=n.useState(null),[g,y]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[S,b]=n.useState([]);return n.useEffect(()=>{null!=m&&m.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==m?void 0:m.code));return 0===(null==g?void 0:g.length)||null===g?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==g),{documentType:null==m?void 0:m.code,fileStoreId:g,documentUid:g,fileName:(null==_?void 0:_.name)||"",id:c?null===(t=c.find(e=>e.documentType===(null==m?void 0:m.code)))||void 0===t?void 0:t.id:void 0}]})},[g,m]),n.useEffect(()=>{try{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],S.map(e=>{var t,n,l;null!=m&&m.code&&a.newUploadedDocs.push({documentType:null==m?void 0:m.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})}),d[s]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)))}catch(e){Promise.reject(e)}},[S,m]),n.useEffect(()=>{},[_]),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"}},""+o(null==a?void 0:a.code)),(null==a||null===(r=a.uploadedDocuments)||void 0===r?void 0:r.length)&&l.createElement(Ll,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),p?l.createElement("div",{style:{marginTop:"20px"}},l.createElement(t.LabelFieldPair,{style:{width:"100%"}},l.createElement(t.CardLabel,{style:{marginTop:"-10px",width:"100%"}},null!=a&&a.required?o(null==a?void 0:a.code)+"* ":""+o(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:o,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:m,optionKey:"i18nKey",select:e=>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])&&h(i.file)})(0,e),t:o,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Fl(e){let{fiReport:n,isCitizen:r=!1}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(r?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+o("BPA_FI_REPORT")),n.map((e,i)=>{var r,a,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)?""+o("BPA_FI_REPORT"):`${o("BPA_FI_REPORT")} - ${i+1}`),l.createElement(t.Row,{className:"border-none",label:""+o("BPA_FI_DATE_LABEL"),text:null!=e&&e.date?e.date.includes("-")?`${null===(r=e.date)||void 0===r?void 0:r.split("-")[2]}/${null===(a=e.date)||void 0===a?void 0:a.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:""+o("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:""+o(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+o("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Ll,{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 Bl(e){let{t:i,document:r,setNocDocuments:o,setError:a,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==r?void 0:r.code)})[0],s=Digit.ULBService.getStateId(),[d,p]=n.useState(),[v,f]=n.useState(null),[m,E]=n.useState(()=>(null==c?void 0:c.fileStoreId)||null);return n.useEffect(()=>{var e,t;null!=r&&null!==(e=r.dropdownData)&&void 0!==e&&null!==(t=e[0])&&void 0!==t&&t.code&&o(e=>{var t;const n=null==e?void 0:e.filter(e=>{var t,n;return(null==e?void 0:e.documentType)!==(null==r||null===(t=r.dropdownData)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.code)});return 0===(null==m?void 0:m.length)||null===m?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==m),{documentType:null==r||null===(t=r.dropdownData)||void 0===t?void 0:t[0].code,fileStoreId:m,documentUid:m,fileName:(null==v?void 0:v.name)||""}]})},[m]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(v){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(v.size>=5242880)a(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=v&&v.type&&!e.test(null==v?void 0:v.type))a(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=We(function(){return E(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",v,Digit.ULBService.getStateId())).then(function(e){var t,n,l,r;(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===(r=l.files[0])||void 0===r?void 0:r.fileStoreId):a(i("CS_FILE_UPLOAD_ERROR"))})},function(){a(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!=r&&r.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])&&f(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Ul=e=>{var i;let{t:r,noc:o,docs:a,isNoc:u,applicationData:c,NOCdata:s,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==c?void 0:c.status)||"",f=(null==d||null===(i=d.data)||void 0===i?void 0:i.nextActions)||[],{data:m}=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([]),[y,S]=n.useState([]),[b,T]=n.useState(!1),[A,C]=Digit.Hooks.useSessionStorage(null==o?void 0:o.nocType,[]),[D,N]=n.useState(null),R=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 r,a,s,d;l=u?null==m||null===(r=m.NOC)||void 0===r||null===(a=r.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==o?void 0:o.applicationType)&&(null==e?void 0:e.nocType)===(null==o?void 0:o.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==o?void 0:o.additionalDetails,applicationStatus:null==o?void 0:o.applicationStatus,appNumberLink:null==o?void 0:o.applicationNo,nocNo:null==o?void 0:o.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)}),S(p))},[m,h]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==f?void 0:f.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:R?""+r(`BPA_${null==o?void 0:o.nocType}_HEADER`):r(`BPA_${null==o?void 0:o.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:R?""+r(null==e?void 0:e.title):r(null==e?void 0:e.title),text:r(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:R?""+r(null==e?void 0:e.title):r(null==e?void 0:e.title),text:r(null!=e&&e.value?null==e?void 0:e.value:"CS_NA")})})),l.createElement(Ll,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==y?void 0:y.map((e,t)=>l.createElement(Bl,{key:t,document:e,t:r,error:D,setError:N,setNocDocuments:C,nocDocuments:A,checkEnablingDocs:b}))))},jl=e=>{let{permissions:i,t:r}=e;const[o,a,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[c,s,d]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const p=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},r("BPA_PERMIT_CONDITIONS")),null==o?void 0:o.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:p?"100%":"70%"},label:null==e?void 0:e.label,checked:null==e?void 0:e.checked,onChange:e=>((e,t,n)=>{const l=e.target.checked;a(()=>null==o?void 0:o.map((e,t)=>n===t?{...e,checked:l}:e))})(e,0,n),isLabelFirst:!0,index:n})),null==c?void 0:c.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{s(()=>null==c?void 0:c.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:p?"96%":"830px",width:p?"96%":"830px"},style:p?{paddingRight:"10%"}:{},placeholder:r("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:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...c];t.splice(e,1),s([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:r("BPA_ADD_MORE"),onClick:()=>{s([...c,{label:""}])}}))};function Hl(e){let{documents:r,svgStyles:o={},isSendBackFlow:a=!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==r||r.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))},[r]),n.useEffect(()=>{var e;null!=c&&c.length&&"BillAmend"===(null==r||null===(e=r[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"),f=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!f&&(null==r?void 0:r.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,r;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)),a?null!=e&&null!==(r=e.documentType)&&void 0!==r&&r.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")))))})),f&&(null==r?void 0:r.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!=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"}},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 Wl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:r}=n,{t:o}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:o("ES_PT_TITLE_TAX_HEADS"),text:o("ES_PT_TITLE_AMOUNT"),className:"border-none",textStyle:{fontWeight:"bold"}}),l.createElement(t.BreakLine,{style:{margin:"16px 0",width:"40%"}}),null==r?void 0:r.map((e,n)=>l.createElement(t.Row,{key:o(e.taxHeadCode),label:o(e.taxHeadCode),text:"₹ "+e.estimateAmount||"N/A",last:n===(null==r?void 0:r.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:o("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function zl(e){let{floors:n}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:r(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},r(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"}},r(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:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:""})}:{key:r(e.title),label:r(e.title),text:r(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 $l(e){let{owners:n}=e,r={};r=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:o}=i.useTranslation(),a=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},c={position:"relative",padding:"8px"},s={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?u={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(u={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},c={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},s={}),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"},r.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:u,className:"owner-details-child"},l.createElement(t.CardSubHeader,{style:Number(a)>1?{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},Number(a)>1?`${o(null==e?void 0:e.title)} ${n+1}`:o(null==e?void 0:e.title)),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:c},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:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{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",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:s}))}))))})))}const Vl=e=>{var r,o,a;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===(r=u.values)||void 0===r?void 0:r.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===(o=u.permit)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),l.createElement("div",null,null==u||null===(a=u.scruntinyDetails)||void 0===a?void 0:a.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))))))))},Kl=e=>{var r,o,a,u,c;let{edcrDetails:s,applicationData:d}=e;const{t:p}=i.useTranslation(),v=window.Digit.Utils.browser.isMobile(),f=[{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"}],m=e=>{const t=e;return(e,n,l)=>e[t]},E=n.useMemo(()=>f.map(e=>({Header:p(""+e.name),accessor:m(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,r,o,a,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===(r=i[0])||void 0===r?void 0:r.builtUpArea,FloorArea:(null===(o=e.occupancies)||void 0===o||null===(a=o[0])||void 0===a?void 0:a.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,r;let t=null===(i=n[e])||void 0===i||null===(r=i.usageCategory)||void 0===r?void 0:r.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===(r=s.values)||void 0===r?void 0:r.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===(o=s.subOccupancyTableDetails)||void 0===o||null===(a=o[0])||void 0===a||null===(u=a.value)||void 0===u||null===(c=u.planDetail)||void 0===c?void 0:c.blocks.map((e,n)=>{var i,r,o,a,u;return l.createElement("div",{key:n,style:(null==s||null===(i=s.subOccupancyTableDetails)||void 0===i||null===(r=i[0])||void 0===r||null===(o=r.value)||void 0===o||null===(a=o.planDetail)||void 0===a||null===(u=a.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:{}})})))})))},Yl=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))},ql=e=>{var n,r,o;let{data:a,OpenImage:u,privacy:c={}}=e;const{t:s}=i.useTranslation();return l.createElement("div",null,a.date&&l.createElement("p",null,a.date),l.createElement("p",null,a.name),a.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:a.mobileNumber,privacy:c}),l.createElement("p",null,"    ")),a.source&&l.createElement("p",null,s("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+a.source.toUpperCase())),a.comment&&l.createElement(Yl,{otherComment:null==a?void 0:a.otherComment,headComment:null==a?void 0:a.comment}),null!=a&&a.wfComment?l.createElement("div",null,null==a||null===(n=a.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==a||null===(r=a.thumbnailsToShow)||void 0===r||null===(o=r.thumbs)||void 0===o?void 0:o.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,s("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==a?void 0:a.thumbnailsToShow.thumbs,onClick:(e,t)=>{u(e,t,null==a?void 0:a.thumbnailsToShow)}})):null)};function Gl(e){let{units:n}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:r(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"}},`${r(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:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:""})}:{key:r(e.title),label:r(e.title)+":",text:r(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 Zl(e){let{units:n}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:r(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"}},`${r(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:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:""})}:{key:r(e.title),label:r(e.title)+":",text:r(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 Xl=e=>{var r,o,a,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:f,plumberDetails:m,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===(r=c.additionalDetails)||void 0===r?void 0:r.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==f?void 0:f.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===(o=c.additionalDetails)||void 0===o?void 0:o.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==m?void 0:m.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===(a=c.additionalDetails)||void 0===a?void 0:a.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:""})))))))},Ql=[{title:"PT_PENDING_DUES_FROM_EARLIER",value:"Pending dues from earlier"},{title:"PT_MISCALCULATION_OF_EARLIER_ASSESSMENT",value:"Miscalculation of earlier Assessment"},{title:"PT_ONE_TIME_PENALITY",value:"One time penality"},{title:"PT_OTHERS",value:"Others"}],Jl=[{title:"PT_ADVANCED_PAID_BY_CITIZEN_EARLIER",value:"Advanced Paid By Citizen Earlier"},{title:"PT_REBATE_PROVIDED_BY_COMMISSIONER_EO",value:"Rebate provided by commissioner/EO"},{title:"PT_ADDITIONAL_AMOUNT_CHARGED_FROM_THE_CITIZEN",value:"Additional amount charged from the citizen"},{title:"PT_OTHERS",value:"Others"}],ei=e=>{var r,o,a,c;let{wsAdditionalDetails:s}=e;const{t:d}=i.useTranslation(),[p,v,f]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[m,E,h]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(r=s.additionalDetails)||void 0===r||!r.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[A,C]=n.useState(null),[D,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[R,P]=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={...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 r,o,a,u,c,d,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(r=p.billDetails)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(a=p.billDetails)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(c=p.billDetails)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.taxAmount)}];P(e),N(null==p||null===(f=p.billDetails)||void 0===f?void 0:f[0])}else v(i),T(i)},[]);let O={};const w=e=>l.createElement("h1",{className:"heading-m"},e.label),x=()=>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"})),L=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(x,null)),M=function(e,t,n){void 0===t&&(t=!1);let l={...b};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,r;const t=0==(null==n||null===(i=n.target)||void 0===i?void 0:i.value)?1:Math.sign(null==n||null===(r=n.target)||void 0===r?void 0:r.value)||-1;l[e]=1==t?n.target.value:""}T(l)};return l.createElement(n.Fragment,null,l.createElement("div",{style:{lineHeight:"19px",maxWidth:"950px",minWidth:"280px"}},R&&l.createElement(t.StatusTable,null,l.createElement("div",null,null==R?void 0:R.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!==(o=s.additionalDetails)&&void 0!==o&&o.isAdhocRebate?l.createElement("div",{onClick:e=>{S(!0)}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},d("WS_PAYMENT_ADD_REBATE_PENALTY"))):null,y&&l.createElement(t.Modal,{headerBarMain:l.createElement(w,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(L,{onClick:()=>{T(p),S(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{T(p),S(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.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 r,o,a,u,c,p,f,m,h,g;const e=null==s||null===(r=s.additionalDetails)||void 0===r||null===(o=r.appDetails)||void 0===o?void 0:o.applicationNo,t=null==s||null===(a=s.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n={...null==s||null===(c=s.additionalDetails)||void 0===c||null===(p=c.appDetails)||void 0===p?void 0:p.additionalDetails,...b};s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(m=f.appDetails)||void 0===m?void 0:m.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===(h=s.additionalDetails)||void 0===h||null===(g=h.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,r,o,a,u,c,s,d,p,f,m,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===(m=e.Calculation)||void 0===m||null===(h=m[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===(r=e.Calculation)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.taxHeadEstimates,"category");const y=[{title:"WS_APPLICATION_FEE_HEADER",value:null===(a=e.Calculation)||void 0===a||null===(u=a[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(al(e.Calculation[0])),N(null==e||null===(f=e.Calculation)||void 0===f?void 0:f[0]),P(y),b.billDetails=null==e?void 0:e.Calculation,v(b),S(!1)}).catch(e=>{var t,n,l,i,r,o;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===(r=i.data)||void 0===r||null===(o=r.Errors[0])||void 0===o?void 0:o.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:Ql,optionKey:"title",select:e=>M("adhocPenaltyReason",!0,e),selected:(null==b?void 0:b.adhocPenaltyReason_data)||"",isPropertyAssess:!0,name:"adhocPenaltyReason_data",t:d})),"PT_OTHERS"===(null==b||null===(a=b.adhocPenaltyReason_data)||void 0===a?void 0:a.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==b?void 0:b.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==b?void 0:b.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:Jl,optionKey:"title",select:e=>M("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(c=b.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==b?void 0:b.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==b?void 0:b.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})))},ti=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:{...t},display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},ni=e=>{let{t:n,userType:i=!1,infoBannerLabel:r="",infoClickLable:o="",infoClickInfoLabel:a="",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(r))),n(o)+" ",l.createElement(ti,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},li=e=>{var r,o,a,u,c,s,d;let{wsAdditionalDetails:p}=e;const{t:v}=i.useTranslation(),[f,m]=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"})),y=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!==(r=p.additionalDetails)&&void 0!==r&&r.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),m(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},v("WS_PAYMENT_VIEW_BREAKUP"))):null,f&&l.createElement(t.Modal,{headerBarMain:l.createElement(h,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(y,{onClick:()=>{m(!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===(o=E.billSlabData)||void 0===o||null===(a=o.FEE)||void 0===a?void 0:a.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"}})))))},ii={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:{}},ri=e=>{let{className:t="table",headers:n=[],values:r=[],arrears:o=0}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:ii.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:ii.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...ii.cell,...ii.cellLeft,...ii.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...ii.cell,...n.length==t+1?ii.cellRight:{},...ii.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(r).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...ii.cell,...ii.cellLeft},component:"th",scope:"row"},Object.keys(r)[t]),n.map((t,i)=>l.createElement("td",{style:{...ii.cell,textAlign:"left",...n.length==i+1?ii.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...ii.cell,...ii.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...ii.cell,...ii.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},o):t==n.length-2?l.createElement("td",{style:{...ii.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:ii.cell,key:t,numeric:!0})))))))},oi={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))"}},ai=e=>{var t,r,o;let{bill:a={}}=e;const{t:u}=i.useTranslation();let c={},s=(null==a||null===(t=a.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];s=[...s];const d=(null===(r=s)||void 0===r?void 0:r.reduce((e,t,n)=>0===n?e:e+t.amount,0))||0;let p="₹ "+((null==d||null===(o=d.toFixed)||void 0===o?void 0:o.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:r=[]}=e;return r.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 f=[];f=Object.keys(v),f.sort((e,t)=>v[e]-v[t]);const[m,E]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:oi.headerStyle},u("CS_ARREARS_DETAILS")),m&&l.createElement(ri,{headers:[...f],values:c,arrears:p}),!m&&l.createElement("div",{style:oi.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),m&&l.createElement("div",{style:oi.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))};function ui(e){var o,a,u,c,s,d,p,v,f,m,E,h,g,y;let{applicationDetails:S,workflowDetails:b,isDataLoading:T,applicationData:A,timelineStatusPrefix:C,showTimeLine:D=!0,statusAttribute:N="status",paymentsList:R,oldValue:P,isInfoLabel:I=!1}=e;const{t:O}=i.useTranslation();function w(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",S);const[x,L]=n.useState({}),[M,k]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==A?void 0:A.status)||M.loading||M.loaded||M.canLoad||k({loading:!1,loaded:!1,canLoad:!0}),null==M||!M.canLoad||M.loading||M.loaded||(k({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 r(){n(o),l({loading:!1,loaded:!0,canLoad:!0})}let o={};const a=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){o=e})}();return a&&a.then?a.then(r):r()})}catch(e){return Promise.reject(e)}}((null==A?void 0:A.tenantId)||tenantId,null==A?void 0:A.propertyId,L,k));const F=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:F(null==A||null===(i=A.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==A?void 0:A.channel)||""};return l.createElement(ql,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var r,o,a,u,c,s,d,p,v,f,m,E,h,g,y,b,T,C;const n={uuid:null==e||null===(r=e.assignes)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==S?void 0:S.tenantId,businessIds:null==S?void 0:S.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}}},i={date:null==e||null===(a=e.auditDetails)||void 0===a?void 0:a.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===(f=v[0])||void 0===f?void 0:f.uuid)&&null!=A&&null!==(m=A.processInstance)&&void 0!==m&&null!==(E=m.assignes)&&void 0!==E&&null!==(h=E[0])&&void 0!==h&&h.mobileNumber?null==A||null===(g=A.processInstance)||void 0===g||null===(y=g.assignes)||void 0===y||null===(b=y[0])||void 0===b?void 0:b.mobileNumber:null==e||null===(T=e.assignes)||void 0===T||null===(C=T[0])||void 0===C?void 0:C.mobileNumber,comment:O(e&&(null==e?void 0:e.comment)),thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(ql,{data:i,OpenImage:w,privacy:n})}{var D,N,R,P,I;const t={date:F(null==A||null===(D=A.auditDetails)||void 0===D?void 0:D.lastModifiedTime),name:null==e||null===(N=e.assignes)||void 0===N||null===(R=N[0])||void 0===R?void 0:R.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(P=e.assignes)||void 0===P||null===(I=P[0])||void 0===I?void 0:I.mobileNumber,thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(ql,{data:t,OpenImage:w})}},U=(e,t)=>e?t?e:O(e):O("NA"),j=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),H=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")||j?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),$=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"),[V,K]=n.useState(!1);return l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},I?l.createElement(ni,{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==S||null===(o=S.applicationDetails)||void 0===o?void 0:o.map((e,i)=>{var o,a,u,c,s,d,p,v,f,m,E,_,h,g,y,T,A,C,D,N,I,w,L,M,k,F,B,U,V,K,Y,q,G,Z,X,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"}:j?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&j?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},H?""+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")||j?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o,a,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(r.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},O(null==n?void 0:n.title)))):H||W?""+O(n.title):O(n.title),text:l.createElement("div",null,l.createElement(r.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:$(n),last:i===(null==e||null===(o=e.values)||void 0===o?void 0:o.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(ai,{bill:null===(a=x.Bill)||void 0===a?void 0:a[0]}):"")})))),(null==e?void 0:e.belowComponent)&&l.createElement(e.belowComponent,null),(null==e||null===(a=e.additionalDetails)||void 0===a?void 0:a.inspectionReport)&&l.createElement(Vl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:R}),(null==S||null===(u=S.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(Fl,{fiReport:null==S||null===(p=S.applicationData)||void 0===p||null===(v=p.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(zl,{floors:null==e||null===(m=e.additionalDetails)||void 0===m?void 0:m.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement($l,{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(Zl,{units:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.units}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.accessories)&&l.createElement(Gl,{units:null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.accessories}),(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==b||null===(C=b.data)||void 0===C||null===(D=C.nextActions)||void 0===D?void 0:D.length)>0&&l.createElement(jl,{applicationData:null==S?void 0:S.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(Ml,{t:O,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:b}),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc)&&l.createElement(Ul,{t:O,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(L=e.additionalDetails)||void 0===L?void 0:L.data,bpaActionsDetails:b}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.scruntinyDetails)&&l.createElement(Vl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.buildingExtractionDetails)&&l.createElement(Vl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.subOccupancyTableDetails)&&l.createElement(Kl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(Ll,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.documents)&&l.createElement(Hl,{documents:null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.documents}),(null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.taxHeadEstimatesCalculation)&&l.createElement(Wl,{taxHeadEstimatesCalculation:null==e||null===(q=e.additionalDetails)||void 0===q?void 0:q.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Xl,{wsAdditionalDetails:e,oldValue:P}),(null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(r.Link,{to:null==e||null===(Z=e.additionalDetails)||void 0===Z||null===(X=Z.redirectUrl)||void 0===X?void 0:X.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(ei,{wsAdditionalDetails:e,workflowDetails:b}),(null==e||null===(te=e.additionalDetails)||void 0===te?void 0:te.estimationDetails)&&l.createElement(li,{wsAdditionalDetails:e,workflowDetails:b}))}),D&&(null==b||null===(a=b.data)||void 0===a||null===(u=a.timeline)||void 0===u?void 0:u.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==b?void 0:b.isLoading)||T)&&l.createElement(t.Loader,null),!(null!=b&&b.isLoading)&&!T&&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!=b&&null!==(c=b.data)&&void 0!==c&&c.timeline&&1===(null==b||null===(s=b.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==b||null===(p=b.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state}`),customChild:B(null==b||null===(f=b.data)||void 0===f?void 0:f.timeline[0],null==b||null===(m=b.data)||void 0===m?void 0:m.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==b||null===(E=b.data)||void 0===E?void 0:E.timeline)&&(null==b||null===(h=b.data)||void 0===h?void 0:h.timeline.slice(0,V?null==b?void 0:b.data.timeline.length:2).map((e,n,i)=>{let r="";var o,a,u,c,s,d;return window.location.href.includes("/obps/")&&(r=null!=b&&null!==(o=b.data)&&void 0!==o&&null!==(a=o.timeline[n-1])&&void 0!==a&&null!==(u=a.state)&&void 0!==u&&u.includes("BACK_FROM")||null!=b&&null!==(c=b.data)&&void 0!==c&&null!==(s=c.timeline[n-1])&&void 0!==s&&null!==(d=s.state)&&void 0!==d&&d.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]}${r}`),customChild:B(e,n)}))}))),(null==b||null===(g=b.data)||void 0===g||null===(y=g.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:O(V?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{K(e=>!e)}})))))}function ci(e){var n,i,r,o,a,u,c,s,d,p,v,f,m,E,_,h,g,y;let{t:S,showToast:b,closeToast:T,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==b||null===(C=b.action)||void 0===C?void 0:C.action){case"SENDBACK":e="error"===(null==b?void 0:b.key)?null==b||null===(n=b.error)||void 0===n?void 0:n.message:S("TL_SENDBACK_CHECKLIST_MESSAGE_HEAD");break;case"FORWARD":e="error"===(null==b?void 0:b.key)?null==b||null===(i=b.error)||void 0===i?void 0:i.message:S("TL_FORWARD_SUCCESS_MESSAGE_MAIN");break;case"APPROVE":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(o=b.error)||void 0===o?void 0:o.message:S("TL_SENDBACK_TOCITIZEN_CHECKLIST_MESSAGE_HEAD");break;case"REJECT":e="error"===(null==b?void 0:b.key)?null==b||null===(a=b.error)||void 0===a?void 0:a.message:S("TL_APPROVAL_REJ_MESSAGE_HEAD");break;case"RESUBMIT":e="error"===(null==b?void 0:b.key)?null==b||null===(u=b.error)||void 0===u?void 0:u.message:S("TL_APPLICATION_RESUBMIT_SUCCESS_MESSAGE_MAIN");break;case"CANCEL":e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(s=b.error)||void 0===s?void 0:s.message:S(`ES_${A}_${null==b||null===(d=b.action)||void 0===d?void 0:d.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:e,onClose:T}))}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")?S(e[1]):S(e[0]),n};let n="";switch(null==b||null===(D=b.action)||void 0===D?void 0:D.action){case"REVOCATE":n="error"===(null==b?void 0:b.key)?null==b||null===(p=b.error)||void 0===p?void 0:p.message:e(["BPA_APPROVAL_REVOCATED_MESSAGE_HEAD","BPA_APPROVAL_OC_REVOCATED_MESSAGE_HEAD"]);break;case"VERIFY_AND_FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(E=b.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==b?void 0:b.key)?null==b||null===(_=b.error)||void 0===_?void 0:_.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_FOR_DOCUMENT_VERIFICATION":case"SEND_BACK_FOR_FIELD_INSPECTION":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(g=b.error)||void 0===g?void 0:g.message:S(`ES_${A}_${null==b||null===(y=b.action)||void 0===y?void 0:y.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var N,R;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:`ES_${A}_${null==b||null===(R=b.action)||void 0===R?void 0:R.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function si(e){var r,o,a,u,c,s,d,p,v,f,m,E,_,h,g,y,S,b,T;let{workflowDetails:A,displayMenu:C,onActionSelect:D,setDisplayMenu:N,businessService:R,forcedActionPrefix:P,ActionBarStyle:I={},MenuStyle:O={},isAction:w,applicationDetails:x}=e;const{t:L}=i.useTranslation();let M=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):{};M=null==t?void 0:t.value}const F=null===(r=M)||void 0===r||null===(o=r.info)||void 0===o||null===(a=o.roles)||void 0===a?void 0:a.map(e=>e.code);let B=!1,U=!1,j=(null==A||null===(u=A.data)||void 0===u||null===(c=u.actionState)||void 0===c||null===(s=c.nextActions)||void 0===s?void 0:s.filter(e=>(null==F?void 0:F.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==A||null===(d=A.data)||void 0===d||null===(p=d.nextActions)||void 0===p?void 0:p.filter(e=>(null==F?void 0:F.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));Digit.Hooks.useClickOutside(k,()=>{N(!1)},C),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==j?void 0:j.length)||null!=j&&null!==(v=j[0])&&void 0!==v&&null!==(f=v.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==j?void 0:j.length)?(U=!1,B=!0):(null==j?void 0:j.length)>0&&(U=!0,B=!1);const H=Digit.SessionStorage.get("User"),W=null==H||null===(m=H.info)||void 0===m?void 0:m.uuid,z=null==x||null===(E=x.applicationData)||void 0===E||null===(_=E.auditDetails)||void 0===_?void 0:_.lastModifiedBy;return l.createElement(l.Fragment,null,!(null!=A&&A.isLoading)&&U&&!B&&!w&&l.createElement(t.ActionBar,{style:{...I}},C&&(null!=A&&null!==(h=A.data)&&void 0!==h&&null!==(g=h.actionState)&&void 0!==g&&g.nextActions||null!=A&&null!==(y=A.data)&&void 0!==y&&y.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:P||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase()),options:j,optionKey:"action",t:L,onSelect:D,style:O}):null,"ewst"===R?z===W||null==z?l.createElement(t.SubmitBar,{ref:k,label:L("WF_TAKE_ACTION"),onSubmit:()=>N(!C)}):l.createElement(t.CardLabel,{style:{color:"red",font:"30px",fontWeight:"bold"}},""+L("EW_ALERT_ANOTHER_VENDOR")):l.createElement(t.SubmitBar,{ref:k,label:L("WF_TAKE_ACTION"),onSubmit:()=>N(!C)})),!(null!=A&&A.isLoading)&&!U&&B&&!w&&l.createElement(t.ActionBar,{style:{...I}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==j||null===(S=j[0])||void 0===S?void 0:S.action,value:null==j||null===(b=j[0])||void 0===b?void 0:b.action,onClick:e=>{D((null==j?void 0:j[0])||{})}},L(`${P||"WF_EMPLOYEE_"+(null==R?void 0:R.toUpperCase())}_${null==j||null===(T=j[0])||void 0===T?void 0:T.action}`))))}const di=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),pi=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(di,null));function vi(e){let{action:n,closeWarningPopup:r}=e;const{t:o}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement(t.Modal,{headerBarMain:l.createElement("h1",{className:"heading-m"},o("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(pi,{onClick:()=>{r()}}),hideSubmit:!0,isDisabled:!1,popupStyles:a?{}:{width:"29%",marginTop:"auto"}},l.createElement(t.Card,null,l.createElement("div",{style:{marginBottom:"30px"}},l.createElement("h1",null,o("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",o("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:""+o("PT_AMOUNT_DUE"),text:"₹"+o(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:o("ES_PT_COMMON_CANCEL"),onSubmit:r,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:o("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 fi=e=>{var o;const u=Digit.ULBService.getCurrentTenantId(),c=Digit.ULBService.getStateId(),{t:s}=i.useTranslation(),d=r.useHistory();let{id:p}=r.useParams();const[v,f]=n.useState(!1),[m,E]=n.useState(null),[_,h]=n.useState(!1),[g,y]=n.useState(!1),[S,b]=n.useState(!1),{applicationDetails:T,showToast:A,setShowToast:C,isLoading:D,isDataLoading:N,applicationData:R,mutate:P,nocMutation:I,workflowDetails:O,id:w,businessService:x,closeToast:L,moduleCode:M,timelineStatusPrefix:k,forcedActionPrefix:F,statusAttribute:B,ActionBarStyle:U,MenuStyle:j,paymentsList:H,showTimeLine:W=!0,oldValue:z,isInfoLabel:$=!1,clearDataDetails:V,isAction:K=!1}=e;n.useEffect(()=>{A&&O.revalidate()},[A]);const Y=a.useQueryClient(),q=()=>{E(null),h(!1)};return D||g?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,D?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(ui,{applicationDetails:T,id:w,workflowDetails:O,isDataLoading:N,applicationData:R,businessService:x,timelineStatusPrefix:k,statusAttribute:B,paymentsList:H,showTimeLine:W,oldValue:z,isInfoLabel:$}),_?l.createElement(xl,{t:s,action:m,tenantId:u,state:c,id:p,applicationDetails:T,applicationData:null==T?void 0:T.applicationData,closeModal:q,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,r,o,a,u,c,p,v,f,E,_,h){if(0!=(null==e||null===(i=e.Property)||void 0===i||null===(r=i.workflow)||void 0===r||null===(o=r.comment)||void 0===o?void 0:o.length)&&0!=(null==e||null===(a=e.Licenses)||void 0===a||null===(u=a[0])||void 0===u||null===(c=u.comment)||void 0===c?void 0:c.length)&&0!=(null==e||null===(p=e.WaterConnection)||void 0===p||null===(v=p.comment)||void 0===v?void 0:v.length)&&0!=(null==e||null===(f=e.SewerageConnection)||void 0===f||null===(E=f.comment)||void 0===E?void 0:E.length)&&0!=(null==e||null===(_=e.BPA)||void 0===_||null===(h=_.comment)||void 0===h?void 0:h.length)){function g(t){if(l)return t;P&&(y(!0),P(e,{onError:(e,t)=>{y(!1),C({key:"error",error:e}),setTimeout(L,5e3)},onSuccess:(e,t)=>{var l,i,r,o,a,u,c,p,v,f,E,_;sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),y(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=m,d.replace("/upyog-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=m,d.push("/upyog-ui/employee/obps/stakeholder-response",{data:e})),null!==(r=n)&&void 0!==r&&r.isNoc&&d.push("/upyog-ui/employee/noc/response",{data:e}),(null==e||null===(o=e.Amendments)||void 0===o?void 0:o.length)>0?null!=t&&null!==(a=t.AmendmentUpdate)&&void 0!==a&&null!==(u=a.workflow)&&void 0!==u&&u.action.includes("SEND_BACK")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(c=t.AmendmentUpdate)&&void 0!==c&&null!==(p=c.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(v=t.AmendmentUpdate)&&void 0!==v&&null!==(f=v.workflow)&&void 0!==f&&f.action.includes("APPROVE")?C({key:"success",label:s("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(_=E.workflow)&&void 0!==_&&_.action.includes("REJECT")&&C({key:"success",label:s("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")}):(C({key:"success",action:m}),V&&setTimeout(V,3e3),setTimeout(L,5e3),Y.clear(),Y.refetchQueries("APPLICATION_SEARCH"))}})),q()}y(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&I){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==I?void 0:I.mutateAsync(e)),i=We(function(){return y(!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,r,o,a,u,c,d,p,v,f;y(!1);let m=null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&null!==(i=n.Errors)&&void 0!==i&&null!==(r=i[0])&&void 0!==r&&r.code?s(null==e||null===(o=e.response)||void 0===o||null===(a=o.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(c=u[0])||void 0===c?void 0:c.code):(null==e||null===(d=e.response)||void 0===d||null===(p=d.data)||void 0===p||null===(v=p.Errors)||void 0===v||null===(f=v[0])||void 0===f?void 0:f.message)||e;q(),C({key:"error",error:{message:m}}),setTimeout(L,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(g):g(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==O||null===(o=O.data)||void 0===o?void 0:o.timeline,businessService:x,workflowDetails:O,moduleCode:M}):null,S?l.createElement(vi,{action:m,workflowDetails:O,businessService:x,isWarningPop:S,closeWarningPopup:()=>{b(!1)}}):null,l.createElement(ci,{t:s,showToast:A,closeToast:L,businessService:x}),l.createElement(si,{isAction:K,workflowDetails:O,displayMenu:v,onActionSelect:function(e){if(sessionStorage.setItem("SELECTED_ACTION",null==e?void 0:e.action),e)if(null!=e&&e.isToast)C({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(L,5e3);else if(null!=e&&e.isWarningPopUp)b(!0);else if(null!=e&&e.redirectionUrll){var t,n,l,i,r;if("ACTIVATE_CONNECTION"===(null==e||null===(t=e.redirectionUrll)||void 0===t?void 0:t.action))d.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===(r=location)||void 0===r?void 0:r.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(n=e.redirectionUrll)||void 0===n?void 0:n.action)){var o,a;d.push(""+(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.pathname),{data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state})}else{var u;window.location.assign(`${window.location.origin}/upyog-ui/employee/payment/collect/${null==e||null===(u=e.redirectionUrll)||void 0===u?void 0:u.pathname}`)}}else if(null!=e&&e.redirectionUrl){var c,s;d.push({pathname:null===(c=e.redirectionUrl)||void 0===c?void 0:c.pathname,state:{...null===(s=e.redirectionUrl)||void 0===s?void 0:s.state}})}else h(!0);E(e),f(!1)},setDisplayMenu:f,businessService:x,forcedActionPrefix:F,ActionBarStyle:U,MenuStyle:j,applicationDetails:T})))};var mi=l.memo(()=>{var e,o,a,u,c,s,d,p,f,m,E,_,h,g;const{t:y}=i.useTranslation(),{data:S}=Digit.Hooks.useStore.getInitData(),b=Digit.ULBService.getCurrentTenantId(),{tenants:T}=S||{},{id:A}=r.useParams(),[C,D]=n.useState(null),[N,P]=n.useState({}),[I,O]=n.useState(!1),[w,x]=n.useState(!1),[L,M]=n.useState("ptr");r.useHistory();let k=!1;window.location.href.includes("applicationsearch")&&(k=!0),sessionStorage.setItem("applicationNoinAppDetails",A);const{isLoading:F,data:B}=Digit.Hooks.ptr.usePtrApplicationDetail(y,b,A),{mutate:U}=Digit.Hooks.ptr.usePTRApplicationAction(b);let j=Digit.Hooks.useWorkflowDetails({tenantId:(null==B||null===(e=B.applicationData)||void 0===e?void 0:e.tenantId)||b,id:null==B||null===(o=B.applicationData)||void 0===o||null===(a=o.applicationData)||void 0===a?void 0:a.applicationNumber,moduleCode:L,role:"PTR_CEMP"});var H,W;Digit.Hooks.ptr.usePTRSearch({tenantId:b,filters:{applicationNumber:A,audit:!0}}),n.useEffect(()=>{B&&P(v.cloneDeep(B))},[B]),n.useEffect(()=>{var e,t,n;null==j||null===(e=j.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==j||null===(t=j.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===L||M(null==j||null===(n=j.data)||void 0===n?void 0:n.applicationBusinessService)},[j.data]),!Digit.UserService.hasAccess(["PTR_CEMP"])||"ptr"!==(null==j||null===(u=j.data)||void 0===u?void 0:u.applicationBusinessService)||null==j||null===(c=j.data)||void 0===c||null===(s=c.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d||!d.find(e=>"PAY"===e.action)||(j.data.actionState.nextActions=null==j||null===(H=j.data)||void 0===H||null===(W=H.actionState)||void 0===W?void 0:W.nextActions.map(e=>{var t,n;return"PAY"===e.action?{action:"PAY",forcedName:"WF_PAY_APPLICATION",redirectionUrl:{pathname:"/upyog-ui/employee/payment/collect/pet-services/"+(null==N||null===(t=N.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let z=[{order:1,label:y("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==N?void 0:N.applicationData,t=T.find(t=>t.code===e.tenantId);return Promise.resolve(R(e.applicationData,t,y)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:$,isLoading:V}=Digit.Hooks.useRecieptSearch({tenantId:b,businessService:"pet-services",consumerCodes:null==N||null===(p=N.applicationData)||void 0===p||null===(f=p.applicationData)||void 0===f?void 0:f.applicationNumber,isEmployee:!1},{enabled:!(null==N||null===(m=N.applicationData)||void 0===m||null===(E=m.applicationData)||void 0===E||!E.applicationNumber)});return $&&(null==$?void 0:$.Payments.length)>0&&0==V&&z.push({label:y("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...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==$||null===(e=$.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==$?void 0:$.Payments[0]})}}),$&&(null==$?void 0:$.Payments.length)>0&&0==V&&z.push({label:y("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(b,{PetRegistrationApplications:[null==B||null===(e=B.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(b,{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"}},y("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"}},z&&z.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>O(!I),displayOptions:I,options:z,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})))),l.createElement(fi,{isAction:k,applicationDetails:null==N?void 0:N.applicationData,isLoading:F,isDataLoading:F,applicationData:null==N||null===(_=N.applicationData)||void 0===_?void 0:_.applicationData,mutate:U,workflowDetails:j,businessService:L,moduleCode:"pet-services",showToast:C,setShowToast:D,closeToast:()=>{D(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}),"Expired"==(null==N||null===(h=N.applicationData)||void 0===h||null===(g=h.applicationData)||void 0===g?void 0:g.status)&&l.createElement(r.Link,{to:"/upyog-ui/employee/ptr/petservice/revised-application"},l.createElement(t.SubmitBar,{style:{marginBottom:"5px"},label:"Renewal"})))});const Ei={PTRCheckPage:e=>{var r,o,a,u,c,d;let{onSubmit:p,value:v={}}=e;const{t:m}=i.useTranslation(),{address:E,pets:_,isEditPET:h,isUpdatePET:g,ownerss:y}=v,S=h||g?"edit-application":"new-application",[b,T]=n.useState(!1);return l.createElement(l.Fragment,null,l.createElement(s,{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==y?void 0:y.applicantName)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/owners`})}),l.createElement(t.Row,{label:m("PTR_FATHER_HUSBAND_NAME"),text:""+m(f(null==y?void 0:y.fatherName)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/owners`})}),l.createElement(t.Row,{label:m("PTR_MOBILE_NUMBER"),text:""+m(f(null==y?void 0:y.mobileNumber)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/owners`})}),l.createElement(t.Row,{label:m("PTR_EMAIL_ID"),text:""+m(f(null==y?void 0:y.emailId)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/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===(r=_.petType)||void 0===r?void 0:r.value)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_SEARCH_BREED_TYPE"),text:""+m(f(null==_||null===(o=_.breedType)||void 0===o?void 0:o.value)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_PET_NAME"),text:""+m(f(null==_?void 0:_.petName)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_DOCTOR_NAME"),text:""+m(f(null==_?void 0:_.doctorName)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_CLINIC_NAME"),text:""+m(f(null==_?void 0:_.clinicName)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_VACCINATED_DATE"),text:""+m(f(null==_?void 0:_.lastVaccineDate)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_PET_AGE"),text:""+m(f((null==_?void 0:_.petAge)+" Months")),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_PET_SEX"),text:""+m(f(null==_||null===(a=_.petGender)||void 0===a?void 0:a.name)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_IDENTIFICATION_MARK"),text:""+m(f(null==_?void 0:_.identificationMark)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/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(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/pet-details`})}),l.createElement(t.Row,{label:m("PTR_VACCINATION_NUMBER"),text:""+m(f(null==_?void 0:_.vaccinationNumber)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/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(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/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(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/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(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/address`})}),l.createElement(t.Row,{label:m("PTR_STREET_NAME"),text:""+m(f(null==E?void 0:E.streetName)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/address`})}),l.createElement(t.Row,{label:m("PTR_ADDRESS_LINE1"),text:""+m(f(null==E?void 0:E.addressline1)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/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(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/address`})}),l.createElement(t.Row,{label:m("PTR_ADDRESS_PINCODE"),text:""+m(f(null==E?void 0:E.pincode)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/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(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/address`})}),l.createElement(t.Row,{label:m("PTR_LOCALITY"),text:""+m(f(null==E||null===(d=E.locality)||void 0===d?void 0:d.i18nKey)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/address`})}),l.createElement(t.Row,{label:m("PTR_LANDMARK"),text:""+m(f(null==E?void 0:E.landmark)),actionButton:l.createElement(C,{jumpTo:`/upyog-ui/citizen/ptr/petservice/${S}/address`})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:m("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{T(!b)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:m("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:p,disabled:!b})))},PTRAcknowledgement:e=>{var o,a;let{data:u,onSuccess:c}=e;const{t:s}=i.useTranslation(),d=Digit.ULBService.getCitizenCurrentTenant(!0),p=Digit.UserService.getUser().info,v=Digit.Hooks.ptr.usePTRCreateAPI(null===(o=u.address)||void 0===o||null===(a=o.city)||void 0===a?void 0:a.code),{data:f}=Digit.Hooks.useStore.getInitData(),{tenants:m}=f||{};return n.useEffect(()=>{try{u.tenantId=d;let e=(e=>{var t,n,l,i,r,o;return{PetRegistrationApplications:[{tenantId:(e=(e=>{var t,n,l,i;let{pets:r}=e,o={petType:null==r||null===(t=r.petType)||void 0===t?void 0:t.value,breedType:null==r||null===(n=r.breedType)||void 0===n?void 0:n.value,petGender:null==r||null===(l=r.petGender)||void 0===l?void 0:l.code,birthDate:null!=r&&r.birthDate?E(null==r?void 0:r.birthDate):null,adoptionDate:null!=r&&r.adoptionDate?E(null==r?void 0:r.adoptionDate):null,identificationMark:null==r?void 0:r.identificationMark,petColor:null==r||null===(i=r.petColor)||void 0===i?void 0:i.colourCode,clinicName:null==r?void 0:r.clinicName,petName:null==r?void 0:r.petName,doctorName:null==r?void 0:r.doctorName,lastVaccineDate:null==r?void 0:r.lastVaccineDate,petAge:null==r?void 0:r.petAge,vaccinationNumber:null==r?void 0:r.vaccinationNumber};return e.pets=o,e})(e=(e=>{var t,n,l;let{address:i}=e,r={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=r,e})(e=(e=>{let{ownerss:t}=e,n={...t};return e.ownerss=n,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===(r=e)||void 0===r||null===(o=r.propertyDetails)||void 0===o?void 0:o.propertyId,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}}]}})(u);v.mutate(e,{onSuccess:c})}catch(e){}},[]),v.isLoading||v.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(O,{t:s,data:v.data,isSuccess:v.isSuccess,isLoading:v.isIdle||v.isLoading}),l.createElement(t.StatusTable,null,v.isSuccess&&l.createElement(t.Row,{rowContainerStyle:I,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),v.isSuccess&&l.createElement(t.SubmitBar,{label:s("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=v.data;let t=e&&e[0]||{};const n=m.find(e=>e.code===t.tenantId);return Promise.resolve(R({...t},n,s)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(r.Link,"CITIZEN"===(null==p?void 0:p.type)?{to:"/upyog-ui/citizen"}:{to:"/upyog-ui/employee"},l.createElement(t.LinkButton,{label:s("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:S,PTRNewApplication:e=>{var n,o,u,c;const s=a.useQueryClient(),d=r.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:v}=r.useLocation(),f=r.useHistory();Digit.ULBService.getStateId();let m=[];const[E,_,h]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:y,isLoading:S}=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",v.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const T=Digit.ULBService.getCitizenCurrentTenant(!0),{data:A}=Digit.Hooks.ptr.usePTRSearch({tenantId:T,filters:{applicationNumber:b}});let C=null==A?void 0:A.PetRegistrationApplications[0];function D(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=E.owners||[];n[l]=t,_({...E,[e]:[...n]})}else if("units"===e){let e=E.units||[];e=t,_({...E,units:e})}else _({...E,[e]:{...E[e],...t}});((e,t,n,l)=>{let i,r=v.split("/").pop(),o=r.charAt(r.length-1),a=!1;Number(parseInt(r))||"0"==r||"-1"==r?"-1"==r||"-2"==r?(r=v.slice(0,-3),r=r.split("/").pop(),a=!0):(r=v.slice(0,-2),r=r.split("/").pop(),a=!0):a=!1,isNaN(o)||(a=!0);let{nextStep:u={}}=m.find(e=>e.route===(r||"0")),c=f.push;if(e&&(c=f.replace),n&&(u=l),null===u)return c(d.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?`${d.path}/${u}/${t}`:`${d.path}/${u}`,c(i)})(n,l,i,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(h(),s.invalidateQueries("PTR_CREATE_PET"));const N=()=>{},R=()=>{};if(S)return l.createElement(t.Loader,null);y=y||g,y.forEach(e=>{m=m.concat(e.body.filter(e=>!e.hideInCitizen))}),m.indexRoute="info";const P=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRCheckPage"),I=null===(u=Digit)||void 0===u||null===(c=u.ComponentRegistryService)||void 0===c?void 0:c.getComponent("PTRAcknowledgement");return l.createElement(r.Switch,null,m.map((e,t)=>{const{component:n,texts:i,inputs:o,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(r.Route,{path:`${d.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:i,inputs:o,key:a},onSelect:D,onSkip:N,t:p,formData:E,onAdd:R,renewApplication:v.includes("new-application")?{}:C}))}),l.createElement(r.Route,{path:d.path+"/check"},l.createElement(P,{onSubmit:function(){try{return f.push(d.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(r.Route,{path:d.path+"/acknowledgement"},l.createElement(I,{data:E,onSuccess:()=>{h(),s.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"])}})),l.createElement(r.Route,null,l.createElement(r.Redirect,{to:`${d.path}/${m.indexRoute}`})))},ApplicationDetails:mi,PTRMyApplications:()=>{const{t:e}=i.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),o=Digit.UserService.getUser().info;let a,u,c=window.location.href.split("/").pop();isNaN(parseInt(c))?a=4:(u=c,a=parseInt(c)+50);let s=isNaN(parseInt(c))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",mobileNumber:null==o?void 0:o.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 f=(null==v?void 0:v.length)>0?null==v?void 0:v.map(e=>null==e?void 0:e.applicationNumber):[],m={tenantId:n,referenceIds:f};const{isLoading:E,data:_}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:m}},{filters:{serviceSearchArgs:m},enabled:(null==f?void 0:f.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(w,{application:e,tenantId:null==o?void 0:o.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(r.Link,{to:"/upyog-ui/citizen/ptr/petservice/my-application/"+a},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(r.Link,{to:"/upyog-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,o,a,u,c,s,d,p,v,f,E,_,h,g,y,S,T,A,C,D;const{t:N}=i.useTranslation(),{acknowledgementIds:P,tenantId:I}=r.useParams(),[O,w]=n.useState(!1),[x,L]=n.useState(!1),[M,k]=n.useState(null),{data:F}=Digit.Hooks.useStore.getInitData(),{tenants:B}=F||{},{isLoading:U,data:j}=Digit.Hooks.ptr.usePTRSearch({tenantId:I,filters:{applicationNumber:P}}),[H,W]=n.useState(null),z=Te(j,"PetRegistrationApplications",[]),$=Te(j,"PetRegistrationApplications[0].applicationNumber",[]);let V=z&&z.length>0&&z[0]||{};const K=V;sessionStorage.setItem("ptr-pet",JSON.stringify(K));const[Y,q]=n.useState(!1);n.useEffect(()=>{!function(){try{q(!0),Promise.resolve(Digit.PaymentService.fetchBill(I,{businessService:"pet-services",consumerCode:P})).then(function(e){W(e),q(!1)})}catch(e){return Promise.reject(e)}}()},[I,P]);const{isLoading:G}=Digit.Hooks.ptr.usePTRSearch({tenantId:I,filters:{applicationNumber:$,audit:!0}},{enabled:!0}),{data:Z,isLoading:X}=Digit.Hooks.useRecieptSearch({tenantId:I,businessService:"pet-services",consumerCodes:P,isEmployee:!1},{enabled:!!P});if(V.workflow||(V.workflow={id:null,tenantId:I,businessService:"pet-services",businessId:null==K?void 0:K.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),U||G)return l.createElement(t.Loader,null);let Q=[];return Q.push({label:N("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=K||{},t=B.find(t=>t.code===e.tenantId);return Promise.resolve(R({...e},t,N)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&Q.push({label:N("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n,...l}=e;try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[{...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==Z||null===(e=Z.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==Z?void 0:Z.Payments[0]})}}),Z&&(null==Z?void 0:Z.Payments.length)>0&&0==X&&Q.push({label:N("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(I,{PetRegistrationApplications:[null==j||null===(e=j.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(I,{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"}},N("PTR_PET_APPLICATION_DETAILS")),Q&&Q.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>w(!O),displayOptions:O,options:Q})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("PTR_APPLICATION_NO_LABEL"),text:null==V?void 0:V.applicationNumber})),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("PTR_VALIDITY_DATE"),text:(J=null==V?void 0:V.validityDate,J?new Date(1e3*J).getDate()+"/"+(new Date(1e3*J).getMonth()+1)+"/"+new Date(1e3*J).getFullYear().toString():"NA")})),(null==V?void 0:V.petToken)&&(null==V?void 0:V.petToken.length)>0&&l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("PTR_TOKEN"),text:null==V?void 0:V.petToken})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},N("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("PTR_PINCODE"),text:(null==V||null===(e=V.address)||void 0===e?void 0:e.pincode)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_CITY"),text:(null==V||null===(o=V.address)||void 0===o?void 0:o.city)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_STREET_NAME"),text:(null==V||null===(a=V.address)||void 0===a?void 0:a.street)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_HOUSE_NO"),text:(null==V||null===(u=V.address)||void 0===u?void 0:u.doorNo)||N("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},N("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("PTR_APPLICANT_NAME"),text:(null==V?void 0:V.applicantName)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_FATHER/HUSBAND_NAME"),text:(null==V?void 0:V.fatherName)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_APPLICANT_MOBILE_NO"),text:(null==V?void 0:V.mobileNumber)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_APPLICANT_EMAILID"),text:(null==V?void 0:V.emailId)||N("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},N("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:N("PTR_PET_TYPE"),text:(null==V||null===(c=V.petDetails)||void 0===c?void 0:c.petType)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_BREED_TYPE"),text:(null==V||null===(s=V.petDetails)||void 0===s?void 0:s.breedType)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_DOCTOR_NAME"),text:(null==V||null===(d=V.petDetails)||void 0===d?void 0:d.doctorName)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_CLINIC_NAME"),text:(null==V||null===(p=V.petDetails)||void 0===p?void 0:p.clinicName)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_VACCINATED_DATE"),text:(null==V||null===(v=V.petDetails)||void 0===v?void 0:v.lastVaccineDate)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_VACCINATION_NUMBER"),text:(null==V||null===(f=V.petDetails)||void 0===f?void 0:f.vaccinationNumber)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_PET_NAME"),text:(null==V||null===(E=V.petDetails)||void 0===E?void 0:E.petName)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_PET_AGE"),text:(null==V||null===(_=V.petDetails)||void 0===_?void 0:_.petAge)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_PET_SEX"),text:(null==V||null===(h=V.petDetails)||void 0===h?void 0:h.petGender)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_IDENTIFICATION_MARK"),text:(null==V||null===(g=V.petDetails)||void 0===g?void 0:g.identificationMark)||N("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:N("PTR_VACCINATION_NUMBER"),text:(null==V||null===(y=V.petDetails)||void 0===y?void 0:y.vaccinationNumber)||N("CS_NA")}),null!=V&&null!==(S=V.petDetails)&&void 0!==S&&S.birthDate?(null==V||null===(T=V.petDetails)||void 0===T?void 0:T.birthDate)&&l.createElement(t.Row,{className:"border-none",label:N("PTR_BIRTH"),text:m(null==V||null===(A=V.petDetails)||void 0===A?void 0:A.birthDate)||N("CS_NA")}):(null==V||null===(C=V.petDetails)||void 0===C?void 0:C.adoptionDate)&&l.createElement(t.Row,{className:"border-none",label:N("PTR_ADOPTION"),text:m(null==V||null===(D=V.petDetails)||void 0===D?void 0:D.adoptionDate)||N("CS_NA")})),l.createElement(b,{application:K,id:null==K?void 0:K.applicationNumber,userType:"citizen"}),M&&l.createElement(t.Toast,{error:M.key,label:N(M.label),style:{bottom:"0px"},onClose:()=>{k(null)}})),x&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:L,setShowToast:k,data:j})));var J},PTRCreatePet:e=>{var n,o,u,c;const s=a.useQueryClient(),d=r.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:v}=r.useLocation(),f=r.useHistory();Digit.ULBService.getStateId();let m=[];const[E,_,h]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:y,isLoading:S}=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",v.includes("new-application")?"NEWAPPLICATION":"RENEWAPPLICATION");const T=Digit.ULBService.getCitizenCurrentTenant(!0),{data:A}=Digit.Hooks.ptr.usePTRSearch({tenantId:T,filters:{applicationNumber:b}});let C=null==A?void 0:A.PetRegistrationApplications[0];function D(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=E.owners||[];n[l]=t,_({...E,[e]:[...n]})}else if("units"===e){let e=E.units||[];e=t,_({...E,units:e})}else _({...E,[e]:{...E[e],...t}});((e,t,n,l)=>{let i,r=v.split("/").pop(),o=r.charAt(r.length-1),a=!1;Number(parseInt(r))||"0"==r||"-1"==r?"-1"==r||"-2"==r?(r=v.slice(0,-3),r=r.split("/").pop(),a=!0):(r=v.slice(0,-2),r=r.split("/").pop(),a=!0):a=!1,isNaN(o)||(a=!0);let{nextStep:u={}}=m.find(e=>e.route===(r||"0")),c=f.push;if(e&&(c=f.replace),n&&(u=l),null===u)return c(d.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?`${d.path}/${u}/${t}`:`${d.path}/${u}`,c(i)})(n,l,i,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(h(),s.invalidateQueries("PTR_CREATE_PET"));const N=()=>{},R=()=>{};if(S)return l.createElement(t.Loader,null);y=y||g,y.forEach(e=>{m=m.concat(e.body.filter(e=>!e.hideInCitizen))}),m.indexRoute="info";const P=null===(n=Digit)||void 0===n||null===(o=n.ComponentRegistryService)||void 0===o?void 0:o.getComponent("PTRCheckPage"),I=null===(u=Digit)||void 0===u||null===(c=u.ComponentRegistryService)||void 0===c?void 0:c.getComponent("PTRAcknowledgement");return l.createElement(r.Switch,null,m.map((e,t)=>{const{component:n,texts:i,inputs:o,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(r.Route,{path:`${d.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:i,inputs:o,key:a},onSelect:D,onSkip:N,t:p,formData:E,onAdd:R,renewApplication:v.includes("new-application")?{}:C}))}),l.createElement(r.Route,{path:d.path+"/check"},l.createElement(P,{onSubmit:function(){try{return f.push(d.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(r.Route,{path:d.path+"/acknowledgement"},l.createElement(I,{data:E,onSuccess:()=>{h(),s.invalidateQueries("PTR_CREATE_PET"),sessionStorage.removeItem(["applicationType","petId"]),sessionStorage.removeItem("petToken")}})),l.createElement(r.Route,null,l.createElement(r.Redirect,{to:`${d.path}/${m.indexRoute}`})))},PTRCitizenDetails:e=>{var i,r,o,a,c;let{t:d,config:p,onSelect:v,userType:f,formData:m,renewApplication:E}=e;const _=Digit.UserService.getUser().info,h={width:"EMPLOYEE"===_.type?"50%":"86%"};let g={};const[y,S]=n.useState((null==E?void 0:E.applicantName)||("EMPLOYEE"===_.type?"":null==_?void 0:_.name)||(null==m||null===(i=m.ownerss)||void 0===i?void 0:i.applicantName)||""),[b,T]=n.useState((null==E?void 0:E.emailId)||(null==m||null===(r=m.ownerss)||void 0===r?void 0:r.emailId)||""),[A,C]=n.useState((null==E?void 0:E.mobileNumber)||("EMPLOYEE"===_.type?"":null==_?void 0:_.mobileNumber)||(null==m||null===(o=m.ownerss)||void 0===o?void 0:o.mobileNumber)||""),[D,N]=n.useState((null==m||null===(a=m.ownerss)||void 0===a?void 0:a.alternateNumber)||""),[R,P]=n.useState((null==E?void 0:E.fatherName)||(null==m||null===(c=m.ownerss)||void 0===c?void 0:c.fatherName)||""),I=()=>{let e,t=m.ownerss;"citizen"===f?(e={...t,applicantName:y,mobileNumber:A,alternateNumber:D,fatherName:R,emailId:b},v(p.key,{...m[p.key],...e},!1)):(e={...t,applicantName:y,mobileNumber:A,alternateNumber:D,fatherName:R,emailId:b},v(p.key,e,!1))};return n.useEffect(()=>{"citizen"===f&&I()},[y,A,R,b]),l.createElement(l.Fragment,null,l.createElement(s,{currentStep:1}),l.createElement(t.FormStep,{config:p,onSelect:I,onSkip:()=>v(),t:d,isDisabled:!(y&&A&&R&&b)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+d("PTR_APPLICANT_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:y,style:h,onChange:function(e){S(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:d("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("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:d("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+d("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:d("CORE_COMMON_APPLICANT_MOBILE_NUMBER_INVALID")}),l.createElement(t.CardLabel,null,""+d("PTR_FATHER_HUSBAND_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",style:h,value:R,onChange:function(e){P(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"tel",title:d("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("PTR_EMAIL_ID")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:d,type:"email",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:b,style:h,onChange:function(e){T(e.target.value)},ValidationRequired:!0},g={isRequired:!0,pattern:"^[a-zA-Z0-9._%+-]+@[a-zA-Z]+\\.[a-zA-Z]{3,4}$",type:"email",title:d("PT_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var i,r,a,c,d,p,v,f,E,_,h,g,y,S,b,T,A,C,D,N,R,P,I,O,w,x,L,M,k,F,B,U,j;let{t:H,config:W,onSelect:z,userType:$,formData:V,renewApplication:K}=e;const Y=Digit.UserService.getUser().info,q=e=>e?{i18nKey:e,code:e,value:e}:null;let G={},{data:Z}=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 X={width:"EMPLOYEE"===Y.type?"50%":"86%"},[Q,J]=n.useState(q(null==K||null===(i=K.petDetails)||void 0===i?void 0:i.petType)||(null==V||null===(r=V.pets)||void 0===r?void 0:r.petType)||""),[ee,te]=n.useState(q(null==K||null===(a=K.petDetails)||void 0===a?void 0:a.breedType)||(null==V||null===(c=V.pets)||void 0===c?void 0:c.breedType)||""),[ne,le]=n.useState(q(null==K||null===(d=K.petDetails)||void 0===d?void 0:d.petGender)||(null==V||null===(p=V.pets)||void 0===p?void 0:p.petGender)||""),[ie,re]=n.useState((null==K||null===(v=K.petDetails)||void 0===v?void 0:v.petName)||(null==V||null===(f=V.pets)||void 0===f?void 0:f.petName)||""),[oe,ae]=n.useState((null==K||null===(E=K.petDetails)||void 0===E?void 0:E.petAge)||(null==V||null===(_=V.pets)||void 0===_?void 0:_.petAge)||""),[ue,ce]=n.useState((null==K||null===(h=K.petDetails)||void 0===h?void 0:h.petName)||(null==V||null===(g=V.pets)||void 0===g?void 0:g.doctorName)||""),[se,de]=n.useState((null==K||null===(y=K.petDetails)||void 0===y?void 0:y.clinicName)||(null==V||null===(S=V.pets)||void 0===S?void 0:S.clinicName)||""),[pe,ve]=n.useState((null==K||null===(b=K.petDetails)||void 0===b?void 0:b.vaccinationNumber)||(null==V||null===(T=V.pets)||void 0===T?void 0:T.vaccinationNumber)||""),[fe,me]=n.useState((null==K||null===(A=K.petDetails)||void 0===A?void 0:A.lastVaccineDate)||(null==V||null===(C=V.pets)||void 0===C?void 0:C.lastVaccineDate)||""),[Ee,_e]=n.useState((null==V||null===(D=V.pets)||void 0===D?void 0:D.petColor)||""),[he,ge]=n.useState((null==K||null===(N=K.petDetails)||void 0===N?void 0:N.identificationMark)||(null==V||null===(R=V.pets)||void 0===R?void 0:R.identificationMark)||""),[ye,Se]=n.useState(q(null!=K&&null!==(P=K.petDetails)&&void 0!==P&&P.birthDate||null!=K&&null!==(I=K.petDetails)&&void 0!==I&&I.adoptionDate?null!=K&&null!==(O=K.petDetails)&&void 0!==O&&O.birthDate?"Birth":"Adoption":null)||q(null!=V&&null!==(w=V.pets)&&void 0!==w&&w.birthDate||null!=V&&null!==(x=V.pets)&&void 0!==x&&x.adoptionDate?null!=V&&null!==(L=V.pets)&&void 0!==L&&L.birthDate?"Birth":"Adoption":null)||[{i18nKey:"",code:""}]),[be,Te]=n.useState(m(null==K||null===(M=K.petDetails)||void 0===M?void 0:M.birthDate)||(null==V||null===(k=V.pets)||void 0===k?void 0:k.birthDate)||""),[Ae,Ce]=n.useState(m(null==K||null===(F=K.petDetails)||void 0===F?void 0:F.adoptionDate)||(null==V||null===(B=V.pets)||void 0===B?void 0:B.adoptionDate)||""),De=Digit.ULBService.getStateId(),{data:Ne}=Digit.Hooks.ptr.usePTRPetMDMS(De,"PetService","PetType"),{data:Re}=Digit.Hooks.ptr.useBreedTypeMDMS(De,"PetService","BreedType");let Pe=[],Ie=[];Ne&&Ne.map(e=>{Pe.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:Oe}=o.useForm();Re&&Re.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!=K&&K.petDetails&&_e(null==Z||null===(e=Z.filter(e=>{var t;return(null==e?void 0:e.colourCode)===(null==K||null===(t=K.petDetails)||void 0===t?void 0:t.petColor)}))||void 0===e?void 0:e[0])},[Z]);const{data:we}=Digit.Hooks.ptr.usePTRGenderMDMS(De,"common-masters","GenderType");let xe=[];we&&we.map(e=>{"TRANSGENDER"!==e.code&&xe.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{if(be){const[e,t,n]=be.split("-").map(Number),l=new Date(e,t-1,n),i=new Date;let r=i.getFullYear()-l.getFullYear(),o=i.getMonth()-l.getMonth();o<0&&(r-=1,o+=12),ae(12*r+o)}},[be]);const Le=()=>{let e;e={...V.pets,petType:Q,breedType:ee,petGender:ne,petName:ie,petAge:oe,doctorName:ue,clinicName:se,lastVaccineDate:fe,vaccinationNumber:pe,birthDate:be,adoptionDate:Ae,identificationMark:he,petColor:Ee},z(W.key,e,!1)};return n.useEffect(()=>{"citizen"===$&&Le()},[Q,ee,ne,ie,oe,ue,fe,be,Ae,he,Ee]),l.createElement(l.Fragment,null,l.createElement(s,{currentStep:2}),l.createElement(t.FormStep,{config:W,onSelect:Le,onSkip:()=>z(),t:H,isDisabled:!(Q&&ee&&ne&&ie&&oe&&ue&&se&&fe&&pe&&(!be&&Ae||!Ae&&be))},l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("PTR_SEARCH_PET_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"petType",defaultValue:Q,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Q,select:J,option:Pe,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_SEARCH_BREED_TYPE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"breedType",defaultValue:ee,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ee,select:te,option:Ie,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_PET_SEX")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"petGender",defaultValue:ne,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:ne,select:le,option:xe,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_PET_COLOR")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(o.Controller,{control:Oe,name:"petColor",defaultValue:Ee,rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:Ee,select:_e,optionCardStyles:{overflowY:"auto",maxHeight:"300px"},option:Z,optionKey:"i18nKey",t:H,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+H("PTR_SELECT_BIRTH_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.RadioButtons,{t:H,options:[{i18nKey:"Birth",code:"Birth"},{i18nKey:"Adoption",code:"Adoption"}],optionsKey:"code",name:"selectBirthAdoption",value:ye,selectedOption:ye,innerStyles:{display:"inline-block",marginLeft:"20px",paddingBottom:"2px",marginBottom:"2px"},onSelect:Se,isDependent:!0}),("Birth"===(null==ye?void 0:ye.code)||(null==K||null===(U=K.petDetails)||void 0===U?void 0:U.birth))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("PTR_BIRTH")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"birthDate",value:be,onChange:function(e){Ce(null),Te(e.target.value)},style:X,max:(new Date).toISOString().split("T")[0],rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||H("ERR_DEFAULT_INPUT_FIELD_MSG")}})),("Adoption"===(null==ye?void 0:ye.code)||(null==K||null===(j=K.petDetails)||void 0===j?void 0:j.adoption))&&l.createElement("div",null,l.createElement(t.CardLabel,null,""+H("PTR_ADOPTION")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"adoptionDate",value:Ae,onChange:function(e){Te(null),Ce(e.target.value)},style:X,max:(new Date).toISOString().split("T")[0],rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||H("ERR_DEFAULT_INPUT_FIELD_MSG")}})),l.createElement(t.CardLabel,null,""+H("PTR_PET_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:ie,onChange:function(e){re(e.target.value)},style:X,ValidationRequired:!1},G={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:H("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("PTR_IDENTIFICATION_MARK")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"identificationMark",value:he,onChange:function(e){ge(e.target.value)},style:X,ValidationRequired:!1}),l.createElement(t.CardLabel,null,H("PTR_PET_AGE")+" (in months)"," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:oe,onChange:function(e){ae(e.target.value)},style:X,placeholder:"in months",ValidationRequired:!0},G={isRequired:!0,pattern:"^(?:[1-9][0-9]?|[1-3][0-9]{2}|400)$",type:"tel",title:H("PT_NAME_ERROR_MESSAGE")})),null!=oe&&oe>=0&&l.createElement("div",null,Math.floor(oe/12),"  ",1===Math.floor(oe/12)?"YEAR":"YEARS","  ",oe%12,"  ",oe%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+H("PTR_DOCTOR_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:ue,onChange:function(e){ce(e.target.value)},style:X,ValidationRequired:!1},G={isRequired:!0,pattern:"^[a-zA-Z ]+$",type:"text",title:H("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("PTR_CLINIC_NAME")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,u({t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:se,onChange:function(e){de(e.target.value)},style:X,ValidationRequired:!1},G={isRequired:!0,pattern:"^[a-zA-Z0-9 .,?!'\"-]+$",type:"text",title:H("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+H("PTR_VACCINATED_DATE")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:fe,onChange:function(e){me(e.target.value)},style:X,max:(new Date).toISOString().split("T")[0],rules:{required:H("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||H("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement(t.CardLabel,null,""+H("PTR_VACCINATION_NUMBER")," ",l.createElement("span",{className:"astericColor"},"*")),l.createElement(t.TextInput,{t:H,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:pe,onChange:function(e){ve(e.target.value)},style:X}))))},PTRSelectAddress:e=>{var i,a,c,d,p,v,f,m,E,_,h,g,y,S,b,T,A,C,D,N,R,P,I;let{t:O,config:w,onSelect:x,formData:L,renewApplication:M}=e;const k=e=>e?{i18nKey:e,code:e,value:e}:null,F=Digit.Hooks.ptr.useTenants(),{pathname:B}=r.useLocation();let U={};const{control:j}=o.useForm(),H=Digit.UserService.getUser().info,[W,z]=n.useState((null==M||null===(i=M.address)||void 0===i?void 0:i.pincode)||(null==L||null===(a=L.address)||void 0===a?void 0:a.pincode)||""),[$,V]=n.useState((null==L||null===(c=L.address)||void 0===c?void 0:c.city)||k(null==M||null===(d=M.address)||void 0===d?void 0:d.city)||""),[K,Y]=n.useState(k(null==M||null===(p=M.address)||void 0===p?void 0:p.locality)||(null==L||null===(v=L.address)||void 0===v?void 0:v.locality)||""),[q,G]=n.useState((null==M||null===(f=M.address)||void 0===f?void 0:f.streetName)||(null==M||null===(m=M.address)||void 0===m?void 0:m.street)||(null==L||null===(E=L.address)||void 0===E?void 0:E.streetName)||""),[Z,X]=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==L||null===(g=L.address)||void 0===g?void 0:g.houseNo)||""),[Q,J]=n.useState((null==M||null===(y=M.address)||void 0===y?void 0:y.landmark)||(null==L||null===(S=L.address)||void 0===S?void 0:S.landmark)||""),[ee,te]=n.useState((null==M||null===(b=M.address)||void 0===b?void 0:b.houseName)||(null==M||null===(T=M.address)||void 0===T?void 0:T.buildingName)||(null==L||null===(A=L.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==L||null===(N=L.address)||void 0===N?void 0:N.addressline1)||""),[ie,re]=n.useState((null==M||null===(R=M.address)||void 0===R?void 0:R.addressline2)||(null==M||null===(P=M.address)||void 0===P?void 0:P.addressLine2)||(null==L||null===(I=L.address)||void 0===I?void 0:I.addressline2)||""),{data:oe}=Digit.Hooks.useBoundaryLocalities(null==$?void 0:$.code,"revenue",{enabled:!!$},O);let ae=[];return oe&&oe.map((e,t)=>{ae.push({i18nKey:e.i18nkey,code:e.code,label:e.label})}),l.createElement(l.Fragment,null,l.createElement(s,{currentStep:3}),l.createElement(t.FormStep,{config:w,onSelect:()=>{let e={...L.address,pincode:W,city:$,locality:K,streetName:q,houseNo:Z,landmark:Q,houseName:ee,addressline1:ne,addressline2:ie};x(w.key,{...L[w.key],...e},!1)},onSkip:()=>x(),t:O,isDisabled:!(W&&$&&q&&Z&&Q&&(B.includes("revised")||B.includes("renew")||K)&&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:Z,placeholder:"Enter House No",onChange:e=>{X(e.target.value)},style:{width:"EMPLOYEE"===H.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"===H.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:q,placeholder:"Enter Street Name",onChange:e=>{G(e.target.value)},style:{width:"EMPLOYEE"===H.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"===H.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=>{re(e.target.value)},style:{width:"EMPLOYEE"===H.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(o.Controller,{control:j,name:"city",defaultValue:$,rules:{required:O("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:$,select:V,option:F,optionKey:"i18nKey",t:O,placeholder:"Select"})}),l.createElement(t.CardLabel,null,""+O("PTR_LOCALITY")," ",l.createElement("span",{className:"check-page-link-button"},"*")),l.createElement(o.Controller,{control:j,name:"locality",defaultValue:K,rules:{required:O("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:K,select:Y,option:ae,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"===H.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,o,a;let{t:u,config:c,onSelect:d,formData:p,renewApplication:v}=e;const[f,m]=n.useState((null==p||null===(i=p.documents)||void 0===i?void 0:i.documents)||[]),[E,_]=n.useState(null),[h,g]=n.useState(!0),[S,b]=n.useState(!1),{pathname:T}=r.useLocation(),A=Digit.UserService.getUser().info,C=Digit.ULBService.getStateId(),{isLoading:D,data:N}=Digit.Hooks.ptr.usePetMDMS(C,"PetService","Documents"),R=e=>{if(e.length>0){const t={documentType:"PET.PETPHOTO",filestoreId:e[0],documentUid:e[0]};m(e=>[...e.filter(e=>"PET.PETPHOTO"!==e.documentType),t])}};return n.useEffect(()=>{var e,t;let n=0;null==N||null===(e=N.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)?g(!0):g(!1)},[f,S]),l.createElement("div",null,l.createElement(s,{currentStep:4}),D?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:u,config:c,onSelect:()=>{let e={...p.documents,documents:f};d(c.key,e)},onSkip:()=>d(),isDisabled:!h},null==N||null===(o=N.PetService)||void 0===o||null===(a=o.Documents)||void 0===a?void 0:a.map((e,n)=>"PET.PETPHOTO"!==(null==e?void 0:e.code)||T.includes("revised-application")?l.createElement(y,{key:n,document:e,t:u,error:E,setError:_,setDocuments:m,documents:f,setCheckRequiredFields:b,renewApplication:v,user:A}):l.createElement("div",{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller",style:{display:"inline"}},u("PET_PETPHOTO"),l.createElement("span",{style:{color:"#b0242c"}},u("PET_ONLY_PNG_ALLOWED")," ")),l.createElement("div",{style:{marginLeft:"EMPLOYEE"===(null==A?void 0:A.type)?"37%":""}},l.createElement(t.ImageUploadHandler,{tenantId:C,uploadedImages:f.filter(e=>"PET.PETPHOTO"===e.documentType).map(e=>e.filestoreId),onPhotoChange:R,t:u,error:E,setError:_,maxImages:1})))),E&&l.createElement(t.Toast,{label:E,onClose:()=>_(null),error:!0})))},PTRServiceDoc:e=>{var n;let{t:i,config:r,onSelect:o}=e;Digit.ULBService.getCurrentTenantId();const a=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const{isLoading:u,data:c={}}=Digit.Hooks.ptr.usePetMDMS(a,"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(r.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!=r&&r.isMutation?(e,n)=>{let{code:r,dropdownData:o}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(r)),l.createElement(t.CardText,{className:"primaryColor"},o.map(e=>i(null==e?void 0:e.code)).join(", ")))}:(e,n)=>{let{code:r,dropdownData:o}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(h(r,".","_"))),o.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(h(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("PTR_COMMON_NEXT"),onSubmit:o}))))},PTRWFApplicationTimeline:b,PropertySearch:e=>{var i,r,a,c,s,d,p,v,f;let{t:m,config:E,onSelect:_,userType:h,formData:g,renewApplication:y}=e;const{control:S}=o.useForm(),b=Digit.UserService.getUser().info;let T={};const[A,C]=n.useState((null==y?void 0:y.propertyId)||(null==g||null===(i=g.propertyDetails)||void 0===i?void 0:i.propertyId)||""),[D,N]=n.useState((null==g||null===(r=g.propertyDetails)||void 0===r?void 0:r.buildingName)||""),[R,P]=n.useState((null==g||null===(a=g.propertyDetails)||void 0===a?void 0:a.doorNo)||""),[I,O]=n.useState((null==g||null===(c=g.propertyDetails)||void 0===c?void 0:c.city)||""),[w,x]=n.useState((null==g||null===(s=g.propertyDetails)||void 0===s?void 0:s.street)||""),[L,M]=n.useState((null==g||null===(d=g.propertyDetails)||void 0===d?void 0:d.locality)||""),[k,F]=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)||""),[j,H]=n.useState((null==g||null===(f=g.propertyDetails)||void 0===f?void 0:f.gisCode)||""),[W,z]=n.useState(!1),$=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),V=Digit.ULBService.getStateId(),K=Digit.Hooks.ptr.useTenants(),Y={width:"EMPLOYEE"===b.type?"50%":"86%"},q=e=>e?{i18nKey:e,code:e,value:e}:null;let G=[];K&&K.map(e=>{G.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name,pinCode:""+e.pincode})});const{data:Z}=Digit.Hooks.useBoundaryLocalities($,"revenue",{enabled:!!$},m);let X=[];Z&&Z.map(e=>{X.push({i18nKey:""+e.name,code:""+e.code,value:""+e.name})});const{isLoading:Q,isError:J,data:ee,error:te}=Digit.Hooks.pt.useApplicationDetail(m,V,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,r,o,a,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===(r=i.address)||void 0===r?void 0:r.pincode,f=null==ee||null===(o=ee.applicationData)||void 0===o||null===(a=o.address)||void 0===a?void 0:a.city,m=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&&f&&m&&(P(p),x(d),F(v),O(q(f)),M(q(m)))}z(!1)}},[W,Q,J,ee,te]);const{data:ne}=Digit.Hooks.useCustomMDMS(V,"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===$)}});let le=[];ne&&ne.map(e=>{le.push({i18nKey:""+e.code,code:""+e.code,value:""+e.code})});const ie=()=>{let e;e={...g.propertyDetails,propertyId:A,street:w,buildingName:D,city:I,doorNo:R,locality:L,pincode:k,firestationId:B,gisCode:j},_(E.key,{...g[E.key],...e},!1)};return n.useEffect(()=>{"citizen"===h&&ie()},[A,I,R,w,L,D,k,B,j]),l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:E,onSelect:ie,onSkip:()=>_(),t:m,isDisabled:!I||!L||!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,""+m("NOC_PROPERTY_ID_LABEL")),l.createElement("div",{className:"field-container"},l.createElement(t.TextInput,u({t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"propertyId",value:A,onChange:function(e){C(e.target.value)},style:Y,ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z0-9/-]*$",type:"text",title:m("PT_NAME_ERROR_MESSAGE")})),l.createElement("div",{style:{position:"relative",zIndex:"100",right:"EMPLOYEE"===b.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,""+m("NOC_PROPERTY_DETAILS_BLDG_NAME_LABEL")),l.createElement(t.TextInput,u({t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"buildingName",value:D,onChange:function(e){N(e.target.value)},style:Y,ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z0-9 ]*$",type:"text",title:m("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+m("NOC_PROPERTY_PLOT_NO_LABEL")),l.createElement(t.TextInput,u({t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doorNo",value:R,onChange:function(e){P(e.target.value)},style:Y,ValidationRequired:!1},T={isRequired:!0,pattern:"^[0-9/-]*$",type:"text",title:m("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+m("NOC_PROPERTY_CITY_LABEL")),l.createElement(o.Controller,{control:S,name:"city",defaultValue:I,rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:I,select:O,option:G,optionKey:"i18nKey",placeholder:"Select",t:m})}),l.createElement(t.CardLabel,null,""+m("NOC_PROPERTY_DETAILS_SRT_NAME_LABEL")),l.createElement(t.TextInput,u({t:m,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"street",value:w,defaultValue:w,onChange:function(e){x(e.target.value)},style:Y,ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z]*$",type:"text",title:m("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+m("NOC_PROPERTY_DETAILS_MOHALLA_LABEL")),l.createElement(o.Controller,{control:S,name:"locality",defaultValue:L,rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:L,select:M,option:X,optionKey:"i18nKey",placeholder:"Select",t:m})}),l.createElement(t.CardLabel,null,""+m("NOC_PROPERTY_DETAILS_PIN_LABEL")),l.createElement(t.TextInput,u({t:m,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"pincode",value:k,onChange:function(e){F(e.target.value)},style:Y,ValidationRequired:!1},T={isRequired:!1,pattern:"^[0-9]{0,6}*$",type:"text",title:m("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+m("NOC_PROPERTY_DETAILS_FIRESTATION_LABEL")),l.createElement(o.Controller,{control:S,name:"firestationId",defaultValue:B,rules:{required:m("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:B,select:U,option:le,optionKey:"i18nKey",placeholder:"Select",t:m})}),l.createElement(t.CardLabel,null,""+m("NOC_PROPERTY_DETAILS_GIS_CORD_LABEL")),l.createElement(t.TextInput,u({t:m,type:"textarea",isMandatory:!1,optionKey:"i18nKey",name:"gisCode",value:j,onChange:function(e){H(e.target.value)},style:Y,ValidationRequired:!1},T={isRequired:!1,type:"text",title:m("PT_NAME_ERROR_MESSAGE")})))))}},_i=e=>{let{stateCode:t,userType:i,tenants:o}=e;const{path:a,url:u}=r.useRouteMatch(),c=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:c}),Object.entries(Ei).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PTR_TENANTS",o),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(ke,{path:a,url:u,userType:i}):l.createElement(A,null)},hi=e=>{const{t:r}=i.useTranslation(),[o,a,u]=Digit.Hooks.useSessionStorage("PTR_PET",{});return n.useEffect(()=>{u()},[]),l.createElement(t.CitizenHomeCard,{header:r("ACTION_TEST_PTR"),links:[],Icon:()=>l.createElement(t.PTIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=i.useTranslation(),[r,o]=n.useState("-"),{data:a,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&&o(a)},[c]),!Digit.Utils.ptrAccess())return null;const d=[{count:u?"-":null==r?void 0:r.totalCount,label:e("ES_COMMON_INBOX"),link:"/upyog-ui/employee/ptr/petservice/inbox"},{label:e("PTR_TITLE_NEW_PET_REGISTRATION"),link:"/upyog-ui/employee/ptr/petservice/new-application",role:"PTR_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/upyog-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==r?void 0:r.totalCount,label:e("ES_TITLE_INBOX"),link:"/upyog-ui/employee/ptr/petservice/inbox"}],links:d.filter(e=>!(null!=e&&e.role)||p)};return l.createElement(t.EmployeeModuleCard,v)},PTRModule:_i,PTRLinks:hi,PTR_INBOX_FILTER:e=>l.createElement(Ue,e),PTRInboxTableConfig:e=>({PTR:{inboxColumns:t=>[{Header:e("PTR_APPLICATION_NUMBER"),Cell:e=>{var n,i,o,a;let{row:u}=e;return l.createElement("div",null,l.createElement("span",{className:"link"},l.createElement(r.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===(o=u.original)||void 0===o||null===(a=o.searchData)||void 0===a?void 0:a.applicationNumber)))},mobileCell:e=>{var t;return He(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 He(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 He(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 He(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:r}=t;return je(e(""+(null==r||null===(n=r.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 He(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=hi,exports.PTRModule=_i;