@mseva/digit-ui-module-ptr 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t=require("@mseva/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"),r=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)}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e,t){return e(t={exports:{}},t.exports),t.exports}var d=c(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]",r="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Function]",p="[object GeneratorFunction]",v="[object Map]",m="[object Number]",f="[object Object]",h="[object RegExp]",E="[object Set]",g="[object String]",y="[object Symbol]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",x="[object Uint16Array]",R="[object Uint32Array]",I=/\b__p \+= '';/g,w=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,M=RegExp(L.source),F=RegExp(k.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/[\\^$.*+?()[\]{}|]/g,V=RegExp($.source),q=/^\s+/,G=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\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="["+ce+"]",me="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+me+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+he+")",Te="(?:"+Se+"|"+he+")",Ce="(?:"+ve+"|"+Ee+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,ye,_e].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",ye,_e].join("|")+")"+Ae,Ne="(?:"+[ge+ve+"?",ve,ye,_e,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),xe=RegExp(ve,"g"),Re=RegExp(Ee+"(?="+Ee+")|"+Ne+Ae,"g"),Ie=RegExp([Se+"?"+fe+"+(?:['’](?: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_])",me,De].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Oe=/[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"],ke=-1,Me={};Me[T]=Me[C]=Me[A]=Me[D]=Me[N]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[x]=Me[R]=!0,Me[o]=Me[r]=Me[S]=Me[a]=Me[b]=Me[u]=Me[c]=Me[d]=Me[v]=Me[m]=Me[f]=Me[h]=Me[E]=Me[g]=Me[_]=!1;var Fe={};Fe[o]=Fe[r]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[N]=Fe[v]=Fe[m]=Fe[f]=Fe[h]=Fe[E]=Fe[g]=Fe[y]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[x]=Fe[R]=!0,Fe[c]=Fe[d]=Fe[_]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof s&&s&&s.Object===Object&&s,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),$e=t&&!t.nodeType&&t,Ve=$e&&e&&!e.nodeType&&e,qe=Ve&&Ve.exports===$e,Ge=qe&&je.process,Ke=function(){try{return Ve&&Ve.require&&Ve.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),Ye=Ke&&Ke.isArrayBuffer,Xe=Ke&&Ke.isDate,Ze=Ke&&Ke.isMap,Je=Ke&&Ke.isRegExp,Qe=Ke&&Ke.isSet,et=Ke&&Ke.isTypedArray;function tt(e,t,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 r=e[i];t(l,r,n(r),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 rt(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var r=e[n];t(r,n,e)&&(o[i++]=r)}return o}function at(e,t){return!(null==e||!e.length)&&Et(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 st(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 ct(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=St("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 ht(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 Et(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):ht(e,yt,n)}function gt(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function yt(e){return e!=e}function _t(e,t){var n=null==e?0:e.length;return n?Ct(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,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(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 At(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(q,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return st(t,function(t){return e[t]})}function xt(e,t){return e.has(t)}function Rt(e,t){for(var n=-1,l=e.length;++n<l&&Et(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length;n--&&Et(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 Ot=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({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(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,o=0,r=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[o++]=n)}return r}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 Mt(e)?function(e){for(var t=Re.lastIndex=0;Re.test(e);)++t;return t}(e):mt(e)}function zt(e){return Mt(e)?function(e){return e.match(Re)||[]}(e):function(e){return e.split("")}(e)}function $t(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var Vt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),qt=function e(t){var s,G=(t=null==t?ze:qt.defaults(ze.Object(),t,qt.pick(ze,Le))).Array,ce=t.Date,de=t.Error,pe=t.Function,ve=t.Math,me=t.Object,fe=t.RegExp,he=t.String,Ee=t.TypeError,ge=G.prototype,ye=me.prototype,_e=t["__core-js_shared__"],Se=pe.prototype.toString,be=ye.hasOwnProperty,Te=0,Ce=(s=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",Ae=ye.toString,De=Se.call(me),Ne=ze._,Re=fe("^"+Se.call(be).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=qe?t.Buffer:void 0,Be=t.Symbol,je=t.Uint8Array,We=we?we.allocUnsafe:void 0,$e=Bt(me.getPrototypeOf,me),Ve=me.create,Ge=ye.propertyIsEnumerable,Ke=ge.splice,mt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Gt=Be?Be.toStringTag:void 0,Kt=function(){try{var e=Ji(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),Yt=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==ze.Date.now&&ce.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=ve.ceil,Qt=ve.floor,en=me.getOwnPropertySymbols,tn=we?we.isBuffer:void 0,nn=t.isFinite,ln=ge.join,on=Bt(me.keys,me),rn=ve.max,an=ve.min,un=ce.now,sn=t.parseInt,cn=ve.random,dn=ge.reverse,pn=Ji(t,"DataView"),vn=Ji(t,"Map"),mn=Ji(t,"Promise"),fn=Ji(t,"Set"),hn=Ji(t,"WeakMap"),En=Ji(me,"create"),gn=hn&&new hn,yn={},_n=Po(pn),Sn=Po(vn),bn=Po(mn),Tn=Po(fn),Cn=Po(hn),An=Be?Be.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function Pn(e){if(Vr(e)&&!Lr(e)&&!(e instanceof wn)){if(e instanceof In)return e;if(be.call(e,"__wrapped__"))return xo(e)}return new In(e)}var xn=function(){function e(){}return function(t){if(!$r(t))return{};if(Ve)return Ve(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Rn(){}function In(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 On(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 kn(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 kn;++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=Lr(e),l=!n&&Or(e),i=!n&&!l&&Br(e),o=!n&&!l&&!i&&Qr(e),r=n||l||i||o,a=r?At(e.length,he):[],u=a.length;for(var s in e)!t&&!be.call(e,s)||r&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||oo(s,u))||a.push(s);return a}function Un(e){var t=e.length;return t?e[kl(0,t-1)]:void 0}function Hn(e,t){return To(hi(e),Yn(t,0,e.length))}function jn(e){return To(hi(e))}function Wn(e,t,n){(void 0!==n&&!Rr(e[t],n)||void 0===n&&!(t in e))&&Gn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&Rr(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function $n(e,t){for(var n=e.length;n--;)if(Rr(e[n][0],t))return n;return-1}function Vn(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function qn(e,t){return e&&Ei(t,Sa(t),e)}function Gn(e,t,n){"__proto__"==t&&Kt?Kt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Kn(e,t){for(var n=-1,l=t.length,i=G(l),o=null==e;++n<l;)i[n]=o?void 0:ha(e,t[n]);return i}function Yn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,r){var s,c=1&t,_=2&t,I=4&t;if(n&&(s=i?n(e,l,i,r):n(e)),void 0!==s)return s;if(!$r(e))return e;var w=Lr(e);if(w){if(s=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),!c)return hi(e,s)}else{var O=to(e),L=O==d||O==p;if(Br(e))return ci(e,c);if(O==f||O==o||L&&!i){if(s=_||L?{}:lo(e),!c)return _?function(e,t){return Ei(e,eo(e),t)}(e,function(e,t){return e&&Ei(t,ba(t),e)}(s,e)):function(e,t){return Ei(e,Qi(e),t)}(e,qn(s,e))}else{if(!Fe[O])return i?e:{};s=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 C:case A:case D:case N:case P:case"[object Uint8ClampedArray]":case x:case R:return pi(e,n);case v:return new l;case m:case g:return new l(e);case h:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case y:return Dn?me(Dn.call(e)):{}}}(e,O,c)}}r||(r=new Fn);var k=r.get(e);if(k)return k;r.set(e,s),Xr(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,r))}):qr(e)&&e.forEach(function(l,i){s.set(i,Xn(l,t,n,i,e,r))});var M=w?void 0:(I?_?Vi:$i:_?ba:Sa)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),zn(s,i,Xn(l,t,n,i,e,r))}),s}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 Jn(e,t,l){if("function"!=typeof e)throw new Ee(n);return yo(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,o=at,r=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,Nt(n))),l?(o=ut,r=!1):t.length>=200&&(o=xt,r=!1,t=new Mn(t));e:for(;++i<a;){var c=e[i],d=null==n?c:n(c);if(c=l||0!==c?c:0,r&&d==d){for(var p=s;p--;)if(t[p]===d)continue e;u.push(c)}else o(t,d,l)||u.push(c)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:H,variable:"",imports:{_:Pn}},(Pn.prototype=Rn.prototype).constructor=Pn,(In.prototype=xn(Rn.prototype)).constructor=In,(wn.prototype=xn(Rn.prototype)).constructor=wn,On.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:be.call(t,e)},On.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},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():Ke.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},kn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(vn||Ln),string:new On}},kn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},kn.prototype.get=function(e){return Xi(this,e).get(e)},kn.prototype.has=function(e){return Xi(this,e).has(e)},kn.prototype.set=function(e,t){var n=Xi(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)},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 kn(l)}return n.set(e,t),this.size=n.size,this};var el=_i(ul),tl=_i(sl,!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],r=t(o);if(null!=r&&(void 0===a?r==r&&!Jr(r):n(r,a)))var a=r,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,r=e.length;for(n||(n=io),i||(i=[]);++o<r;){var a=e[o];t>0&&n(a)?t>1?ol(a,t-1,n,l,i):ct(i,a):l||(i[i.length]=a)}return i}var rl=Si(),al=Si(!0);function ul(e,t){return e&&rl(e,t,Sa)}function sl(e,t){return e&&al(e,t,Sa)}function cl(e,t){return rt(t,function(t){return jr(e[t])})}function dl(e,t){for(var n=0,l=(t=ri(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 Lr(e)?l:ct(l,n(e))}function vl(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Gt&&Gt in me(e)?function(e){var t=be.call(e,Gt),n=e[Gt];try{e[Gt]=void 0;var l=!0}catch(e){}var i=Ae.call(e);return l&&(t?e[Gt]=n:delete e[Gt]),i}(e):function(e){return Ae.call(e)}(e)}function ml(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function hl(e,t){return null!=e&&t in me(e)}function El(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=G(o),u=Infinity,s=[];r--;){var c=e[r];r&&t&&(c=st(c,Nt(t))),u=an(c.length,u),a[r]=!n&&(t||i>=120&&c.length>=120)?new Mn(r&&c):void 0}c=e[0];var d=-1,p=a[0];e:for(;++d<i&&s.length<u;){var v=c[d],m=t?t(v):v;if(v=n||0!==v?v:0,!(p?xt(p,m):l(s,m,n))){for(r=o;--r;){var f=a[r];if(!(f?xt(f,m):l(e[r],m,n)))continue e}p&&p.push(m),s.push(v)}}return s}function gl(e,t,n){var l=null==(e=fo(e,t=ri(t,e)))?e:e[No(Ho(t))];return null==l?void 0:tt(l,e,n)}function yl(e){return Vr(e)&&vl(e)==o}function _l(e,t,n,l,i){return e===t||(null==e||null==t||!Vr(e)&&!Vr(t)?e!=e&&t!=t:function(e,t,n,l,i,s){var d=Lr(e),p=Lr(t),_=d?r:to(e),T=p?r:to(t),C=(_=_==o?f:_)==f,A=(T=T==o?f:T)==f,D=_==T;if(D&&Br(e)){if(!Br(t))return!1;d=!0,C=!1}if(D&&!C)return s||(s=new Fn),d||Qr(e)?Wi(e,t,n,l,i,s):function(e,t,n,l,i,o,r){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||!o(new je(e),new je(t)));case a:case u:case m:return Rr(+e,+t);case c:return e.name==t.name&&e.message==t.message;case h:case g:return e==t+"";case v:var s=Ft;case E:if(s||(s=Ht),e.size!=t.size&&!(1&l))return!1;var d=r.get(e);if(d)return d==t;l|=2,r.set(e,t);var p=Wi(s(e),s(t),l,i,o,r);return r.delete(e),p;case y:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,_,n,l,i,s);if(!(1&n)){var N=C&&be.call(e,"__wrapped__"),P=A&&be.call(t,"__wrapped__");if(N||P){var x=N?e.value():e,R=P?t.value():t;return s||(s=new Fn),i(x,R,n,l,s)}}return!!D&&(s||(s=new Fn),function(e,t,n,l,i,o){var r=1&n,a=$i(e),u=a.length;if(u!=$i(t).length&&!r)return!1;for(var s=u;s--;){var c=a[s];if(!(r?c in t:be.call(t,c)))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=r;++s<u;){var f=e[c=a[s]],h=t[c];if(l)var E=r?l(h,f,c,t,e,o):l(f,h,c,e,t,o);if(!(void 0===E?f===h||i(f,h,n,l,o):E)){v=!1;break}m||(m="constructor"==c)}if(v&&!m){var g=e.constructor,y=t.constructor;g==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y||(v=!1)}return o.delete(e),o.delete(t),v}(e,t,n,l,i,s))}(e,t,n,l,_l,i))}function Sl(e,t,n,l){var i=n.length,o=i,r=!l;if(null==e)return!o;for(e=me(e);i--;){var a=n[i];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var u=(a=n[i])[0],s=e[u],c=a[1];if(r&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Fn;if(l)var p=l(s,c,u,e,t,d);if(!(void 0===p?_l(c,s,3,l,d):p))return!1}}return!0}function bl(e){return!(!$r(e)||(t=e,Ce&&Ce in t))&&(jr(e)?Re:ie).test(Po(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ga:"object"==typeof e?Lr(e)?Pl(e[0],e[1]):Nl(e):nu(e)}function Cl(e){if(!co(e))return on(e);var t=[];for(var n in me(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Dl(e,t){var n=-1,l=Mr(e)?G(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||Sl(n,e,t)}}function Pl(e,t){return ao(e)&&po(t)?vo(No(e),t):function(n){var l=ha(n,e);return void 0===l&&l===t?Ea(n,e):_l(t,l,3)}}function xl(e,t,n,l,i){e!==t&&rl(t,function(o,r){if(i||(i=new Fn),$r(o))!function(e,t,n,l,i,o,r){var a=Eo(e,n),u=Eo(t,n),s=r.get(u);if(s)Wn(e,n,s);else{var c=o?o(a,u,n+"",e,t,r):void 0,d=void 0===c;if(d){var p=Lr(u),v=!p&&Br(u),m=!p&&!v&&Qr(u);c=u,p||v||m?Lr(a)?c=a:Fr(a)?c=hi(a):v?(d=!1,c=ci(u,!0)):m?(d=!1,c=pi(u,!0)):c=[]:Kr(u)||Or(u)?(c=a,Or(a)?c=aa(a):$r(a)&&!jr(a)||(c=lo(u))):d=!1}d&&(r.set(u,c),i(c,u,l,o,r),r.delete(u)),Wn(e,n,c)}}(e,t,r,n,xl,l,i);else{var a=l?l(Eo(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),Wn(e,r,a)}},ba)}function Rl(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function Il(e,t,n){t=t.length?st(t,function(e){return Lr(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Ga];var l=-1;return t=st(t,Nt(Yi())),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,r=i.length,a=n.length;++l<r;){var u=vi(i[l],o[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:st(t,function(t){return t(e)}),index:++l,value:e}}))}function wl(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var r=t[l],a=dl(e,r);n(a,r)&&Hl(o,ri(r,e),a)}return o}function Ol(e,t,n,l){var i=l?gt:Et,o=-1,r=t.length,a=e;for(e===t&&(t=hi(t)),n&&(a=st(e,Nt(n)));++o<r;)for(var u=0,s=t[o],c=n?n(s):s;(u=i(a,c,u,l))>-1;)a!==e&&Ke.call(a,u,1),Ke.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!==o){var o=i;oo(i)?Ke.call(e,i,1):Jl(e,i)}}return e}function kl(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 Fl(e,t){return _o(mo(e,t,Ga),e+"")}function Bl(e){return Un(Ra(e))}function Ul(e,t){var n=Ra(e);return To(n,Yn(t,0,n.length))}function Hl(e,t,n,l){if(!$r(e))return e;for(var i=-1,o=(t=ri(t,e)).length,r=o-1,a=e;null!=a&&++i<o;){var u=No(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=r){var c=a[u];void 0===(s=l?l(c,u,a):void 0)&&(s=$r(c)?c:oo(t[i+1])?[]:{})}zn(a,u,s),a=a[u]}return e}var jl=gn?function(e,t){return gn.set(e,t),e}:Ga,Wl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:$a(t),writable:!0})}:Ga;function zl(e){return To(Ra(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 o=G(i);++l<i;)o[l]=e[l+t];return o}function Vl(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function ql(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,r=e[o];null!==r&&!Jr(r)&&(n?r<=t:r<t)?l=o+1:i=o}return i}return Gl(e,t,Ga,n)}function Gl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Jr(t),s=void 0===t;i<o;){var c=Qt((i+o)/2),d=n(e[c]),p=void 0!==d,v=null===d,m=d==d,f=Jr(d);if(r)var h=l||m;else h=s?m&&(l||p):a?m&&p&&(l||!v):u?m&&p&&!v&&(l||!f):!v&&!f&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function Kl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!Rr(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function Yl(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Lr(e))return st(e,Xl)+"";if(Jr(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=at,o=e.length,r=!0,a=[],u=a;if(n)r=!1,i=ut;else if(o>=200){var s=t?null:Mi(e);if(s)return Ht(s);r=!1,i=xt,u=new Mn}else u=t?[]:a;e:for(;++l<o;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,r&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(c)}else i(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Jl(e,t){return null==(e=fo(e,t=ri(t,e)))||delete e[No(Ho(t))]}function Ql(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?$l(e,l?0:o,l?o+1:i):$l(e,l?o+1:0,l?i:o)}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,ct([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=G(l);++i<l;)for(var r=e[i],a=-1;++a<l;)a!=i&&(o[i]=Qn(o[i]||r,e[a],t,n));return Zl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,r={};++l<i;)n(r,e[l],l<o?t[l]:void 0);return r}function ii(e){return Fr(e)?e:[]}function oi(e){return"function"==typeof e?e:Ga}function ri(e,t){return Lr(e)?e:ao(e,t)?[e]:Do(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 si=Yt||function(e){return ze.clearTimeout(e)};function ci(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=Jr(e),r=void 0!==t,a=null===t,u=t==t,s=Jr(t);if(!a&&!s&&!o&&e>t||o&&r&&u&&!a&&!s||l&&r&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||a&&n&&i||!r&&i||!u)return-1}return 0}function mi(e,t,n,l){for(var i=-1,o=e.length,r=n.length,a=-1,u=t.length,s=rn(o-r,0),c=G(u+s),d=!l;++a<u;)c[a]=t[a];for(;++i<r;)(d||i<o)&&(c[n[i]]=e[i]);for(;s--;)c[a++]=e[i++];return c}function fi(e,t,n,l){for(var i=-1,o=e.length,r=-1,a=n.length,u=-1,s=t.length,c=rn(o-a,0),d=G(c+s),p=!l;++i<c;)d[i]=e[i];for(var v=i;++u<s;)d[v+u]=t[u];for(;++r<a;)(p||i<o)&&(d[v+n[r]]=e[i++]);return d}function hi(e,t){var n=-1,l=e.length;for(t||(t=G(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Gn(n,a,u):zn(n,a,u)}return n}function gi(e,t){return function(n,l){var i=Lr(n)?nt:Vn,o=t?t():{};return i(n,e,Yi(l,2),o)}}function yi(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,r=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&ro(n[0],n[1],r)&&(o=i<3?void 0:o,i=1),t=me(t);++l<i;){var a=n[l];a&&e(t,a,l,o)}return t})}function _i(e,t){return function(n,l){if(null==n)return n;if(!Mr(n))return e(n,l);for(var i=n.length,o=t?i:-1,r=me(n);(t?o--:++o<i)&&!1!==l(r[o],o,r););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=me(t),r=l(t),a=r.length;a--;){var u=r[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=Mt(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(ja(Oa(t).replace(Pe,"")),e,"")}}function Ci(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=xn(e.prototype),l=e.apply(n,t);return $r(l)?l:n}}function Ai(e){return function(t,n,l){var i=me(t);if(!Mr(t)){var o=Yi(n,3);t=Sa(t),n=function(e){return o(i[e],e,i)}}var r=e(t,n,l);return r>-1?i[o?t[r]:r]:void 0}}function Di(e){return zi(function(t){var l=t.length,i=l,o=In.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new Ee(n);if(o&&!a&&"wrapper"==Gi(r))var a=new In([],!0)}for(i=a?i:l;++i<l;){var u=Gi(r=t[i]),s="wrapper"==u?qi(r):void 0;a=s&&uo(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Gi(s[0])].apply(a,s[3]):1==r.length&&uo(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Lr(n))return a.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,r,a,u,s){var c=128&t,d=1&t,p=2&t,v=24&t,m=512&t,f=p?void 0:Ci(e);return function h(){for(var E=arguments.length,g=G(E),y=E;y--;)g[y]=arguments[y];if(v)var _=Ki(h),S=wt(g,_);if(l&&(g=mi(g,l,i,v)),o&&(g=fi(g,o,r,v)),E-=S,v&&E<s){var b=Ut(g,_);return Li(e,t,Ni,h.placeholder,n,g,b,a,u,s-E)}var T=d?n:this,C=p?T[e]:e;return E=g.length,a?g=ho(g,a):m&&E>1&&g.reverse(),c&&u<E&&(g.length=u),this&&this!==ze&&this instanceof h&&(C=f||Ci(C)),C.apply(T,g)}}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 xi(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=Xl(n),l=Xl(l)):(n=Yl(n),l=Yl(l)),i=e(n,l)}return i}}function Ri(e){return zi(function(t){return t=st(t,Nt(Yi())),Fl(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?" ":Xl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Jt(e/Wt(t)));return Mt(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function wi(e){return function(t,n,l){return l&&"number"!=typeof l&&ro(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,o=rn(Jt((t-e)/(n||1)),0),r=G(o);o--;)r[l?o:++i]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function Oi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Li(e,t,n,l,i,o,r,a,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,i,c?o:void 0,c?r:void 0,c?void 0:o,c?void 0:r,a,u,s],p=n.apply(void 0,d);return uo(e)&&go(p,d),p.placeholder=l,So(p,e,t)}function ki(e){var t=ve[e];return function(e,n){if(e=ra(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 Mi=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Fi(e){return function(t){var n=to(t);return n==v?Ft(t):n==E?jt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,r,a,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new Ee(n);var d=o?o.length:0;if(d||(t&=-97,o=r=void 0),u=void 0===u?u:rn(ia(u),0),s=void 0===s?s:ia(s),d-=r?r.length:0,64&t){var p=o,v=r;o=r=void 0}var m=c?void 0:qi(e),f=[e,t,i,o,r,p,v,a,u,s];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 r=t[3];if(r){var a=e[3];e[3]=a?mi(a,r,t[4]):r,e[4]=a?Ut(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?fi(a,r,t[6]):r,e[6]=a?Ut(e[5],l):t[6]),(r=t[7])&&(e[7]=r),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]=o}(f,m),e=f[0],t=f[1],i=f[2],o=f[3],r=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:rn(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var l=Ci(e);return function i(){for(var o=arguments.length,r=G(o),a=o,u=Ki(i);a--;)r[a]=arguments[a];var s=o<3&&r[0]!==u&&r[o-1]!==u?[]:Ut(r,u);if((o-=s.length)<n)return Li(e,t,Ni,i.placeholder,void 0,r,s,void 0,void 0,n-o);var c=this&&this!==ze&&this instanceof i?l:e;return tt(c,this,r)}}(e,t,s):32!=t&&33!=t||r.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ci(e);return function t(){for(var r=-1,a=arguments.length,u=-1,s=l.length,c=G(s+a),d=this&&this!==ze&&this instanceof t?o:e;++u<s;)c[u]=l[u];for(;a--;)c[u++]=arguments[++r];return tt(d,i?n:this,c)}}(e,t,i,o);else var h=function(e,t,n){var l=1&t,i=Ci(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 So((m?jl:go)(h,f),e,t)}function Ui(e,t,n,l){return void 0===e||Rr(e,ye[n])&&!be.call(l,n)?t:e}function Hi(e,t,n,l,i,o){return $r(e)&&$r(t)&&(o.set(t,e),xl(e,t,void 0,Hi,o),o.delete(t)),e}function ji(e){return Kr(e)?void 0:e}function Wi(e,t,n,l,i,o){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,v=2&n?new Mn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var m=e[d],f=t[d];if(l)var h=r?l(f,m,d,t,e,o):l(m,f,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(v){if(!vt(t,function(e,t){if(!xt(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 _o(mo(e,void 0,ko),e+"")}function $i(e){return pl(e,Sa,Qi)}function Vi(e){return pl(e,ba,eo)}var qi=gn?function(e){return gn.get(e)}:Ja;function Gi(e){for(var t=e.name+"",n=yn[t],l=be.call(yn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Ki(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function Yi(){var e=Pn.iteratee||Ka;return e=e===Ka?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Zi(e){for(var t=Sa(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,po(i)]}return t}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Qi=en?function(e){return null==e?[]:(e=me(e),rt(en(e),function(t){return Ge.call(e,t)}))}:ou,eo=en?function(e){for(var t=[];e;)ct(t,Qi(e)),e=$e(e);return t}:ou,to=vl;function no(e,t,n){for(var l=-1,i=(t=ri(t,e)).length,o=!1;++l<i;){var r=No(t[l]);if(!(o=null!=e&&n(e,r)))break;e=e[r]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&zr(i)&&oo(r,i)&&(Lr(e)||Or(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:xn($e(e))}function io(e){return Lr(e)||Or(e)||!!(mt&&e&&e[mt])}function oo(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ro(e,t,n){if(!$r(n))return!1;var l=typeof t;return!!("number"==l?Mr(n)&&oo(t,n.length):"string"==l&&t in n)&&Rr(n[t],e)}function ao(e,t){if(Lr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jr(e))||W.test(e)||!j.test(e)||null!=t&&e in me(t)}function uo(e){var t=Gi(e),n=Pn[t];if("function"!=typeof n||!(t in wn.prototype))return!1;if(e===n)return!0;var l=qi(n);return!!l&&e===l[0]}(pn&&to(new pn(new ArrayBuffer(1)))!=b||vn&&to(new vn)!=v||mn&&"[object Promise]"!=to(mn.resolve())||fn&&to(new fn)!=E||hn&&to(new hn)!=_)&&(to=function(e){var t=vl(e),n=t==f?e.constructor:void 0,l=n?Po(n):"";if(l)switch(l){case _n:return b;case Sn:return v;case bn:return"[object Promise]";case Tn:return E;case Cn:return _}return t});var so=_e?jr:ru;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)}function po(e){return e==e&&!$r(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=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=rn(l.length-t,0),r=G(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=G(t+1);++i<t;)a[i]=l[i];return a[t]=n(r),tt(e,this,a)}}function fo(e,t){return t.length<2?e:dl(e,$l(t,0,-1))}function ho(e,t){for(var n=e.length,l=an(t.length,n),i=hi(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=bo(jl),yo=Zt||function(e,t){return ze.setTimeout(e,t)},_o=bo(Wl);function So(e,t,n){var l=t+"";return _o(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(K,"{\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(Y);return t?t[1].split(X):[]}(l),n)))}function bo(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 To(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=kl(n,i),r=e[o];e[o]=e[n],e[n]=r}return e.length=t,e}var Co,Ao,Do=(Co=Cr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ao.size&&Ao.clear(),e}),Ao=Co.cache,Co);function No(e){if("string"==typeof e||Jr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function xo(e){if(e instanceof wn)return e.clone();var t=new In(e.__wrapped__,e.__chain__);return t.__actions__=hi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ro=Fl(function(e,t){return Fr(e)?Qn(e,ol(t,1,Fr,!0)):[]}),Io=Fl(function(e,t){var n=Ho(t);return Fr(n)&&(n=void 0),Fr(e)?Qn(e,ol(t,1,Fr,!0),Yi(n,2)):[]}),wo=Fl(function(e,t){var n=Ho(t);return Fr(n)&&(n=void 0),Fr(e)?Qn(e,ol(t,1,Fr,!0),void 0,n):[]});function Oo(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=rn(l+i,0)),ht(e,Yi(t,3),i)}function Lo(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?rn(l+i,0):an(i,l-1)),ht(e,Yi(t,3),i,!0)}function ko(e){return null!=e&&e.length?ol(e,1):[]}function Mo(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=st(e,ii);return t.length&&t[0]===e[0]?El(t):[]}),Bo=Fl(function(e){var t=Ho(e),n=st(e,ii);return t===Ho(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,Yi(t,2)):[]}),Uo=Fl(function(e){var t=Ho(e),n=st(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function Ho(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jo=Fl(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ol(e,t):e}var zo=zi(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Ll(e,st(t,function(e){return oo(e,n)?+e:e}).sort(vi)),l});function $o(e){return null==e?e:dn.call(e)}var Vo=Fl(function(e){return Zl(ol(e,1,Fr,!0))}),qo=Fl(function(e){var t=Ho(e);return Fr(t)&&(t=void 0),Zl(ol(e,1,Fr,!0),Yi(t,2))}),Go=Fl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,Zl(ol(e,1,Fr,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Fr(e))return t=rn(e.length,t),!0}),At(t,function(t){return st(e,St(t))})}function Yo(e,t){if(!e||!e.length)return[];var n=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fr(e)?Qn(e,t):[]}),Zo=Fl(function(e){return ni(rt(e,Fr))}),Jo=Fl(function(e){var t=Ho(e);return Fr(t)&&(t=void 0),ni(rt(e,Fr),Yi(t,2))}),Qo=Fl(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,ni(rt(e,Fr),void 0,t)}),er=Fl(Ko),tr=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,Yo(e,n)});function nr(e){var t=Pn(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var ir=zi(function(e){var t=e.length,n=t?e[0]:0,l=this.__wrapped__,i=function(t){return Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof wn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,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)}),or=gi(function(e,t,n){be.call(e,n)?++e[n]:Gn(e,n,1)}),rr=Ai(Oo),ar=Ai(Lo);function ur(e,t){return(Lr(e)?lt:el)(e,Yi(t,3))}function sr(e,t){return(Lr(e)?it:tl)(e,Yi(t,3))}var cr=gi(function(e,t,n){be.call(e,n)?e[n].push(t):Gn(e,n,[t])}),dr=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=Mr(e)?G(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),pr=gi(function(e,t,n){Gn(e,n,t)});function vr(e,t){return(Lr(e)?st:Dl)(e,Yi(t,3))}var mr=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ro(e,t[0],t[1])?t=[]:n>2&&ro(t[0],t[1],t[2])&&(t=[t[0]]),Il(e,ol(t,1),[])}),hr=Xt||function(){return ze.Date.now()};function Er(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 gr(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=ia(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var yr=Fl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,Ki(yr));l|=32}return Bi(e,l,t,n,i)}),_r=Fl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,Ki(_r));l|=32}return Bi(t,l,e,n,i)});function Sr(e,t,l){var i,o,r,a,u,s,c=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new Ee(n);function m(t){var n=i,l=o;return i=o=void 0,c=t,a=e.apply(l,n)}function f(e){return c=e,u=yo(E,t),d?m(e):a}function h(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=r}function E(){var e=hr();if(h(e))return g(e);u=yo(E,function(e){var n=t-(e-s);return p?an(n,r-(e-c)):n}(e))}function g(e){return u=void 0,v&&i?m(e):(i=o=void 0,a)}function y(){var e=hr(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(p)return si(u),u=yo(E,t),m(s)}return void 0===u&&(u=yo(E,t)),a}return t=ra(t)||0,$r(l)&&(d=!!l.leading,r=(p="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,v="trailing"in l?!!l.trailing:v),y.cancel=function(){void 0!==u&&si(u),c=0,i=s=o=u=void 0},y.flush=function(){return void 0===u?a:g(hr())},y}var br=Fl(function(e,t){return Jn(e,1,t)}),Tr=Fl(function(e,t,n){return Jn(e,ra(t)||0,n)});function Cr(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],o=l.cache;if(o.has(i))return o.get(i);var r=e.apply(this,n);return l.cache=o.set(i,r)||o,r};return l.cache=new(Cr.Cache||kn),l}function Ar(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)}}Cr.Cache=kn;var Dr=ai(function(e,t){var n=(t=1==t.length&&Lr(t[0])?st(t[0],Nt(Yi())):st(ol(t,1),Nt(Yi()))).length;return Fl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Nr=Fl(function(e,t){return Bi(e,32,void 0,t,Ut(t,Ki(Nr)))}),Pr=Fl(function(e,t){return Bi(e,64,void 0,t,Ut(t,Ki(Pr)))}),xr=zi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function Rr(e,t){return e===t||e!=e&&t!=t}var Ir=Oi(ml),wr=Oi(function(e,t){return e>=t}),Or=yl(function(){return arguments}())?yl:function(e){return Vr(e)&&be.call(e,"callee")&&!Ge.call(e,"callee")},Lr=G.isArray,kr=Ye?Nt(Ye):function(e){return Vr(e)&&vl(e)==S};function Mr(e){return null!=e&&zr(e.length)&&!jr(e)}function Fr(e){return Vr(e)&&Mr(e)}var Br=tn||ru,Ur=Xe?Nt(Xe):function(e){return Vr(e)&&vl(e)==u};function Hr(e){if(!Vr(e))return!1;var t=vl(e);return t==c||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Kr(e)}function jr(e){if(!$r(e))return!1;var t=vl(e);return t==d||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==ia(e)}function zr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function $r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Vr(e){return null!=e&&"object"==typeof e}var qr=Ze?Nt(Ze):function(e){return Vr(e)&&to(e)==v};function Gr(e){return"number"==typeof e||Vr(e)&&vl(e)==m}function Kr(e){if(!Vr(e)||vl(e)!=f)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 Yr=Je?Nt(Je):function(e){return Vr(e)&&vl(e)==h},Xr=Qe?Nt(Qe):function(e){return Vr(e)&&to(e)==E};function Zr(e){return"string"==typeof e||!Lr(e)&&Vr(e)&&vl(e)==g}function Jr(e){return"symbol"==typeof e||Vr(e)&&vl(e)==y}var Qr=et?Nt(et):function(e){return Vr(e)&&zr(e.length)&&!!Me[vl(e)]},ea=Oi(Al),ta=Oi(function(e,t){return e<=t});function na(e){if(!e)return[];if(Mr(e))return Zr(e)?zt(e):hi(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=to(e);return(t==v?Ft:t==E?Ht:Ra)(e)}function la(e){return e?(e=ra(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 oa(e){return e?Yn(ia(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if($r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=$r(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 aa(e){return Ei(e,ba(e))}function ua(e){return null==e?"":Xl(e)}var sa=yi(function(e,t){if(co(t)||Mr(t))Ei(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),ca=yi(function(e,t){Ei(t,ba(t),e)}),da=yi(function(e,t,n,l){Ei(t,ba(t),e,l)}),pa=yi(function(e,t,n,l){Ei(t,Sa(t),e,l)}),va=zi(Kn),ma=Fl(function(e,t){e=me(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ro(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],r=ba(o),a=-1,u=r.length;++a<u;){var s=r[a],c=e[s];(void 0===c||Rr(c,ye[s])&&!be.call(e,s))&&(e[s]=o[s])}return e}),fa=Fl(function(e){return e.push(void 0,Hi),tt(Ca,void 0,e)});function ha(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function Ea(e,t){return null!=e&&no(e,t,hl)}var ga=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},$a(Ga)),ya=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},Yi),_a=Fl(gl);function Sa(e){return Mr(e)?Bn(e):Cl(e)}function ba(e){return Mr(e)?Bn(e,!0):function(e){if(!$r(e))return function(e){var t=[];if(null!=e)for(var n in me(e))t.push(n);return t}(e);var t=co(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=yi(function(e,t,n){xl(e,t,n)}),Ca=yi(function(e,t,n,l){xl(e,t,n,l)}),Aa=zi(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=ri(t,e),l||(l=t.length>1),t}),Ei(e,Vi(e),n),l&&(n=Xn(n,7,ji));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Da=zi(function(e,t){return null==e?{}:function(e,t){return wl(e,t,function(t,n){return Ea(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=st(Vi(e),function(e){return[e]});return t=Yi(t),wl(e,n,function(e,n){return t(e,n[0])})}var Pa=Fi(Sa),xa=Fi(ba);function Ra(e){return null==e?[]:Pt(e,Sa(e))}var Ia=Ti(function(e,t,n){return t=t.toLowerCase(),e+(n?wa(t):t)});function wa(e){return Ha(ua(e).toLowerCase())}function Oa(e){return(e=ua(e))&&e.replace(ae,Ot).replace(xe,"")}var La=Ti(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ka=Ti(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ma=bi("toLowerCase"),Fa=Ti(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ba=Ti(function(e,t,n){return e+(n?" ":"")+Ha(t)}),Ua=Ti(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ha=bi("toUpperCase");function ja(e,t,n){return e=ua(e),void 0===(t=n?void 0:t)?function(e){return Oe.test(e)}(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wa=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return Hr(e)?e:new de(e)}}),za=zi(function(e,t){return lt(t,function(t){t=No(t),Gn(e,t,yr(e[t],e))}),e});function $a(e){return function(){return e}}var Va=Di(),qa=Di(!0);function Ga(e){return e}function Ka(e){return Tl("function"==typeof e?e:Xn(e,1))}var Ya=Fl(function(e,t){return function(n){return gl(n,e,t)}}),Xa=Fl(function(e,t){return function(n){return gl(e,n,t)}});function Za(e,t,n){var l=Sa(t),i=cl(t,l);null!=n||$r(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=cl(t,Sa(t)));var o=!($r(n)&&"chain"in n&&!n.chain),r=jr(e);return lt(i,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=hi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,ct([this.value()],arguments))})}),e}function Ja(){}var Qa=Ri(st),eu=Ri(ot),tu=Ri(vt);function nu(e){return ao(e)?St(No(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=wi(),iu=wi(!0);function ou(){return[]}function ru(){return!1}var au,uu=xi(function(e,t){return e+t},0),su=ki("ceil"),cu=xi(function(e,t){return e/t},1),du=ki("floor"),pu=xi(function(e,t){return e*t},1),vu=ki("round"),mu=xi(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=Er,Pn.assign=sa,Pn.assignIn=ca,Pn.assignInWith=da,Pn.assignWith=pa,Pn.at=va,Pn.before=gr,Pn.bind=yr,Pn.bindAll=za,Pn.bindKey=_r,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lr(e)?e:[e]},Pn.chain=nr,Pn.chunk=function(e,t,n){t=(n?ro(e,t,n):void 0===t)?1:rn(ia(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,r=G(Jt(l/t));i<l;)r[o++]=$l(e,i,i+=t);return r},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=G(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Lr(n)?hi(n):[n],ol(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=Yi();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(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)}})},Pn.conforms=function(e){return function(e){var t=Sa(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},Pn.constant=$a,Pn.countBy=or,Pn.create=function(e,t){var n=xn(e);return null==t?n:qn(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=Sr,Pn.defaults=ma,Pn.defaultsDeep=fa,Pn.defer=br,Pn.delay=Tr,Pn.difference=Ro,Pn.differenceBy=Io,Pn.differenceWith=wo,Pn.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):[]},Pn.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):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!0):[]},Pn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ro(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:oa(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Pn.filter=function(e,t){return(Lr(e)?rt:il)(e,Yi(t,3))},Pn.flatMap=function(e,t){return ol(vr(e,t),1)},Pn.flatMapDeep=function(e,t){return ol(vr(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ia(n),ol(vr(e,t),n)},Pn.flatten=ko,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:ia(t)):[]},Pn.flip=function(e){return Bi(e,512)},Pn.flow=Va,Pn.flowRight=qa,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?[]:cl(e,Sa(e))},Pn.functionsIn=function(e){return null==e?[]:cl(e,ba(e))},Pn.groupBy=cr,Pn.initial=function(e){return null!=e&&e.length?$l(e,0,-1):[]},Pn.intersection=Fo,Pn.intersectionBy=Bo,Pn.intersectionWith=Uo,Pn.invert=ga,Pn.invertBy=ya,Pn.invokeMap=dr,Pn.iteratee=Ka,Pn.keyBy=pr,Pn.keys=Sa,Pn.keysIn=ba,Pn.map=vr,Pn.mapKeys=function(e,t){var n={};return t=Yi(t,3),ul(e,function(e,l,i){Gn(n,t(e,l,i),e)}),n},Pn.mapValues=function(e,t){var n={};return t=Yi(t,3),ul(e,function(e,l,i){Gn(n,l,t(e,l,i))}),n},Pn.matches=function(e){return Nl(Xn(e,1))},Pn.matchesProperty=function(e,t){return Pl(e,Xn(t,1))},Pn.memoize=Cr,Pn.merge=Ta,Pn.mergeWith=Ca,Pn.method=Ya,Pn.methodOf=Xa,Pn.mixin=Za,Pn.negate=Ar,Pn.nthArg=function(e){return e=ia(e),Fl(function(t){return Rl(t,e)})},Pn.omit=Aa,Pn.omitBy=function(e,t){return Na(e,Ar(Yi(t)))},Pn.once=function(e){return gr(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(Lr(t)||(t=null==t?[]:[t]),Lr(n=l?void 0:n)||(n=null==n?[]:[n]),Il(e,t,n))},Pn.over=Qa,Pn.overArgs=Dr,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=Nr,Pn.partialRight=Pr,Pn.partition=mr,Pn.pick=Da,Pn.pickBy=Na,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?Ol(e,t,Yi(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,void 0,n):e},Pn.pullAt=zo,Pn.range=lu,Pn.rangeRight=iu,Pn.rearg=xr,Pn.reject=function(e,t){return(Lr(e)?rt:il)(e,Ar(Yi(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Yi(t,3);++l<o;){var r=e[l];t(r,l,e)&&(n.push(r),i.push(l))}return Ll(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:ia(t))},Pn.reverse=$o,Pn.sampleSize=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),(Lr(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(Lr(e)?jn:zl)(e)},Pn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ro(e,t,n)?(t=0,n=l):(t=null==t?0:ia(t),n=void 0===n?l:ia(n)),$l(e,t,n)):[]},Pn.sortBy=fr,Pn.sortedUniq=function(e){return e&&e.length?Kl(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Kl(e,Yi(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ro(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Yr(t))&&!(t=Xl(t))&&Mt(e)?ui(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:rn(ia(t),0),Fl(function(n){var l=n[t],i=ui(n,0,t);return l&&ct(i,l),tt(e,this,i)})},Pn.tail=function(e){var t=null==e?0:e.length;return t?$l(e,1,t):[]},Pn.take=function(e,t,n){return e&&e.length?$l(e,0,(t=n||void 0===t?1:ia(t))<0?0:t):[]},Pn.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):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?ei(e,Yi(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?ei(e,Yi(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 Ee(n);return $r(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Sr(e,t,{leading:i,maxWait:t,trailing:o})},Pn.thru=lr,Pn.toArray=na,Pn.toPairs=Pa,Pn.toPairsIn=xa,Pn.toPath=function(e){return Lr(e)?st(e,No):Jr(e)?[e]:hi(Do(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=Lr(e),i=l||Br(e)||Qr(e);if(t=Yi(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:$r(e)&&jr(o)?xn($e(e)):{}}return(i?lt:ul)(e,function(e,l,i){return t(n,e,l,i)}),n},Pn.unary=function(e){return Er(e,1)},Pn.union=Vo,Pn.unionBy=qo,Pn.unionWith=Go,Pn.uniq=function(e){return e&&e.length?Zl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Zl(e,Yi(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||Jl(e,t)},Pn.unzip=Ko,Pn.unzipWith=Yo,Pn.update=function(e,t,n){return null==e?e:Ql(e,t,oi(n))},Pn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,oi(n),l)},Pn.values=Ra,Pn.valuesIn=function(e){return null==e?[]:Pt(e,ba(e))},Pn.without=Xo,Pn.words=ja,Pn.wrap=function(e,t){return Nr(oi(t),e)},Pn.xor=Zo,Pn.xorBy=Jo,Pn.xorWith=Qo,Pn.zip=er,Pn.zipObject=function(e,t){return li(e||[],t||[],zn)},Pn.zipObjectDeep=function(e,t){return li(e||[],t||[],Hl)},Pn.zipWith=tr,Pn.entries=Pa,Pn.entriesIn=xa,Pn.extend=ca,Pn.extendWith=da,Za(Pn,Pn),Pn.add=uu,Pn.attempt=Wa,Pn.camelCase=Ia,Pn.capitalize=wa,Pn.ceil=su,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ra(n))==n?n:0),void 0!==t&&(t=(t=ra(t))==t?t:0),Yn(ra(e),t,n)},Pn.clone=function(e){return Xn(e,4)},Pn.cloneDeep=function(e){return Xn(e,5)},Pn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Zn(e,t,Sa(t))},Pn.deburr=Oa,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=cu,Pn.endsWith=function(e,t,n){e=ua(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:Yn(ia(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Pn.eq=Rr,Pn.escape=function(e){return(e=ua(e))&&F.test(e)?e.replace(k,Lt):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&V.test(e)?e.replace($,"\\$&"):e},Pn.every=function(e,t,n){var l=Lr(e)?ot:nl;return n&&ro(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Pn.find=rr,Pn.findIndex=Oo,Pn.findKey=function(e,t){return ft(e,Yi(t,3),ul)},Pn.findLast=ar,Pn.findLastIndex=Lo,Pn.findLastKey=function(e,t){return ft(e,Yi(t,3),sl)},Pn.floor=du,Pn.forEach=ur,Pn.forEachRight=sr,Pn.forIn=function(e,t){return null==e?e:rl(e,Yi(t,3),ba)},Pn.forInRight=function(e,t){return null==e?e:al(e,Yi(t,3),ba)},Pn.forOwn=function(e,t){return e&&ul(e,Yi(t,3))},Pn.forOwnRight=function(e,t){return e&&sl(e,Yi(t,3))},Pn.get=ha,Pn.gt=Ir,Pn.gte=wr,Pn.has=function(e,t){return null!=e&&no(e,t,fl)},Pn.hasIn=Ea,Pn.head=Mo,Pn.identity=Ga,Pn.includes=function(e,t,n,l){e=Mr(e)?e:Ra(e),n=n&&!l?ia(n):0;var i=e.length;return n<0&&(n=rn(i+n,0)),Zr(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Et(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:ia(n);return i<0&&(i=rn(l+i,0)),Et(e,t,i)},Pn.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<rn(t,n)}(e=ra(e),t,n)},Pn.invoke=_a,Pn.isArguments=Or,Pn.isArray=Lr,Pn.isArrayBuffer=kr,Pn.isArrayLike=Mr,Pn.isArrayLikeObject=Fr,Pn.isBoolean=function(e){return!0===e||!1===e||Vr(e)&&vl(e)==a},Pn.isBuffer=Br,Pn.isDate=Ur,Pn.isElement=function(e){return Vr(e)&&1===e.nodeType&&!Kr(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Mr(e)&&(Lr(e)||"string"==typeof e||"function"==typeof e.splice||Br(e)||Qr(e)||Or(e)))return!e.length;var t=to(e);if(t==v||t==E)return!e.size;if(co(e))return!Cl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return _l(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?_l(e,t,void 0,n):!!l},Pn.isError=Hr,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=jr,Pn.isInteger=Wr,Pn.isLength=zr,Pn.isMap=qr,Pn.isMatch=function(e,t){return e===t||Sl(e,t,Zi(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Zi(t),n)},Pn.isNaN=function(e){return Gr(e)&&e!=+e},Pn.isNative=function(e){if(so(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=Gr,Pn.isObject=$r,Pn.isObjectLike=Vr,Pn.isPlainObject=Kr,Pn.isRegExp=Yr,Pn.isSafeInteger=function(e){return Wr(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Xr,Pn.isString=Zr,Pn.isSymbol=Jr,Pn.isTypedArray=Qr,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return Vr(e)&&to(e)==_},Pn.isWeakSet=function(e){return Vr(e)&&"[object WeakSet]"==vl(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=La,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=ia(n))<0?rn(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):ht(e,yt,i,!0)},Pn.lowerCase=ka,Pn.lowerFirst=Ma,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,Ga,ml):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,Yi(t,2),ml):void 0},Pn.mean=function(e){return _t(e,Ga)},Pn.meanBy=function(e,t){return _t(e,Yi(t,2))},Pn.min=function(e){return e&&e.length?ll(e,Ga,Al):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,Yi(t,2),Al):void 0},Pn.stubArray=ou,Pn.stubFalse=ru,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?Rl(e,ia(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Ja,Pn.now=hr,Pn.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 Ii(Qt(i),n)+e+Ii(Jt(i),n)},Pn.padEnd=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?e+Ii(t-l,n):e},Pn.padStart=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?Ii(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(ua(e).replace(q,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ro(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=cn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return kl(e,t)},Pn.reduce=function(e,t,n){var l=Lr(e)?dt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,el)},Pn.reduceRight=function(e,t,n){var l=Lr(e)?pt:Tt,i=arguments.length<3;return l(e,Yi(t,4),n,i,tl)},Pn.repeat=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),Ml(ua(e),t)},Pn.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var l=-1,i=(t=ri(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=jr(o)?o.call(e):o}return e},Pn.round=vu,Pn.runInContext=e,Pn.sample=function(e){return(Lr(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Mr(e))return Zr(e)?Wt(e):e.length;var t=to(e);return t==v||t==E?e.size:Cl(e).length},Pn.snakeCase=Fa,Pn.some=function(e,t,n){var l=Lr(e)?vt:Vl;return n&&ro(e,t,n)&&(t=void 0),l(e,Yi(t,3))},Pn.sortedIndex=function(e,t){return ql(e,t)},Pn.sortedIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=ql(e,t);if(l<n&&Rr(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return ql(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Gl(e,t,Yi(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ql(e,t,!0)-1;if(Rr(e[n],t))return n}return-1},Pn.startCase=Ba,Pn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Yn(ia(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Pn.subtract=mu,Pn.sum=function(e){return e&&e.length?Ct(e,Ga):0},Pn.sumBy=function(e,t){return e&&e.length?Ct(e,Yi(t,2)):0},Pn.template=function(e,t,n){var l=Pn.templateSettings;n&&ro(e,t,n)&&(t=void 0),e=ua(e),t=da({},t,l,Ui);var i,o,r=da({},t.imports,l.imports,Ui),a=Sa(r),u=Pt(r,a),s=0,c=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+c.source+"|"+(c===H?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),v="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,r,a,u){return l||(l=r),d+=e.slice(s,u).replace(se,kt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var m=be.call(t,"variable")&&t.variable;if(m){if(J.test(m))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(I,""):d).replace(w,"$1").replace(O,"$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=Wa(function(){return pe(a,v+"return "+d).apply(void 0,u)});if(f.source=d,Hr(f))throw f;return f},Pn.times=function(e,t){if((e=ia(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=At(l,t=Yi(t));++n<e;)t(n);return i},Pn.toFinite=la,Pn.toInteger=ia,Pn.toLength=oa,Pn.toLower=function(e){return ua(e).toLowerCase()},Pn.toNumber=ra,Pn.toSafeInteger=function(e){return e?Yn(ia(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=ua,Pn.toUpper=function(e){return ua(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ui(l,Rt(l,i),It(l,i)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,$t(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,0,It(l,zt(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(q,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,Rt(l,zt(t))).join("")},Pn.truncate=function(e,t){var n=30,l="...";if($r(t)){var i="separator"in t?t.separator:i;n="length"in t?ia(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=ua(e)).length;if(Mt(e)){var r=zt(e);o=r.length}if(n>=o)return e;var a=n-Wt(l);if(a<1)return l;var u=r?ui(r,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(r&&(a+=u.length-a),Yr(i)){if(e.slice(a).search(i)){var s,c=u;for(i.global||(i=fe(i.source,ua(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xl(i),a)!=a){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},Pn.unescape=function(e){return(e=ua(e))&&M.test(e)?e.replace(L,Vt):e},Pn.uniqueId=function(e){var t=++Te;return ua(e)+t},Pn.upperCase=Ua,Pn.upperFirst=Ha,Pn.each=ur,Pn.eachRight=sr,Pn.first=Mo,Za(Pn,(au={},ul(Pn,function(e,t){be.call(Pn.prototype,t)||(au[t]=e)}),au),{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){wn.prototype[e]=function(n){n=void 0===n?1:rn(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:Yi(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(Ga)},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 gl(n,e,t)})}),wn.prototype.reject=function(e){return this.filter(Ar(Yi(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=Pn[l?"take"+("last"==t?"Right":""):t],o=l||/^find/.test(t);i&&(Pn.prototype[t]=function(){var t=this.__wrapped__,r=l?[1]:arguments,a=t instanceof wn,u=r[0],s=a||Lr(t),c=function(e){var t=i.apply(Pn,ct([e],r));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,p=!!this.__actions__.length,v=o&&!d,m=a&&!p;if(!o&&s){t=m?t:new wn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[c],thisArg:void 0}),new In(f,d)}return v&&m?e.apply(this,r):(f=this.thru(c),v?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[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(Lr(i)?i:[],e)}return this[n](function(n){return t.apply(Lr(n)?n:[],e)})}}),ul(wn.prototype,function(e,t){var n=Pn[t];if(n){var l=n.name+"";be.call(yn,l)||(yn[l]=[]),yn[l].push({name:t,func:n})}}),yn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],wn.prototype.clone=function(){var e=new wn(this.__wrapped__);return e.__actions__=hi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=hi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=hi(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=Lr(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],r=o.size;switch(o.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=an(t,e+r);break;case"takeRight":e=rn(e,t-r)}}return{start:e,end:t}}(0,i,this.__views__),r=o.start,a=o.end,u=a-r,s=l?a:r-1,c=this.__iteratees__,d=c.length,p=0,v=an(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,h=e[s+=t];++f<d;){var E=c[f],g=E.type,y=(0,E.iteratee)(h);if(2==g)h=y;else if(!y){if(1==g)continue e;break e}}m[p++]=h}return m},Pn.prototype.at=ir,Pn.prototype.chain=function(){return nr(this)},Pn.prototype.commit=function(){return new In(this.value(),this.__chain__)},Pn.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__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof Rn;){var l=xo(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 wn){var t=e;return this.__actions__.length&&(t=new wn(this)),(t=t.reverse()).__actions__.push({func:lr,args:[$o],thisArg:void 0}),new In(t,this.__chain__)}return this.thru($o)},Pn.prototype.toJSON=Pn.prototype.valueOf=Pn.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},Pn.prototype.first=Pn.prototype.head,bt&&(Pn.prototype[bt]=function(){return this}),Pn}();Ve?((Ve.exports=qt)._=qt,$e._=qt):ze._=qt}).call(s)});const p=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},v=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},m=e=>{var i,o,a,u,s,c,p,v,m,f;const{pets:h,focusIndex:E,allOwners:g,setFocusIndex:y,setPets:_,t:S,formData:b,config:T,setError:C,clearErrors:A,formState:D,menu:N,breed_type:P,pet_sex:x}=e,[R,I]=n.useState(null),{control:w,formState:O,watch:L,trigger:k}=r.useForm(),M=L(),{errors:F}=O,B=(Digit.ULBService.getCurrentTenantId(),n.useMemo(()=>{var e;return null==b||null===(e=b.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==b||null===(i=b.ownershipCategory)||void 0===i?void 0:i.code])),[U,H]=l.useState({});n.useEffect(()=>{let e=B;d.isEqual(U,M)||(H({...M}),_(t=>t.map(t=>t.key&&t.key===h.key?{...t,...M,...e}:{...t})),k())},[M]),n.useEffect(()=>{var e;Object.keys(F).length&&!d.isEqual((null===(e=D.errors[T.key])||void 0===e?void 0:e.type)||{},F)?C(T.key,{type:F}):!Object.keys(F).length&&D.errors[T.key]&&A(T.key)},[F]);const j={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==g?void 0:g.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_SEARCH_PET_TYPE")+" *"),l.createElement(r.Controller,{control:w,name:"petType",defaultValue:null==h?void 0:h.petType,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:N,optionKey:"i18nKey",t:S})})),l.createElement(t.CardLabelError,{style:j},O.touched.petType?null==F||null===(o=F.petType)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_SEARCH_BREED_TYPE")+" *"),l.createElement(r.Controller,{control:w,name:"breedType",defaultValue:null==h?void 0:h.breedType,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:S})})),l.createElement(t.CardLabelError,{style:j},O.touched.breedType?null==F||null===(a=F.breedType)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_PET_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"petName",defaultValue:null==h?void 0:h.petName,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"petName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"petName"})},onBlur:t=>{y({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:j},O.touched.petName?null==F||null===(u=F.petName)||void 0===u?void 0:u.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_PET_AGE")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"petAge",defaultValue:null==h?void 0:h.petAge,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!(/^\d{1,4}$/.test(e)&&parseInt(e,10)>=0&&parseInt(e,10)<=1440)||S("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"petAge"===E.type,onChange:t=>{e.onChange(t),y({index:h.key,type:"petAge"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,placeholder:"in months"})}))),l.createElement("div",{style:{textAlign:"center"}},Math.floor(L("petAge")/12)," ",1===Math.floor(L("petAge")/12)?"YEAR":"YEARS"," ",L("petAge")%12," ",L("petAge")%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabelError,{style:j},O.touched.petAge?null==F||null===(s=F.petAge)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_PET_SEX")+" *"),l.createElement(r.Controller,{control:w,name:"petGender",defaultValue:null==h?void 0:h.petGender,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:x,optionKey:"i18nKey",t:S})})),l.createElement(t.CardLabelError,{style:j},O.touched.petGender?null==F||null===(c=F.petGender)||void 0===c?void 0:c.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_DOCTOR_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"doctorName",defaultValue:null==h?void 0:h.doctorName,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"doctorName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"doctorName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},O.touched.doctorName?null==F||null===(p=F.doctorName)||void 0===p?void 0:p.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_CLINIC_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"clinicName",defaultValue:null==h?void 0:h.clinicName,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"clinicName"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"clinicName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},O.touched.clinicName?null==F||null===(v=F.clinicName)||void 0===v?void 0:v.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_VACCINATED_DATE")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"lastVaccineDate",defaultValue:null==h?void 0:h.lastVaccineDate,rules:{required:S("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||S("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},max:(new Date).toISOString().split("T")[0]})}))),l.createElement(t.CardLabelError,{style:j},O.touched.lastVaccineDate?null==F||null===(m=F.lastVaccineDate)||void 0===m?void 0:m.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},S("PTR_VACCINATION_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:w,name:"vaccinationNumber",defaultValue:null==h?void 0:h.vaccinationNumber,render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:E.index===(null==h?void 0:h.key)&&"vaccinationNumber"===E.type,onChange:t=>{e.onChange(t.target.value),y({index:h.key,type:"vaccinationNumber"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},O.touched.vaccinationNumber?null==F||null===(f=F.vaccinationNumber)||void 0===f?void 0:f.message:""))),(null==R?void 0:R.label)&&l.createElement(t.Toast,{label:null==R?void 0:R.label,onClose:e=>{I(e=>null)}}))},f=e=>{var i,o,a,u,s;const{owner:c,focusIndex:p,allOwners:v,setFocusIndex:m,setOwners:f,t:h,config:E,setError:g,clearErrors:y,formState:_}=e,[S,b]=n.useState(null),{control:T,formState:C,watch:A,trigger:D}=r.useForm(),N=A(),{errors:P}=C;Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{D()},[]);const[x,R]=l.useState({});n.useEffect(()=>{d.isEqual(x,N)||(R({...N}),f(e=>e.map(e=>e.key&&e.key===c.key?{...e,...N}:{...e})),D())},[N]),n.useEffect(()=>{var e;Object.keys(P).length&&!d.isEqual((null===(e=_.errors[E.key])||void 0===e?void 0:e.type)||{},P)?g(E.key,{type:P}):!Object.keys(P).length&&_.errors[E.key]&&y(E.key)},[P]);const I={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==v?void 0:v.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_APPLICANT_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"applicantName",defaultValue:null==c?void 0:c.applicantName,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"applicantName"===p.type,onChange:t=>{e.onChange(t.target.value),m({index:c.key,type:"applicantName"})},onBlur:t=>{m({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},C.touched.applicantName?null==P||null===(i=P.applicantName)||void 0===i?void 0:i.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_FATHER_HUSBAND_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"fatherName",defaultValue:null==c?void 0:c.fatherName,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"fatherName"===p.type,onChange:t=>{e.onChange(t.target.value),m({index:c.key,type:"fatherName"})},onBlur:t=>{m({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},C.touched.fatherName?null==P||null===(o=P.fatherName)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"mobileNumber",defaultValue:null==c?void 0:c.mobileNumber,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[6789]\d{9}$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"mobileNumber"===p.type,onChange:t=>{e.onChange(t),m({index:c.key,type:"mobileNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},C.touched.mobileNumber?null==P||null===(a=P.mobileNumber)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_ALT_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"alternateNumber",defaultValue:null==c?void 0:c.alternateNumber,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>/^[6789]\d{9}$/.test(e)},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"alternateNumber"===p.type,onChange:t=>{e.onChange(t),m({index:c.key,type:"alternateNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},C.touched.alternateNumber?null==P||null===(u=P.alternateNumber)||void 0===u?void 0:u.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},h("PTR_EMAIL_ID")),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:T,name:"emailId",defaultValue:null==c?void 0:c.emailId,rules:{validate:e=>{const t=e.trim().toLowerCase();return/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(t)||"TL_EMAIL_ID_ERROR_MESSAGE"}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:p.index===(null==c?void 0:c.key)&&"emailId"===p.type,onChange:t=>{e.onChange(t),m({index:c.key,type:"emailId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},C.touched.emailId?null==P||null===(s=P.emailId)||void 0===s?void 0:s.message:""))),(null==S?void 0:S.label)&&l.createElement(t.Toast,{label:null==S?void 0:S.label,onClose:e=>{b(e=>null)}}))};let h=[];const E=e=>{let{currentStep:n=1,flow:o=""}=e;const{t:r}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":h=[];break;default:h=["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:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},h.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"},r(e))),i<o.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))};function g(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function y(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:c,formData:d,setFormError:p,clearFormErrors:v,config:m,formState:f,id:h}=e;const E=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],[y,_]=(Digit.ULBService.getCurrentTenantId(),n.useState(E?{...E,active:"ACTIVE"===(null==E?void 0:E.status),code:null==E?void 0:E.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{})),[S,b]=n.useState(null),[T,C]=n.useState(()=>(null==E?void 0:E.fileStoreId)||null),{dropdownData:A}=r;var D=A;const[N,P]=n.useState(!1),x=()=>{var e,t;let n=null===(e=f.errors)||void 0===e||null===(t=e[m.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(null==r?void 0:r.code)&&(n=n.filter(e=>e!=(null==r?void 0:r.code)),n.length?p(m.key,{type:n}):v(m.key))};return n.useEffect(()=>{null!=y&&y.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==y?void 0:y.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==y?void 0:y.code,filestoreId:T,documentUid:T}]}),N?N&&x():T&&null!=y&&y.code?T&&null!=y&&y.code&&x():(()=>{var e,t;let n=null===(e=f.errors)||void 0===e||null===(t=e[m.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(r.code)||(n.push(r.code),p(m.key,{type:n}))})()},[T,y,N]),n.useEffect(()=>{if("update"===c){var e,t;const n=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==r?void 0:r.code))[0],l=D.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return{...e,i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}})[0];l?(_(l),C(null==n?void 0:n.fileStoreId)):P(!0)}},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(S){const e=function(){if(S.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return C(null),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?C(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){u(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)}}()},[S]),n.useEffect(()=>{N&&C(null)},[N]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:y,option:D.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>_(e),optionKey:"i18nKey",t:o})):null,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:()=>{C(null)},id:h,message:T?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),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=[{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:"pincode",texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRCitizenAddress",key:"address",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]}];function b(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:c,formData:d,id:p}=e;const v=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0];console.log("filetetetetet",v),Digit.ULBService.getCurrentTenantId();const[m,f]=n.useState(v?{...v,active:!0===(null==r?void 0:r.active),code:null==v?void 0:v.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[h,E]=n.useState(null),[y,_]=n.useState(()=>(null==v?void 0:v.filestoreId)||null),{dropdownData:S}=r;var b=S;const[T,C]=n.useState(!1);return n.useEffect(()=>{null!=m&&m.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==m?void 0:m.code));return 0===(null==y?void 0:y.length)||null===y?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==m?void 0:m.code,filestoreId:y,documentUid:y}]})},[y,m]),n.useEffect(()=>{if("update"===c){var e,t;const n=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==r?void 0:r.code))[0],l=b.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return{...e,i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}})[0];l?(f(l),_(null==n?void 0:n.fileStoreId)):C(!0)}},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(h){const e=function(){if(h.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return _(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",h,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?_(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){u(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)}}()},[h]),n.useEffect(()=>{T&&_(null)},[T]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:m,style:{width:"100%"},option:b.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>f(e),optionKey:"i18nKey",t:o})):null,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){E(e.target.files[0])},onDelete:()=>{_(null)},id:p,message:y?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!y}))))}c(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:s,function(e,t){var n=[],l=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},r=n.push,a=n.indexOf,u={},s=u.toString,c=u.hasOwnProperty,d=c.toString,p=d.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},f=function(e){return null!=e&&e===e.window},h=e.document,E={type:!0,src:!0,nonce:!0,noModule:!0};function g(e,t,n){var l,i,o=(n=n||h).createElement("script");if(o.text=e,t)for(l in E)(i=t[l]||t.getAttribute&&t.getAttribute(l))&&o.setAttribute(l,i);n.head.appendChild(o).parentNode.removeChild(o)}function y(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[s.call(e)]||"object":typeof e}var _=function(e,t){return new _.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!m(e)&&!f(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}_.fn=_.prototype={jquery:"3.6.0",constructor:_,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=_.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return _.each(this,e)},map:function(e){return this.pushStack(_.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(_.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:r,sort:n.sort,splice:n.splice},_.extend=_.fn.extend=function(){var e,t,n,l,i,o,r=arguments[0]||{},a=1,u=arguments.length,s=!1;for("boolean"==typeof r&&(s=r,r=arguments[a]||{},a++),"object"==typeof r||m(r)||(r={}),a===u&&(r=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)l=e[t],"__proto__"!==t&&r!==l&&(s&&l&&(_.isPlainObject(l)||(i=Array.isArray(l)))?(n=r[t],o=i&&!Array.isArray(n)?[]:i||_.isPlainObject(n)?n:{},i=!1,r[t]=_.extend(s,o,l)):void 0!==l&&(r[t]=l));return r},_.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==s.call(e)||(t=l(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){g(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,l=0;if(S(e))for(n=e.length;l<n&&!1!==t.call(e[l],l,e[l]);l++);else for(l in e)if(!1===t.call(e[l],l,e[l]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?_.merge(n,"string"==typeof e?[e]:e):r.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,l=0,i=e.length;l<n;l++)e[i++]=t[l];return e.length=i,e},grep:function(e,t,n){for(var l=[],i=0,o=e.length,r=!n;i<o;i++)!t(e[i],i)!==r&&l.push(e[i]);return l},map:function(e,t,n){var l,i,r=0,a=[];if(S(e))for(l=e.length;r<l;r++)null!=(i=t(e[r],r,n))&&a.push(i);else for(r in e)null!=(i=t(e[r],r,n))&&a.push(i);return o(a)},guid:1,support:v}),"function"==typeof Symbol&&(_.fn[Symbol.iterator]=n[Symbol.iterator]),_.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){u["[object "+t+"]"]=t.toLowerCase()});var b=function(e){var t,n,l,i,o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,_="sizzle"+1*new Date,S=e.document,b=0,T=0,C=ue(),A=ue(),D=ue(),N=ue(),P=function(e,t){return e===t&&(d=!0),0},x={}.hasOwnProperty,R=[],I=R.pop,w=R.push,O=R.push,L=R.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+F+"*("+B+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+F+"*\\]",H=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(F+"+","g"),W=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),z=new RegExp("^"+F+"*,"+F+"*"),$=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),V=new RegExp(F+"|>"),q=new RegExp(H),G=new RegExp("^"+B+"$"),K={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},re=_e(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(R=L.call(S.childNodes),S.childNodes)}catch(e){O={apply:R.length?function(e,t){w.apply(e,L.call(t))}:function(e,t){for(var n=e.length,l=0;e[n++]=t[l++];);e.length=n-1}}}function ae(e,t,l,i){var o,a,s,c,d,m,E,g=t&&t.ownerDocument,S=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==S&&9!==S&&11!==S)return l;if(!i&&(p(t),t=t||v,f)){if(11!==S&&(d=Q.exec(e)))if(o=d[1]){if(9===S){if(!(s=t.getElementById(o)))return l;if(s.id===o)return l.push(s),l}else if(g&&(s=g.getElementById(o))&&y(t,s)&&s.id===o)return l.push(s),l}else{if(d[2])return O.apply(l,t.getElementsByTagName(e)),l;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(l,t.getElementsByClassName(o)),l}if(n.qsa&&!N[e+" "]&&(!h||!h.test(e))&&(1!==S||"object"!==t.nodeName.toLowerCase())){if(E=e,g=t,1===S&&(V.test(e)||$.test(e))){for((g=ee.test(e)&&Ee(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(le,ie):t.setAttribute("id",c=_)),a=(m=r(e)).length;a--;)m[a]=(c?"#"+c:":scope")+" "+ye(m[a]);E=m.join(",")}try{return O.apply(l,g.querySelectorAll(E)),l}catch(t){N(e,!0)}finally{c===_&&t.removeAttribute("id")}}}return u(e.replace(W,"$1"),t,l,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>l.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[_]=!0,e}function ce(e){var t=v.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)l.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ve(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&re(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,l){for(var i,o=e([],n.length,t),r=o.length;r--;)n[i=o[r]]&&(n[i]=!(l[i]=n[i]))})})}function Ee(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!Y.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=ae.setDocument=function(e){var t,i,r=e?e.ownerDocument||e:S;return r!=v&&9===r.nodeType&&r.documentElement?(m=(v=r).documentElement,f=!o(v),S!=v&&(i=v.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return m.appendChild(e).appendChild(v.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(v.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(v.getElementsByClassName),n.getById=ce(function(e){return m.appendChild(e).id=_,!v.getElementsByName||!v.getElementsByName(_).length}),n.getById?(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n=t.getElementById(e);return n?[n]:[]}}):(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n,l,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),l=0;o=i[l++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),l.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,l=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&l.push(n);return l}return o},l.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},E=[],h=[],(n.qsa=J.test(v.querySelectorAll))&&(ce(function(e){var t;m.appendChild(e).innerHTML="<a id='"+_+"'></a><select id='"+_+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+F+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+_+"-]").length||h.push("~="),(t=v.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+F+"*name"+F+"*="+F+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=v.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+F+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(g=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),E.push("!=",H)}),h=h.length&&new RegExp(h.join("|")),E=E.length&&new RegExp(E.join("|")),t=J.test(m.compareDocumentPosition),y=t||J.test(m.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,l=t&&t.parentNode;return e===l||!(!l||1!==l.nodeType||!(n.contains?n.contains(l):e.compareDocumentPosition&&16&e.compareDocumentPosition(l)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},P=t?function(e,t){if(e===t)return d=!0,0;var l=!e.compareDocumentPosition-!t.compareDocumentPosition;return l||(1&(l=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===l?e==v||e.ownerDocument==S&&y(S,e)?-1:t==v||t.ownerDocument==S&&y(S,t)?1:c?k(c,e)-k(c,t):0:4&l?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,l=0,i=e.parentNode,o=t.parentNode,r=[e],a=[t];if(!i||!o)return e==v?-1:t==v?1:i?-1:o?1:c?k(c,e)-k(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;r[l]===a[l];)l++;return l?pe(r[l],a[l]):r[l]==S?-1:a[l]==S?1:0},v):v},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&f&&!N[t+" "]&&(!E||!E.test(t))&&(!h||!h.test(t)))try{var l=g.call(e,t);if(l||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return l}catch(e){N(t,!0)}return ae(t,v,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=v&&p(e),y(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=v&&p(e);var i=l.attrHandle[t.toLowerCase()],o=i&&x.call(l.attrHandle,t.toLowerCase())?i(e,t,!f):void 0;return void 0!==o?o:n.attributes||!f?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ae.escape=function(e){return(e+"").replace(le,ie)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,l=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(P),d){for(;t=e[o++];)t===e[o]&&(i=l.push(o));for(;i--;)e.splice(l[i],1)}return c=null,e},i=ae.getText=function(e){var t,n="",l=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[l++];)n+=i(t);return n},(l=ae.selectors={cacheLength:50,createPseudo:se,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&q.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(l){var i=ae.attr(l,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(j," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,l,i){var o="nth"!==e.slice(0,3),r="last"!==e.slice(-4),a="of-type"===t;return 1===l&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,d,p,v,m,f=o!==r?"nextSibling":"previousSibling",h=t.parentNode,E=a&&t.nodeName.toLowerCase(),g=!u&&!a,y=!1;if(h){if(o){for(;f;){for(p=t;p=p[f];)if(a?p.nodeName.toLowerCase()===E:1===p.nodeType)return!1;m=f="only"===e&&!m&&"nextSibling"}return!0}if(m=[r?h.firstChild:h.lastChild],r&&g){for(y=(v=(s=(c=(d=(p=h)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=v&&h.childNodes[v];p=++v&&p&&p[f]||(y=v=0)||m.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[b,v,y];break}}else if(g&&(y=v=(s=(c=(d=(p=t)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1]),!1===y)for(;(p=++v&&p&&p[f]||(y=v=0)||m.pop())&&((a?p.nodeName.toLowerCase()!==E:1!==p.nodeType)||!++y||(g&&((c=(d=p[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[b,y]),p!==t)););return(y-=i)===l||y%l==0&&y/l>=0}}},PSEUDO:function(e,t){var n,i=l.pseudos[e]||l.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return i[_]?i(t):i.length>1?(n=[e,e,"",t],l.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var l,o=i(e,t),r=o.length;r--;)e[l=k(e,o[r])]=!(n[l]=o[r])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],l=a(e.replace(W,"$1"));return l[_]?se(function(e,t,n,i){for(var o,r=l(e,null,i,[]),a=e.length;a--;)(o=r[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,l(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return ae(e,t).length>0}}),contains:se(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}}),lang:se(function(e){return G.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===v.activeElement&&(!v.hasFocus||v.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=ve(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=me(t);function ge(){}function ye(e){for(var t=0,n=e.length,l="";t<n;t++)l+=e[t].value;return l}function _e(e,t,n){var l=t.dir,i=t.next,o=i||l,r=n&&"parentNode"===o,a=T++;return t.first?function(t,n,i){for(;t=t[l];)if(1===t.nodeType||r)return e(t,n,i);return!1}:function(t,n,u){var s,c,d,p=[b,a];if(u){for(;t=t[l];)if((1===t.nodeType||r)&&e(t,n,u))return!0}else for(;t=t[l];)if(1===t.nodeType||r)if(c=(d=t[_]||(t[_]={}))[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[l]||t;else{if((s=c[o])&&s[0]===b&&s[1]===a)return p[2]=s[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function Se(e){return e.length>1?function(t,n,l){for(var i=e.length;i--;)if(!e[i](t,n,l))return!1;return!0}:e[0]}function be(e,t,n,l,i){for(var o,r=[],a=0,u=e.length,s=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,l,i)||(r.push(o),s&&t.push(a)));return r}function Te(e,t,n,l,i,o){return l&&!l[_]&&(l=Te(l)),i&&!i[_]&&(i=Te(i,o)),se(function(o,r,a,u){var s,c,d,p=[],v=[],m=r.length,f=o||function(e,t,n){for(var l=0,i=t.length;l<i;l++)ae(e,t[l],n);return n}(t||"*",a.nodeType?[a]:a,[]),h=!e||!o&&t?f:be(f,p,e,a,u),E=n?i||(o?e:m||l)?[]:r:h;if(n&&n(h,E,a,u),l)for(s=be(E,v),l(s,[],a,u),c=s.length;c--;)(d=s[c])&&(E[v[c]]=!(h[v[c]]=d));if(o){if(i||e){if(i){for(s=[],c=E.length;c--;)(d=E[c])&&s.push(h[c]=d);i(null,E=[],s,u)}for(c=E.length;c--;)(d=E[c])&&(s=i?k(o,d):p[c])>-1&&(o[s]=!(r[s]=d))}}else E=be(E===r?E.splice(m,E.length):E),i?i(null,r,E,u):O.apply(r,E)})}function Ce(e){for(var t,n,i,o=e.length,r=l.relative[e[0].type],a=r||l.relative[" "],u=r?1:0,c=_e(function(e){return e===t},a,!0),d=_e(function(e){return k(t,e)>-1},a,!0),p=[function(e,n,l){var i=!r&&(l||n!==s)||((t=n).nodeType?c(e,n,l):d(e,n,l));return t=null,i}];u<o;u++)if(n=l.relative[e[u].type])p=[_e(Se(p),n)];else{if((n=l.filter[e[u].type].apply(null,e[u].matches))[_]){for(i=++u;i<o&&!l.relative[e[i].type];i++);return Te(u>1&&Se(p),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ye(e))}p.push(n)}return Se(p)}return ge.prototype=l.filters=l.pseudos,l.setFilters=new ge,r=ae.tokenize=function(e,t){var n,i,o,r,a,u,s,c=A[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=l.preFilter;a;){for(r in n&&!(i=z.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=$.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(W," ")}),a=a.slice(n.length)),l.filter)!(i=K[r].exec(a))||s[r]&&!(i=s[r](i))||(n=i.shift(),o.push({value:n,type:r,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ae.error(e):A(e,u).slice(0)},a=ae.compile=function(e,t){var n,i=[],o=[],a=D[e+" "];if(!a){for(t||(t=r(e)),n=t.length;n--;)(a=Ce(t[n]))[_]?i.push(a):o.push(a);(a=D(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,r,a,u,c){var d,m,h,E=0,g="0",y=o&&[],_=[],S=s,T=o||i&&l.find.TAG("*",c),C=b+=null==S?1:Math.random()||.1,A=T.length;for(c&&(s=r==v||r||c);g!==A&&null!=(d=T[g]);g++){if(i&&d){for(m=0,r||d.ownerDocument==v||(p(d),a=!f);h=e[m++];)if(h(d,r||v,a)){u.push(d);break}c&&(b=C)}n&&((d=!h&&d)&&E--,o&&y.push(d))}if(E+=g,n&&g!==E){for(m=0;h=t[m++];)h(y,_,r,a);if(o){if(E>0)for(;g--;)y[g]||_[g]||(_[g]=I.call(u));_=be(_)}O.apply(u,_),c&&!o&&_.length>0&&E+t.length>1&&ae.uniqueSort(u)}return c&&(b=C,s=S),y};return n?se(o):o}(o,i))).selector=e}return a},u=ae.select=function(e,t,n,i){var o,u,s,c,d,p="function"==typeof e&&e,v=!i&&r(e=p.selector||e);if(n=n||[],1===v.length){if((u=v[0]=v[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&f&&l.relative[u[1].type]){if(!(t=(l.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=K.needsContext.test(e)?0:u.length;o--&&!l.relative[c=(s=u[o]).type];)if((d=l.find[c])&&(i=d(s.matches[0].replace(te,ne),ee.test(u[0].type)&&Ee(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return O.apply(n,i),n;break}}return(p||a(e,v))(i,t,!f,n,!t||ee.test(e)&&Ee(t.parentNode)||t),n},n.sortStable=_.split("").sort(P).join("")===_,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(v.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var l;if(!n)return!0===e[t]?t.toLowerCase():(l=e.getAttributeNode(t))&&l.specified?l.value:null}),ae}(e);_.find=b,_.expr=b.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=b.uniqueSort,_.text=b.getText,_.isXMLDoc=b.isXML,_.contains=b.contains,_.escapeSelector=b.escape;var T=function(e,t,n){for(var l=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&_(e).is(n))break;l.push(e)}return l},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=_.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(e,t,n){return m(t)?_.grep(e,function(e,l){return!!t.call(e,l,e)!==n}):t.nodeType?_.grep(e,function(e){return e===t!==n}):"string"!=typeof t?_.grep(e,function(e){return a.call(t,e)>-1!==n}):_.filter(t,e,n)}_.filter=function(e,t,n){var l=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===l.nodeType?_.find.matchesSelector(l,e)?[l]:[]:_.find.matches(e,_.grep(t,function(e){return 1===e.nodeType}))},_.fn.extend({find:function(e){var t,n,l=this.length,i=this;if("string"!=typeof e)return this.pushStack(_(e).filter(function(){for(t=0;t<l;t++)if(_.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<l;t++)_.find(e,i[t],n);return l>1?_.uniqueSort(n):n},filter:function(e){return this.pushStack(P(this,e||[],!1))},not:function(e){return this.pushStack(P(this,e||[],!0))},is:function(e){return!!P(this,"string"==typeof e&&A.test(e)?_(e):e||[],!1).length}});var x,R=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(e,t,n){var l,i;if(!e)return this;if(n=n||x,"string"==typeof e){if(!(l="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:R.exec(e))||!l[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(l[1]){if(_.merge(this,_.parseHTML(l[1],(t=t instanceof _?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),N.test(l[1])&&_.isPlainObject(t))for(l in t)m(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(i=h.getElementById(l[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(_):_.makeArray(e,this)}).prototype=_.fn,x=_(h);var I=/^(?:parents|prev(?:Until|All))/,w={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(_.contains(this,t[e]))return!0})},closest:function(e,t){var n,l=0,i=this.length,o=[],r="string"!=typeof e&&_(e);if(!A.test(e))for(;l<i;l++)for(n=this[l];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(r?r.index(n)>-1:1===n.nodeType&&_.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(_(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return null!=e.contentDocument&&l(e.contentDocument)?e.contentDocument:(D(e,"template")&&(e=e.content||e),_.merge([],e.childNodes))}},function(e,t){_.fn[e]=function(n,l){var i=_.map(this,t,n);return"Until"!==e.slice(-5)&&(l=n),l&&"string"==typeof l&&(i=_.filter(l,i)),this.length>1&&(w[e]||_.uniqueSort(i),I.test(e)&&i.reverse()),this.pushStack(i)}});var L=/[^\x20\t\r\n\f]+/g;function k(e){return e}function M(e){throw e}function F(e,t,n,l){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(L)||[],function(e,n){t[n]=!0}),t}(e):_.extend({},e);var t,n,l,i,o=[],r=[],a=-1,u=function(){for(i=i||e.once,l=t=!0;r.length;a=-1)for(n=r.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},s={add:function(){return o&&(n&&!t&&(a=o.length-1,r.push(n)),function t(n){_.each(n,function(n,l){m(l)?e.unique&&s.has(l)||o.push(l):l&&l.length&&"string"!==y(l)&&t(l)})}(arguments),n&&!t&&u()),this},remove:function(){return _.each(arguments,function(e,t){for(var n;(n=_.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?_.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=r=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=r=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],r.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!l}};return s},_.extend({Deferred:function(t){var n=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],l="pending",i={state:function(){return l},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return _.Deferred(function(t){_.each(n,function(n,l){var i=m(e[l[4]])&&e[l[4]];o[l[1]](function(){var e=i&&i.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[l[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,l,i){var o=0;function r(t,n,l,i){return function(){var a=this,u=arguments,s=function(){var e,s;if(!(t<o)){if((e=l.apply(a,u))===n.promise())throw new TypeError("Thenable self-resolution");m(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?s.call(e,r(o,n,k,i),r(o,n,M,i)):(o++,s.call(e,r(o,n,k,i),r(o,n,M,i),r(o,n,k,n.notifyWith))):(l!==k&&(a=void 0,u=[e]),(i||n.resolveWith)(a,u))}},c=i?s:function(){try{s()}catch(e){_.Deferred.exceptionHook&&_.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(l!==M&&(a=void 0,u=[e]),n.rejectWith(a,u))}};t?c():(_.Deferred.getStackHook&&(c.stackTrace=_.Deferred.getStackHook()),e.setTimeout(c))}}return _.Deferred(function(e){n[0][3].add(r(0,e,m(i)?i:k,e.notifyWith)),n[1][3].add(r(0,e,m(t)?t:k)),n[2][3].add(r(0,e,m(l)?l:M))}).promise()},promise:function(e){return null!=e?_.extend(e,i):i}},o={};return _.each(n,function(e,t){var r=t[2],a=t[5];i[t[1]]=r.add,a&&r.add(function(){l=a},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),r.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=r.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,l=Array(n),o=i.call(arguments),r=_.Deferred(),a=function(e){return function(n){l[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||r.resolveWith(l,o)}};if(t<=1&&(F(e,r.done(a(n)).resolve,r.reject,!t),"pending"===r.state()||m(o[n]&&o[n].then)))return r.then();for(;n--;)F(o[n],a(n),r.reject);return r.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},_.readyException=function(t){e.setTimeout(function(){throw t})};var U=_.Deferred();function H(){h.removeEventListener("DOMContentLoaded",H),e.removeEventListener("load",H),_.ready()}_.fn.ready=function(e){return U.then(e).catch(function(e){_.readyException(e)}),this},_.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==e&&--_.readyWait>0||U.resolveWith(h,[_]))}}),_.ready.then=U.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(_.ready):(h.addEventListener("DOMContentLoaded",H),e.addEventListener("load",H));var j=function(e,t,n,l,i,o,r){var a=0,u=e.length,s=null==n;if("object"===y(n))for(a in i=!0,n)j(e,t,a,n[a],!0,o,r);else if(void 0!==l&&(i=!0,m(l)||(r=!0),s&&(r?(t.call(e,l),t=null):(s=t,t=function(e,t,n){return s.call(_(e),n)})),t))for(;a<u;a++)t(e[a],n,r?l:l.call(e[a],a,t(e[a],n)));return i?e:s?t.call(e):u?t(e[0],n):o},W=/^-ms-/,z=/-([a-z])/g;function $(e,t){return t.toUpperCase()}function V(e){return e.replace(W,"ms-").replace(z,$)}var q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=_.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var l,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(l in t)i[V(l)]=t[l];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,l=e[this.expando];if(void 0!==l){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in l?[t]:t.match(L)||[]).length;for(;n--;)delete l[t[n]]}(void 0===t||_.isEmptyObject(l))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!_.isEmptyObject(t)}};var K=new G,Y=new G,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var l;if(void 0===n&&1===e.nodeType)if(l="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(l))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}Y.set(e,t,n)}else n=void 0;return n}_.extend({hasData:function(e){return Y.hasData(e)||K.hasData(e)},data:function(e,t,n){return Y.access(e,t,n)},removeData:function(e,t){Y.remove(e,t)},_data:function(e,t,n){return K.access(e,t,n)},_removeData:function(e,t){K.remove(e,t)}}),_.fn.extend({data:function(e,t){var n,l,i,o=this[0],r=o&&o.attributes;if(void 0===e){if(this.length&&(i=Y.get(o),1===o.nodeType&&!K.get(o,"hasDataAttrs"))){for(n=r.length;n--;)r[n]&&0===(l=r[n].name).indexOf("data-")&&(l=V(l.slice(5)),J(o,l,i[l]));K.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Y.set(this,e)}):j(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Y.get(o,e))||void 0!==(n=J(o,e))?n:void 0;this.each(function(){Y.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Y.remove(this,e)})}}),_.extend({queue:function(e,t,n){var l;if(e)return l=K.get(e,t=(t||"fx")+"queue"),n&&(!l||Array.isArray(n)?l=K.access(e,t,_.makeArray(n)):l.push(n)),l||[]},dequeue:function(e,t){var n=_.queue(e,t=t||"fx"),l=n.length,i=n.shift(),o=_._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),l--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){_.dequeue(e,t)},o)),!l&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return K.get(e,n)||K.access(e,n,{empty:_.Callbacks("once memory").add(function(){K.remove(e,[t+"queue",n])})})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?_.queue(this[0],e):void 0===t?this:this.each(function(){var n=_.queue(this,e,t);_._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&_.dequeue(this,e)})},dequeue:function(e){return this.each(function(){_.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,l=1,i=_.Deferred(),o=this,r=this.length,a=function(){--l||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";r--;)(n=K.get(o[r],e+"queueHooks"))&&n.empty&&(l++,n.empty.add(a));return a(),i.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,le=function(e){return _.contains(e.ownerDocument,e)},ie={composed:!0};ne.getRootNode&&(le=function(e){return _.contains(e.ownerDocument,e)||e.getRootNode(ie)===e.ownerDocument});var oe=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&le(e)&&"none"===_.css(e,"display")};function re(e,t,n,l){var i,o,r=20,a=l?function(){return l.cur()}:function(){return _.css(e,t,"")},u=a(),s=n&&n[3]||(_.cssNumber[t]?"":"px"),c=e.nodeType&&(_.cssNumber[t]||"px"!==s&&+u)&&ee.exec(_.css(e,t));if(c&&c[3]!==s){for(s=s||c[3],c=+(u/=2)||1;r--;)_.style(e,t,c+s),(1-o)*(1-(o=a()/u||.5))<=0&&(r=0),c/=o;_.style(e,t,(c*=2)+s),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],l&&(l.unit=s,l.start=c,l.end=i)),i}var ae={};function ue(e){var t,n=e.ownerDocument,l=e.nodeName,i=ae[l];return i||(t=n.body.appendChild(n.createElement(l)),i=_.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ae[l]=i,i)}function se(e,t){for(var n,l,i=[],o=0,r=e.length;o<r;o++)(l=e[o]).style&&(n=l.style.display,t?("none"===n&&(i[o]=K.get(l,"display")||null,i[o]||(l.style.display="")),""===l.style.display&&oe(l)&&(i[o]=ue(l))):"none"!==n&&(i[o]="none",K.set(l,"display",n)));for(o=0;o<r;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}_.fn.extend({show:function(){return se(this,!0)},hide:function(){return se(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){oe(this)?_(this).show():_(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,ve=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var fe={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?_.merge([e],n):n}function Ee(e,t){for(var n=0,l=e.length;n<l;n++)K.set(e[n],"globalEval",!t||K.get(t[n],"globalEval"))}fe.tbody=fe.tfoot=fe.colgroup=fe.caption=fe.thead,fe.th=fe.td,v.option||(fe.optgroup=fe.option=[1,"<select multiple='multiple'>","</select>"]);var ge=/<|&#?\w+;/;function ye(e,t,n,l,i){for(var o,r,a,u,s,c,d=t.createDocumentFragment(),p=[],v=0,m=e.length;v<m;v++)if((o=e[v])||0===o)if("object"===y(o))_.merge(p,o.nodeType?[o]:o);else if(ge.test(o)){for(r=r||d.appendChild(t.createElement("div")),a=(ve.exec(o)||["",""])[1].toLowerCase(),r.innerHTML=(u=fe[a]||fe._default)[1]+_.htmlPrefilter(o)+u[2],c=u[0];c--;)r=r.lastChild;_.merge(p,r.childNodes),(r=d.firstChild).textContent=""}else p.push(t.createTextNode(o));for(d.textContent="",v=0;o=p[v++];)if(l&&_.inArray(o,l)>-1)i&&i.push(o);else if(s=le(o),r=he(d.appendChild(o),"script"),s&&Ee(r),n)for(c=0;o=r[c++];)me.test(o.type||"")&&n.push(o);return d}var _e=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function be(){return!1}function Te(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function Ce(e,t,n,l,i,o){var r,a;if("object"==typeof t){for(a in"string"!=typeof n&&(l=l||n,n=void 0),t)Ce(e,a,n,l,t[a],o);return e}if(null==l&&null==i?(i=n,l=n=void 0):null==i&&("string"==typeof n?(i=l,l=void 0):(i=l,l=n,n=void 0)),!1===i)i=be;else if(!i)return e;return 1===o&&(r=i,(i=function(e){return _().off(e),r.apply(this,arguments)}).guid=r.guid||(r.guid=_.guid++)),e.each(function(){_.event.add(this,t,i,l,n)})}function Ae(e,t,n){n?(K.set(e,t,!1),_.event.add(e,t,{namespace:!1,handler:function(e){var l,o,r=K.get(this,t);if(1&e.isTrigger&&this[t]){if(r.length)(_.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),K.set(this,t,r),l=n(this,t),this[t](),r!==(o=K.get(this,t))||l?K.set(this,t,!1):o={},r!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else r.length&&(K.set(this,t,{value:_.event.trigger(_.extend(r[0],_.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===K.get(e,t)&&_.event.add(e,t,Se)}_.event={global:{},add:function(e,t,n,l,i){var o,r,a,u,s,c,d,p,v,m,f,h=K.get(e);if(q(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&_.find.matchesSelector(ne,i),n.guid||(n.guid=_.guid++),(u=h.events)||(u=h.events=Object.create(null)),(r=h.handle)||(r=h.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(L)||[""]).length;s--;)v=f=(a=_e.exec(t[s])||[])[1],m=(a[2]||"").split(".").sort(),v&&(d=_.event.special[v]||{},d=_.event.special[v=(i?d.delegateType:d.bindType)||v]||{},c=_.extend({type:v,origType:f,data:l,handler:n,guid:n.guid,selector:i,needsContext:i&&_.expr.match.needsContext.test(i),namespace:m.join(".")},o),(p=u[v])||((p=u[v]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,m,r)||e.addEventListener&&e.addEventListener(v,r)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),_.event.global[v]=!0)},remove:function(e,t,n,l,i){var o,r,a,u,s,c,d,p,v,m,f,h=K.hasData(e)&&K.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(L)||[""]).length;s--;)if(v=f=(a=_e.exec(t[s])||[])[1],m=(a[2]||"").split(".").sort(),v){for(d=_.event.special[v]||{},p=u[v=(l?d.delegateType:d.bindType)||v]||[],a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=o=p.length;o--;)c=p[o],!i&&f!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||l&&l!==c.selector&&("**"!==l||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));r&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,h.handle)||_.removeEvent(e,v,h.handle),delete u[v])}else for(v in u)_.event.remove(e,v+t[s],n,l,!0);_.isEmptyObject(u)&&K.remove(e,"handle events")}},dispatch:function(e){var t,n,l,i,o,r,a=new Array(arguments.length),u=_.event.fix(e),s=(K.get(this,"events")||Object.create(null))[u.type]||[],c=_.event.special[u.type]||{};for(a[0]=u,t=1;t<arguments.length;t++)a[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(r=_.event.handlers.call(this,u,s),t=0;(i=r[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(l=((_.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(u.result=l)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,l,i,o,r,a=[],u=t.delegateCount,s=e.target;if(u&&s.nodeType&&!("click"===e.type&&e.button>=1))for(;s!==this;s=s.parentNode||this)if(1===s.nodeType&&("click"!==e.type||!0!==s.disabled)){for(o=[],r={},n=0;n<u;n++)void 0===r[i=(l=t[n]).selector+" "]&&(r[i]=l.needsContext?_(i,this).index(s)>-1:_.find(i,this,null,[s]).length),r[i]&&o.push(l);o.length&&a.push({elem:s,handlers:o})}return s=this,u<t.length&&a.push({elem:s,handlers:t.slice(u)}),a},addProp:function(e,t){Object.defineProperty(_.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[_.expando]?e:new _.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click",Se),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&D(t,"input")&&K.get(t,"click")||D(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},_.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},_.Event=function(e,t){if(!(this instanceof _.Event))return new _.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Se:be,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&_.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[_.expando]=!0},_.Event.prototype={constructor:_.Event,isDefaultPrevented:be,isPropagationStopped:be,isImmediatePropagationStopped:be,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Se,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Se,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Se,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},_.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},_.event.addProp),_.each({focus:"focusin",blur:"focusout"},function(e,t){_.event.special[e]={setup:function(){return Ae(this,e,Te),!1},trigger:function(){return Ae(this,e),!0},_default:function(){return!0},delegateType:t}}),_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){_.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,l=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===l||_.contains(l,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),_.fn.extend({on:function(e,t,n,l){return Ce(this,e,t,n,l)},one:function(e,t,n,l){return Ce(this,e,t,n,l,1)},off:function(e,t,n){var l,i;if(e&&e.preventDefault&&e.handleObj)return l=e.handleObj,_(e.delegateTarget).off(l.namespace?l.origType+"."+l.namespace:l.origType,l.selector,l.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=be),this.each(function(){_.event.remove(this,e,n,t)})}});var De=/<script|<style|<link/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function xe(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&_(e).children("tbody")[0]||e}function Re(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ie(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function we(e,t){var n,l,i,o,r,a;if(1===t.nodeType){if(K.hasData(e)&&(a=K.get(e).events))for(i in K.remove(t,"handle events"),a)for(n=0,l=a[i].length;n<l;n++)_.event.add(t,i,a[i][n]);Y.hasData(e)&&(o=Y.access(e),r=_.extend({},o),Y.set(t,r))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Le(e,t,n,l){t=o(t);var i,r,a,u,s,c,d=0,p=e.length,f=p-1,h=t[0],E=m(h);if(E||p>1&&"string"==typeof h&&!v.checkClone&&Ne.test(h))return e.each(function(i){var o=e.eq(i);E&&(t[0]=h.call(this,i,o.html())),Le(o,t,n,l)});if(p&&(r=(i=ye(t,e[0].ownerDocument,!1,e,l)).firstChild,1===i.childNodes.length&&(i=r),r||l)){for(u=(a=_.map(he(i,"script"),Re)).length;d<p;d++)s=i,d!==f&&(s=_.clone(s,!0,!0),u&&_.merge(a,he(s,"script"))),n.call(e[d],s,d);if(u)for(c=a[a.length-1].ownerDocument,_.map(a,Ie),d=0;d<u;d++)me.test((s=a[d]).type||"")&&!K.access(s,"globalEval")&&_.contains(c,s)&&(s.src&&"module"!==(s.type||"").toLowerCase()?_._evalUrl&&!s.noModule&&_._evalUrl(s.src,{nonce:s.nonce||s.getAttribute("nonce")},c):g(s.textContent.replace(Pe,""),s,c))}return e}function ke(e,t,n){for(var l,i=t?_.filter(t,e):e,o=0;null!=(l=i[o]);o++)n||1!==l.nodeType||_.cleanData(he(l)),l.parentNode&&(n&&le(l)&&Ee(he(l,"script")),l.parentNode.removeChild(l));return e}_.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var l,i,o,r,a=e.cloneNode(!0),u=le(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||_.isXMLDoc(e)))for(r=he(a),l=0,i=(o=he(e)).length;l<i;l++)Oe(o[l],r[l]);if(t)if(n)for(o=o||he(e),r=r||he(a),l=0,i=o.length;l<i;l++)we(o[l],r[l]);else we(e,a);return(r=he(a,"script")).length>0&&Ee(r,!u&&he(e,"script")),a},cleanData:function(e){for(var t,n,l,i=_.event.special,o=0;void 0!==(n=e[o]);o++)if(q(n)){if(t=n[K.expando]){if(t.events)for(l in t.events)i[l]?_.event.remove(n,l):_.removeEvent(n,l,t.handle);n[K.expando]=void 0}n[Y.expando]&&(n[Y.expando]=void 0)}}}),_.fn.extend({detach:function(e){return ke(this,e,!0)},remove:function(e){return ke(this,e)},text:function(e){return j(this,function(e){return void 0===e?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Le(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||xe(this,e).appendChild(e)})},prepend:function(){return Le(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=xe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(_.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return _.clone(this,e,t)})},html:function(e){return j(this,function(e){var t=this[0]||{},n=0,l=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!De.test(e)&&!fe[(ve.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(_.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Le(this,arguments,function(t){var n=this.parentNode;_.inArray(this,e)<0&&(_.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){_.fn[e]=function(e){for(var n,l=[],i=_(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),_(i[a])[t](n),r.apply(l,n.get());return this.pushStack(l)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Fe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=function(e,t,n){var l,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in l=n.call(e),t)e.style[i]=o[i];return l},Ue=new RegExp(te.join("|"),"i");function He(e,t,n){var l,i,o,r,a=e.style;return(n=n||Fe(e))&&(""!==(r=n.getPropertyValue(t)||n[t])||le(e)||(r=_.style(e,t)),!v.pixelBoxStyles()&&Me.test(r)&&Ue.test(t)&&(l=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=l,a.minWidth=i,a.maxWidth=o)),void 0!==r?r+"":r}function je(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(s).appendChild(c);var t=e.getComputedStyle(c);l="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",r=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),ne.removeChild(s),c=null}}function n(e){return Math.round(parseFloat(e))}var l,i,o,r,a,u,s=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===c.style.backgroundClip,_.extend(v,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),r},pixelPosition:function(){return t(),l},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,l,i;return null==a&&(t=h.createElement("table"),n=h.createElement("tr"),l=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",l.style.height="9px",l.style.display="block",ne.appendChild(t).appendChild(n).appendChild(l),i=e.getComputedStyle(n),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),a}}))}();var We=["Webkit","Moz","ms"],ze=h.createElement("div").style,$e={};function Ve(e){return _.cssProps[e]||$e[e]||(e in ze?e:$e[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in ze)return e}(e)||e)}var qe=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ke={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var l=ee.exec(t);return l?Math.max(0,l[2]-(n||0))+(l[3]||"px"):t}function Ze(e,t,n,l,i,o){var r="width"===t?1:0,a=0,u=0;if(n===(l?"border":"content"))return 0;for(;r<4;r+=2)"margin"===n&&(u+=_.css(e,n+te[r],!0,i)),l?("content"===n&&(u-=_.css(e,"padding"+te[r],!0,i)),"margin"!==n&&(u-=_.css(e,"border"+te[r]+"Width",!0,i))):(u+=_.css(e,"padding"+te[r],!0,i),"padding"!==n?u+=_.css(e,"border"+te[r]+"Width",!0,i):a+=_.css(e,"border"+te[r]+"Width",!0,i));return!l&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-a-.5))||0),u}function Je(e,t,n){var l=Fe(e),i=(!v.boxSizingReliable()||n)&&"border-box"===_.css(e,"boxSizing",!1,l),o=i,r=He(e,t,l),a="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(r)){if(!n)return r;r="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&D(e,"tr")||"auto"===r||!parseFloat(r)&&"inline"===_.css(e,"display",!1,l))&&e.getClientRects().length&&(i="border-box"===_.css(e,"boxSizing",!1,l),(o=a in e)&&(r=e[a])),(r=parseFloat(r)||0)+Ze(e,t,n||(i?"border":"content"),o,l,r)+"px"}function Qe(e,t,n,l,i){return new Qe.prototype.init(e,t,n,l,i)}_.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=He(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,l){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,r,a=V(t),u=Ge.test(t),s=e.style;if(u||(t=Ve(a)),r=_.cssHooks[t]||_.cssHooks[a],void 0===n)return r&&"get"in r&&void 0!==(i=r.get(e,!1,l))?i:s[t];"string"==(o=typeof n)&&(i=ee.exec(n))&&i[1]&&(n=re(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(_.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),r&&"set"in r&&void 0===(n=r.set(e,n,l))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,l){var i,o,r,a=V(t);return Ge.test(t)||(t=Ve(a)),(r=_.cssHooks[t]||_.cssHooks[a])&&"get"in r&&(i=r.get(e,!0,n)),void 0===i&&(i=He(e,t,l)),"normal"===i&&t in Ye&&(i=Ye[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),_.each(["height","width"],function(e,t){_.cssHooks[t]={get:function(e,n,l){if(n)return!qe.test(_.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,l):Be(e,Ke,function(){return Je(e,t,l)})},set:function(e,n,l){var i,o=Fe(e),r=!v.scrollboxSize()&&"absolute"===o.position,a=(r||l)&&"border-box"===_.css(e,"boxSizing",!1,o),u=l?Ze(e,t,l,a,o):0;return a&&r&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),u&&(i=ee.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=_.css(e,t)),Xe(0,n,u)}}}),_.cssHooks.marginLeft=je(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Be(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(e,t){_.cssHooks[e+t]={expand:function(n){for(var l=0,i={},o="string"==typeof n?n.split(" "):[n];l<4;l++)i[e+te[l]+t]=o[l]||o[l-2]||o[0];return i}},"margin"!==e&&(_.cssHooks[e+t].set=Xe)}),_.fn.extend({css:function(e,t){return j(this,function(e,t,n){var l,i,o={},r=0;if(Array.isArray(t)){for(l=Fe(e),i=t.length;r<i;r++)o[t[r]]=_.css(e,t[r],!1,l);return o}return void 0!==n?_.style(e,t,n):_.css(e,t)},e,t,arguments.length>1)}}),_.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,l,i,o){this.elem=e,this.prop=n,this.easing=i||_.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=l,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?_.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=_.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){_.fx.step[e.prop]?_.fx.step[e.prop](e):1!==e.elem.nodeType||!_.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:_.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},_.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},_.fx=Qe.prototype.init,_.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function it(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(it):e.setTimeout(it,_.fx.interval),_.fx.tick())}function ot(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function rt(e,t){var n,l=0,i={height:e};for(t=t?1:0;l<4;l+=2-t)i["margin"+(n=te[l])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function at(e,t,n){for(var l,i=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),o=0,r=i.length;o<r;o++)if(l=i[o].call(n,t,e))return l}function ut(e,t,n){var l,i,o=0,r=ut.prefilters.length,a=_.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=et||ot(),n=Math.max(0,s.startTime+s.duration-t),l=1-(n/s.duration||0),o=0,r=s.tweens.length;o<r;o++)s.tweens[o].run(l);return a.notifyWith(e,[s,l,n]),l<1&&r?n:(r||a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s]),!1)},s=a.promise({elem:e,props:_.extend({},t),opts:_.extend(!0,{specialEasing:{},easing:_.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||ot(),duration:n.duration,tweens:[],createTween:function(t,n){var l=_.Tween(e,s.opts,t,n,s.opts.specialEasing[t]||s.opts.easing);return s.tweens.push(l),l},stop:function(t){var n=0,l=t?s.tweens.length:0;if(i)return this;for(i=!0;n<l;n++)s.tweens[n].run(1);return t?(a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s,t])):a.rejectWith(e,[s,t]),this}}),c=s.props;for(function(e,t){var n,l,i,o,r;for(n in e)if(i=t[l=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==l&&(e[l]=o,delete e[n]),(r=_.cssHooks[l])&&"expand"in r)for(n in o=r.expand(o),delete e[l],o)n in e||(e[n]=o[n],t[n]=i);else t[l]=i}(c,s.opts.specialEasing);o<r;o++)if(l=ut.prefilters[o].call(s,e,c,s.opts))return m(l.stop)&&(_._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return _.map(c,at,s),m(s.opts.start)&&s.opts.start.call(e,s),s.progress(s.opts.progress).done(s.opts.done,s.opts.complete).fail(s.opts.fail).always(s.opts.always),_.fx.timer(_.extend(u,{elem:e,anim:s,queue:s.opts.queue})),s}_.Animation=_.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return re(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(L);for(var n,l=0,i=e.length;l<i;l++)(ut.tweeners[n=e[l]]=ut.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var l,i,o,r,a,u,s,c,d="width"in t||"height"in t,p=this,v={},m=e.style,f=e.nodeType&&oe(e),h=K.get(e,"fxshow");for(l in n.queue||(null==(r=_._queueHooks(e,"fx")).unqueued&&(r.unqueued=0,a=r.empty.fire,r.empty.fire=function(){r.unqueued||a()}),r.unqueued++,p.always(function(){p.always(function(){r.unqueued--,_.queue(e,"fx").length||r.empty.fire()})})),t)if(nt.test(i=t[l])){if(delete t[l],o=o||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!h||void 0===h[l])continue;f=!0}v[l]=h&&h[l]||_.style(e,l)}if((u=!_.isEmptyObject(t))||!_.isEmptyObject(v))for(l in d&&1===e.nodeType&&(n.overflow=[m.overflow,m.overflowX,m.overflowY],null==(s=h&&h.display)&&(s=K.get(e,"display")),"none"===(c=_.css(e,"display"))&&(s?c=s:(se([e],!0),s=e.style.display||s,c=_.css(e,"display"),se([e]))),("inline"===c||"inline-block"===c&&null!=s)&&"none"===_.css(e,"float")&&(u||(p.done(function(){m.display=s}),null==s&&(s="none"===(c=m.display)?"":c)),m.display="inline-block")),n.overflow&&(m.overflow="hidden",p.always(function(){m.overflow=n.overflow[0],m.overflowX=n.overflow[1],m.overflowY=n.overflow[2]})),u=!1,v)u||(h?"hidden"in h&&(f=h.hidden):h=K.access(e,"fxshow",{display:s}),o&&(h.hidden=!f),f&&se([e],!0),p.done(function(){for(l in f||se([e]),K.remove(e,"fxshow"),v)_.style(e,l,v[l])})),u=at(f?h[l]:0,l,p),l in h||(h[l]=u.start,f&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),_.speed=function(e,t,n){var l=e&&"object"==typeof e?_.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return _.fx.off?l.duration=0:"number"!=typeof l.duration&&(l.duration=l.duration in _.fx.speeds?_.fx.speeds[l.duration]:_.fx.speeds._default),null!=l.queue&&!0!==l.queue||(l.queue="fx"),l.old=l.complete,l.complete=function(){m(l.old)&&l.old.call(this),l.queue&&_.dequeue(this,l.queue)},l},_.fn.extend({fadeTo:function(e,t,n,l){return this.filter(oe).css("opacity",0).show().end().animate({opacity:t},e,n,l)},animate:function(e,t,n,l){var i=_.isEmptyObject(e),o=_.speed(t,n,l),r=function(){var t=ut(this,_.extend({},e),o);(i||K.get(this,"finish"))&&t.stop(!0)};return r.finish=r,i||!1===o.queue?this.each(r):this.queue(o.queue,r)},stop:function(e,t,n){var l=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=_.timers,r=K.get(this);if(i)r[i]&&r[i].stop&&l(r[i]);else for(i in r)r[i]&&r[i].stop&<.test(i)&&l(r[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||_.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=K.get(this),l=n[e+"queue"],i=n[e+"queueHooks"],o=_.timers,r=l?l.length:0;for(n.finish=!0,_.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<r;t++)l[t]&&l[t].finish&&l[t].finish.call(this);delete n.finish})}}),_.each(["toggle","show","hide"],function(e,t){var n=_.fn[t];_.fn[t]=function(e,l,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(rt(t,!0),e,l,i)}}),_.each({slideDown:rt("show"),slideUp:rt("hide"),slideToggle:rt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){_.fn[e]=function(e,n,l){return this.animate(t,e,n,l)}}),_.timers=[],_.fx.tick=function(){var e,t=0,n=_.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||_.fx.stop(),et=void 0},_.fx.timer=function(e){_.timers.push(e),_.fx.start()},_.fx.interval=13,_.fx.start=function(){tt||(tt=!0,it())},_.fx.stop=function(){tt=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(t,n){return t=_.fx&&_.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,l){var i=e.setTimeout(n,t);l.stop=function(){e.clearTimeout(i)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",v.checkOn=""!==e.value,v.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",v.radioValue="t"===e.value}();var st,ct=_.expr.attrHandle;_.fn.extend({attr:function(e,t){return j(this,_.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){_.removeAttr(this,e)})}}),_.extend({attr:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?_.prop(e,t,n):(1===o&&_.isXMLDoc(e)||(i=_.attrHooks[t.toLowerCase()]||(_.expr.match.bool.test(t)?st:void 0)),void 0!==n?null===n?void _.removeAttr(e,t):i&&"set"in i&&void 0!==(l=i.set(e,n,t))?l:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(l=i.get(e,t))?l:null==(l=_.find.attr(e,t))?void 0:l)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,l=0,i=t&&t.match(L);if(i&&1===e.nodeType)for(;n=i[l++];)e.removeAttribute(n)}}),st={set:function(e,t,n){return!1===t?_.removeAttr(e,n):e.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||_.find.attr;ct[t]=function(e,t,l){var i,o,r=t.toLowerCase();return l||(o=ct[r],ct[r]=i,i=null!=n(e,t,l)?r:null,ct[r]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function vt(e){return(e.match(L)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(L)||[]}_.fn.extend({prop:function(e,t){return j(this,_.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[_.propFix[e]||e]})}}),_.extend({prop:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(e)||(i=_.propHooks[t=_.propFix[t]||t]),void 0!==n?i&&"set"in i&&void 0!==(l=i.set(e,n,t))?l:e[t]=n:i&&"get"in i&&null!==(l=i.get(e,t))?l:e[t]},propHooks:{tabIndex:{get:function(e){var t=_.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(_.propHooks.selected={get:function(e){return null},set:function(e){}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(e){var t,n,l,i,o,r,a,u=0;if(m(e))return this.each(function(t){_(this).addClass(e.call(this,t,mt(this)))});if((t=ft(e)).length)for(;n=this[u++];)if(i=mt(n),l=1===n.nodeType&&" "+vt(i)+" "){for(r=0;o=t[r++];)l.indexOf(" "+o+" ")<0&&(l+=o+" ");i!==(a=vt(l))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,l,i,o,r,a,u=0;if(m(e))return this.each(function(t){_(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=ft(e)).length)for(;n=this[u++];)if(i=mt(n),l=1===n.nodeType&&" "+vt(i)+" "){for(r=0;o=t[r++];)for(;l.indexOf(" "+o+" ")>-1;)l=l.replace(" "+o+" "," ");i!==(a=vt(l))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,l="string"===n||Array.isArray(e);return"boolean"==typeof t&&l?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(n){_(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,r;if(l)for(i=0,o=_(this),r=ft(e);t=r[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=mt(this))&&K.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":K.get(this,"__className__")||""))})},hasClass:function(e){var t,n,l=0;for(t=" "+e+" ";n=this[l++];)if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;_.fn.extend({val:function(e){var t,n,l,i=this[0];return arguments.length?(l=m(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=l?e.call(this,n,_(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=_.map(i,function(e){return null==e?"":e+""})),(t=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=_.valHooks[i.type]||_.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ht,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(e){var t=_.find.attr(e,"value");return null!=t?t:vt(_.text(e))}},select:{get:function(e){var t,n,l,i=e.options,o=e.selectedIndex,r="select-one"===e.type,a=r?null:[],u=r?o+1:i.length;for(l=o<0?u:r?o:0;l<u;l++)if(((n=i[l]).selected||l===o)&&!n.disabled&&(!n.parentNode.disabled||!D(n.parentNode,"optgroup"))){if(t=_(n).val(),r)return t;a.push(t)}return a},set:function(e,t){for(var n,l,i=e.options,o=_.makeArray(t),r=i.length;r--;)((l=i[r]).selected=_.inArray(_.valHooks.option.get(l),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=_.inArray(_(e).val(),t)>-1}},v.checkOn||(_.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in e;var Et=/^(?:focusinfocus|focusoutblur)$/,gt=function(e){e.stopPropagation()};_.extend(_.event,{trigger:function(t,n,l,i){var o,r,a,u,s,d,p,v,E=[l||h],g=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(r=v=a=l=l||h,3!==l.nodeType&&8!==l.nodeType&&!Et.test(g+_.event.triggered)&&(g.indexOf(".")>-1&&(y=g.split("."),g=y.shift(),y.sort()),s=g.indexOf(":")<0&&"on"+g,(t=t[_.expando]?t:new _.Event(g,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=y.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=l),n=null==n?[t]:_.makeArray(n,[t]),p=_.event.special[g]||{},i||!p.trigger||!1!==p.trigger.apply(l,n))){if(!i&&!p.noBubble&&!f(l)){for(Et.test((u=p.delegateType||g)+g)||(r=r.parentNode);r;r=r.parentNode)E.push(r),a=r;a===(l.ownerDocument||h)&&E.push(a.defaultView||a.parentWindow||e)}for(o=0;(r=E[o++])&&!t.isPropagationStopped();)v=r,t.type=o>1?u:p.bindType||g,(d=(K.get(r,"events")||Object.create(null))[t.type]&&K.get(r,"handle"))&&d.apply(r,n),(d=s&&r[s])&&d.apply&&q(r)&&(t.result=d.apply(r,n),!1===t.result&&t.preventDefault());return t.type=g,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(E.pop(),n)||!q(l)||s&&m(l[g])&&!f(l)&&((a=l[s])&&(l[s]=null),_.event.triggered=g,t.isPropagationStopped()&&v.addEventListener(g,gt),l[g](),t.isPropagationStopped()&&v.removeEventListener(g,gt),_.event.triggered=void 0,a&&(l[s]=a)),t.result}},simulate:function(e,t,n){var l=_.extend(new _.Event,n,{type:e,isSimulated:!0});_.event.trigger(l,null,t)}}),_.fn.extend({trigger:function(e,t){return this.each(function(){_.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return _.event.trigger(e,t,n,!0)}}),v.focusin||_.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){_.event.simulate(t,e.target,_.event.fix(e))};_.event.special[t]={setup:function(){var l=this.ownerDocument||this.document||this,i=K.access(l,t);i||l.addEventListener(e,n,!0),K.access(l,t,(i||0)+1)},teardown:function(){var l=this.ownerDocument||this.document||this,i=K.access(l,t)-1;i?K.access(l,t,i):(l.removeEventListener(e,n,!0),K.remove(l,t))}}});var yt=e.location,_t={guid:Date.now()},St=/\?/;_.parseXML=function(t){var n,l;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return l=n&&n.getElementsByTagName("parsererror")[0],n&&!l||_.error("Invalid XML: "+(l?_.map(l.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var bt=/\[\]$/,Tt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function Dt(e,t,n,l){var i;if(Array.isArray(t))_.each(t,function(t,i){n||bt.test(e)?l(e,i):Dt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,l)});else if(n||"object"!==y(t))l(e,t);else for(i in t)Dt(e+"["+i+"]",t[i],n,l)}_.param=function(e,t){var n,l=[],i=function(e,t){var n=m(t)?t():t;l[l.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!_.isPlainObject(e))_.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return l.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=_.prop(this,"elements");return e?_.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!_(this).is(":disabled")&&At.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:n.replace(Tt,"\r\n")}}).get()}});var Nt=/%20/g,Pt=/#.*$/,xt=/([?&])_=[^&]*/,Rt=/^(.*?):[ \t]*([^\r\n]*)$/gm,It=/^(?:GET|HEAD)$/,wt=/^\/\//,Ot={},Lt={},kt="*/".concat("*"),Mt=h.createElement("a");function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(L)||[];if(m(n))for(;l=o[i++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function Bt(e,t,n,l){var i={},o=e===Lt;function r(a){var u;return i[a]=!0,_.each(e[a]||[],function(e,a){var s=a(t,n,l);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),r(s),!1)}),u}return r(t.dataTypes[0])||!i["*"]&&r("*")}function Ut(e,t){var n,l,i=_.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:l||(l={}))[n]=t[n]);return l&&_.extend(!0,e,l),e}Mt.href=yt.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,_.ajaxSettings),t):Ut(_.ajaxSettings,e)},ajaxPrefilter:Ft(Ot),ajaxTransport:Ft(Lt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,i,o,r,a,u,s,c,d,p,v=_.ajaxSetup({},n=n||{}),m=v.context||v,f=v.context&&(m.nodeType||m.jquery)?_(m):_.event,E=_.Deferred(),g=_.Callbacks("once memory"),y=v.statusCode||{},S={},b={},T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(s){if(!r)for(r={};t=Rt.exec(o);)r[t[1].toLowerCase()+" "]=(r[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=r[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return s?o:null},setRequestHeader:function(e,t){return null==s&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,S[e]=t),this},overrideMimeType:function(e){return null==s&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)C.always(e[C.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||T;return l&&l.abort(t),A(0,t),this}};if(E.promise(C),v.url=((t||v.url||yt.href)+"").replace(wt,yt.protocol+"//"),v.type=n.method||n.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(L)||[""],null==v.crossDomain){u=h.createElement("a");try{u.href=v.url,u.href=u.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=u.protocol+"//"+u.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=_.param(v.data,v.traditional)),Bt(Ot,v,n,C),s)return C;for(d in(c=_.event&&v.global)&&0==_.active++&&_.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!It.test(v.type),i=v.url.replace(Pt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(p=v.url.slice(i.length),v.data&&(v.processData||"string"==typeof v.data)&&(i+=(St.test(i)?"&":"?")+v.data,delete v.data),!1===v.cache&&(i=i.replace(xt,"$1"),p=(St.test(i)?"&":"?")+"_="+_t.guid+++p),v.url=i+p),v.ifModified&&(_.lastModified[i]&&C.setRequestHeader("If-Modified-Since",_.lastModified[i]),_.etag[i]&&C.setRequestHeader("If-None-Match",_.etag[i])),(v.data&&v.hasContent&&!1!==v.contentType||n.contentType)&&C.setRequestHeader("Content-Type",v.contentType),C.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+kt+"; q=0.01":""):v.accepts["*"]),v.headers)C.setRequestHeader(d,v.headers[d]);if(v.beforeSend&&(!1===v.beforeSend.call(m,C,v)||s))return C.abort();if(T="abort",g.add(v.complete),C.done(v.success),C.fail(v.error),l=Bt(Lt,v,n,C)){if(C.readyState=1,c&&f.trigger("ajaxSend",[C,v]),s)return C;v.async&&v.timeout>0&&(a=e.setTimeout(function(){C.abort("timeout")},v.timeout));try{s=!1,l.send(S,A)}catch(e){if(s)throw e;A(-1,e)}}else A(-1,"No Transport");function A(t,n,r,u){var d,p,h,S,b,T=n;s||(s=!0,a&&e.clearTimeout(a),l=void 0,o=u||"",C.readyState=t>0?4:0,d=t>=200&&t<300||304===t,r&&(S=function(e,t,n){for(var l,i,o,r,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===l&&(l=e.mimeType||t.getResponseHeader("Content-Type"));if(l)for(i in a)if(a[i]&&a[i].test(l)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}r||(r=i)}o=o||r}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,C,r)),!d&&_.inArray("script",v.dataTypes)>-1&&_.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),S=function(e,t,n,l){var i,o,r,a,u,s={},c=e.dataTypes.slice();if(c[1])for(r in e.converters)s[r.toLowerCase()]=e.converters[r];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&l&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(r=s[u+" "+o]||s["* "+o]))for(i in s)if((a=i.split(" "))[1]===o&&(r=s[u+" "+a[0]]||s["* "+a[0]])){!0===r?r=s[i]:!0!==s[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,S,C,d),d?(v.ifModified&&((b=C.getResponseHeader("Last-Modified"))&&(_.lastModified[i]=b),(b=C.getResponseHeader("etag"))&&(_.etag[i]=b)),204===t||"HEAD"===v.type?T="nocontent":304===t?T="notmodified":(T=S.state,p=S.data,d=!(h=S.error))):(h=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(n||T)+"",d?E.resolveWith(m,[p,T,C]):E.rejectWith(m,[C,T,h]),C.statusCode(y),y=void 0,c&&f.trigger(d?"ajaxSuccess":"ajaxError",[C,v,d?p:h]),g.fireWith(m,[C,T]),c&&(f.trigger("ajaxComplete",[C,v]),--_.active||_.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return _.get(e,t,n,"json")},getScript:function(e,t){return _.get(e,void 0,t,"script")}}),_.each(["get","post"],function(e,t){_[t]=function(e,n,l,i){return m(n)&&(i=i||l,l=n,n=void 0),_.ajax(_.extend({url:e,type:t,dataType:i,data:n,success:l},_.isPlainObject(e)&&e))}}),_.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),_._evalUrl=function(e,t,n){return _.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){_.globalEval(e,t,n)}})},_.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=_(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){_(this).wrapInner(e.call(this,t))}):this.each(function(){var t=_(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){_(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(e){return!_.expr.pseudos.visible(e)},_.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},jt=_.ajaxSettings.xhr();v.cors=!!jt&&"withCredentials"in jt,v.ajax=jt=!!jt,_.ajaxTransport(function(t){var n,l;if(v.cors||jt&&!t.crossDomain)return{send:function(i,o){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];for(r in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(r,i[r]);n=function(e){return function(){n&&(n=l=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ht[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),l=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=l:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&l()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),_.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return _.globalEval(e),e}}}),_.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),_.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(l,i){t=_("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var Wt,zt=[],$t=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||_.expando+"_"+_t.guid++;return this[e]=!0,e}}),_.ajaxPrefilter("json jsonp",function(t,n,l){var i,o,r,a=!1!==t.jsonp&&($t.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&$t.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace($t,"$1"+i):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return r||_.error(i+" was not called"),r[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){r=arguments},l.always(function(){void 0===o?_(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),r&&m(o)&&o(r[0]),r=o=void 0}),"script"}),v.createHTMLDocument=((Wt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),_.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((l=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(l)):t=h),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ye([e],t,o),o&&o.length&&_(o).remove(),_.merge([],i.childNodes)));var l,i,o},_.fn.load=function(e,t,n){var l,i,o,r=this,a=e.indexOf(" ");return a>-1&&(l=vt(e.slice(a)),e=e.slice(0,a)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),r.length>0&&_.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,r.html(l?_("<div>").append(_.parseHTML(e)).find(l):e)}).always(n&&function(e,t){r.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},_.expr.pseudos.animated=function(e){return _.grep(_.timers,function(t){return e===t.elem}).length},_.offset={setOffset:function(e,t,n){var l,i,o,r,a,u,s=_.css(e,"position"),c=_(e),d={};"static"===s&&(e.style.position="relative"),a=c.offset(),o=_.css(e,"top"),u=_.css(e,"left"),("absolute"===s||"fixed"===s)&&(o+u).indexOf("auto")>-1?(r=(l=c.position()).top,i=l.left):(r=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,_.extend({},a))),null!=t.top&&(d.top=t.top-a.top+r),null!=t.left&&(d.left=t.left-a.left+i),"using"in t?t.using.call(e,d):c.css(d)}},_.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){_.offset.setOffset(this,e,t)});var t,n,l=this[0];return l?l.getClientRects().length?{top:(t=l.getBoundingClientRect()).top+(n=l.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,l=this[0],i={top:0,left:0};if("fixed"===_.css(l,"position"))t=l.getBoundingClientRect();else{for(t=this.offset(),n=l.ownerDocument,e=l.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===_.css(e,"position");)e=e.parentNode;e&&e!==l&&1===e.nodeType&&((i=_(e).offset()).top+=_.css(e,"borderTopWidth",!0),i.left+=_.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-_.css(l,"marginTop",!0),left:t.left-i.left-_.css(l,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===_.css(e,"position");)e=e.offsetParent;return e||ne})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;_.fn[e]=function(l){return j(this,function(e,l,i){var o;if(f(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[l];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[l]=i},e,l,arguments.length)}}),_.each(["top","left"],function(e,t){_.cssHooks[t]=je(v.pixelPosition,function(e,n){if(n)return n=He(e,t),Me.test(n)?_(e).position()[t]+"px":n})}),_.each({Height:"height",Width:"width"},function(e,t){_.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,l){_.fn[l]=function(i,o){var r=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return j(this,function(t,n,i){var o;return f(t)?0===l.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?_.css(t,n,a):_.style(t,n,i,a)},t,r?i:void 0,r)}})}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){_.fn[t]=function(e){return this.on(t,e)}}),_.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,l){return this.on(t,e,n,l)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){_.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;_.proxy=function(e,t){var n,l,o;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return l=i.call(arguments,2),(o=function(){return e.apply(t||this,l.concat(i.call(arguments)))}).guid=e.guid=e.guid||_.guid++,o},_.holdReady=function(e){e?_.readyWait++:_.ready(!0)},_.isArray=Array.isArray,_.parseJSON=JSON.parse,_.nodeName=D,_.isFunction=m,_.isWindow=f,_.camelCase=V,_.type=y,_.now=Date.now,_.isNumeric=function(e){var t=_.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},_.trim=function(e){return null==e?"":(e+"").replace(Vt,"")};var qt=e.jQuery,Gt=e.$;return _.noConflict=function(t){return e.$===_&&(e.$=Gt),t&&e.jQuery===_&&(e.jQuery=qt),_},void 0===t&&(e.jQuery=e.$=_),_})});const T=e=>{var n,o,r;let{data:a,OpenImage:u}=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(t.TelePhone,{mobile:a.mobileNumber}),a.source&&l.createElement("p",null,s("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,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(o=a.thumbnailsToShow)||void 0===o||null===(r=o.thumbs)||void 0===r?void 0:r.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)},C=e=>{var r,a,u,s,c,d,p;const{t:v}=i.useTranslation(),m=null==e||null===(r=e.application)||void 0===r||null===(a=r.workflow)||void 0===a?void 0:a.businessService,{isLoading:f,data:h}=Digit.Hooks.useWorkflowDetails({tenantId:null===(u=e.application)||void 0===u?void 0:u.tenantId,id:null===(s=e.application)||void 0===s?void 0:s.applicationNumber,moduleCode:m});function E(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const g=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(T,{data:o})}if(t.state){var o,r,a,u,s;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(r=t.assignes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.mobileNumber,comment:v(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(T,{data:e,OpenImage:E})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.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(T,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==h||null===(c=h.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},v("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=h&&h.timeline&&1===(null==h||null===(d=h.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:v((null==h||null===(p=h.timeline[0])||void 0===p?void 0:p.state)&&`WF_${m}_${h.timeline[0].state}`||"NA"),customChild:g(null==h?void 0:h.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==h?void 0:h.timeline)&&(null==h?void 0:h.timeline.map((e,n,i)=>{var o;let r="";var a,u,s,c,d,p,m,f;return window.location.href.includes("/obps/")&&(r=null!==(a=workflowDetails)&&void 0!==a&&null!==(u=a.data)&&void 0!==u&&null!==(s=u.timeline[n-1])&&void 0!==s&&null!==(c=s.state)&&void 0!==c&&c.includes("BACK_FROM")||null!==(d=workflowDetails)&&void 0!==d&&null!==(p=d.data)&&void 0!==p&&null!==(m=p.timeline[n-1])&&void 0!==m&&null!==(f=m.state)&&void 0!==f&&f.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,label:v(`ES_PTR_COMMON_STATUS_${null==h||null===(o=h.processInstances[n].state)||void 0===o?void 0:o.state}${r}`),customChild:g(e)}))})))),h&&(n=>{var i,r,a;let u=n[0];const s=n.map(e=>e.action);if(s.includes("PAY")||s.includes("EDIT")){let e=s.indexOf("EDIT")||s.indexOf("PAY");e=-1!=e?e:s.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===(r=e.application)||void 0===r?void 0:r.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;case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(o.Link,{to:"/digit-ui/citizen/fsm/rate/"+e.id},l.createElement(t.SubmitBar,{label:v("CS_APPLICATION_DETAILS_RATE")})));default:return null}})(null==h?void 0:h.nextActions))},A=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],D=()=>{var e,n,r,a,s,c;const{path:d,...p}=o.useRouteMatch(),{t:v}=i.useTranslation(),m=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRCreatePet"),f=null===(r=Digit)||void 0===r||null===(a=r.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRApplicationDetails"),h=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("PTRMyApplications");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(E=A)&&(E=[]),E.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:m}),l.createElement(t.PrivateRoute,{path:d+"/petservice/application/:acknowledgementIds/:tenantId",component:f}),l.createElement(t.PrivateRoute,{path:d+"/petservice/my-applications",component:h}),l.createElement(t.PrivateRoute,{path:d+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:v,parentRoute:d}))}))));var E},N=e=>{let{jumpTo:n}=e;const{t:r}=i.useTranslation(),a=o.useHistory();return l.createElement(t.LinkButton,{label:r("CS_COMMON_CHANGE"),className:"check-page-link-button",onClick:function(){a.push(n)}})},P=e=>e.substr(0,1).toUpperCase()+e.substr(1),x=(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},{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,o,r,a,u,s,c;return{t:n,tenantId:null==t?void 0:t.code,name:`${n(null==t?void 0:t.i18nKey)} ${c=n("ULBGRADE_"+(null==t||null===(i=t.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),c.toLowerCase().split(" ").map(P).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_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}]},x(e,n),{title:n("PTR_LOCATION_DETAILS"),values:[{title:n("PTR_PINCODE"),value:null==e||null===(r=e.address)||void 0===r?void 0:r.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===(s=e.address)||void 0===s?void 0:s.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)}},I=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_SUCCESS"):t("ES_PTR_RESPONSE_CREATE_ACTION"):e.isLoading?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_PENDING"):t("CS_PTR_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_FAILED"):t("CS_PTR_APPLICATION_FAILED")},w={padding:"4px 0px",justifyContent:"space-between"},O=e=>{var n;return l.createElement(t.Banner,{message:I(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%"}})},L=e=>{var n;let{application:r,buttonLabel:a}=e;const{t:u}=i.useTranslation();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_NO_LABEL"),note:null==r?void 0:r.applicationNumber}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICANT_NAME"),note:null==r?void 0:r.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_CATEGORY"),note:u("PTR_APPLICATION")}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==r||null===(n=r.petDetails)||void 0===n?void 0:n.petType}),l.createElement(t.KeyNote,{keyValue:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:u("PTR_COMMON_"+(null==r?void 0:r.status))}),l.createElement(o.Link,{to:`/digit-ui/citizen/ptr/petservice/application/${null==r?void 0:r.applicationNumber}/${null==r?void 0:r.tenantId}`},l.createElement(t.SubmitBar,{label:a})))};var k,M=Array.isArray,F="object"==typeof s&&s&&s.Object===Object&&s,B="object"==typeof self&&self&&self.Object===Object&&self,U=F||B||Function("return this")(),H=U.Symbol,j=Object.prototype,W=j.hasOwnProperty,z=j.toString,$=H?H.toStringTag:void 0,V=Object.prototype.toString,q=H?H.toStringTag:void 0,G=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":q&&q in Object(e)?function(e){var t=W.call(e,$),n=e[$];try{e[$]=void 0;var l=!0}catch(e){}var i=z.call(e);return l&&(t?e[$]=n:delete e[$]),i}(e):function(e){return V.call(e)}(e)},K=function(e){return null!=e&&"object"==typeof e},Y=function(e){return"symbol"==typeof e||K(e)&&"[object Symbol]"==G(e)},X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Q=function(e){if(!J(e))return!1;var t=G(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ee=U["__core-js_shared__"],te=(k=/[^.]+$/.exec(ee&&ee.keys&&ee.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",ne=Function.prototype.toString,le=function(e){if(null!=e){try{return ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ie=/^\[object .+?Constructor\]$/,oe=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!J(e)||(t=e,te&&te in t))&&(Q(e)?oe:ie).test(le(e));var t}(n)?n:void 0},ae=re(Object,"create"),ue=Object.prototype.hasOwnProperty,se=Object.prototype.hasOwnProperty;function ce(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])}}ce.prototype.clear=function(){this.__data__=ae?ae(null):{},this.size=0},ce.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ce.prototype.get=function(e){var t=this.__data__;if(ae){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ue.call(t,e)?t[e]:void 0},ce.prototype.has=function(e){var t=this.__data__;return ae?void 0!==t[e]:se.call(t,e)},ce.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ae&&void 0===t?"__lodash_hash_undefined__":t,this};var de=ce,pe=function(e,t){return e===t||e!=e&&t!=t},ve=function(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1},me=Array.prototype.splice;function fe(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])}}fe.prototype.clear=function(){this.__data__=[],this.size=0},fe.prototype.delete=function(e){var t=this.__data__,n=ve(t,e);return!(n<0||(n==t.length-1?t.pop():me.call(t,n,1),--this.size,0))},fe.prototype.get=function(e){var t=this.__data__,n=ve(t,e);return n<0?void 0:t[n][1]},fe.prototype.has=function(e){return ve(this.__data__,e)>-1},fe.prototype.set=function(e,t){var n=this.__data__,l=ve(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var he=fe,Ee=re(U,"Map"),ge=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.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 de,map:new(Ee||he),string:new de}},ye.prototype.delete=function(e){var t=ge(this,e).delete(e);return this.size-=t?1:0,t},ye.prototype.get=function(e){return ge(this,e).get(e)},ye.prototype.has=function(e){return ge(this,e).has(e)},ye.prototype.set=function(e,t){var n=ge(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var _e=ye;function Se(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 r=e.apply(this,l);return n.cache=o.set(i,r)||o,r};return n.cache=new(Se.Cache||_e),n}Se.Cache=_e;var be,Te,Ce=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/\\(\\)?/g,De=(be=Se(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ce,function(e,n,l,i){t.push(l?i.replace(Ae,"$1"):n||e)}),t},function(e){return 500===Te.size&&Te.clear(),e}),Te=be.cache,be),Ne=H?H.prototype:void 0,Pe=Ne?Ne.toString:void 0,xe=function(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Re=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return M(e)?e:function(e,t){if(M(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Y(e))||Z.test(e)||!X.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:De(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(M(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(Y(t))return Pe?Pe.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[xe(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Ie=e=>{let{t:n,currentPage:i,columns:o,data:r,getCellProps:a,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:v,sortParams:m,totalRecords:f}=e;return l.createElement(t.Table,{t:n,data:r,currentPage:i,columns:o,getCellProps:a,onNextPage:c,onPrevPage:d,pageSizeLimit:v,disableSort:u,onPageSizeChange:p,onSort:s,sortParams:m,totalRecords:f})},we=e=>{let{businessService:r}=e;const{t:a}=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:[]}],[s,c]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===r).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)});c(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"},s.map((e,t)=>{let{link:n,text:i,hyperlink:r=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},r?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},a(i)))}))))},Oe={date:t.DatePicker,mobileNumber:t.MobileNumber},Le=e=>{var n;let{onSearch:o,type:a,onClose:u,searchFields:s,searchParams:c,isInboxPage:d,clearSearch:p}=e;const{t:v}=i.useTranslation(),{handleSubmit:m,reset:f,watch:h,control:E,formState:g,setValue:y}=r.useForm({defaultValues:d?c:{locality:null,city:null,...c}}),_=h(),S=innerWidth<=640;function b(){const e=s.reduce((e,t)=>({...e,[null==t?void 0:t.name]:""}),{});if(f(e),d){const e={...c};e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o({...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:m(e=>{e.mobileNumber||delete e.mobileNumber,e.delete=[],s.forEach(t=>{e[t.name]||e.delete.push(t.name)}),o(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==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,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(r.Controller,e.type?{render:t=>l.createElement(null==Oe?void 0:Oe[e.type],{formValue:_,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:E,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:E,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===(a=o[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(g.errors).length||(()=>{var e;let t=!0;return Object.keys(_).forEach(e=>{!["locality","city"].includes(e)&&_[e]&&(t=!1)}),null==s||!s.find(e=>"locality"===e.name)||null!=_&&null!==(e=_.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(g.errors).length,label:v("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},ke=e=>{let{tableConfig:o,filterComponent:r,...a}=e;const{data:u,useNewInboxAPI:s}=a,{t:c}=i.useTranslation(),[d,p]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[v,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[f,h]=n.useState(!1),E=l.useMemo(()=>a.isSearch?o.searchColumns(a):o.inboxColumns(a)||[],[]);let g;return a.isLoading?g=l.createElement(t.Loader,null):f?g=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?g=v&&l.createElement(v,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},c("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(Ie,{t:c,data:u,columns:E,getCellProps:e=>({style:{minWidth:e.column.Header===c("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(we,{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:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:a.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(Le,{defaultSearchParams:a.defaultSearchParams,onSearch:e=>{a.onSearch(e),h(!1)},type:"desktop",searchFields:a.searchFields,isInboxPage:!(null!=a&&a.isSearch),searchParams:a.searchParams,clearSearch:()=>h(!0)}),l.createElement("div",{className:"result",style:{marginLeft:null!=a&&a.isSearch?"":"24px",flex:1}},g)))},Me=e=>{const{t:o}=i.useTranslation(),[r,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: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:r,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},Fe=e=>{let{t:i,data:o,onFilterChange:r,onSearch:a,onSort:u,serviceRequestIdKey:s,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:v,searchFields:m,sortParams:f,linkPrefix:h,filterComponent:E}=e;const[g,y]=n.useState(p?"SEARCH":""),[_,S]=n.useState(!!p),[b,T]=n.useState(f),[C]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(E)});n.useEffect(()=>{g&&S(!0)},[g]);const A=()=>{S(!1),y(""),T(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:s,linkPrefix:h||"/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"},a&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{y("SEARCH"),S(!0)}}),!p&&r&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{y("FILTER"),S(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{y("SORT"),S(!0)}})),D,_&&l.createElement(t.PopUp,null,"FILTER"===g&&l.createElement("div",{className:"popup-module"},l.createElement(C,{onFilterChange:e=>{r(e),S(!1)},Close:A,type:"mobile",searchParams:v})),"SORT"===g&&l.createElement("div",{className:"popup-module"},l.createElement(Me,{type:"mobile",sortParams:f,onClose:A,onSort:u})),"SEARCH"===g&&l.createElement("div",{className:"popup-module"},l.createElement(Le,{type:"mobile",onClose:A,onSearch:a,isFstpOperator:c,searchParams:v,searchFields:m}))))},Be=e=>{let{linkPrefix:r,classNameForMobileView:a=""}=e;const{t:u}=i.useTranslation(),s=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:r+"/search"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];s.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"},c.map((e,t)=>{let{link:n,text:i}=e;return l.createElement("span",{className:"link",key:t},l.createElement(o.Link,{to:n},i))}))))},Ue=e=>{let{data:t,isLoading:n,isSearch:o,searchFields:r,onFilterChange:a,onSearch:u,onSort:s,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:v,tableConfig:m,filterComponent:f}=e;const{t:h}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(Be,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),l.createElement(Fe,{t:h,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:a,isLoading:n,isSearch:o,onSearch:u,onSort:s,searchParams:d,searchFields:r,linkPrefix:v,sortParams:p,serviceRequestIdKey:null==m?void 0:m.serviceRequestIdKey,filterComponent:f}))))},He=e=>{var o,r,a,u,s;let{useNewInboxAPI:c,parentRoute:d,moduleCode:p="PTR",initialStates:v={},filterComponent:m,isInbox:f,rawWfHandler:h,rawSearchHandler:E,combineResponse:g,wfConfig:y,searchConfig:_,middlewaresWf:S,middlewareSearch:b,EmptyResultInboxComp:T}=e;const C=Digit.ULBService.getCurrentTenantId();console.log("here");const{t:A}=i.useTranslation(),[D,N]=n.useState(()=>f?{}:{enabled:!1}),[P,x]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[R,I]=n.useState(v.pageOffset||0),[w,O]=n.useState(v.pageSize||10),[L,k]=n.useState(v.sortParams||[{id:"createdTime",desc:!0}]),[M,F]=n.useState(v.searchParams||{});let B=window.Digit.Utils.browser.isMobile(),U=B?{limit:100,offset:0,sortBy:null==L||null===(o=L[0])||void 0===o?void 0:o.id,sortOrder:null!=L&&null!==(r=L[0])&&void 0!==r&&r.desc?"DESC":"ASC"}:{limit:w,offset:R,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:H,data:j,searchFields:W,...z}=c?Digit.Hooks.useNewInboxGeneral({tenantId:C,ModuleCode:p,filters:{...M,...U,sortParams:L}}):Digit.Hooks.useInboxGeneral({tenantId:C,businessService:p,isInbox:f,filters:{...M,...U,sortParams:L},rawWfHandler:h,rawSearchHandler:E,combineResponse:g,wfConfig:y,searchConfig:{...D,..._},middlewaresWf:S,middlewareSearch:b});n.useEffect(()=>{I(0)},[M]);const $=e=>{let t=e.delete,n={...M,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,F({...n}),N({enabled:!0})},V=n.useCallback(e=>{0!==e.length&&k(e)},[]);var q,G;if(null!==(null==z||null===(s=z.data)||void 0===s?void 0:s.length))return B?l.createElement(Ue,{data:j,isLoading:H,isSearch:!f,searchFields:W,onFilterChange:$,onSearch:$,onSort:V,parentRoute:d,searchParams:M,sortParams:L,linkPrefix:d+"/application-details/",tableConfig:null!=z&&z.tableConfig?null===(q=res)||void 0===q?void 0:q.tableConfig:P(A).PTR,filterComponent:m,EmptyResultInboxComp:T,useNewInboxAPI:c}):l.createElement("div",null,f&&l.createElement(t.Header,null,A("ES_COMMON_INBOX")),l.createElement(ke,{moduleCode:p,data:j,tableConfig:P(A).PTR,isLoading:H,defaultSearchParams:v.searchParams,isSearch:!f,onFilterChange:$,searchFields:W,onSearch:$,onSort:V,onNextPage:()=>{I(e=>e+w)},onPrevPage:()=>{I(e=>e-w)},currentPage:Math.floor(R/w),pageSizeLimit:w,disableSort:!1,onPageSizeChange:e=>{O(Number(e.target.value))},parentRoute:d,searchParams:M,sortParams:L,totalRecords:Number(null==j||null===(G=j[0])||void 0===G?void 0:G.totalCount),filterComponent:m,EmptyResultInboxComp:T,useNewInboxAPI:c}))},je=e=>{var i,a;let{isLoading:u,t:s,onSubmit:c,data:d,count:p,setShowToast:v}=e;const m=window.Digit.Utils.browser.isMobile(),{register:f,control:h,handleSubmit:E,setValue:g,getValues:y,reset:_,formState:S}=r.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 b=Digit.ULBService.getStateId(),{data:T}=Digit.Hooks.ptr.usePTRPetMDMS(b,"PetService","PetType");let C=[];T&&T.map(e=>{C.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const A=e=>l.createElement("span",{className:"cell-text"},e),D=n.useMemo(()=>[{Header:s("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:s("PTR_APPLICANT_NAME"),Cell:e=>{var t,n;return A(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.applicantName))},disableSortBy:!0},{Header:s("PTR_PET_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType))},disableSortBy:!0},{Header:s("PTR_BREED_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType))},disableSortBy:!0},{Header:s("PTR_MOBILE_NUMBER"),Cell:e=>{var t;let{row:n}=e;return A(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.mobileNumber))},disableSortBy:!0}],[]),N=n.useCallback(e=>{0!==e.length&&(g("sortBy",e.id),g("sortOrder",e.desc?"DESC":"ASC"))},[]);function P(){g("offset",y("offset")-y("limit")),E(c)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,s("PTR_SEARCH_PET_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},s("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:c,handleSubmit:E},l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_APPLICATION_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:f({})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_SEARCH_PET_TYPE")),l.createElement(r.Controller,{control:h,name:"petType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:C,optionKey:"i18nKey",t:s,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_OWNER_MOBILE_NO")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:s("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,s("PTR_FROM_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"fromDate",control:h})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_TO_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:h})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:s("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{_({applicationNumber:"",fromDate:"",toDate:"",petType:"",mobileNumber:"",status:"",breedType:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),v(null),P()}},s("ES_COMMON_CLEAR_ALL")))),!u&&null!=d&&d.display?l.createElement(t.Card,{style:{marginTop:20}},s(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:s,data:d,totalRecords:p,columns:D,getCellProps:e=>({style:{minWidth:e.column.Header===s("PTR_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){g("limit",Number(e.target.value)),E(c)()},currentPage:y("offset")/y("limit"),onNextPage:function(){g("offset",y("offset")+y("limit")),E(c)()},onPrevPage:P,pageSizeLimit:y("limit"),onSort:N,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},We=e=>{o.useParams();const{t:r}=i.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,s]=n.useState({}),[c,d]=n.useState(null),p={enabled:!!(u&&Object.keys(u).length>0)},{isLoading:v,isSuccess:m,data:{PetRegistrationApplications:f,Count:h}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:u},p);return l.createElement(l.Fragment,null,l.createElement(je,{t:r,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"}):s(i):d({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):d({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:m&&!v?f.length>0?f:{display:"ES_COMMON_NO_DATA"}:"",count:h}),c&&l.createElement(t.Toast,{error:c.error,warning:c.warning,label:r(c.label),isDleteBtn:!0,onClose:()=>{d(null)}}))},ze=e=>{var n,r,a,s,c,d,p,v;let{path:m,url:f,userType:h}=e;console.log("before coming here");const{t:E}=i.useTranslation(),g=o.useLocation();sessionStorage.removeItem("revalidateddone");const y=window.Digit.Utils.browser.isMobile(),_={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},S=e=>{let{location:n}=e;const{t:r}=i.useTranslation(),a=o.useLocation().search,u=(new URLSearchParams(a).get("from"),Digit.Hooks.useQueryParams(),[{path:"/digit-ui/employee",content:r("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/ptr/petservice/inbox",content:r("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/digit-ui/employee/ptr/petservice/my-applications",content:r("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:y?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},b=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRNewApplication"),T=null===(a=Digit)||void 0===a||null===(s=a.ComponentRegistryService)||void 0===s?void 0:s.getComponent("ApplicationDetails"),C=null===(c=Digit)||void 0===c||null===(d=c.ComponentRegistryService)||void 0===d?void 0:d.getComponent("PTRResponse"),A=(null===(p=Digit)||void 0===p||null===(v=p.ComponentRegistryService)||void 0===v||v.getComponent("PTRDocsRequired"),window.location.href.includes("ptr/response")),D=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return console.log("path",m),l.createElement(o.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},A?null:l.createElement("div",{style:D?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(S,{location:g})),l.createElement(t.PrivateRoute,{exact:!0,path:m+"/",component:()=>l.createElement($l,{matchPath:m,userType:h})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/inbox",component:()=>l.createElement(He,{useNewInboxAPI:!0,parentRoute:m,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:_,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/new-application",component:()=>l.createElement(b,{parentUrl:f})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/application-details/:id",component:()=>l.createElement(T,{parentRoute:m})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(T,{parentRoute:m})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/response",component:e=>l.createElement(C,u({},e,{parentRoute:m}))}),l.createElement(t.PrivateRoute,{path:m+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:E,parentRoute:m}))}),l.createElement(t.PrivateRoute,{path:m+"/searchold",component:()=>l.createElement(He,{parentRoute:m,businessService:"ptr",middlewareSearch:searchMW,initialStates:_,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:m+"/petservice/my-applications",component:e=>l.createElement(We,u({},e,{parentRoute:m}))}))))},$e=e=>{var n;let{status:o,searchParams:r,onAssignmentChange:a,statusMap:u}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>a({...e,state:o.state},o),checked:null==r?void 0:r.applicationStatus.some(e=>e.uuid===o.uuid),label:`${o.name} (${(null==u||null===(n=u.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-"})`})},Ve=e=>{var o,r,a,u,s;let{onAssignmentChange:c,searchParams:d,businessServices:p,statusMap:v}=e;const{t:m}=i.useTranslation(),[f,h]=n.useState(!1),{data:E,isLoading:g}=Digit.Hooks.useApplicationStatusGeneral({businessServices:p},{}),{userRoleStates:y}=E||{},_=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_PTR_COMMON_STATUS_"+(e.state||"CREATED"));return g?l.createElement(t.Loader,null):null!=y&&y.filter(e=>!e.isTerminateState).length?l.createElement("div",{className:"status-container"},l.createElement("div",{className:"filter-label",style:{fontWeight:"normal"}},m("ES_INBOX_STATUS")),null==y||null===(o=y.filter(e=>!e.isTerminateState))||void 0===o||null===(r=o.slice(0,4))||void 0===r?void 0:r.map((e,t)=>l.createElement($e,{businessServices:p,key:t,onAssignmentChange:c,status:{name:_(e,m),code:e.applicationStatus,...e},searchParams:d,statusMap:v})),(null==y||null===(a=y.filter(e=>!e.isTerminateState))||void 0===a?void 0:a.slice(4).length)>0?l.createElement(l.Fragment,null,f&&(null==y||null===(u=y.filter(e=>!e.isTerminateState))||void 0===u||null===(s=u.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement($e,{businessServices:p,key:e.uuid,onAssignmentChange:c,status:{name:_(e,m),code:e.applicationStatus,...e},searchParams:d,statusMap:v}))),l.createElement("div",{className:"filter-button",onClick:()=>h(!f)}," ",m(f?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},qe=e=>{var o;let{searchParams:r,onFilterChange:u,defaultSearchParams:s,statusMap:c,moduleCode:d,...p}=e;const{t:v}=i.useTranslation(),m=a.useQueryClient(),[f,h]=n.useState(()=>({...r,services:[]})),E=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],g=e=>{let t=e.delete,n={...f,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,h({...n})},y=()=>{h({...s,services:[]}),u({...s})},_=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:y},v("ES_COMMON_CLEAR_ALL")),"desktop"===p.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"===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=>{g({locality:[...(null==f?void 0:f.locality)||[],e]})},tenantId:_,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==f||null===(o=f.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:v(e.i18nkey),onClick:()=>{g({locality:null==f?void 0:f.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")),E.map((e,n)=>{var i;const o=null==f||null===(i=f.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:o,onChange:t=>((e,t)=>{var n;g(e.target.checked?{services:Array.isArray(f.services)?[...f.services,t]:[t]}:{services:f.services.filter(e=>e!==t),applicationStatus:null===(n=f.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(Ve,{searchParams:f,businessServices:f.services,statusMap:c||m.getQueryData("INBOX_STATUS_MAP_"+d),moduleCode:d,onAssignmentChange:(e,t)=>{if(e.target.checked)g({applicationStatus:[...null==f?void 0:f.applicationStatus,t]});else{let e=null==f?void 0:f.applicationStatus.filter(e=>e.state!==t.state);g({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{u(0===f.services.length?{...f,services:E.map(e=>e.value)}:f)},label:v("ES_COMMON_APPLY")}))))))},Ge=e=>l.createElement("span",{className:"cell-text"},e),Ke=e=>l.createElement("span",{className:"sla-cell"},e),Ye=[{head:"ES_TITILE_OWNER_DETAILS",body:[{component:"PTROwnerDetails",withoutLabel:!0,key:"owners",type:"component"}]},{head:"ES_TITILE_PET_DETAILS",body:[{component:"PTRPetdetails",withoutLabel:!0,key:"pets",type:"component"}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{headerCaption:"PTR_CAPTION",header:"PTR_PINCODE_LABEL",cardText:"PTR_PINCODE_TEXT",submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRSelectStreet",key:"address",withoutLabel:!0,nextStep:"landmark"},{type:"component",route:"landmark",component:"PTSelectLandmark",withoutLabel:!0,key:"address",hideInEmployee:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{component:"PTRDocumentUpload",withoutLabel:!0,key:"documents",type:"component"}]}],Xe=e=>l.createElement("h1",{className:"heading-m"},e.label),Ze=()=>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(Ze,null)),Qe=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:h,data:E}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[y,_]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,R]=n.useState(null),[I,w]=n.useState(null),[O,L]=n.useState([]),[k,M]=n.useState(null),[F,B]=n.useState(!1);function U(e){P(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;C(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{w(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("PT",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?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("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(()=>{a&&_(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:r,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:o,optionsKey:"name",onSelect:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:O,selectedFinancialYear:k,setSelectedFinancialYear:M}):(e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,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:r,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")}${o.docUploadRequired?" *":""}`,populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:T,selectedApprover:A,setSelectedApprover:D,selectFile:U,uploadedFile:x,setUploadedFile:R,businessService:p}))},[a,T,O,k,x]),a&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xe,{label:r(y.label.heading)}),headerBarEnd:l.createElement(Je,{onClick:s}),actionCancelLabel:r(y.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(y.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!k:f||(null==a?void 0:a.docUploadRequired)&&!x,formId:"modal-action"},h?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:y.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",c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:{...d,workflow:t}})}else if(null!=a&&a.showFinancialYearsModal)c({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==k?void 0:k.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],x&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:x}]),c({Property:{...d,workflow:t}})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},et=e=>l.createElement("h1",{className:"heading-m"},e.label),tt=()=>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"})),nt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(tt,null)),lt=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:m,data:f}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[h,E]=n.useState({}),[y,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,R]=n.useState(null),[I,w]=n.useState([]),[O,L]=n.useState(null);n.useEffect(()=>{var e;f&&f["egf-master"]&&w(null===(e=f["egf-master"])||void 0===e?void 0:e.FinancialYear)},[f]);const{data:k}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function M(e){D(e.target.files[0])}return n.useEffect(()=>{if(v&&k){var e;const t=k["common-masters"].Department;b(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,r=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",r),{uuid:null==e?void 0:e.uuid,name:`${null==e||null===(i=e.user)||void 0===i?void 0:i.name} - ${null==r?void 0:r.name}`}}))}},[v]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(r("CS_FILE_UPLOAD_ERROR"))})},function(){R(r("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((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,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:a,selected:r}):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:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:M,uploadedFile:N,setUploadedFile:P,businessService:p}))},[a,S,I,O,N]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(et,{label:r(h.label.heading)}),headerBarEnd:l.createElement(nt,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.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!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null},c({Licenses:[d]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},it=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"})),rt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ot,null)),at=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:v,isLoading:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function I(e){A(e.target.files[0])}return 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{x(null);const e=function(){if(C){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=C&&C.type&&!e.test(null==C?void 0:C.type))x(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",C,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?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[C]),n.useEffect(()=>{a&&h((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,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:a,selected:r}):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:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:I,uploadedFile:D,setUploadedFile:N,businessService:p,error:P}))},[a,_,D,P]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(it,{label:r(f.label.heading)}),headerBarEnd:l.createElement(rt,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},m?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:f.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!=b&&b.uuid?[null==b?void 0:b.uuid]:null,wfDocuments:D?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]:null},c({Licenses:[d]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},ut=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"})),ct=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(st,null)),dt=e=>{var i,o,r,u,s,c,d,p,v,m,f,h;let{t:E,action:y,tenantId:_,closeModal:S,submitAction:b,applicationDetails:T,applicationData:C,businessService:A,workflowDetails:D,blockReason:N}=e;console.log("applicationData",C),console.log("workflowDetails",D),Digit.Hooks.obps.useObpsAPI(null!==(i=C)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(u=C)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(c=s.address)||void 0===c?void 0:c.city:_,!1);const{data:P,isLoading:x}=Digit.Hooks.useEmployeeSearch(_,{roles:null==D||null===(d=D.data)||void 0===d||null===(p=d.initialActionState)||void 0===p||null===(v=p.nextActions)||void 0===v||null===(m=v.filter(e=>(null==e?void 0:e.action)==(null==y?void 0:y.action)))||void 0===m||null===(f=m[0])||void 0===f||null===(h=f.assigneeRoles)||void 0===h?void 0:h.map(e=>({code:e})),isActive:!0},{enabled:!(null!=y&&y.isTerminateState)}),[R,I]=(a.useQueryClient(),n.useState({})),[w,O]=n.useState({}),[L,k]=n.useState([]),[M,F]=n.useState([]),[B,U]=n.useState({}),[H,j]=n.useState({}),[W,z]=n.useState(null),[$,V]=n.useState(null),[q,G]=n.useState(null),[K,Y]=n.useState(null),X=!!Digit.Utils.browser.isMobile();function Z(e){z(e.target.files[0])}n.useEffect(()=>{var e;k(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{G(null);const e=function(){if(W){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(W.size>=5242880)G(E("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=W&&W.type&&!e.test(null==W?void 0:W.type))G(E("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",W,Digit.ULBService.getStateId()||(null==_?void 0:_.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?V(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):G(E("CS_FILE_UPLOAD_ERROR"))})},function(){G(E("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[W]);const J=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},Q=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},ee=e=>{var t,n;let l=[],i=[];var o,r;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),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{i.push({docs:J(e.Documents),date:e.InspectionDate,questions:Q(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},te=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,r,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===(o=e.uploadedDocuments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},ne=()=>{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(()=>{F(null==N?void 0:N.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),y&&I((e=>{var n,i,o,r,a,u,s;let{t:c,action:d,approvers:p,selectedApprover:v,setSelectedApprover:m,selectedBlockReason:f,setBlockReason:h,selectFile:E,uploadedFile:g,setUploadedFile:y,assigneeLabel:_,businessService:S,error:b,blockReasonFiltered:T}=e,C=!1;return"REVOCATE"!=(null==d?void 0:d.action)&&"REJECT"!=(null==d?void 0:d.action)&&"SKIP_PAYMENT"!=d.action&&"SEND_BACK_TO_CITIZEN"!=(null==d?void 0:d.action)&&"APPROVE"!=(null==d?void 0:d.action)||(C=!0),{label:{heading:`WF_${null==d?void 0:d.action}_APPLICATION`,submit:`WF_${S}_${null==d?void 0:d.action}`,cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(n=d.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(i=d.state)||void 0===i?void 0:i.state)?null:c(_||"WF_ROLE_"+(null===(o=d.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)?null:l.createElement(t.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:m,selected:v})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:T,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:E,onDelete:()=>{y(null)},message:g?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:E,action:y,approvers:L,selectedApprover:B,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:j,selectFile:Z,uploadedFile:$,setUploadedFile:V,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:q,blockReasonFiltered:M}))},[y,L,K,$,q]),y&&R.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ut,{label:E(R.label.heading)}),headerBarEnd:l.createElement(ct,{onClick:S}),actionCancelLabel:E(R.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:E(R.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:X?{width:"720px"}:{},style:X?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:X?{paddingLeft:"5px"}:{}},x?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,o,r,a,u,s,c,d,p,v,m,f,h,g,A,N,P,x,R,I,w,O,L,k;C={...C,documents:te(),additionalDetails:{...null===(t=C)||void 0===t?void 0:t.additionalDetails,fieldinspection_pending:ee(C),pendingapproval:ne(),blockingReason:null==H?void 0:H.name},workflow:{action:null==y?void 0:y.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:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(i=D.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(r=o[0])||void 0===r||null===(a=r.state)||void 0===a?void 0:a.applicationStatus)?[null==D||null===(u=D.data)||void 0===u||null===(s=u.processInstances)||void 0===s||null===(c=s[0])||void 0===c||null===(d=c.assigner)||void 0===d?void 0:d.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(p=D.data)||void 0===p||null===(v=p.processInstances)||void 0===v||null===(m=v[0])||void 0===m||null===(f=m.state)||void 0===f?void 0:f.applicationStatus)?[null==D||null===(h=D.data)||void 0===h||null===(g=h.processInstances)||void 0===g||null===(A=g[0])||void 0===A||null===(N=A.assigner)||void 0===N?void 0:N.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,varificationDocuments:$?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:$}]:null},action:null==y?void 0:y.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==D||null===(P=D.data)||void 0===P||null===(x=P.processInstances)||void 0===x||null===(R=x[0])||void 0===R||null===(I=R.state)||void 0===I?void 0:I.applicationStatus)?[null==D||null===(w=D.data)||void 0===w||null===(O=w.processInstances)||void 0===O||null===(L=O[0])||void 0===L||null===(k=L.assigner)||void 0===k?void 0:k.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,wfDocuments:$?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:$}]:null};const M=function(e,t,n,l,i,o,r,a,u,s,c,d){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=C)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=C)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(r=C)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(u=a.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(s=C)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.selfCertificationCharges)||void 0===d?void 0:d.BPA_GAUSHALA_CHARGES_CESS))){var p,v,m;C.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",C.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",C.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",C.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),C.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==T||null===(p=T.nocData)||void 0===p?void 0:p.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:{...e,documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]}}});let t={sourceRefId:null==e||null===(v=e[0])||void 0===v||null===(m=v.Noc)||void 0===m?void 0:m.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(_,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,r,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())||1!=l&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,n,r,a,u,s,c,d,p,v,m,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.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)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==C.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(S(),alert(E("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else b({BPA:C},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}S(),alert(E("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:w,formId:"modal-action"})):l.createElement(t.Loader,null)},pt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),vt=()=>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"})),mt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(vt,null)),ft=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:v,businessService:m}=e;const{data:f,isLoading:h}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=s&&s.isTerminateState)}),[E,y]=(a.useQueryClient(),n.useState({})),[_,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState({}),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function O(e){N(e.target.files[0])}return o.useHistory(),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(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)I(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))I(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",D,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?x(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)}}()},[D]),n.useEffect(()=>{s&&y((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,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 h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!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||h?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{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:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:m})}]}]}})({t:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:O,uploadedFile:P,setUploadedFile:x,businessService:m,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:R}))},[s,b,P,R]),s&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(pt,{label:u(E.label.heading)}),headerBarEnd:l.createElement(mt,{onClick:d}),actionCancelLabel:u(E.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:w?{width:"720px"}:{},style:w?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:w?{paddingLeft:"5px"}:{}},h?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){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(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)=>{o.push(e)}),v={...v,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:P?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null},documents:o},p({Noc:v},!1,{isNoc:!0})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)};function ht(e){var t=this.__data__=new he(e);this.size=t.size}ht.prototype.clear=function(){this.__data__=new he,this.size=0},ht.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ht.prototype.get=function(e){return this.__data__.get(e)},ht.prototype.has=function(e){return this.__data__.has(e)},ht.prototype.set=function(e,t){var n=this.__data__;if(n instanceof he){var l=n.__data__;if(!Ee||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new _e(l)}return n.set(e,t),this.size=n.size,this};var Et=ht,gt=function(){try{var e=re(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),yt=function(e,t,n){"__proto__"==t&>?gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},_t=Object.prototype.hasOwnProperty,St=function(e,t,n){var l=e[t];_t.call(e,t)&&pe(l,n)&&(void 0!==n||t in e)||yt(e,t,n)},bt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?yt(n,a,u):St(n,a,u)}return n},Tt=function(e){return K(e)&&"[object Arguments]"==G(e)},Ct=Object.prototype,At=Ct.hasOwnProperty,Dt=Ct.propertyIsEnumerable,Nt=Tt(function(){return arguments}())?Tt:function(e){return K(e)&&At.call(e,"callee")&&!Dt.call(e,"callee")},Pt=function(){return!1},xt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?U.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Pt}),Rt=/^(?:0|[1-9]\d*)$/,It=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Rt.test(e))&&e>-1&&e%1==0&&e<t},wt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ot={};Ot["[object Float32Array]"]=Ot["[object Float64Array]"]=Ot["[object Int8Array]"]=Ot["[object Int16Array]"]=Ot["[object Int32Array]"]=Ot["[object Uint8Array]"]=Ot["[object Uint8ClampedArray]"]=Ot["[object Uint16Array]"]=Ot["[object Uint32Array]"]=!0,Ot["[object Arguments]"]=Ot["[object Array]"]=Ot["[object ArrayBuffer]"]=Ot["[object Boolean]"]=Ot["[object DataView]"]=Ot["[object Date]"]=Ot["[object Error]"]=Ot["[object Function]"]=Ot["[object Map]"]=Ot["[object Number]"]=Ot["[object Object]"]=Ot["[object RegExp]"]=Ot["[object Set]"]=Ot["[object String]"]=Ot["[object WeakMap]"]=!1;var Lt=function(e){return function(t){return e(t)}},kt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&F.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Mt=kt&&kt.isTypedArray,Ft=Mt?Lt(Mt):function(e){return K(e)&&wt(e.length)&&!!Ot[G(e)]},Bt=Object.prototype.hasOwnProperty,Ut=function(e,t){var n=M(e),l=!n&&Nt(e),i=!n&&!l&&xt(e),o=!n&&!l&&!i&&Ft(e),r=n||l||i||o,a=r?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 s in e)!t&&!Bt.call(e,s)||r&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||It(s,u))||a.push(s);return a},Ht=Object.prototype,jt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ht)},Wt=function(e,t){return function(n){return e(t(n))}},zt=Wt(Object.keys,Object),$t=Object.prototype.hasOwnProperty,Vt=function(e){return null!=e&&wt(e.length)&&!Q(e)},qt=function(e){return Vt(e)?Ut(e):function(e){if(!jt(e))return zt(e);var t=[];for(var n in Object(e))$t.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Gt=Object.prototype.hasOwnProperty,Kt=function(e){return Vt(e)?Ut(e,!0):function(e){if(!J(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=jt(e),n=[];for(var l in e)("constructor"!=l||!t&&Gt.call(e,l))&&n.push(l);return n}(e)},Yt=c(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?U.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}}),Xt=function(){return[]},Zt=Object.prototype.propertyIsEnumerable,Jt=Object.getOwnPropertySymbols,Qt=Jt?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,r=[];++l<i;){var a=t[l];Zt.call(e,a)&&(r[o++]=a)}return r}(Jt(e)))}:Xt,en=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},tn=Wt(Object.getPrototypeOf,Object),nn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)en(t,Qt(e)),e=tn(e);return t}:Xt,ln=function(e,t,n){var l=t(e);return M(e)?l:en(l,n(e))},on=function(e){return ln(e,qt,Qt)},rn=function(e){return ln(e,Kt,nn)},an=re(U,"DataView"),un=re(U,"Promise"),sn=re(U,"Set"),cn=re(U,"WeakMap"),dn=le(an),pn=le(Ee),vn=le(un),mn=le(sn),fn=le(cn),hn=G;(an&&"[object DataView]"!=hn(new an(new ArrayBuffer(1)))||Ee&&"[object Map]"!=hn(new Ee)||un&&"[object Promise]"!=hn(un.resolve())||sn&&"[object Set]"!=hn(new sn)||cn&&"[object WeakMap]"!=hn(new cn))&&(hn=function(e){var t=G(e),n="[object Object]"==t?e.constructor:void 0,l=n?le(n):"";if(l)switch(l){case dn:return"[object DataView]";case pn:return"[object Map]";case vn:return"[object Promise]";case mn:return"[object Set]";case fn:return"[object WeakMap]"}return t});var En=hn,gn=Object.prototype.hasOwnProperty,yn=U.Uint8Array,_n=function(e){var t=new e.constructor(e.byteLength);return new yn(t).set(new yn(e)),t},Sn=/\w*$/,bn=H?H.prototype:void 0,Tn=bn?bn.valueOf:void 0,Cn=Object.create,An=function(){function e(){}return function(t){if(!J(t))return{};if(Cn)return Cn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Dn=kt&&kt.isMap,Nn=Dn?Lt(Dn):function(e){return K(e)&&"[object Map]"==En(e)},Pn=kt&&kt.isSet,xn=Pn?Lt(Pn):function(e){return K(e)&&"[object Set]"==En(e)},Rn={};Rn["[object Arguments]"]=Rn["[object Array]"]=Rn["[object ArrayBuffer]"]=Rn["[object DataView]"]=Rn["[object Boolean]"]=Rn["[object Date]"]=Rn["[object Float32Array]"]=Rn["[object Float64Array]"]=Rn["[object Int8Array]"]=Rn["[object Int16Array]"]=Rn["[object Int32Array]"]=Rn["[object Map]"]=Rn["[object Number]"]=Rn["[object Object]"]=Rn["[object RegExp]"]=Rn["[object Set]"]=Rn["[object String]"]=Rn["[object Symbol]"]=Rn["[object Uint8Array]"]=Rn["[object Uint8ClampedArray]"]=Rn["[object Uint16Array]"]=Rn["[object Uint32Array]"]=!0,Rn["[object Error]"]=Rn["[object Function]"]=Rn["[object WeakMap]"]=!1;var In=function e(t,n,l,i,o,r){var a,u=1&n,s=2&n,c=4&n;if(l&&(a=o?l(t,i,o,r):l(t)),void 0!==a)return a;if(!J(t))return t;var d=M(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&gn.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=En(t),v="[object Function]"==p||"[object GeneratorFunction]"==p;if(xt(t))return Yt(t,u);if("[object Object]"==p||"[object Arguments]"==p||v&&!o){if(a=s||v?{}:function(e){return"function"!=typeof e.constructor||jt(e)?{}:An(tn(e))}(t),!u)return s?function(e,t){return bt(e,nn(e),t)}(t,function(e,t){return e&&bt(t,Kt(t),e)}(a,t)):function(e,t){return bt(e,Qt(e),t)}(t,function(e,t){return e&&bt(t,qt(t),e)}(a,t))}else{if(!Rn[p])return o?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return _n(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?_n(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?_n(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,Sn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return Tn?Object(Tn.call(e)):{}}}(t,p,u)}}r||(r=new Et);var m=r.get(t);if(m)return m;r.set(t,a),xn(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,r))}):Nn(t)&&t.forEach(function(i,o){a.set(o,e(i,n,l,o,t,r))});var f=d?void 0:(c?s?rn:on:s?Kt:qt)(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]),St(a,o,e(i,n,l,o,t,r))}),a},wn=function(e){return In(e,5)};const On=e=>l.createElement("h1",{className:"heading-m"},e.label),Ln=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ln,null)),Mn=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}},Fn=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:v}=e;const{data:m,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[y,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,R]=n.useState(null),I=window.Digit.Utils.browser.isMobile(),w=window.location.href.includes("/employee");function O(e){D(e.target.files[0])}return 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{R(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))R(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=g(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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),R(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),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)?a&&E((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:s,selectFile:c,uploadedFile:d,setUploadedFile:p,businessService:v,error:m}=e,f=!0,h=!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)||(h=!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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:a}):null},h&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!h,type:"custom",populators:h?{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:c,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:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:v,error:x})):a&&E((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,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:r,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:s,onDelete:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:v,error:x}))},[a,S,N,x]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(On,{label:r(h.label.heading)}),headerBarEnd:l.createElement(kn,{onClick:c}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:I&&w?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,r,u,c,v,m;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var f,h,E,g,y,_,S,b,C;const t={...null===(f=p)||void 0===f||null===(h=f.billAmendmentDetails)||void 0===h?void 0:h.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(E=p)||void 0===E?void 0:E.billAmendmentDetails,workflow:{businessId:null===(g=p)||void 0===g||null===(y=g.billAmendmentDetails)||void 0===y?void 0:y.amendmentId,action:null==a?void 0:a.action,tenantId:s,businessService:null!==(_=p)&&void 0!==_&&null!==(S=_.applicationType)&&void 0!==S&&S.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(b=p)&&void 0!==b&&null!==(C=b.applicationType)&&void 0!==C&&C.includes("WATER")?"WS":"SW",assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]}};d({AmendmentUpdate:n})}else{if(p={...p,action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:[],assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:{...null===(n=p)||void 0===n?void 0:n.processInstance,action:null==a?void 0:a.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.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=wn(null==e?void 0:e.date);p.disconnectionExecutionDate=Mn(t)}else if(null!=e&&e.date){const t=wn(null==e?void 0:e.date);p.connectionExecutionDate=Mn(t)}var D;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(r=o.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(u=p)||void 0===u||null===(c=u.processInstance)||void 0===c?void 0:c.businessService)||window.location.href.includes("disconnection"))"WATER"==(null===(D=p)||void 0===D?void 0:D.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===(m=p)||void 0===m?void 0:m.applicationType))d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var P,x,R,I,w,O,L,k,M,F,B,U,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(P=t.value)&&void 0!==P&&P.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(x=t.value)||void 0===x?void 0:x.adhocPenalty)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenaltyComment)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyReason)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebateComment)||""),null!=t&&null!==(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===(H=p)||void 0===H?void 0:H.serviceType)?d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},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=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(!1);function w(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(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{x(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(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?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("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&&h((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:`WF_${null==n?void 0:n.action}_APPLICATION`,submit:`WF_${l}_${null==n?void 0:n.action}`,cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,_,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==a?void 0:a.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};d.creationReason="CREATE",c({PetRegistrationApplications:[{...d,workflow:t}]})}let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:p,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!b?[]:[b],D&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),c({PetRegistrationApplications:[{...d,workflow:t}]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Wn=e=>l.createElement("h1",{className:"heading-m"},e.label),zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(zn,null)),Vn=e=>{var i,o,r;let{t:a,action:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const v=Digit.ULBService.getStateId(),{data:m,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(v,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==m||null===(i=m.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",d);const[h,E]=n.useState({}),[g,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(""),[C,A]=n.useState([]),[D,N]=n.useState(null),P=null===(o=d)||void 0===o||null===(r=o.tradeLicenseDetail)||void 0===r?void 0:r.tradeUnits;console.log("tradeUnits",P);const x=n.useMemo(()=>{var e;if(f||!m||!P.length)return[];const t=new Set(P.map(e=>e.tradeType)),n=(null===(e=m.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[f,m,P]);return console.log("years",x),n.useEffect(()=>{u&&E((e=>{let{t:n,action:i,years:o,selectedApprover:r,setSelectedApprover:a,businessService:u}=e;return{label:{heading:`WF_${null==i?void 0:i.action}_APPLICATION`,submit:`WF_${null==u?void 0:u.toUpperCase()}_${null==i?void 0:i.action}`,cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:a,selected:r})}]}]}})({t:a,action:u,years:x,selectedApprover:b,setSelectedApprover:T,businessService:p}))},[u,x,C,D]),u&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Wn,{label:a(h.label.heading)}),headerBarEnd:l.createElement($n,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=d)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i=`20${Number(l)}-${Number(l)+1}`;d={...d,financialYear:i,action:"INITIATE",additionalDetail:{...d.additionalDetail,validityYears:b.length>0?parseInt(b):""}},c({Licenses:[d]})},defaultValues:g,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"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Gn,null)),Yn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(!1);function w(e){I(!0),A(e.target.files[0])}return n.useEffect(()=>{var e;S(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{x(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",C,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?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("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)}}()},[C]),console.log("actyhdesh,jhfsefsef",a,d),n.useEffect(()=>{h((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:s,setSelectedApprover:c,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:c,selected:s})},{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:()=>{a(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:p,isUploading:R}))},[a,_,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(qn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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!=b&&b.uuid?[null==b?void 0:b.uuid]:null};D&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,fileStoreId:D}]),c({streetVendingDetail:{...d,workflow:n}})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},Xn=e=>l.createElement("h1",{className:"heading-m"},e.label),Zn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Jn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Zn,null)),Qn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:v}=e;console.log("applicationData",d);const{data:m}=Digit.Hooks.useEmployeeSearch(u,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[f,h]=n.useState({}),[E,y]=n.useState({}),[_,S]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[R,I]=n.useState(!1);function w(e){A(e.target.files[0])}return n.useEffect(()=>{var e;S(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{x(null);const e=function(){if(C){const e=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(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?N(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):x(r("CS_FILE_UPLOAD_ERROR"))})},function(){x(r("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&&h((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,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:o,onDelete:()=>{a(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:_,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,_,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Xn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Jn,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:f.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};D&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==C?void 0:C.name,filestoreId:D}]),c({hallsBookingApplication:[{...d,workflow:t}]})},defaultValues:E,formId:"modal-action"})):l.createElement(t.Loader,null)},el=e=>null!=e&&e.businessService.includes("PT")?l.createElement(Qe,e):null!=e&&e.businessService.includes("ptr")?l.createElement(jn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(lt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Vn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(at,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(dt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(ft,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Fn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(Yn,e):null!=e&&e.businessService.includes("chb")?l.createElement(Qn,e):void 0;function tl(e){let{documents:n,svgStyles:o={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:s}=i.useTranslation(),c=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!c&&(null==n?void 0:n.map((e,i)=>{var o,c,d;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),r?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),r?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),a&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),c&&(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"}},s(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"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(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"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}const nl=e=>{var t,i;let{t:o,formData:r,applicationData:a,docs:u,bpaActionsDetails:s}=e;const c=(null==a?void 0:a.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[v,m]=n.useState((null==r||null===(i=r.documents)||void 0===i?void 0:i.documents)||[]),[f,h]=n.useState(null),[E,g]=n.useState([]),[y,_]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,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,r;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(r=o.DocTypeMapping)||void 0===r?void 0:r.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 s=[];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)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),g(s)},[!A,!N]),n.useEffect(()=>{let e=0;E.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)}),_("0"!=e&&0!=e||!(v.length>0))},[v,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[a,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==E?void 0:E.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(ll,{key:t,index:t,document:e,t:o,error:f,setError:h,setDocuments:m,documents:v,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:E,checkEnablingDocs:T}))))};function ll(e){var i,o;let{t:r,document:a,setDocuments:u,documents:s,index:c,bpaTaxDocuments:d,checkEnablingDocs:p}=e;const v=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],m=Digit.ULBService.getStateId(),[f,h]=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]:{}),[E,g]=n.useState(null),[y,_]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[S,b]=n.useState([]);return n.useEffect(()=>{null!=f&&f.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==y?void 0:y.length)||null===y?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==y),{documentType:null==f?void 0:f.code,fileStoreId:y,documentUid:y,fileName:(null==E?void 0:E.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==f?void 0:f.code)))||void 0===t?void 0:t.id:void 0}]})},[y,f]),n.useEffect(()=>{try{S.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],S.map(e=>{var t,n,l;null!=f&&f.code&&a.newUploadedDocs.push({documentType:null==f?void 0:f.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(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[c]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(d)))}catch(e){Promise.reject(e)}},[S,f]),n.useEffect(()=>{},[E]),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"}},""+r(null==a?void 0:a.code)),(null==a||null===(o=a.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(tl,{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?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:f,optionKey:"i18nKey",select:e=>h(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:m,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:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function il(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,i)=>{var o,a,u,s,c,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)?""+r("BPA_FI_REPORT"):`${r("BPA_FI_REPORT")} - ${i+1}`),l.createElement(t.Row,{className:"border-none",label:""+r("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===(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:""+r("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(c=e.questions)||void 0===c?void 0:c.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:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(tl,{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 ol(e){let{t:i,document:o,setNocDocuments:r,setError:a,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],c=Digit.ULBService.getStateId(),[d,p]=n.useState(),[v,m]=n.useState(null),[f,h]=n.useState(()=>(null==s?void 0:s.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&&r(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{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=g(function(){return h(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?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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!=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:c,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 rl=e=>{var i;let{t:o,noc:r,docs:a,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),v=(null==s?void 0:s.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:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[g,y]=n.useState([]),[_,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[D,N]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;y(null==E||null===(e=E["common-masters"])||void 0===e?void 0:e.DocumentType)},[E]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,a,c,d;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(a=o.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.nocType)):null==h||null===(c=h.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.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==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},i.push(l[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.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))},[f,g]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===v&&(null==m?void 0:m.length)>0)},[s,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==r?void 0:r.nocType}_HEADER`):o(`BPA_${null==r?void 0:r.nocType}_HEADER`),labelStyle:{fontSize:"20px",width:"150%"}}),c&&c.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(tl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==_?void 0:_.map((e,t)=>l.createElement(ol,{key:t,document:e,t:o,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},al=e=>{let{permissions:i,t:o}=e;const[r,a,u]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[s,c,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"}},o("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.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==r?void 0:r.map((e,t)=>n===t?{...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)=>{c(()=>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:p?"96%":"830px",width:p?"96%":"830px"},style:p?{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:p?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...s];t.splice(e,1),c([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:p?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{c([...s,{label:""}])}}))};function ul(e){let{documents:o,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=i.useTranslation(),[s,c]=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:[]]}),c(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=s&&s.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(s,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[s]);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)),a?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!=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"}},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 sl(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:r}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("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:r(e.taxHeadCode),label:r(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:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function cl(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 dl(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=i.useTranslation(),a=(null==n?void 0:n.length)||1;let u={marginTop:"19px"},s={position:"relative",padding:"8px"},c={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"},s={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(u={...u,maxWidth:"950px"},u={...u,maxWidth:"950px"},c={}),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:r(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?`${r(null==e?void 0:e.title)} ${n+1}`:r(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:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{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",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:c}))}))))})))}const pl=e=>{var o,r,a,u,s,c,d,p,v,m,f,h,E,y,_,S,b,T,C,A,D,N,P;let{scrutinyDetails:x,paymentsList:R=[],additionalDetails:I,applicationData:w}=e;const O=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==w?void 0:w.status))&&window.location.href.includes("bpa"),[L,k]=n.useState(),[M,F]=n.useState(),[B,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,$]=n.useState(),[V,q]=n.useState([]),[G,K]=n.useState(),[Y,X]=n.useState(""),[Z,J]=n.useState(null),[Q,ee]=n.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[ne,le]=n.useState(!1),[ie,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{J(null);const e=function(){if(G&&null!=G&&G.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==G||null===(t=G.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(G.size>=2e6)J(re("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=g(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",G,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?q([...V,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):J(re("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else J(re("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[G]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(V))},[V]),n.useEffect(()=>{var e,t,n,l,i,o,r;if(null!=I&&null!==(e=I.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==I?void 0:I.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==I||null===(n=I.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==I||null===(l=I.lessAdjustmentFeeFiles[(null==I||null===(i=I.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,H).then(e=>ee(null==e?void 0:e.data))}k(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),F(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==I||null===(o=I.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==I||null===(r=I.selfCertificationCharges)||void 0===r?void 0:r.BPA_LESS_ADJUSMENT_PLOT),W(null==I?void 0:I.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==I?void 0:I.otherFeesDiscription),q(null==I?void 0:I.lessAdjustmentFeeFiles)},[I]);const{t:re}=i.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},re(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?re(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void re("NA");return l.createElement(n.Fragment,null,!(null!=x&&x.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==x||null===(o=x.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:""+re(""+e.title),text:null!=e&&e.value?`${ae(e)} ${re(null==e?void 0:e.isUnit)}`:re("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:""+re(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},re(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},re(null==e?void 0:e.title))),null==x||null===(r=x.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==x||null===(a=x.values[0])||void 0===a?void 0:a.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},re("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},re("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==I?void 0:I.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:re("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==I?void 0:I.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==x||null===(u=x.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!0)}},re("SHOW_P2_FEES_DETAILS"))),ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!1)}},re("HIDE_P2_FEES_DETAILS"))),ne&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==I||null===(s=I.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==I||null===(c=I.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==I||null===(d=I.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==I||null===(p=I.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,re("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==I||null===(v=I.selfCertificationCharges)||void 0===v?void 0:v.BPA_DEVELOPMENT_CHARGES)||0,value:L,disabled:!O,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(k(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==I||null===(m=I.selfCertificationCharges)||void 0===m?void 0:m.BPA_OTHER_CHARGES)||0,value:M,disabled:!O,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(F(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:re,type:"text",name:"otherChargesDiscription",defaultValue:null==I||null===(f=I.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!O,onChange:e=>{!function(e){W(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==I||null===(h=I.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:B,disabled:!O,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(t=I.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(n=I.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==I||null===(l=I.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==I||null===(i=I.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(B)>0&&O?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){$(e.target.files[0]),K(e.target.files[0])},disabled:!O,onDelete:()=>{$(null),K("")},message:z?"1 "+re("FILEUPLOADED"):re("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:Y})):null,(null==Q||null===(E=Q.fileStoreIds)||void 0===E?void 0:E.length)&&parseInt(null==I||null===(y=I.selfCertificationCharges)||void 0===y?void 0:y.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},re("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(_=Q.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==I||null===(S=I.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(b=Q.fileStoreIds[(null==Q||null===(T=Q.fileStoreIds)||void 0===T?void 0:T.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:re("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==I||null===(C=I.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==I||null===(A=I.selfCertificationCharges)||void 0===A?void 0:A.BPA_LABOUR_CESS)+parseFloat(null==I||null===(D=I.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==I||null===(N=I.selfCertificationCharges)||void 0===N?void 0:N.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(B)?parseFloat(B):0))}))),l.createElement("div",null,null==x||null===(P=x.scruntinyDetails)||void 0===P?void 0:P.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+re(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"}},re(null==e?void 0:e.text))))))))},vl=e=>{var o,r,a,u,s;let{edcrDetails:c,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"}],f=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>m.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function E(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,r,a,u,s;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===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function g(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==c||null===(o=c.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==c||null===(r=c.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,r,a,u;return l.createElement("div",{key:n,style:(null==c||null===(i=c.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.value)||void 0===r||null===(a=r.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:g(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(e),columns:h,getCellProps:e=>({style:{}})})))})))},ml=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))},fl=e=>{var o,r,a;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:v}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,v("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(ml,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},v("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},v("View Less")))))):null,(null==u||null===(r=u.thumbnailsToShow)||void 0===r||null===(a=r.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,v("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function hl(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 El(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 gl=e=>{var o,r,a,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let p=(v=location.search)?(/^[?#]/.test(v)?v.slice(1):v).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var v;const m=null==p?void 0:p.mode;var{connectionDetails:f,plumberDetails:h,roadCuttingDetails:E,roadCuttingAddlDetails:g,activationDetails:y}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};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"}},d("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:""+d(""+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===(r=c.additionalDetails)||void 0===r?void 0:r.plumberDetails)&&"MODIFY"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+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"!=m&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-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:""+d(""+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.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+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===(s=c.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==y?void 0:y.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},yl=[{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"}],_l=[{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"}],Sl=e=>{var o,r,a,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation(),[p,v,m]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,h,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==c||null===(o=c.additionalDetails)||void 0===o||!o.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[C,A]=n.useState(null),[D,N]=n.useState(c.additionalDetails.data?c.additionalDetails.data:{}),[P,x]=n.useState(c.additionalDetails.values?c.additionalDetails.values:[]),R=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(R,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i={...null==c||null===(e=c.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,r,a,u,s,d,m;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.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===(s=p.billDetails)||void 0===s||null===(d=s[0])||void 0===d?void 0:d.taxAmount)}];x(e),N(null==p||null===(m=p.billDetails)||void 0===m?void 0:m[0])}else v(i),T(i)},[]);let I={};const w=e=>l.createElement("h1",{className:"heading-m"},e.label),O=()=>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(O,null)),k=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,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:""}T(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!=c&&null!==(r=c.additionalDetails)&&void 0!==r&&r.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==c||null===(l=c.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,r,a,u,s,p,m,f,E,g;const e=null==c||null===(o=c.additionalDetails)||void 0===o||null===(r=o.appDetails)||void 0===r?void 0:r.applicationNo,t=null==c||null===(a=c.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n={...null==c||null===(s=c.additionalDetails)||void 0===s||null===(p=s.appDetails)||void 0===p?void 0:p.additionalDetails,...b};c.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==c||null===(m=c.additionalDetails)||void 0===m||null===(f=m.appDetails)||void 0===f?void 0:f.service)?[{applicationNo:e,tenantId:t,waterConnection:c.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:c.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==c||null===(E=c.additionalDetails)||void 0===E||null===(g=E.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,r,a,u,s,c,d,p,m,f,E,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===(E=f[0])||void 0===E||null===(g=E.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===(r=o[0])||void 0===r?void 0:r.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===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount}];h(wn(e.Calculation[0])),N(null==e||null===(m=e.Calculation)||void 0===m?void 0:m[0]),x(y),b.billDetails=null==e?void 0:e.Calculation,v(b),S(!1)}).catch(e=>{var t,n,l,i,o,r;A({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===(r=o.Errors[0])||void 0===r?void 0:r.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else A({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:yl,optionKey:"title",select:e=>k("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=>k("adhocPenaltyComment",!1,e)},I={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=>k("adhocPenalty",!1,e)},I={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:_l,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(s=b.adhocRebateReason_data)||void 0===s?void 0:s.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=>k("adhocRebateComment",!1,e)},I={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=>k("adhocRebate",!1,e)},I={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{A(!1)},isDleteBtn:!0})))},bl=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"})))},Tl=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{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(r)+" ",l.createElement(bl,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},Cl=e=>{var o,r,a,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:v}=i.useTranslation(),[m,f]=n.useState(!1),[h,E]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),y=()=>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"})),_=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(y,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),E(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(g,{label:v("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(_,{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==h||null===(r=h.billSlabData)||void 0===r||null===(a=r.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==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},v("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.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==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(c=h.billSlabData)||void 0===c||null===(d=c.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==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Al={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:{}},Dl=e=>{let{className:t="table",headers:n=[],values:o=[],arrears:r=0}=e;const{t:a}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:Al.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Al.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Al.cell,...Al.cellLeft,...Al.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...Al.cell,...n.length==t+1?Al.cellRight:{},...Al.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Al.cell,...Al.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:{...Al.cell,textAlign:"left",...n.length==i+1?Al.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Al.cell,...Al.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...Al.cell,...Al.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:{...Al.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Al.cell,key:t,numeric:!0})))))))},Nl={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))"}},Pl=e=>{var t,o,r;let{bill:a={}}=e;const{t:u}=i.useTranslation();let s={},c=(null==a||null===(t=a.billDetails)||void 0===t?void 0:t.sort((e,t)=>t.fromPeriod-e.fromPeriod))||[];c=[...c];const d=(null===(o=c)||void 0===o?void 0:o.reduce((e,t,n)=>e+t.amount,0))||0;let p="₹ "+((null==d||null===(r=d.toFixed)||void 0===r?void 0:r.call(d,0))||Number(0).toFixed(0));c.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);s[((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={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{v[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let m=[];m=Object.keys(v),m.sort((e,t)=>v[e]-v[t]);const[f,h]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:Nl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Dl,{headers:[...m],values:s,arrears:p}),!f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:Nl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{h(!1)}},u("CS_HIDE_CARD"))))};function xl(e){var r,a,u,s,c,d,p,v,m,f,h,E,g,y;let{applicationDetails:S,demandData:b,workflowDetails:T,isDataLoading:C,applicationData:A,totalDemandTax:D,timelineStatusPrefix:N,showTimeLine:P=!0,statusAttribute:x="status",paymentsList:R,oldValue:I,isInfoLabel:w=!1}=e;const{t:O}=i.useTranslation();let L=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function k(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[M,F]=n.useState({}),[B,U]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==A?void 0:A.status)||B.loading||B.loaded||B.canLoad||U({loading:!1,loaded:!1,canLoad:!0}),null==B||!B.canLoad||B.loading||B.loaded||(U({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(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};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){r=e})}();return a&&a.then?a.then(o):o()})}catch(e){return Promise.reject(e)}}((null==A?void 0:A.tenantId)||tenantId,null==A?void 0:A.propertyId,F,U));const H=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()}`},j=function(e,t,n){if(void 0===t&&(t=0),"OPEN"===e.state||"INITIATED"===e.status&&!window.location.href.includes("/obps/")){var i;const e={date:H(null==A||null===(i=A.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==A?void 0:A.channel)||""};return l.createElement(fl,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,b,T,C;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==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}}},D=n[t-1],N={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===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==A||null===(c=A.processInstance)||void 0===c||null===(d=c.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!==(h=f.assignes)&&void 0!==h&&null!==(E=h[0])&&void 0!==E&&E.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(null==e?void 0:e.comment),wfComment:D?D.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(fl,{data:N,OpenImage:k,privacy:i})}{var D,N,P,x,R;const t={date:H(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===(x=e.assignes)||void 0===x||null===(R=x[0])||void 0===R?void 0:R.mobileNumber};return l.createElement(fl,{data:t})}},W=(e,t)=>e?t?e:O(e):O("NA"),z=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),$=window.location.href.includes("employee/noc"),V=window.location.href.includes("employee/obps"),q=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||z?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),G={table:{border:"2px solid black",width:"100%",fontFamily:"sans-serif"},td:{padding:"10px",border:"1px solid black",textAlign:"center"},th:{padding:"10px",border:"1px solid black",textAlign:"center"}},K=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${W(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?W(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):O("N/A"),[Y,X]=n.useState(!1);console.log("demand Data arr",b);const Z=null==b?void 0:b.reduce((e,t)=>e+t.demandInterest,0),J=null==b?void 0:b.reduce((e,t)=>e+t.demandPenality,0),Q=null==b?void 0:b.reduce((e,t)=>e+t.collectionTax,0),ee=null==b?void 0:b.reduce((e,t)=>e+t.collectionInterest,0),te=null==b?void 0:b.reduce((e,t)=>e+t.collectionPenality,0),ne=null==b?void 0:b.reduce((e,t)=>e+t.balanceTax,0);return null==b||b.reduce((e,t)=>e+t.balanceInterest,0),null==b||b.reduce((e,t)=>e+t.balancePenality,0),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},w?l.createElement(Tl,{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===(r=S.applicationDetails)||void 0===r?void 0:r.map((e,i)=>{var r,a,u,s,c,d,p,v,m,f,h,E,g,y,_,b,C,A,D,N,P,x,w,k,F,B,U,H,j,W,G,Y,X,Z,J,Q,ee,te,ne,le;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"}:z?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&z?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},$?""+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")||z?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(r=e.values)||void 0===r?void 0:r.map((n,i)=>{var r,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(o.Link,{to:null==n?void 0:n.to},l.createElement("span",{className:"link",style:{color:"#a82227"}},O(null==n?void 0:n.title)))):$||V?""+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:q(),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:K(n),last:i===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:q(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Pl,{bill:null===(a=M.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(pl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:R,additionalDetails:null==S||null===(u=S.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==S||null===(s=S.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(il,{fiReport:null==S||null===(v=S.applicationData)||void 0===v||null===(m=v.additionalDetails)||void 0===m?void 0:m.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(cl,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(dl,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units)&&l.createElement(El,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories)&&l.createElement(hl,{units:null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.accessories}),!L&&(null==e||null===(A=e.additionalDetails)||void 0===A?void 0:A.permissions)&&(null==T||null===(D=T.data)||void 0===D||null===(N=D.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(al,{applicationData:null==S?void 0:S.applicationData,t:O,permissions:null==e||null===(P=e.additionalDetails)||void 0===P?void 0:P.permissions}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement(nl,{t:O,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:T})),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc)&&l.createElement(rl,{t:O,isNoc:!0,NOCdata:e.values,applicationData:null==S?void 0:S.applicationData,docs:e.additionalDetails.noc,noc:null===(k=e.additionalDetails)||void 0===k?void 0:k.data,bpaActionsDetails:T}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.scruntinyDetails)&&l.createElement(pl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.buildingExtractionDetails)&&l.createElement(pl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.subOccupancyTableDetails)&&l.createElement(vl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==S?void 0:S.applicationData}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl)&&l.createElement(tl,{documents:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.documents)&&l.createElement(ul,{documents:null==e||null===(G=e.additionalDetails)||void 0===G?void 0:G.documents}),(null==e||null===(Y=e.additionalDetails)||void 0===Y?void 0:Y.taxHeadEstimatesCalculation)&&l.createElement(sl,{taxHeadEstimatesCalculation:null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(gl,{wsAdditionalDetails:e,oldValue:I}),(null==e||null===(Z=e.additionalDetails)||void 0===Z?void 0:Z.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(J=e.additionalDetails)||void 0===J||null===(Q=J.redirectUrl)||void 0===Q?void 0:Q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(ee=e.additionalDetails)||void 0===ee||null===(te=ee.redirectUrl)||void 0===te?void 0:te.title))),(null==e||null===(ne=e.additionalDetails)||void 0===ne?void 0:ne.estimationDetails)&&l.createElement(Sl,{wsAdditionalDetails:e,workflowDetails:T}),(null==e||null===(le=e.additionalDetails)||void 0===le?void 0:le.estimationDetails)&&l.createElement(Cl,{wsAdditionalDetails:e,workflowDetails:T}))}),P&&(null==T||null===(a=T.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==T?void 0:T.isLoading)||C)&&l.createElement(t.Loader,null),!(null!=T&&T.isLoading)&&!C&&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!==(s=T.data)&&void 0!==s&&s.timeline&&1===(null==T||null===(c=T.data)||void 0===c||null===(d=c.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:O(`${N}${null==T||null===(p=T.data)||void 0===p||null===(v=p.timeline[0])||void 0===v?void 0:v.state}`),customChild:j(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===(h=T.data)||void 0===h?void 0:h.timeline)&&(null==T||null===(E=T.data)||void 0===E?void 0:E.timeline.slice(0,Y?null==T?void 0:T.data.timeline.length:2).map((e,n,i)=>{var o;let r="";var a,u,s,c,d,p;return window.location.href.includes("/obps/")&&(r=null!=T&&null!==(a=T.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=T&&null!==(c=T.data)&&void 0!==c&&null!==(d=c.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(`${N}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[x]}${r}`),customChild:j(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===(y=g.timeline)||void 0===y?void 0:y.length)>2&&l.createElement(t.LinkButton,{label:O(Y?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{X(e=>!e)}})))),l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"16px",fontSize:"24px"}},"DCB Details"),l.createElement("table",{border:"1px",style:G.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:G.th},"Installments"),l.createElement("th",{colSpan:"3",style:G.th},"Demand"),l.createElement("th",{colSpan:"3",style:G.th},"Collection"),l.createElement("th",{colSpan:"3",style:G.th},"Balance"),l.createElement("th",{style:G.th},"Advance")),l.createElement("tr",null,l.createElement("th",{style:G.th}),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Tax"),l.createElement("th",{style:G.th},"Interest"),l.createElement("th",{style:G.th},"Penalty"),l.createElement("th",{style:G.th},"Advance"))),l.createElement("tbody",null,null==b?void 0:b.map(e=>l.createElement("tr",null,l.createElement("td",{style:G.td},e.taxPeriodFrom,"-",e.taxPeriodTo),l.createElement("td",{style:G.td},e.demandTax),l.createElement("td",{style:G.td},e.demandInterest),l.createElement("td",{style:G.td},e.demandPenality),l.createElement("td",{style:G.td},e.collectionTax),l.createElement("td",{style:G.td},e.collectionInterest),l.createElement("td",{style:G.td},e.collectionPenality),l.createElement("td",{style:G.td},e.balanceTax),l.createElement("td",{style:G.td},e.balanceInterest),l.createElement("td",{style:G.td},e.balancePenality),l.createElement("td",{style:G.td},e.advance))),l.createElement("tr",null,l.createElement("th",{style:G.th},"Total"),l.createElement("td",{style:G.td},D),l.createElement("td",{style:G.td},Z),l.createElement("td",{style:G.td},J),l.createElement("td",{style:G.td},Q),l.createElement("td",{style:G.td},ee),l.createElement("td",{style:G.td},te),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td})),l.createElement("tr",null,l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("th",{style:G.th},"Total"),l.createElement("td",{style:G.td},ne),l.createElement("td",{style:G.td},"0"),l.createElement("td",{style:G.td},"0"),l.createElement("td",{style:G.td},"0")),l.createElement("tr",null,l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("td",{style:G.td}),l.createElement("th",{style:G.th},"Total Balance"),l.createElement("td",{style:G.td},ne)))))}function Rl(e){var n,i,o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,_;let{t:S,showToast:b,closeToast:T,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.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===(o=b.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.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===(s=b.error)||void 0===s?void 0:s.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:S(`ES_${C}_${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!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.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===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.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===(E=b.error)||void 0===E?void 0:E.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===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(y=b.error)||void 0===y?void 0:y.message:S(`ES_${C}_${null==b||null===(_=b.action)||void 0===_?void 0:_.action}_UPDATE_SUCCESS`)}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var N,P;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:`ES_${C}_${null==b||null===(P=b.action)||void 0===P?void 0:P.action}_UPDATE_SUCCESS`;return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function Il(e){var o,r,a,u,s,c,d,p,v,m,f,h,E,g,y,_;let{workflowDetails:S,displayMenu:b,onActionSelect:T,setDisplayMenu:C,businessService:A,forcedActionPrefix:D,ActionBarStyle:N={},MenuStyle:P={}}=e;const{t:x}=i.useTranslation();let R=Digit.UserService.getUser();const I=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):{};R=null==t?void 0:t.value}const w=null===(o=R)||void 0===o||null===(r=o.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let O=!1,L=!1,k=(null==S||null===(u=S.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(c=s.nextActions)||void 0===c?void 0:c.filter(e=>(null==w?void 0:w.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==S||null===(d=S.data)||void 0===d||null===(p=d.nextActions)||void 0===p?void 0:p.filter(e=>(null==w?void 0:w.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(I,()=>{C(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==k?void 0:k.length)||null!=k&&null!==(v=k[0])&&void 0!==v&&null!==(m=v.redirectionUrl)&&void 0!==m&&m.pathname.includes("/pt/property-details/")&&1==(null==k?void 0:k.length)?(L=!1,O=!0):(null==k?void 0:k.length)>0&&(L=!0,O=!1),l.createElement(l.Fragment,null,!(null!=S&&S.isLoading)&&L&&!O&&l.createElement(t.ActionBar,{style:{...N}},b&&(null!=S&&null!==(f=S.data)&&void 0!==f&&null!==(h=f.actionState)&&void 0!==h&&h.nextActions||null!=S&&null!==(E=S.data)&&void 0!==E&&E.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:D||"WF_EMPLOYEE_"+(null==A?void 0:A.toUpperCase()),options:k,optionKey:"action",t:x,onSelect:T,style:P}):null,l.createElement(t.SubmitBar,{ref:I,label:x("WF_TAKE_ACTION"),onSubmit:()=>C(!b)})),!(null!=S&&S.isLoading)&&!L&&O&&l.createElement(t.ActionBar,{style:{...N}},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==k||null===(g=k[0])||void 0===g?void 0:g.action,value:null==k||null===(y=k[0])||void 0===y?void 0:y.action,onClick:e=>{T((null==k?void 0:k[0])||{})}},x(`${D||"WF_EMPLOYEE_"+(null==A?void 0:A.toUpperCase())}_${null==k||null===(_=k[0])||void 0===_?void 0:_.action}`))))}const wl=()=>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(wl,null));function Ll(e){let{action:n,closeWarningPopup:o}=e;const{t:r}=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"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Ol,{onClick:()=>{o()}}),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,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("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:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("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 kl=e=>{var r,u;console.log("props",e);let s=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const c=Digit.ULBService.getCurrentTenantId(),d=Digit.ULBService.getStateId(),{data:p}=Digit.Hooks.obps.useMDMS(d,"BPA",["BlockReason"]),{t:v}=i.useTranslation(),m=o.useHistory();let{id:f}=o.useParams();const[h,E]=n.useState(!1),[y,_]=n.useState(null),[S,b]=n.useState(!1),[T,C]=n.useState(!1),[A,D]=n.useState(!1),{data:N}=Digit.Hooks.obps.useMDMS(d,"BPA",["RiskTypeComputation"]),{applicationDetails:P,demandData:x,totalDemandTax:R,totalBalanceTax:I,showToast:w,setShowToast:O,isLoading:L,isDataLoading:k,applicationData:M,mutate:F,nocMutation:B,workflowDetails:U,id:H,businessService:j,closeToast:W,moduleCode:z,timelineStatusPrefix:$,forcedActionPrefix:V,statusAttribute:q,ActionBarStyle:G,MenuStyle:K,paymentsList:Y,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q}=e;n.useEffect(()=>{w&&U.revalidate()},[w]);const ee=a.useQueryClient(),te=()=>{_(null),b(!1)};return L||T?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,L?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(xl,{applicationDetails:P,demandData:x,id:H,workflowDetails:U,isDataLoading:k,applicationData:M,totalDemandTax:R,totalBalanceTax:I,businessService:j,timelineStatusPrefix:$,statusAttribute:q,paymentsList:Y,showTimeLine:X,oldValue:Z,isInfoLabel:J}),S?l.createElement(el,{t:v,action:y,tenantId:c,state:d,id:f,applicationDetails:P,applicationData:null==P?void 0:P.applicationData,closeModal:te,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,r,a,u,s,c,d,p,f,h,E,_,S,b,T,A,D){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(r=o.comment)||void 0===r?void 0:r.length)||("INITIATE"===(null==e||null===(a=e.Licenses)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(c=s[0])||void 0===c||null===(d=c.additionalDetail)||void 0===d||null===(p=d.validityYears)||void 0===p?void 0:p.length):0==(null==e||null===(f=e.Licenses)||void 0===f||null===(h=f[0])||void 0===h||null===(E=h.comment)||void 0===E?void 0:E.length))||0==(null==e||null===(_=e.WaterConnection)||void 0===_||null===(S=_.comment)||void 0===S?void 0:S.length)||0==(null==e||null===(b=e.SewerageConnection)||void 0===b||null===(T=b.comment)||void 0===T?void 0:T.length)||0==(null==e||null===(A=e.BPA)||void 0===A||null===(D=A.comment)||void 0===D?void 0:D.length)){var N,P;"INITIATE"===(null==e||null===(N=e.Licenses)||void 0===N||null===(P=N[0])||void 0===P?void 0:P.action)?alert(v("Please fill in the validity before submitting")):alert(v("Please fill in the comments before submitting"))}else{const i=function(i,o,r,a,u){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(r=o.additionalDetails)&&void 0!==r&&r.blockingReason||"BLOCK"!=(null==e||null===(a=e.BPA)||void 0===a||null===(u=a.workflow)||void 0===u?void 0:u.action)){function s(t){if(l)return t;F&&(C(!0),F(e,{onError:(e,t)=>{C(!1),O({key:"error",error:e}),setTimeout(W,5e3)},onSuccess:(e,t)=>{var l,i,o,r,a,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),C(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=y,m.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=y,m.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&m.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(r=e.Amendments)||void 0===r?void 0:r.length)>0){var s,c,d,p,f,h,E,g;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(h=f.workflow)&&void 0!==h&&h.action.includes("APPROVE")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(g=E.workflow)&&void 0!==g&&g.action.includes("REJECT")&&O({key:"success",label:v("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var _;if((null==e||null===(a=e.Licenses)||void 0===a?void 0:a.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return O({key:"success",action:y}),void m.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(_=e.Licenses[0])||void 0===_?void 0:_.applicationNumber));O({key:"success",action:y}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),ee.clear(),ee.refetchQueries("APPLICATION_SEARCH")}}})),te()}C(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute({...e}));const i=function(){if(!1!==t&&B){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==B?void 0:B.mutateAsync(e)),i=g(function(){return C(!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,r,a,u,s,c,d,p,m;C(!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?v(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(c=e.response)||void 0===c||null===(d=c.data)||void 0===d||null===(p=d.Errors)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.message)||e;te(),O({key:"error",error:{message:f}}),setTimeout(W,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(s):s(i)}alert(v("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(r=U.data)||void 0===r?void 0:r.timeline,businessService:j,workflowDetails:U,moduleCode:z,blockReason:null==p||null===(u=p.BPA)||void 0===u?void 0:u.BlockReason}):null,A?l.createElement(Ll,{action:y,workflowDetails:U,businessService:j,isWarningPop:A,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(Rl,{t:v,showToast:w,closeToast:W,businessService:j}),s?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:v("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==M?void 0:M.applicationNo})).then(function(e){var t,n,l,i,o,r;const a=Digit.Utils.obps.calculateRiskType(null==N||null===(t=N.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==P||null===(n=P.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==P||null===(o=P.edcrDetails)||void 0===o||null===(r=o.planDetail)||void 0===r?void 0:r.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=a,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,i,o,r,a,s,d,p,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(r=u.BPA)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(s=a.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(d=u.BPA)||void 0===d||null===(p=d.additionalDetails)||void 0===p||null===(m=p.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(v("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(Il,{workflowDetails:U,displayMenu:h,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa")&&window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]),null!=e&&e.isToast)O({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(W,5e3);else if(null!=e&&e.isWarningPopUp)D(!0);else if(null!=e&&e.redirectionUrll){var i,o,r,a,u;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))m.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),JSON.stringify({data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state,url:`${null===(u=location)||void 0===u?void 0:u.pathname}${location.search}`}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var s,c;m.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.pathname),{data:null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.state})}else{var d;window.location.assign(`${window.location.origin}/digit-ui/employee/payment/collect/${null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.pathname}`)}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),b(!0);else{var p,v;m.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:{...null===(v=e.redirectionUrl)||void 0===v?void 0:v.state}})}else b(!0);_(e),E(!1)},setDisplayMenu:E,businessService:j,forcedActionPrefix:V,ActionBarStyle:G,MenuStyle:K})))};var Ml=l.memo(()=>{var e,r,a,u,s,c,p,v,m,f,h,E,g;const{t:y}=i.useTranslation(),{data:_}=Digit.Hooks.useStore.getInitData(),S=Digit.ULBService.getCurrentTenantId(),{tenants:b}=_||{},{id:T}=o.useParams(),[C,A]=n.useState(null),[D,N]=n.useState({}),[P,x]=n.useState(!1),[I,w]=n.useState(!1),[O,L]=n.useState("ptr");console.log("gggggg",D),sessionStorage.setItem("applicationNoinAppDetails",T);const{isLoading:k,data:M}=Digit.Hooks.ptr.usePtrApplicationDetail(y,S,T),{mutate:F}=Digit.Hooks.ptr.usePTRApplicationAction(S);let B=Digit.Hooks.useWorkflowDetails({tenantId:(null==M||null===(e=M.applicationData)||void 0===e?void 0:e.tenantId)||S,id:null==M||null===(r=M.applicationData)||void 0===r||null===(a=r.applicationData)||void 0===a?void 0:a.applicationNumber,moduleCode:O,role:"PT_CEMP"});var U,H;console.log("workkkkflooowowow",B),Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:T,audit:!0}}),n.useEffect(()=>{M&&N(d.cloneDeep(M))},[M]),n.useEffect(()=>{var e,t,n;null==B||null===(e=B.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==B||null===(t=B.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===O||L(null==B||null===(n=B.data)||void 0===n?void 0:n.applicationBusinessService)},[B.data]),!Digit.UserService.hasAccess(["PT_CEMP"])||"ptr"!==(null==B||null===(u=B.data)||void 0===u?void 0:u.applicationBusinessService)||null==B||null===(s=B.data)||void 0===s||null===(c=s.actionState)||void 0===c||null===(p=c.nextActions)||void 0===p||!p.find(e=>"PAY"===e.action)||(B.data.actionState.nextActions=null==B||null===(U=B.data)||void 0===U||null===(H=U.actionState)||void 0===H?void 0:H.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==D||null===(t=D.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let j=[{order:1,label:y("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==D?void 0:D.applicationData,t=b.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:W,isLoading:z}=Digit.Hooks.useRecieptSearch({tenantId:S,businessService:"pet-services",consumerCodes:null==D||null===(v=D.applicationData)||void 0===v||null===(m=v.applicationData)||void 0===m?void 0:m.applicationNumber,isEmployee:!1},{enabled:!(null==D||null===(f=D.applicationData)||void 0===f||null===(h=f.applicationData)||void 0===h||!h.applicationNumber)});return W&&(null==W?void 0:W.Payments.length)>0&&0==z&&j.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==W||null===(e=W.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==W?void 0:W.Payments[0]})}}),"APPROVED"===(null==W||null===(E=W.Payments[0])||void 0===E?void 0:E.instrumentStatus)&&j.push({label:y("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(S,{PetRegistrationApplications:[null==M||null===(e=M.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(S,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement("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")),j&&j.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>x(!P),displayOptions:P,options:j,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(kl,{applicationDetails:null==D?void 0:D.applicationData,isLoading:k,isDataLoading:k,applicationData:null==D||null===(g=D.applicationData)||void 0===g?void 0:g.applicationData,mutate:F,workflowDetails:B,businessService:O,moduleCode:"pet-services",showToast:C,setShowToast:A,closeToast:()=>{A(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const Fl=(e,t,n,l,i)=>i(`${l?"E":"C"}S_PTR_RESPONSE_${t||"CREATE"}_${e}${n?"":"_ERROR"}`),Bl=(e,t,n,l)=>Fl("LABEL",e,t,n,l),Ul=e=>{var n,i,o,r,a,u,s,c,d,p,v,m,f;return l.createElement(t.Banner,{message:(p=(null==e||null===(n=e.data)||void 0===n||null===(i=n.PetRegistrationApplications)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.applicationStatus)||e.action,v=e.isSuccess,m=e.isEmployee,f=e.t,Fl("ACTION",p,v,m,f)),applicationNumber:null==e||null===(r=e.data)||void 0===r||null===(a=r.PetRegistrationApplications)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.applicationNumber,info:Bl((null===(s=e.data)||void 0===s||null===(c=s.PetRegistrationApplications)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.applicationStatus)||e.action,e.isSuccess,e.isEmployee,e.t),successful:e.isSuccess})},Hl=e=>{const{t:t}=i.useTranslation();return t(null!=e&&e.isSuccess?"CS_PROPERTY_FEEDBACK_SUCCESS":"CS_PROPERTY_FEEDBACK_FAILED")},jl=e=>l.createElement(t.Banner,{message:Hl(e),applicationNumber:"",style:e.isMobile?{width:"unset"}:{width:"740px"},successful:null==e?void 0:e.isSuccess}),Wl={PTRCheckPage:e=>{var r,a,u,s;let{onSubmit:c,value:d={}}=e;const{t:v}=i.useTranslation(),{address:m,pets:f,isEditPET:h,isUpdatePET:g,ownerss:y}=(o.useHistory(),d),_=h||g?"edit-application":"new-application",[S,b]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:5}):null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,v("PTR_CHECK_YOUR_DETAILS")),l.createElement("div",null,l.createElement("br",null),l.createElement(t.CardSubHeader,null,v("ES_TITILE_OWNER_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:v("PTR_APPLICANT_NAME"),text:""+v(p(null==y?void 0:y.applicantName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})}),l.createElement(t.Row,{label:v("PTR_FATHER_HUSBAND_NAME"),text:""+v(p(null==y?void 0:y.fatherName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})}),l.createElement(t.Row,{label:v("PTR_MOBILE_NUMBER"),text:""+v(p(null==y?void 0:y.mobileNumber)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})}),l.createElement(t.Row,{label:v("PTR_EMAIL_ID"),text:""+v(p(null==y?void 0:y.emailId)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/owners`})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,v("ES_TITILE_PET_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:v("PTR_SEARCH_PET_TYPE"),text:""+v(p(null==f||null===(r=f.petType)||void 0===r?void 0:r.value)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_SEARCH_BREED_TYPE"),text:""+v(p(null==f||null===(a=f.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_PET_NAME"),text:""+v(p(null==f?void 0:f.petName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_DOCTOR_NAME"),text:""+v(p(null==f?void 0:f.doctorName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_CLINIC_NAME"),text:""+v(p(null==f?void 0:f.clinicName)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})}),l.createElement(t.Row,{label:v("PTR_VACCINATED_DATE"),text:""+v(p(null==f?void 0:f.lastVaccineDate)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pet-details`})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,v("PTR_LOCATION_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:v("PTR_HOUSE_NO"),text:""+v(p(null==m?void 0:m.doorNo)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/street`})}),l.createElement(t.Row,{label:v("PTR_STREET_NAME"),text:""+v(p(null==m?void 0:m.street)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/street`})}),l.createElement(t.Row,{label:v("PTR_ADDRESS_LINE1"),text:""+v(p(null==m?void 0:m.addressLine1)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/street`})}),l.createElement(t.Row,{label:v("PTR_ADDRESS_PINCODE"),text:""+v(p(null==m?void 0:m.pincode)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/pincode`})}),l.createElement(t.Row,{label:v("MYCITY_CODE_LABEL"),text:""+v(p(null==m||null===(u=m.city)||void 0===u?void 0:u.name)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/address`})}),l.createElement(t.Row,{label:v("PTR_LOCALITY"),text:""+v(p(null==m||null===(s=m.locality)||void 0===s?void 0:s.name)),actionButton:l.createElement(N,{jumpTo:`/digit-ui/citizen/ptr/petservice/${_}/address`})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:v("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{b(!S)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:v("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:c,disabled:!S})))},PTRAcknowledgement:e=>{var r,a;let{data:u,onSuccess:s}=e;const{t:c}=i.useTranslation(),d=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.ptr.usePTRCreateAPI(null===(r=u.address)||void 0===r||null===(a=r.city)||void 0===a?void 0:a.code)),{data:p}=Digit.Hooks.useStore.getInitData(),{tenants:v}=(o.useRouteMatch(),p||{});return n.useEffect(()=>{try{var e,t;u.tenantId=null===(e=u.address)||void 0===e||null===(t=e.city)||void 0===t?void 0:t.code;let n=(e=>{var t;return{PetRegistrationApplications:[{tenantId:(e=(e=>{var t,n,l;let{pets:i}=e,o={...i,petType:null==i||null===(t=i.petType)||void 0===t?void 0:t.value,breedType:null==i||null===(n=i.breedType)||void 0===n?void 0:n.value,petGender:null==i||null===(l=i.petGender)||void 0===l?void 0:l.name,clinicName:null==i?void 0:i.clinicName,petName:null==i?void 0:i.petName,doctorName:null==i?void 0:i.doctorName,lastVaccineDate:null==i?void 0:i.lastVaccineDate,petAge:null==i?void 0:i.petAge,vaccinationNumber:null==i?void 0:i.vaccinationNumber};return e.pets=o,e})(e=(e=>{var t,n,l;let{address:i}=e,o={...i,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.doorNo,street:null==i?void 0:i.street,locality:{code:(null==i||null===(n=i.locality)||void 0===n?void 0:n.code)||"NA",area:null==i||null===(l=i.locality)||void 0===l?void 0:l.name}};return e.address=o,e})(e=(e=>{let{ownerss:t}=e,n={...t};return e.ownerss=n,e})(e=(e=>{let{documents:t}=e,n={...t};return e.documents=n,e})(e))))).tenantId,...null===(t=e)||void 0===t?void 0:t.ownerss,address:e.address,petDetails:e.pets,...e.documents,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}}]}})(u);d.mutate(n,{onSuccess:s})}catch(e){}},[]),d.isLoading||d.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(O,{t:c,data:d.data,isSuccess:d.isSuccess,isLoading:d.isIdle||d.isLoading}),l.createElement(t.StatusTable,null,d.isSuccess&&l.createElement(t.Row,{rowContainerStyle:w,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),d.isSuccess&&l.createElement(t.SubmitBar,{label:c("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=d.data;let t=e&&e[0]||{};const n=v.find(e=>e.code===t.tenantId);return Promise.resolve(R({...t},n,c)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.LinkButton,{label:c("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:T,PTRWFReason: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))},PTRNewApplication:()=>{const e=Digit.ULBService.getCurrentTenantId(),{t:r}=(Digit.Hooks.ptr.useTenants(),i.useTranslation()),[a,u]=n.useState(!1),s=o.useHistory(),[c,d,p]=Digit.Hooks.useSessionStorage("store-data",null),[v,m,f]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[h,E,g]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{});n.useEffect(()=>{m(!1),g()},[]);const y=Ye;return l.createElement(t.FormComposer,{heading:r("ES_TITLE_NEW_PET_REGISTARTION"),isDisabled:!a,label:r("ES_COMMON_APPLICATION_SUBMIT"),config:y.map(e=>({...e,body:e.body.filter(e=>!e.hideInEmployee)})),fieldStyle:{marginRight:0},onSubmit:t=>{var n,l,i,o,r,a,u,c,d,p,v,m,f;const h=[{tenantId:e,...null==t?void 0:t.owners[0],petDetails:{...null==t?void 0:t.pets[0],petType:null==t||null===(n=t.pets[0])||void 0===n||null===(l=n.petType)||void 0===l?void 0:l.value,breedType:null==t||null===(i=t.pets[0])||void 0===i||null===(o=i.breedType)||void 0===o?void 0:o.value,petGender:null==t||null===(r=t.pets[0])||void 0===r||null===(a=r.petGender)||void 0===a?void 0:a.name},address:{...null==t?void 0:t.address,city:null==t||null===(u=t.address)||void 0===u||null===(c=u.city)||void 0===c?void 0:c.name,locality:{code:null==t||null===(d=t.address)||void 0===d||null===(p=d.locality)||void 0===p?void 0:p.code,area:null==t||null===(v=t.address)||void 0===v||null===(m=v.locality)||void 0===m?void 0:m.area}},documents:null==t||null===(f=t.documents)||void 0===f?void 0:f.documents,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}}];s.replace("/digit-ui/employee/ptr/petservice/response",{PetRegistrationApplications:h})},defaultValues:{},onFormValueChange:(e,t,n)=>{u(!Object.keys(n.errors).length)}})},ApplicationDetails:Ml,PTRResponse:e=>{const{t:r}=i.useTranslation(),u=a.useQueryClient(),[s,c]=(o.useHistory(),n.useState(null)),[d,p]=n.useState(null),[v,m]=n.useState(!1),[f,h,E]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[g,y,_]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",!1),S=Digit.ULBService.getCurrentTenantId(),{state:b}=e.location,T=Digit.Hooks.ptr.usePTRCreateAPI(S,"UPDATE"!==b.key),C=Digit.Hooks.ptr.usePTRCreateAPI(S,!1),{data:A}=Digit.Hooks.useStore.getInitData(),{tenants:D}=A||{},{data:N}=Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:b.PetRegistrationApplications.applicationNumber,audit:!0}},{enabled:v,select:e=>{var t;return null===(t=e.PetRegistrationApplications)||void 0===t?void 0:t.filter(e=>"ACTIVE"===e.status)}});return n.useEffect(()=>{C.data&&C.isSuccess&&y(C.data)},[T.data]),n.useEffect(()=>{C.data&&C.isSuccess&&y(C.data)},[C.data]),n.useEffect(()=>{f||T.mutate({PetRegistrationApplications:null==b?void 0:b.PetRegistrationApplications},{onError:(e,t)=>{var n,l,i;p({key:"error"}),c((null==e||null===(n=e.response)||void 0===n||null===(l=n.data)||void 0===l||null===(i=l.Errors[0])||void 0===i?void 0:i.message)||null)},onSuccess:function(e){try{var t;return h(!0),u.clear(),"CREATE"===(null==e||null===(t=e.PetRegistrationApplications[0])||void 0===t?void 0:t.creationReason)&&m(!0),Promise.resolve()}catch(e){return Promise.reject(e)}}})},[]),T.isLoading||T.isIdle&&!f?l.createElement(t.Loader,null):l.createElement("div",null,l.createElement(t.Card,null,l.createElement(Ul,{t:r,data:(null==T?void 0:T.data)||g,action:null==b?void 0:b.action,isSuccess:!!Object.keys(g||{}).length||(null==T?void 0:T.isSuccess),isLoading:T.isIdle&&!f||(null==T?void 0:T.isLoading),isEmployee:e.parentRoute.includes("employee")}),l.createElement(t.CardText,null,((e,t,n,l)=>Fl("DISPLAY",e,t,n,l))(b.action,(T.isSuccess||!!g)&&!T.isError,e.parentRoute.includes("employee"),r)),(T.isSuccess||!!g)&&!T.isError&&l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:r("PTR_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=T.data||g,t=e&&e[0]||{},n=D.find(e=>e.code===t.tenantId);return Promise.resolve(R({...t,auditData:N},n,r)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),d&&l.createElement(t.Toast,{error:"error"===d.key,label:s,onClose:()=>{p(null),c(null)}}),l.createElement(t.ActionBar,null,l.createElement(o.Link,{to:e.parentRoute.includes("employee")?"/digit-ui/employee":"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:r("CORE_COMMON_GO_TO_HOME")}))))},PTRMyApplications:()=>{const{t:e}=i.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info;let a,u,s=window.location.href.split("/").pop();isNaN(parseInt(s))?a=4:(u=s,a=parseInt(s)+50);let c=isNaN(parseInt(s))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",mobileNumber:null==r?void 0:r.mobileNumber,tenantId:n}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:n};const{isLoading:d,data:p}=Digit.Hooks.ptr.usePTRSearch({filters:c},{filters:c}),{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:h,data:E}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:f}},{filters:{serviceSearchArgs:f},enabled:(null==m?void 0:m.length)>0,cacheTime:0});function g(t){var n;let l=null==E||null===(n=E.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||h?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(L,{application:e,tenantId:null==r?void 0:r.permanentCity,buttonLabel:g(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/"+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(o.Link,{to:"/digit-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,r,a,u,s,c,d,p,v,m,f,h;const{t:E}=i.useTranslation(),{acknowledgementIds:g,tenantId:y}=(o.useHistory(),o.useParams()),[_,S]=n.useState([]),[b,T]=n.useState(!1),[A,D]=n.useState(!1),[N,P]=n.useState(null),{data:x}=Digit.Hooks.useStore.getInitData(),{tenants:I}=x||{},{isLoading:w,data:O}=Digit.Hooks.ptr.usePTRSearch({tenantId:y,filters:{applicationNumber:g}}),[L,k]=n.useState(null),M=Re(O,"PetRegistrationApplications",[]),F=Re(O,"PetRegistrationApplications[0].applicationNumber",[]);let B=M&&M.length>0&&M[0]||{};const U=B;sessionStorage.setItem("ptr-pet",JSON.stringify(U));const[H,j]=n.useState(!1);n.useEffect(()=>{!function(){try{j(!0),Promise.resolve(Digit.PaymentService.fetchBill(y,{businessService:"pet-services",consumerCode:g})).then(function(e){k(e),j(!1)})}catch(e){return Promise.reject(e)}}()},[y,g]);const{isLoading:W}=Digit.Hooks.ptr.usePTRSearch({tenantId:y,filters:{applicationNumber:F,audit:!0}},{enabled:!0}),{data:z,isLoading:$}=Digit.Hooks.useRecieptSearch({tenantId:y,businessService:"pet-services",consumerCodes:g,isEmployee:!1},{enabled:!!g});if(B.workflow||(B.workflow={id:null,tenantId:y,businessService:"pet-services",businessId:null==U?void 0:U.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),w||W)return l.createElement(t.Loader,null);let V=E("CS_NA");if(null!=B&&null!==(e=B.additionalDetails)&&void 0!==e&&e.documentDate){var q;const e=new Date(null==B||null===(q=B.additionalDetails)||void 0===q?void 0:q.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];V=`${e.getDate()} ${t} ${e.getFullYear()}`}let G=[];return G.push({label:E("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=U||{},t=I.find(t=>t.code===e.tenantId);return Promise.resolve(R({...e},t,E)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),z&&(null==z?void 0:z.Payments.length)>0&&0==$&&G.push({label:E("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]})}}),"DEPOSITED"===(null==z||null===(r=z.Payments[0])||void 0===r?void 0:r.paymentStatus)&&G.push({label:E("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(y,{PetRegistrationApplications:[null==O||null===(e=O.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(y,{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"}},E("PTR_PET_APPLICATION_DETAILS")),G&&G.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>T(!b),displayOptions:b,options:G})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICATION_NO_LABEL"),text:null==B?void 0:B.applicationNumber})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_PINCODE"),text:(null==B||null===(a=B.address)||void 0===a?void 0:a.pincode)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_CITY"),text:(null==B||null===(u=B.address)||void 0===u?void 0:u.city)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_STREET_NAME"),text:(null==B||null===(s=B.address)||void 0===s?void 0:s.street)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_HOUSE_NO"),text:(null==B||null===(c=B.address)||void 0===c?void 0:c.doorNo)||E("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICANT_NAME"),text:(null==B?void 0:B.applicantName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_FATHER/HUSBAND_NAME"),text:(null==B?void 0:B.fatherName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICANT_MOBILE_NO"),text:(null==B?void 0:B.mobileNumber)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_APPLICANT_EMAILID"),text:(null==B?void 0:B.emailId)||E("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},E("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:E("PTR_PET_TYPE"),text:(null==B||null===(d=B.petDetails)||void 0===d?void 0:d.petType)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_BREED_TYPE"),text:(null==B||null===(p=B.petDetails)||void 0===p?void 0:p.breedType)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_DOCTOR_NAME"),text:(null==B||null===(v=B.petDetails)||void 0===v?void 0:v.doctorName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_CLINIC_NAME"),text:(null==B||null===(m=B.petDetails)||void 0===m?void 0:m.clinicName)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_VACCINATED_DATE"),text:(null==B||null===(f=B.petDetails)||void 0===f?void 0:f.lastVaccineDate)||E("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:E("PTR_VACCINATION_NUMBER"),text:(null==B||null===(h=B.petDetails)||void 0===h?void 0:h.vaccinationNumber)||E("CS_NA")})),l.createElement(C,{application:U,id:null==U?void 0:U.applicationNumber,userType:"citizen"}),N&&l.createElement(t.Toast,{error:N.key,label:E(N.label),style:{bottom:"0px"},onClose:()=>{P(null)}})),A&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:D,setShowToast:P,data:O})))},SelectOtp:e=>{let{config:i,otp:o,onOtpChange:r,onResend:a,onSelect:u,t:s,error:c,userType:d="citizen",canSubmit:p}=e;const[v,m]=n.useState(30),f={type:"register"},[h,E]=n.useState(!1);!function(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}(()=>{m(v-1)},v>0?1e3:null),n.useEffect(function(){try{if(window.location.href.includes("code")){let e=window.location.href.split("=")[1].split("&")[0],t={code_verifier:sessionStorage.getItem("code_verfier_register"),code:e,module:"REGISTER"};console.log("token",e,t,sessionStorage.getItem("code_verfier_register")),fetch("https://api.digitallocker.gov.in/public/oauth2/1/token",{method:"POST",mode:"cors",headers:{"Content-Type":"application/x-www-form-urlencoded","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, DELETE,POST"},body:new URLSearchParams({code:e,grant_type:"authorization_code",client_id:"YN77ADDADE",client_secret:"71abd480b5811ab72277",redirect_uri:"http://localhost:3001/digit-ui/citizen/login/otp",code_verifier:sessionStorage.getItem("code_verfier_register")})}).then(e=>{e.json().then(e=>y(e))})}return Promise.resolve()}catch(e){return Promise.reject(e)}},[]);const y=function(e){try{console.log("registerUser",e);const t={dob:"1998-02-03",mobileNumber:e.mobile,name:e.name,tenantId:"pg",userType:Digit.UserService.getType()};return Promise.resolve(S({otp:{...t,...f}})).then(function(e){null!=e&&e[1]&&(console.log("gggg",null==e?void 0:e[1],typeof(null==e?void 0:e[1])),E(!0),setTimeout(()=>{window.location.href=window.location.href.split("/otp")[0]},3e3))})}catch(e){return Promise.reject(e)}},_=()=>{a(),m(2)},S=function(e){return Promise.resolve(g(function(){return console.log("sendOtpsendOtp",e),Promise.resolve(Digit.UserService.sendOtp(e,"pg")).then(function(e){return[e,null]})},function(e){return[null,e]}))};return"employee"===d?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:o}),v>0?l.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${v} ${s("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:_},s("CS_RESEND_OTP")),!c&&l.createElement(t.CardLabelError,null,s("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:u,config:i,t:s,isDisabled:!(6===(null==o?void 0:o.length)&&p)},l.createElement(t.OTPInput,{length:6,onChange:r,value:o}),v>0?l.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${v} ${s("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:_},s("CS_RESEND_OTP")),!c&&l.createElement(t.CardLabelError,null,s("CS_INVALID_OTP")),!h&&l.createElement(t.CardLabelError,null,s("CS_ALREADY_REGISTERED")))},AcknowledgementCF:e=>{var n,r,a,u,s,c,d,p,v;const{t:m}=i.useTranslation(),f=(Digit.ULBService.getCurrentTenantId(),o.useLocation()),h=(Digit.Hooks.useStore.getInitData(),window.Digit.Utils.browser.isMobile());return l.createElement("form",null,l.createElement(t.Card,{style:h?{padding:"unset"}:{}},l.createElement(jl,{t:m,data:f.state,isSuccess:!(null===(n=f.state)||void 0===n||null===(r=n.result)||void 0===r||null===(a=r.Service)||void 0===a||!a[0]),isMobile:h,isLoading:!1}),(null===(u=f.state)||void 0===u||null===(s=u.result)||void 0===s||null===(c=s.Service)||void 0===c?void 0:c[0])&&l.createElement(t.CardText,{style:{padding:"0px 10px 0px 10px"}},m("CS_CF_FEEDBACK_RESPONSE")),!(null!==(d=f.state)&&void 0!==d&&null!==(p=d.result)&&void 0!==p&&null!==(v=p.Service)&&void 0!==v&&v[0])&&l.createElement(t.CardText,null,m("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement("div",{style:{padding:"0px 10px 20px 10px"}},l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:m("CS_COMMON_GO_BACK_TO_HOME")})))))},CitizenFeedback:e=>{var r,a,u,s;let{popup:c=!1,onClose:d,setShowToast:p,data:v}=e;const{t:m}=i.useTranslation(),f=o.useHistory(),h=Digit.UserService.getUser();let{redirectedFrom:E,propertyId:g,acknowldgementNumber:y,creationReason:_,tenantId:S,locality:b}=Digit.Hooks.useQueryParams();const T=window.Digit.Utils.browser.isMobile();S=S||Digit.ULBService.getCurrentTenantId();const C=Digit.ULBService.getStateId(),{data:A,isLoading:D}=Digit.Hooks.pt.useRatingAndFeedbackMDMS.RatingAndFeedBack(C),[N,P]=n.useState(""),[x,R]=n.useState(0);if(D)return l.createElement(t.Loader,null);const I=e=>{var t,n;let l=null==A||null===(t=A.enabledScreensList)||void 0===t||null===(n=t.filter(e=>{var t,n,l;return"PT"===(null==e?void 0:e.module)&&((null==E?void 0:E.includes(null==e?void 0:e.screenfrom))||(null==e||null===(t=e.bussinessService)||void 0===t?void 0:t.includes(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason)))}))||void 0===n?void 0:n[0];return"Header"===e?null==l?void 0:l.cardHeader:"Text"===e?null==l?void 0:l.cardText:void 0};return l.createElement(l.Fragment,null,l.createElement("form",null,l.createElement(t.Card,null,l.createElement("div",{style:c?{display:"flex",justifyContent:"space-between"}:{}},l.createElement(t.CardHeader,null,m(I("Header"))||m("PT_RATE_HELP_TEXT")),c&&l.createElement("span",{style:{marginTop:"8px"},onClick:()=>d(!1)},l.createElement(t.CloseSvg,null))),l.createElement(t.CardText,null,m(I("Text"),{acknowldgementNumber:y||(null==v||null===(r=v.Properties)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.acknowldgementNumber),propertyId:g||(null==v||null===(u=v.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId)})||m("PT_RATE_TEXT")),l.createElement(t.Rating,{styles:{justifyContent:"center"},currentRating:x,maxRating:5,onFeedback:(e,t,n)=>{R(n)}}),0!==x&&l.createElement("div",null,l.createElement(t.CardLabel,null,m((null==A||null===(w=A.headerByRating)||void 0===w||null===(O=w.filter(e=>x>=(null==e?void 0:e.minvalue)&&x<=(null==e?void 0:e.maxvalue)))||void 0===O||null===(L=O[0])||void 0===L?void 0:L.code)||m("CS_WHAT_WENT_WRONG"))),l.createElement(t.TextArea,{name:"",minLength:"64",onChange:e=>{P(e.target.value)}}),N&&(null==N?void 0:N.length)<64&&l.createElement(t.CardLabelError,{style:{marginTop:"-20px",marginBottom:"25px"}},m("CS_MIN_LENGTH_64"))),l.createElement(t.SubmitBar,{label:m("PT_SUBMIT"),onSubmit:()=>{var e,t,n,l;let i={},o={tenantId:(null==v||null===(e=v.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.tenantId)||S,code:["PT_"+(null!=E&&E.includes("payment")?"PAYMENT":_||(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason))],module:["PT"]};Digit.PTService.cfdefinitionsearch({filters:{ServiceDefinitionCriteria:o}}).then((e,t)=>{var n,l,o,r,a,u,s,m,E,_,T,C,A,D;(null==e||null===(n=e.ServiceDefinition)||void 0===n?void 0:n.length)>0&&(i={tenantId:(null==v||null===(l=v.Properties)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.tenantId)||S,serviceDefId:null==e||null===(r=e.ServiceDefinition)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.id,isActive:!0,attributes:[{attributeCode:"consumerCode",value:g||(null==v||null===(u=v.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId),additionalDetails:{}},{attributeCode:"rating",value:x,additionalDetails:{}},{attributeCode:"comments",value:N,additionalDetails:{}},{attributeCode:"channel",value:"Online",additionalDetails:{}}],additionalDetails:{locality:b||(null==v||null===(m=v.Properties)||void 0===m||null===(E=m[0])||void 0===E||null===(_=E.address)||void 0===_||null===(T=_.locality)||void 0===T?void 0:T.code)||""},accountId:null==h||null===(C=h.info)||void 0===C?void 0:C.uuid},i={...i,referenceId:y||(null==v||null===(A=v.Properties)||void 0===A||null===(D=A[0])||void 0===D?void 0:D.acknowldgementNumber)},Digit.PTService.cfcreate({Service:{...i}},S).then((e,t)=>{var n;(null==e||null===(n=e.Service)||void 0===n?void 0:n.length)>0&&(c?(d(!1),p({key:!1,label:"PT_FEEDBACK_SUBMITTED_SUCCESSFULLY"})):f.push({pathname:"/digit-ui/citizen/feedback-acknowledgement",state:{rating:x,comment:N,result:e}}))}).catch(e=>{var t,n,l;p({key:"error",label:""+(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.Errors[0])||void 0===l?void 0:l.message)})}))})},disabled:!!(N&&(null==N?void 0:N.length)<64)||!x}),!c&&l.createElement("div",{className:"link",style:T?{marginTop:"8px",width:"100%",textAlign:"center"}:{marginTop:"8px"}},l.createElement(o.Link,{to:"/digit-ui/citizen"},m("CS_GO_BACK_HOME"))))));var w,O,L},PTRPetdetails:e=>{let{config:t,onSelect:r,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=i.useTranslation(),[v,f]=(o.useLocation(),n.useState((null==a?void 0:a.pets)||[{doctorName:"",vaccinationNumber:"",lastVaccineDate:"",petAge:"",petType:"",breedType:"",clinicName:"",petName:"",petGender:"",key:Date.now()}])),[h,E]=n.useState({index:-1,type:""}),g=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:y}=Digit.Hooks.ptr.usePTRPetMDMS(g,"PetService","PetType"),{data:_}=Digit.Hooks.ptr.useBreedTypeMDMS(g,"PetService","BreedType");let S=[],b=[];y&&y.map(e=>{S.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})}),_&&_.map(e=>{var t,n;e.PetType==(null===(t=v[0])||void 0===t||null===(n=t.petType)||void 0===n?void 0:n.code)&&b.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:T}=Digit.Hooks.ptr.usePTRGenderMDMS(g,"common-masters","GenderType");let C=[];T&&T.map(e=>{"TRANSGENDER"!==e.code&&C.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{r(null==t?void 0:t.key,v)},[v]);const A={focusIndex:h,allOwners:v,setFocusIndex:E,formData:a,formState:c,setPets:f,t:p,setError:s,clearErrors:d,config:t,menu:S,breed_type:b,pet_sex:C};return l.createElement(l.Fragment,null,v.map((e,t)=>l.createElement(m,u({key:e.key,index:t,pets:e},A))))},PTROwnerDetails:e=>{let{config:t,onSelect:r,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=i.useTranslation(),[v,m]=(o.useLocation(),n.useState((null==a?void 0:a.owners)||[{applicantName:"",mobileNumber:"",fatherName:"",emailId:"",alternateNumber:"",key:Date.now()}])),[h,E]=n.useState({index:-1,type:""});Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),n.useEffect(()=>{r(null==t?void 0:t.key,v)},[v]);const g={focusIndex:h,allOwners:v,setFocusIndex:E,formData:a,formState:c,setOwners:m,t:p,setError:s,clearErrors:d,config:t};return l.createElement(l.Fragment,null,v.map((e,t)=>l.createElement(f,u({key:e.key,index:t,owner:e},g))))},PTRCreatePet:e=>{var n,r,u,s;const c=a.useQueryClient(),d=o.useRouteMatch(),{t:p}=i.useTranslation(),{pathname:v}=o.useLocation(),m=o.useHistory(),f=Digit.ULBService.getStateId();let h=[];const[E,g,y]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:_,isLoading:b}=Digit.Hooks.pt.useMDMS(f,"PropertyTax","CommonFieldsConfig");function T(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=E.owners||[];n[l]=t,g({...E,[e]:[...n]})}else if("units"===e){let e=E.units||[];e=t,g({...E,units:e})}else g({...E,[e]:{...E[e],...t}});((e,t,n,l)=>{let i,o=v.split("/").pop(),r=o.charAt(o.length-1),a=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=v.slice(0,-3),o=o.split("/").pop(),a=!0):(o=v.slice(0,-2),o=o.split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let{nextStep:u={}}=h.find(e=>e.route===(o||"0")),s=m.push;if(e&&(s=m.replace),n&&(u=l),null===u)return s(d.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?`${d.path}/${u}/${t}`:`${d.path}/${u}`,s(i)})(n,l,i,e)}E&&Object.keys(E).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),c.invalidateQueries("PTR_CREATE_PET"));const C=()=>{},A=()=>{};if(b)return l.createElement(t.Loader,null);_=S,_.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="info";const D=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRCheckPage"),N=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("PTRAcknowledgement");return l.createElement(o.Switch,null,h.map((e,t)=>{const{component:n,texts:i,inputs:r,key:a}=e,u="string"==typeof n?Digit.ComponentRegistryService.getComponent(n):n;return l.createElement(o.Route,{path:`${d.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:i,inputs:r,key:a},onSelect:T,onSkip:C,t:p,formData:E,onAdd:A}))}),l.createElement(o.Route,{path:d.path+"/check"},l.createElement(D,{onSubmit:function(){try{return m.push(d.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:E})),l.createElement(o.Route,{path:d.path+"/acknowledgement"},l.createElement(N,{data:E,onSuccess:()=>{y(),c.invalidateQueries("PTR_CREATE_PET")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:`${d.path}/${h.indexRoute}`})))},PTRDocumentUpload:e=>{var i,r;let{t:a,config:u,onSelect:s,formData:c,setError:d,clearErrors:p,formState:v}=e;Digit.ULBService.getCurrentTenantId();const m=Digit.ULBService.getStateId(),[f,h]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[E,g]=n.useState(null);o.useLocation();const{isLoading:_,data:S}=Digit.Hooks.ptr.usePetMDMS(m,"PetService","Documents"),b=null==S||null===(r=S.PetService)||void 0===r?void 0:r.Documents.map(e=>({...e,hasDropdown:!0}));return n.useEffect(()=>{s(u.key,{documents:f,PTRDocumentLength:null==b?void 0:b.length})},[f]),_?l.createElement(t.Loader,null):l.createElement("div",null,null==b?void 0:b.map((e,t)=>l.createElement(y,{key:t,document:e,action:"create",t:a,id:"ptr-document-"+t,error:E,setError:g,setDocuments:h,accept:".pdf, .jpeg, .jpg, .png",documents:f,formData:c,setFormError:d,clearFormErrors:p,config:u,formState:v})),E&&l.createElement(t.Toast,{label:E,onClose:()=>g(null),error:!0}))},PTRSelectStreet:e=>{let{t:i,config:o,onSelect:a,userType:s,formData:c,formState:p,setError:v,clearErrors:m}=e;const[f,h]=n.useState({index:-1,type:""}),{control:E,formState:g,watch:y,trigger:_}=r.useForm(),S=y(),{errors:b}=g,T=window.location.href.includes("ptr/petservice/new-application");let C;var A;return C=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{}}],n.useEffect(()=>{_()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(b).length&&!d.isEqual((null===(e=p.errors[o.key])||void 0===e?void 0:e.type)||{},b)?v(o.key,{type:b}):!Object.keys(b).length&&p.errors[o.key]&&m(o.key))},[b]),n.useEffect(()=>{const e=Object.keys(S),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[o.key])||void 0===n?void 0:n[e]}),d.isEqual(S,t)||(a(o.key,{...c[o.key],...S}),_())},[S]),"employee"===s?null===(A=C)||void 0===A?void 0:A.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},T?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:E,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:{pattern:e=>!!/^[A-Za-z]+( +[A-Za-z]+)*$/.test(e)||i("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:i=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:i.value,onChange:e=>{h({index:n}),i.onChange(e.target.value)},onBlur:i.onBlur,autoFocus:(null==f?void 0:f.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:{...o,inputs:C},_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRCitizenDetails:e=>{var i,r,a,s,c;let{t:d,config:p,onSelect:v,userType:m,formData:f}=e;o.useLocation();let h={};const[g,y]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].applicantName||(null==f||null===(i=f.ownerss)||void 0===i?void 0:i.applicantName)||""),[_,S]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].emailId||(null==f||null===(r=f.ownerss)||void 0===r?void 0:r.emailId)||""),[b,T]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].mobileNumber||(null==f||null===(a=f.ownerss)||void 0===a?void 0:a.mobileNumber)||""),[C,A]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].alternateNumber||(null==f||null===(s=f.ownerss)||void 0===s?void 0:s.alternateNumber)||""),[D,N]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].fatherName||(null==f||null===(c=f.ownerss)||void 0===c?void 0:c.fatherName)||"");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const P=()=>{let e,t=f.ownerss&&f.ownerss[0];"citizen"===m?(e={...t,applicantName:g,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:_},v(p.key,{...f[p.key],...e},!1,0)):(e={...t,applicantName:g,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:_},v(p.key,e,!1,0))};return n.useEffect(()=>{"citizen"===m&&P()},[g,b,D,_]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:1}):null,l.createElement(t.FormStep,{config:p,onSelect:P,onSkip:()=>v(),t:d,isDisabled:!(g&&b&&D&&_)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+d("PTR_APPLICANT_NAME")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:g,onChange:function(e){y(e.target.value)},ValidationRequired:!0},h={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(t.MobileNumber,{value:b,name:"mobileNumber",onChange:e=>{T({value:e}.value)},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:C,name:"alternateNumber",onChange:e=>{A({value:e}.value)},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(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",value:D,onChange:function(e){N(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("PTR_EMAIL_ID")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:_,onChange:function(e){S(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var i,a,s,c,d,p,v,m,f;let{t:h,config:g,onSelect:y,userType:_,formData:S}=e;o.useLocation();let b=window.location.href.charAt(window.location.href.length-1),T={};const[C,A]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petType||(null==S||null===(i=S.pets)||void 0===i?void 0:i.petType)||""),[D,N]=n.useState(S.pets&&S.pets[b]&&S.pets[b].breedType||(null==S||null===(a=S.pets)||void 0===a?void 0:a.breedType)||""),[P,x]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petGender||(null==S||null===(s=S.pets)||void 0===s?void 0:s.petGender)||""),[R,I]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petName||(null==S||null===(c=S.pets)||void 0===c?void 0:c.petName)||""),[w,O]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petAge||(null==S||null===(d=S.pets)||void 0===d?void 0:d.petAge)||""),[L,k]=n.useState(S.pets&&S.pets[b]&&S.pets[b].doctorName||(null==S||null===(p=S.pets)||void 0===p?void 0:p.doctorName)||""),[M,F]=n.useState(S.pets&&S.pets[b]&&S.pets[b].clinicName||(null==S||null===(v=S.pets)||void 0===v?void 0:v.clinicName)||""),[B,U]=n.useState(S.pets&&S.pets[b]&&S.pets[b].vaccinationNumber||(null==S||null===(m=S.pets)||void 0===m?void 0:m.vaccinationNumber)||""),[H,j]=n.useState(S.pets&&S.pets[b]&&S.pets[b].lastVaccineDate||(null==S||null===(f=S.pets)||void 0===f?void 0:f.lastVaccineDate)||""),W=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:z}=Digit.Hooks.ptr.usePTRPetMDMS(W,"PetService","PetType"),{data:$}=Digit.Hooks.ptr.useBreedTypeMDMS(W,"PetService","BreedType");let V=[],q=[];z&&z.map(e=>{V.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:G}=r.useForm();$&&$.map(e=>{e.PetType==(null==C?void 0:C.code)&&q.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:K}=Digit.Hooks.ptr.usePTRGenderMDMS(W,"common-masters","GenderType");let Y=[];K&&K.map(e=>{"TRANSGENDER"!==e.code&&Y.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})});const X=()=>{let e,t=S.pets&&S.pets[b];"citizen"===_?(e={...t,petType:C,breedType:D,petGender:P,petName:R,petAge:w,doctorName:L,clinicName:M,lastVaccineDate:H,vaccinationNumber:B},y(g.key,{...S[g.key],...e},!1,b)):(e={...t,petType:C,breedType:D,petGender:P,petName:R,petAge:w,doctorName:L,clinicName:M,lastVaccineDate:H,vaccinationNumber:B},y(g.key,e,!1,b))};return n.useEffect(()=>{"citizen"===_&&X()},[C,D,P,R,w,L,H]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:2}):null,l.createElement(t.FormStep,{config:g,onSelect:X,onSkip:()=>y(),t:h,isDisabled:!(C&&D&&P&&R&&w&&L&&M&&H&&B)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_PET_TYPE")),l.createElement(r.Controller,{control:G,name:"petType",defaultValue:C,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:C,select:A,option:V,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_BREED_TYPE")),l.createElement(r.Controller,{control:G,name:"breedType",defaultValue:D,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:D,select:N,option:q,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:R,onChange:function(e){I(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_PET_SEX")),l.createElement(r.Controller,{control:G,name:"petGender",defaultValue:P,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:P,select:x,option:Y,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_AGE")),l.createElement(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:w,onChange:function(e){O(e.target.value)},style:{width:"86%"},placeholder:"in months",rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[0123456789]\d{2}$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement("div",null,Math.floor(w/12)," ",1===Math.floor(w/12)?"YEAR":"YEARS"," ",w%12," ",w%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+h("PTR_DOCTOR_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:L,onChange:function(e){k(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={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(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:M,onChange:function(e){F(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_VACCINATED_DATE")),l.createElement(t.TextInput,{t:h,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:H,onChange:function(e){j(e.target.value)},style:{width:"86%"},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(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:B,onChange:function(e){U(e.target.value)},style:{width:"86%"}}))))},PTRCitizenAddress:e=>{let{t:i,config:o,onSelect:a,userType:s,formData:c,formState:p,setError:v,clearErrors:m}=e;const[f,h]=n.useState({index:-1,type:""}),{control:g,formState:y,watch:_,trigger:S}=r.useForm(),b=_(),{errors:T}=y,C=window.location.href.includes("ptr/petservice/new-application");let A;A=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_STREET_INVALID")}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}}];const D=e=>{let{validation:t,name:n,messages:l}=e;if(t){let{pattern:e,maxlength:i,minlength:o,required:r}=t||{};return{pattern:t=>{if(e){var i;if(e instanceof RegExp)return!!e.test(t)||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN";if("string"==typeof e)return!(null===(i=new RegExp(e))||void 0===i||!i.test(t))||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN"}return!0},required:e=>!r||!!e||(null==l?void 0:l.required)||n.toUpperCase()+"_REQUIRED",maxLength:e=>!i||(null==e?void 0:e.length)<=i||(null==l?void 0:l.maxlength)||n.toUpperCase()+"_MAXLENGTH",minlength:o}}return{}};var N;return n.useEffect(()=>{S()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(T).length&&!d.isEqual((null===(e=p.errors[o.key])||void 0===e?void 0:e.type)||{},T)?v(o.key,{type:T}):!Object.keys(T).length&&p.errors[o.key]&&m(o.key))},[T]),n.useEffect(()=>{const e=Object.keys(b),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[o.key])||void 0===n?void 0:n[e]}),d.isEqual(b,t)||(a(o.key,{...c[o.key],...b}),S())},[b]),"employee"===s?null===(N=A)||void 0===N?void 0:N.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},C?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:g,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:D(e)},render:i=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:i.value,onChange:e=>{h({index:n}),i.onChange(e.target.value)},onBlur:i.onBlur,autoFocus:(null==f?void 0:f.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{config:{...o,inputs:A},_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo,buildingName:null==c?void 0:c.address.buildingName,addressLine1:null==c?void 0:c.address.addressLine1,addressLine2:null==c?void 0:c.address.addressLine2,landmark:null==c?void 0:c.address.landmark},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRSelectPincode:e=>{var i;let{t:r,config:a,onSelect:s,formData:c={},userType:d}=e;const p=Digit.Hooks.ptr.useTenants(),{pathname:v}=o.useLocation(),m=v.includes("modify");console.log("formData in oincode ",c);const[f,h]=n.useState(()=>{var e,t,n;return m&&"employee"===d?(null==c||null===(e=c.originalData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.pincode)||"":(null==c||null===(n=c.address)||void 0===n?void 0:n.pincode)||""}),g=[{label:"PTR_ADDRESS_PINCODE",type:"text",name:"pincode",validation:{minlength:6,maxlength:7,pattern:"[0-9]+",max:"9999999",title:r("PTR_ADDRESS_PINCODE_INVALID")}}],[y,_]=n.useState(null),[S,b]=n.useState("");function T(e){h(e.target.value),_(null),b("");let t=Digit.Utils.getPattern("Pincode").test(e.target.value);"employee"===d&&(e.target.value&&!t&&b(r("ERR_DEFAULT_INPUT_FIELD_MSG")),t&&((null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t.toString()===e.target.value)}))||b(r("PTR_COMMON_PINCODE_NOT_SERVICABLE"))),s(a.key,{...c.address,pincode:e.target.value}))}return n.useEffect(()=>{var e;null!=c&&null!==(e=c.address)&&void 0!==e&&e.pincode&&h(c.address.pincode)},[null==c||null===(i=c.address)||void 0===i?void 0:i.pincode]),"employee"===d?null==g?void 0:g.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},r(e.label)),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({key:e.name,value:f,onChange:T},e.validation,{disable:m,autoFocus:m})))),S?l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},S):null)):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{t:r,config:{...a,inputs:g},onSelect:function(e){try{return(null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==(null==e?void 0:e.pincode))}))?s(a.key,{pincode:f}):_("PTR_COMMON_PINCODE_NOT_SERVICABLE"),Promise.resolve()}catch(e){return Promise.reject(e)}},_defaultValues:{pincode:f},onChange:T,onSkip:()=>s(),forcedError:r(y)}))},PTRSelectAddress:e=>{var i;let{t:a,config:u,onSelect:s,userType:c,formData:p}=e;const v=Digit.Hooks.ptr.useTenants();let m=Digit.ULBService.getCurrentTenantId();const{pathname:f}=o.useLocation(),h=f.includes("modify");let g=(null==p?void 0:p.isEditAddress)||!1;h&&(g=!0);const{pincode:y}=(null==p?void 0:p.address)||"",_="employee"===c?v.filter(e=>e.code===m):y?v.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==y)}):v,[S,b]=n.useState(()=>{var e;return(null==p||null===(e=p.address)||void 0===e?void 0:e.city)||null}),{data:T}=Digit.Hooks.useBoundaryLocalities(null==S?void 0:S.code,"revenue",{enabled:!!S},a),[C,A]=n.useState(),[D,N]=n.useState();n.useEffect(()=>{if("employee"===c&&h&&null!=C&&C.length){var e,t,n;const l=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.address)||void 0===t||null===(n=t.locality)||void 0===n?void 0:n.code,i=null==C?void 0:C.filter(e=>e.code===l)[0];I("locality",i)}},[C]),n.useEffect(()=>{_&&1===_.length&&b(_[0])},[_]),n.useEffect(()=>{if(S&&T){var e,t;let l=T,i=[];var n;null!=p&&null!==(e=p.address)&&void 0!==e&&e.locality&&N(p.address.locality),null!=p&&null!==(t=p.address)&&void 0!==t&&t.pincode&&(i=l.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==p.address.pincode)}),null!=p&&null!==(n=p.address)&&void 0!==n&&n.locality||N()),A(()=>i.length>0?i:l),1===i.length&&N(i[0])}},[S,null==p||null===(i=p.address)||void 0===i?void 0:i.pincode,T]);const{control:P,formState:x,watch:R,setValue:I}=r.useForm(),w=R(),{errors:O}=x,L={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};var k,M;return n.useEffect(()=>{if("employee"===c){let e=Object.keys(w);const t={};e.forEach(e=>{var n;return t[e]=null===(n=p[u.key])||void 0===n?void 0:n[e]}),d.isEqual(w,t)||s(u.key,{...p[u.key],...w})}},[w]),n.useEffect(()=>{},[x]),"employee"===c?l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("MYCITY_CODE_LABEL")+" *"),l.createElement(r.Controller,{name:"city",defaultValue:1===(null==_?void 0:_.length)?_[0]:S,control:P,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,disable:g||1===(null==_?void 0:_.length),option:_,select:e.onChange,optionKey:"code",onBlur:e.onBlur,t:a})})),l.createElement(t.CardLabelError,{style:L},x.touched.city?null==O||null===(k=O.city)||void 0===k?void 0:k.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("PTR_LOCALITY")+" *"),l.createElement(r.Controller,{name:"locality",defaultValue:null,control:P,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,option:C,select:e.onChange,onBlur:e.onBlur,optionKey:"i18nkey",t:a,disable:g||!1})})),l.createElement(t.CardLabelError,{style:L},x.touched.locality?null==O||null===(M=O.locality)||void 0===M?void 0:M.message:"")):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(E,{currentStep:3}):null,l.createElement(t.FormStep,{config:u,onSelect:function(){s(u.key,{city:S,locality:D})},t:a,isDisabled:!D},l.createElement("div",null,l.createElement(t.CardLabel,null,a("MYCITY_CODE_LABEL")+" "),l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{options:_.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:S,optionKey:"i18nKey",onSelect:function(e){N(null),A(null),b(e)},t:a,isPTFlow:!0,disabled:g})),S&&C&&l.createElement(t.CardLabel,null,a("PTR_LOCALITY")+" "),S&&C&&l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{dropdownStyle:{paddingBottom:"20px"},isMandatory:u.isMandatory,options:C.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:D,optionKey:"i18nkey",onSelect:function(e){var t;null!=p&&null!==(t=p.address)&&void 0!==t&&t.locality&&(p.address.locality=e),N(e),"employee"===c&&s(u.key,{...p[u.key],locality:e})},t:a,labelKey:"",disabled:g})))))},PTRSelectProofIdentity:e=>{var i,o,r;let{t:a,config:u,onSelect:s,formData:c}=e;Digit.ULBService.getStateId();const[d,p]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[v,m]=n.useState(null),[f,h]=n.useState(!0),[g,y]=n.useState(!1),_=Digit.ULBService.getStateId(),{isLoading:S,data:T}=Digit.Hooks.ptr.usePetMDMS(_,"PetService","Documents");return n.useEffect(()=>{var e;let t=0;null==T||null===(e=T.PetService)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;d.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),h("0"!=t&&0!=t||!(d.length>0))},[d,g]),l.createElement("div",null,l.createElement(E,{currentStep:4}),S?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:a,config:u,onSelect:()=>{let e;e={...c.documents,documents:d},s(u.key,e)},onSkip:()=>s(),isDisabled:f,onAdd:function(){}},null==T||null===(o=T.PetService)||void 0===o||null===(r=o.Documents)||void 0===r?void 0:r.map((e,t)=>l.createElement(b,{key:t,document:e,t:a,error:v,setError:m,setDocuments:p,documents:d,setCheckRequiredFields:y})),v&&l.createElement(t.Toast,{label:v,onClose:()=>m(null),error:!0})))},PTRServiceDoc:e=>{var n;let{t:i,config:o,onSelect:r}=e;Digit.ULBService.getCurrentTenantId();const a=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const u=null!=o&&o.isMutation?["MutationDocuments"]:"Documents",{isLoading:s,data:c={}}=Digit.Hooks.ptr.usePetMDMS(a,"PetService",u);let d=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,s&&l.createElement(t.Loader,null),Array.isArray(d)?d.map(null!=o&&o.isMutation?(e,n)=>{let{code:o,dropdownData:r}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(o)),l.createElement(t.CardText,{className:"primaryColor"},r.map(e=>i(null==e?void 0:e.code)).join(", ")))}:(e,n)=>{let{code:o,dropdownData:r}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(v(o,".","_"))),r.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(v(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("PTR_COMMON_NEXT"),onSubmit:r}))))},PTRWFApplicationTimeline:C},zl=e=>{let{stateCode:t,userType:i,tenants:r}=e;const{path:a,url:u}=o.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:s}),Object.entries(Wl).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PTR_TENANTS",r),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(ze,{path:a,url:u,userType:i}):l.createElement(D,null)},$l=e=>{let{matchPath:o}=e;const{t:r}=i.useTranslation(),[a,u,s]=Digit.Hooks.useSessionStorage("PTR_PET",{});n.useEffect(()=>{s()},[]);const c=[{link:o+"/ptr/petservice/new-application",i18nKey:r("PTR_CREATE_PET_APPLICATION")},{link:o+"/ptr/petservice/my-application",i18nKey:r("PTR_MY_APPLICATIONS_HEADER")},{link:o+"/howItWorks",i18nKey:r("PTR_HOW_IT_WORKS")},{link:o+"/faqs",i18nKey:r("PTR_FAQ_S")}];return l.createElement(t.CitizenHomeCard,{header:r("ACTION_TEST_PTR"),links:c,Icon:()=>l.createElement(t.PTRIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),{data:a,isLoading:u,isFetching:s,isSuccess:c}=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.ptAccess()}});if(n.useEffect(()=>{!s&&c&&r(a)},[s]),!Digit.Utils.ptAccess())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:"PT_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/ptr/petservice/my-applications"}],p=Digit.UserService.hasAccess(["PT_CEMP"])||!1,v={Icon:l.createElement(t.PTRIcon,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:zl,PTRLinks:$l,PTR_INBOX_FILTER:e=>l.createElement(qe,e),PTRInboxTableConfig:e=>({PTR:{inboxColumns:t=>[{Header:e("PTR_APPLICATION_NUMBER"),Cell:e=>{var n,i,r,a;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===(r=u.original)||void 0===r||null===(a=r.searchData)||void 0===a?void 0:a.applicationNumber)))},mobileCell:e=>{var t;return Ke(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 Ge(""+(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 Ke(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 Ge(""+(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 Ke(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 Ge(""+(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 Ke(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 Ge(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 Ke(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=$l,exports.PTRModule=zl;
|
|
1
|
+
var e,t=require("@mseva/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"),r=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)}function s(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}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e,t){return e(t={exports:{}},t.exports),t.exports}var p=d(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]",r="[object Array]",a="[object Boolean]",u="[object Date]",s="[object Error]",d="[object Function]",p="[object GeneratorFunction]",m="[object Map]",v="[object Number]",f="[object Object]",h="[object RegExp]",E="[object Set]",g="[object String]",y="[object Symbol]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",T="[object Float32Array]",C="[object Float64Array]",A="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",P="[object Uint8Array]",x="[object Uint16Array]",w="[object Uint32Array]",R=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,L=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,M=RegExp(L.source),F=RegExp(k.source),B=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,V=/[\\^$.*+?()[\]{}|]/g,q=RegExp(V.source),G=/^\s+/,K=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,le=/^0b[01]+$/i,ie=/^\[object .+?Constructor\]$/,oe=/^0o[0-7]+$/i,re=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\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+"]",me="["+ce+"]",ve="\\d+",fe="[a-z\\xdf-\\xf6\\xf8-\\xff]",he="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",ge="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="[A-Z\\xc0-\\xd6\\xd8-\\xde]",be="(?:"+fe+"|"+he+")",Te="(?:"+Se+"|"+he+")",Ce="(?:"+me+"|"+Ee+")?",Ae="[\\ufe0e\\ufe0f]?"+Ce+"(?:\\u200d(?:"+[ge,ye,_e].join("|")+")[\\ufe0e\\ufe0f]?"+Ce+")*",De="(?:"+["[\\u2700-\\u27bf]",ye,_e].join("|")+")"+Ae,Ne="(?:"+[ge+me+"?",me,ye,_e,"[\\ud800-\\udfff]"].join("|")+")",Pe=RegExp("['’]","g"),xe=RegExp(me,"g"),we=RegExp(Ee+"(?="+Ee+")|"+Ne+Ae,"g"),Re=RegExp([Se+"?"+fe+"+(?:['’](?: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_])",ve,De].join("|"),"g"),Ie=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Oe=/[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"],ke=-1,Me={};Me[T]=Me[C]=Me[A]=Me[D]=Me[N]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[x]=Me[w]=!0,Me[o]=Me[r]=Me[S]=Me[a]=Me[b]=Me[u]=Me[s]=Me[d]=Me[m]=Me[v]=Me[f]=Me[h]=Me[E]=Me[g]=Me[_]=!1;var Fe={};Fe[o]=Fe[r]=Fe[S]=Fe[b]=Fe[a]=Fe[u]=Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[N]=Fe[m]=Fe[v]=Fe[f]=Fe[h]=Fe[E]=Fe[g]=Fe[y]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[x]=Fe[w]=!0,Fe[s]=Fe[d]=Fe[_]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,je=parseInt,He="object"==typeof c&&c&&c.Object===Object&&c,We="object"==typeof self&&self&&self.Object===Object&&self,ze=He||We||Function("return this")(),Ve=t&&!t.nodeType&&t,qe=Ve&&e&&!e.nodeType&&e,Ge=qe&&qe.exports===Ve,Ke=Ge&&He.process,Ye=function(){try{return qe&&qe.require&&qe.require("util").types||Ke&&Ke.binding&&Ke.binding("util")}catch(e){}}(),$e=Ye&&Ye.isArrayBuffer,Xe=Ye&&Ye.isDate,Ze=Ye&&Ye.isMap,Je=Ye&&Ye.isRegExp,Qe=Ye&&Ye.isSet,et=Ye&&Ye.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 r=e[i];t(l,r,n(r),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 rt(e,t){for(var n=-1,l=null==e?0:e.length,i=0,o=[];++n<l;){var r=e[n];t(r,n,e)&&(o[i++]=r)}return o}function at(e,t){return!(null==e||!e.length)&&Et(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 st(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 ct(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 mt(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 vt=St("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 ht(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 Et(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):ht(e,yt,n)}function gt(e,t,n,l){for(var i=n-1,o=e.length;++i<o;)if(l(e[i],t))return i;return-1}function yt(e){return e!=e}function _t(e,t){var n=null==e?0:e.length;return n?Ct(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,o){n=l?(l=!1,e):t(n,e,i,o)}),n}function Ct(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 At(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(G,""):e}function Nt(e){return function(t){return e(t)}}function Pt(e,t){return st(t,function(t){return e[t]})}function xt(e,t){return e.has(t)}function wt(e,t){for(var n=-1,l=e.length;++n<l&&Et(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function It(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Ot=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({"&":"&","<":"<",">":">",'"':""","'":"'"});function kt(e){return"\\"+Be[e]}function Mt(e){return Ie.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,o=0,r=[];++n<i;){var a=e[n];a!==t&&a!==l||(e[n]=l,r[o++]=n)}return r}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 Mt(e)?function(e){for(var t=we.lastIndex=0;we.test(e);)++t;return t}(e):vt(e)}function zt(e){return Mt(e)?function(e){return e.match(we)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&K.test(e.charAt(t)););return t}var qt=bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var c,K=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Le))).Array,ce=t.Date,de=t.Error,pe=t.Function,me=t.Math,ve=t.Object,fe=t.RegExp,he=t.String,Ee=t.TypeError,ge=K.prototype,ye=ve.prototype,_e=t["__core-js_shared__"],Se=pe.prototype.toString,be=ye.hasOwnProperty,Te=0,Ce=(c=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",Ae=ye.toString,De=Se.call(ve),Ne=ze._,we=fe("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Ge?t.Buffer:void 0,Be=t.Symbol,He=t.Uint8Array,We=Ie?Ie.allocUnsafe:void 0,Ve=Bt(ve.getPrototypeOf,ve),qe=ve.create,Ke=ye.propertyIsEnumerable,Ye=ge.splice,vt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Kt=Be?Be.toStringTag:void 0,Yt=function(){try{var e=Ji(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),$t=t.clearTimeout!==ze.clearTimeout&&t.clearTimeout,Xt=ce&&ce.now!==ze.Date.now&&ce.now,Zt=t.setTimeout!==ze.setTimeout&&t.setTimeout,Jt=me.ceil,Qt=me.floor,en=ve.getOwnPropertySymbols,tn=Ie?Ie.isBuffer:void 0,nn=t.isFinite,ln=ge.join,on=Bt(ve.keys,ve),rn=me.max,an=me.min,un=ce.now,sn=t.parseInt,cn=me.random,dn=ge.reverse,pn=Ji(t,"DataView"),mn=Ji(t,"Map"),vn=Ji(t,"Promise"),fn=Ji(t,"Set"),hn=Ji(t,"WeakMap"),En=Ji(ve,"create"),gn=hn&&new hn,yn={},_n=Po(pn),Sn=Po(mn),bn=Po(vn),Tn=Po(fn),Cn=Po(hn),An=Be?Be.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function Pn(e){if(qr(e)&&!Lr(e)&&!(e instanceof In)){if(e instanceof Rn)return e;if(be.call(e,"__wrapped__"))return xo(e)}return new Rn(e)}var xn=function(){function e(){}return function(t){if(!Vr(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function wn(){}function Rn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function In(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(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 kn(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 kn;++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=Lr(e),l=!n&&Or(e),i=!n&&!l&&Br(e),o=!n&&!l&&!i&&Qr(e),r=n||l||i||o,a=r?At(e.length,he):[],u=a.length;for(var s in e)!t&&!be.call(e,s)||r&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||oo(s,u))||a.push(s);return a}function Un(e){var t=e.length;return t?e[kl(0,t-1)]:void 0}function jn(e,t){return To(hi(e),$n(t,0,e.length))}function Hn(e){return To(hi(e))}function Wn(e,t,n){(void 0!==n&&!wr(e[t],n)||void 0===n&&!(t in e))&&Kn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&wr(l,n)&&(void 0!==n||t in e)||Kn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(wr(e[n][0],t))return n;return-1}function qn(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function Gn(e,t){return e&&Ei(t,Sa(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=K(l),o=null==e;++n<l;)i[n]=o?void 0:ha(e,t[n]);return i}function $n(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Xn(e,t,n,l,i,r){var s,c=1&t,_=2&t,R=4&t;if(n&&(s=i?n(e,l,i,r):n(e)),void 0!==s)return s;if(!Vr(e))return e;var I=Lr(e);if(I){if(s=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),!c)return hi(e,s)}else{var O=to(e),L=O==d||O==p;if(Br(e))return ci(e,c);if(O==f||O==o||L&&!i){if(s=_||L?{}:lo(e),!c)return _?function(e,t){return Ei(e,eo(e),t)}(e,function(e,t){return e&&Ei(t,ba(t),e)}(s,e)):function(e,t){return Ei(e,Qi(e),t)}(e,Gn(s,e))}else{if(!Fe[O])return i?e:{};s=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 C:case A:case D:case N:case P:case"[object Uint8ClampedArray]":case x:case w:return pi(e,n);case m:return new l;case v:case g:return new l(e);case h:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new l;case y:return Dn?ve(Dn.call(e)):{}}}(e,O,c)}}r||(r=new Fn);var k=r.get(e);if(k)return k;r.set(e,s),Xr(e)?e.forEach(function(l){s.add(Xn(l,t,n,l,e,r))}):Gr(e)&&e.forEach(function(l,i){s.set(i,Xn(l,t,n,i,e,r))});var M=I?void 0:(R?_?qi:Vi:_?ba:Sa)(e);return lt(M||e,function(l,i){M&&(l=e[i=l]),zn(s,i,Xn(l,t,n,i,e,r))}),s}function Zn(e,t,n){var l=n.length;if(null==e)return!l;for(e=ve(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 Jn(e,t,l){if("function"!=typeof e)throw new Ee(n);return yo(function(){e.apply(void 0,l)},t)}function Qn(e,t,n,l){var i=-1,o=at,r=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,Nt(n))),l?(o=ut,r=!1):t.length>=200&&(o=xt,r=!1,t=new Mn(t));e:for(;++i<a;){var c=e[i],d=null==n?c:n(c);if(c=l||0!==c?c:0,r&&d==d){for(var p=s;p--;)if(t[p]===d)continue e;u.push(c)}else o(t,d,l)||u.push(c)}return u}Pn.templateSettings={escape:B,evaluate:U,interpolate:j,variable:"",imports:{_:Pn}},(Pn.prototype=wn.prototype).constructor=Pn,(Rn.prototype=xn(wn.prototype)).constructor=Rn,(In.prototype=xn(wn.prototype)).constructor=In,On.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},On.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},On.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},On.prototype.has=function(e){var t=this.__data__;return En?void 0!==t[e]:be.call(t,e)},On.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},Ln.prototype.clear=function(){this.__data__=[],this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=Vn(t,e);return!(n<0||(n==t.length-1?t.pop():Ye.call(t,n,1),--this.size,0))},Ln.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},Ln.prototype.has=function(e){return Vn(this.__data__,e)>-1},Ln.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},kn.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(mn||Ln),string:new On}},kn.prototype.delete=function(e){var t=Xi(this,e).delete(e);return this.size-=t?1:0,t},kn.prototype.get=function(e){return Xi(this,e).get(e)},kn.prototype.has=function(e){return Xi(this,e).has(e)},kn.prototype.set=function(e,t){var n=Xi(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)},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(!mn||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new kn(l)}return n.set(e,t),this.size=n.size,this};var el=_i(ul),tl=_i(sl,!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],r=t(o);if(null!=r&&(void 0===a?r==r&&!Jr(r):n(r,a)))var a=r,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,r=e.length;for(n||(n=io),i||(i=[]);++o<r;){var a=e[o];t>0&&n(a)?t>1?ol(a,t-1,n,l,i):ct(i,a):l||(i[i.length]=a)}return i}var rl=Si(),al=Si(!0);function ul(e,t){return e&&rl(e,t,Sa)}function sl(e,t){return e&&al(e,t,Sa)}function cl(e,t){return rt(t,function(t){return Hr(e[t])})}function dl(e,t){for(var n=0,l=(t=ri(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 Lr(e)?l:ct(l,n(e))}function ml(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in ve(e)?function(e){var t=be.call(e,Kt),n=e[Kt];try{e[Kt]=void 0;var l=!0}catch(e){}var i=Ae.call(e);return l&&(t?e[Kt]=n:delete e[Kt]),i}(e):function(e){return Ae.call(e)}(e)}function vl(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function hl(e,t){return null!=e&&t in ve(e)}function El(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=K(o),u=Infinity,s=[];r--;){var c=e[r];r&&t&&(c=st(c,Nt(t))),u=an(c.length,u),a[r]=!n&&(t||i>=120&&c.length>=120)?new Mn(r&&c):void 0}c=e[0];var d=-1,p=a[0];e:for(;++d<i&&s.length<u;){var m=c[d],v=t?t(m):m;if(m=n||0!==m?m:0,!(p?xt(p,v):l(s,v,n))){for(r=o;--r;){var f=a[r];if(!(f?xt(f,v):l(e[r],v,n)))continue e}p&&p.push(v),s.push(m)}}return s}function gl(e,t,n){var l=null==(e=fo(e,t=ri(t,e)))?e:e[No(jo(t))];return null==l?void 0:tt(l,e,n)}function yl(e){return qr(e)&&ml(e)==o}function _l(e,t,n,l,i){return e===t||(null==e||null==t||!qr(e)&&!qr(t)?e!=e&&t!=t:function(e,t,n,l,i,c){var d=Lr(e),p=Lr(t),_=d?r:to(e),T=p?r:to(t),C=(_=_==o?f:_)==f,A=(T=T==o?f:T)==f,D=_==T;if(D&&Br(e)){if(!Br(t))return!1;d=!0,C=!1}if(D&&!C)return c||(c=new Fn),d||Qr(e)?Wi(e,t,n,l,i,c):function(e,t,n,l,i,o,r){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||!o(new He(e),new He(t)));case a:case u:case v:return wr(+e,+t);case s:return e.name==t.name&&e.message==t.message;case h:case g:return e==t+"";case m:var c=Ft;case E:if(c||(c=jt),e.size!=t.size&&!(1&l))return!1;var d=r.get(e);if(d)return d==t;l|=2,r.set(e,t);var p=Wi(c(e),c(t),l,i,o,r);return r.delete(e),p;case y:if(Dn)return Dn.call(e)==Dn.call(t)}return!1}(e,t,_,n,l,i,c);if(!(1&n)){var N=C&&be.call(e,"__wrapped__"),P=A&&be.call(t,"__wrapped__");if(N||P){var x=N?e.value():e,w=P?t.value():t;return c||(c=new Fn),i(x,w,n,l,c)}}return!!D&&(c||(c=new Fn),function(e,t,n,l,i,o){var r=1&n,a=Vi(e),u=a.length;if(u!=Vi(t).length&&!r)return!1;for(var s=u;s--;){var c=a[s];if(!(r?c in t:be.call(t,c)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var v=r;++s<u;){var f=e[c=a[s]],h=t[c];if(l)var E=r?l(h,f,c,t,e,o):l(f,h,c,e,t,o);if(!(void 0===E?f===h||i(f,h,n,l,o):E)){m=!1;break}v||(v="constructor"==c)}if(m&&!v){var g=e.constructor,y=t.constructor;g==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,n,l,i,c))}(e,t,n,l,_l,i))}function Sl(e,t,n,l){var i=n.length,o=i,r=!l;if(null==e)return!o;for(e=ve(e);i--;){var a=n[i];if(r&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){var u=(a=n[i])[0],s=e[u],c=a[1];if(r&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Fn;if(l)var p=l(s,c,u,e,t,d);if(!(void 0===p?_l(c,s,3,l,d):p))return!1}}return!0}function bl(e){return!(!Vr(e)||(t=e,Ce&&Ce in t))&&(Hr(e)?we:ie).test(Po(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ka:"object"==typeof e?Lr(e)?Pl(e[0],e[1]):Nl(e):nu(e)}function Cl(e){if(!co(e))return on(e);var t=[];for(var n in ve(e))be.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Al(e,t){return e<t}function Dl(e,t){var n=-1,l=Mr(e)?K(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]?mo(t[0][0],t[0][1]):function(n){return n===e||Sl(n,e,t)}}function Pl(e,t){return ao(e)&&po(t)?mo(No(e),t):function(n){var l=ha(n,e);return void 0===l&&l===t?Ea(n,e):_l(t,l,3)}}function xl(e,t,n,l,i){e!==t&&rl(t,function(o,r){if(i||(i=new Fn),Vr(o))!function(e,t,n,l,i,o,r){var a=Eo(e,n),u=Eo(t,n),s=r.get(u);if(s)Wn(e,n,s);else{var c=o?o(a,u,n+"",e,t,r):void 0,d=void 0===c;if(d){var p=Lr(u),m=!p&&Br(u),v=!p&&!m&&Qr(u);c=u,p||m||v?Lr(a)?c=a:Fr(a)?c=hi(a):m?(d=!1,c=ci(u,!0)):v?(d=!1,c=pi(u,!0)):c=[]:Yr(u)||Or(u)?(c=a,Or(a)?c=aa(a):Vr(a)&&!Hr(a)||(c=lo(u))):d=!1}d&&(r.set(u,c),i(c,u,l,o,r),r.delete(u)),Wn(e,n,c)}}(e,t,r,n,xl,l,i);else{var a=l?l(Eo(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),Wn(e,r,a)}},ba)}function wl(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function Rl(e,t,n){t=t.length?st(t,function(e){return Lr(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Ka];var l=-1;return t=st(t,Nt($i())),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,r=i.length,a=n.length;++l<r;){var u=mi(i[l],o[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:st(t,function(t){return t(e)}),index:++l,value:e}}))}function Il(e,t,n){for(var l=-1,i=t.length,o={};++l<i;){var r=t[l],a=dl(e,r);n(a,r)&&jl(o,ri(r,e),a)}return o}function Ol(e,t,n,l){var i=l?gt:Et,o=-1,r=t.length,a=e;for(e===t&&(t=hi(t)),n&&(a=st(e,Nt(n)));++o<r;)for(var u=0,s=t[o],c=n?n(s):s;(u=i(a,c,u,l))>-1;)a!==e&&Ye.call(a,u,1),Ye.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!==o){var o=i;oo(i)?Ye.call(e,i,1):Jl(e,i)}}return e}function kl(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 Fl(e,t){return _o(vo(e,t,Ka),e+"")}function Bl(e){return Un(wa(e))}function Ul(e,t){var n=wa(e);return To(n,$n(t,0,n.length))}function jl(e,t,n,l){if(!Vr(e))return e;for(var i=-1,o=(t=ri(t,e)).length,r=o-1,a=e;null!=a&&++i<o;){var u=No(t[i]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=r){var c=a[u];void 0===(s=l?l(c,u,a):void 0)&&(s=Vr(c)?c:oo(t[i+1])?[]:{})}zn(a,u,s),a=a[u]}return e}var Hl=gn?function(e,t){return gn.set(e,t),e}:Ka,Wl=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Va(t),writable:!0})}:Ka;function zl(e){return To(wa(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=K(i);++l<i;)o[l]=e[l+t];return o}function ql(e,t){var n;return el(e,function(e,l,i){return!(n=t(e,l,i))}),!!n}function Gl(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,r=e[o];null!==r&&!Jr(r)&&(n?r<=t:r<t)?l=o+1:i=o}return i}return Kl(e,t,Ka,n)}function Kl(e,t,n,l){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var r=(t=n(t))!=t,a=null===t,u=Jr(t),s=void 0===t;i<o;){var c=Qt((i+o)/2),d=n(e[c]),p=void 0!==d,m=null===d,v=d==d,f=Jr(d);if(r)var h=l||v;else h=s?v&&(l||p):a?v&&p&&(l||!m):u?v&&p&&!m&&(l||!f):!m&&!f&&(l?d<=t:d<t);h?i=c+1:o=c}return an(o,4294967294)}function Yl(e,t){for(var n=-1,l=e.length,i=0,o=[];++n<l;){var r=e[n],a=t?t(r):r;if(!n||!wr(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function $l(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Lr(e))return st(e,Xl)+"";if(Jr(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=at,o=e.length,r=!0,a=[],u=a;if(n)r=!1,i=ut;else if(o>=200){var s=t?null:Mi(e);if(s)return jt(s);r=!1,i=xt,u=new Mn}else u=t?[]:a;e:for(;++l<o;){var c=e[l],d=t?t(c):c;if(c=n||0!==c?c:0,r&&d==d){for(var p=u.length;p--;)if(u[p]===d)continue e;t&&u.push(d),a.push(c)}else i(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Jl(e,t){return null==(e=fo(e,t=ri(t,e)))||delete e[No(jo(t))]}function Ql(e,t,n,l){return jl(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 In&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([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=K(l);++i<l;)for(var r=e[i],a=-1;++a<l;)a!=i&&(o[i]=Qn(o[i]||r,e[a],t,n));return Zl(ol(o,1),t,n)}function li(e,t,n){for(var l=-1,i=e.length,o=t.length,r={};++l<i;)n(r,e[l],l<o?t[l]:void 0);return r}function ii(e){return Fr(e)?e:[]}function oi(e){return"function"==typeof e?e:Ka}function ri(e,t){return Lr(e)?e:ao(e,t)?[e]:Do(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:Vl(e,t,n)}var si=$t||function(e){return ze.clearTimeout(e)};function ci(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 mi(e,t){if(e!==t){var n=void 0!==e,l=null===e,i=e==e,o=Jr(e),r=void 0!==t,a=null===t,u=t==t,s=Jr(t);if(!a&&!s&&!o&&e>t||o&&r&&u&&!a&&!s||l&&r&&u||!n&&u||!i)return 1;if(!l&&!o&&!s&&e<t||s&&n&&i&&!l&&!o||a&&n&&i||!r&&i||!u)return-1}return 0}function vi(e,t,n,l){for(var i=-1,o=e.length,r=n.length,a=-1,u=t.length,s=rn(o-r,0),c=K(u+s),d=!l;++a<u;)c[a]=t[a];for(;++i<r;)(d||i<o)&&(c[n[i]]=e[i]);for(;s--;)c[a++]=e[i++];return c}function fi(e,t,n,l){for(var i=-1,o=e.length,r=-1,a=n.length,u=-1,s=t.length,c=rn(o-a,0),d=K(c+s),p=!l;++i<c;)d[i]=e[i];for(var m=i;++u<s;)d[m+u]=t[u];for(;++r<a;)(p||i<o)&&(d[m+n[r]]=e[i++]);return d}function hi(e,t){var n=-1,l=e.length;for(t||(t=K(l));++n<l;)t[n]=e[n];return t}function Ei(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?Kn(n,a,u):zn(n,a,u)}return n}function gi(e,t){return function(n,l){var i=Lr(n)?nt:qn,o=t?t():{};return i(n,e,$i(l,2),o)}}function yi(e){return Fl(function(t,n){var l=-1,i=n.length,o=i>1?n[i-1]:void 0,r=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&ro(n[0],n[1],r)&&(o=i<3?void 0:o,i=1),t=ve(t);++l<i;){var a=n[l];a&&e(t,a,l,o)}return t})}function _i(e,t){return function(n,l){if(null==n)return n;if(!Mr(n))return e(n,l);for(var i=n.length,o=t?i:-1,r=ve(n);(t?o--:++o<i)&&!1!==l(r[o],o,r););return n}}function Si(e){return function(t,n,l){for(var i=-1,o=ve(t),r=l(t),a=r.length;a--;){var u=r[e?a:++i];if(!1===n(o[u],u,o))break}return t}}function bi(e){return function(t){var n=Mt(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(Oa(t).replace(Pe,"")),e,"")}}function Ci(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=xn(e.prototype),l=e.apply(n,t);return Vr(l)?l:n}}function Ai(e){return function(t,n,l){var i=ve(t);if(!Mr(t)){var o=$i(n,3);t=Sa(t),n=function(e){return o(i[e],e,i)}}var r=e(t,n,l);return r>-1?i[o?t[r]:r]:void 0}}function Di(e){return zi(function(t){var l=t.length,i=l,o=Rn.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new Ee(n);if(o&&!a&&"wrapper"==Ki(r))var a=new Rn([],!0)}for(i=a?i:l;++i<l;){var u=Ki(r=t[i]),s="wrapper"==u?Gi(r):void 0;a=s&&uo(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Ki(s[0])].apply(a,s[3]):1==r.length&&uo(r)?a[u]():a.thru(r)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Lr(n))return a.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,r,a,u,s){var c=128&t,d=1&t,p=2&t,m=24&t,v=512&t,f=p?void 0:Ci(e);return function h(){for(var E=arguments.length,g=K(E),y=E;y--;)g[y]=arguments[y];if(m)var _=Yi(h),S=It(g,_);if(l&&(g=vi(g,l,i,m)),o&&(g=fi(g,o,r,m)),E-=S,m&&E<s){var b=Ut(g,_);return Li(e,t,Ni,h.placeholder,n,g,b,a,u,s-E)}var T=d?n:this,C=p?T[e]:e;return E=g.length,a?g=ho(g,a):v&&E>1&&g.reverse(),c&&u<E&&(g.length=u),this&&this!==ze&&this instanceof h&&(C=f||Ci(C)),C.apply(T,g)}}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 xi(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=Xl(n),l=Xl(l)):(n=$l(n),l=$l(l)),i=e(n,l)}return i}}function wi(e){return zi(function(t){return t=st(t,Nt($i())),Fl(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function Ri(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Ml(t,e):t;var l=Ml(t,Jt(e/Wt(t)));return Mt(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function Ii(e){return function(t,n,l){return l&&"number"!=typeof l&&ro(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,o=rn(Jt((t-e)/(n||1)),0),r=K(o);o--;)r[l?o:++i]=e,e+=n;return r}(t,n,l=void 0===l?t<n?1:-1:la(l),e)}}function Oi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Li(e,t,n,l,i,o,r,a,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,i,c?o:void 0,c?r:void 0,c?void 0:o,c?void 0:r,a,u,s],p=n.apply(void 0,d);return uo(e)&&go(p,d),p.placeholder=l,So(p,e,t)}function ki(e){var t=me[e];return function(e,n){if(e=ra(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 Mi=fn&&1/jt(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Fi(e){return function(t){var n=to(t);return n==m?Ft(t):n==E?Ht(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function Bi(e,t,i,o,r,a,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new Ee(n);var d=o?o.length:0;if(d||(t&=-97,o=r=void 0),u=void 0===u?u:rn(ia(u),0),s=void 0===s?s:ia(s),d-=r?r.length:0,64&t){var p=o,m=r;o=r=void 0}var v=c?void 0:Gi(e),f=[e,t,i,o,r,p,m,a,u,s];if(v&&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 r=t[3];if(r){var a=e[3];e[3]=a?vi(a,r,t[4]):r,e[4]=a?Ut(e[3],l):t[4]}(r=t[5])&&(e[5]=(a=e[5])?fi(a,r,t[6]):r,e[6]=a?Ut(e[5],l):t[6]),(r=t[7])&&(e[7]=r),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]=o}(f,v),e=f[0],t=f[1],i=f[2],o=f[3],r=f[4],!(s=f[9]=void 0===f[9]?c?0:e.length:rn(f[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)h=8==t||16==t?function(e,t,n){var l=Ci(e);return function i(){for(var o=arguments.length,r=K(o),a=o,u=Yi(i);a--;)r[a]=arguments[a];var s=o<3&&r[0]!==u&&r[o-1]!==u?[]:Ut(r,u);if((o-=s.length)<n)return Li(e,t,Ni,i.placeholder,void 0,r,s,void 0,void 0,n-o);var c=this&&this!==ze&&this instanceof i?l:e;return tt(c,this,r)}}(e,t,s):32!=t&&33!=t||r.length?Ni.apply(void 0,f):function(e,t,n,l){var i=1&t,o=Ci(e);return function t(){for(var r=-1,a=arguments.length,u=-1,s=l.length,c=K(s+a),d=this&&this!==ze&&this instanceof t?o:e;++u<s;)c[u]=l[u];for(;a--;)c[u++]=arguments[++r];return tt(d,i?n:this,c)}}(e,t,i,o);else var h=function(e,t,n){var l=1&t,i=Ci(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 So((v?Hl:go)(h,f),e,t)}function Ui(e,t,n,l){return void 0===e||wr(e,ye[n])&&!be.call(l,n)?t:e}function ji(e,t,n,l,i,o){return Vr(e)&&Vr(t)&&(o.set(t,e),xl(e,t,void 0,ji,o),o.delete(t)),e}function Hi(e){return Yr(e)?void 0:e}function Wi(e,t,n,l,i,o){var r=1&n,a=e.length,u=t.length;if(a!=u&&!(r&&u>a))return!1;var s=o.get(e),c=o.get(t);if(s&&c)return s==t&&c==e;var d=-1,p=!0,m=2&n?new Mn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var v=e[d],f=t[d];if(l)var h=r?l(f,v,d,t,e,o):l(v,f,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(m){if(!mt(t,function(e,t){if(!xt(m,t)&&(v===e||i(v,e,n,l,o)))return m.push(t)})){p=!1;break}}else if(v!==f&&!i(v,f,n,l,o)){p=!1;break}}return o.delete(e),o.delete(t),p}function zi(e){return _o(vo(e,void 0,ko),e+"")}function Vi(e){return pl(e,Sa,Qi)}function qi(e){return pl(e,ba,eo)}var Gi=gn?function(e){return gn.get(e)}:Ja;function Ki(e){for(var t=e.name+"",n=yn[t],l=be.call(yn,t)?n.length:0;l--;){var i=n[l],o=i.func;if(null==o||o==e)return i.name}return t}function Yi(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function $i(){var e=Pn.iteratee||Ya;return e=e===Ya?Tl:e,arguments.length?e(arguments[0],arguments[1]):e}function Xi(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function Zi(e){for(var t=Sa(e),n=t.length;n--;){var l=t[n],i=e[l];t[n]=[l,i,po(i)]}return t}function Ji(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return bl(n)?n:void 0}var Qi=en?function(e){return null==e?[]:(e=ve(e),rt(en(e),function(t){return Ke.call(e,t)}))}:ou,eo=en?function(e){for(var t=[];e;)ct(t,Qi(e)),e=Ve(e);return t}:ou,to=ml;function no(e,t,n){for(var l=-1,i=(t=ri(t,e)).length,o=!1;++l<i;){var r=No(t[l]);if(!(o=null!=e&&n(e,r)))break;e=e[r]}return o||++l!=i?o:!!(i=null==e?0:e.length)&&zr(i)&&oo(r,i)&&(Lr(e)||Or(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:xn(Ve(e))}function io(e){return Lr(e)||Or(e)||!!(vt&&e&&e[vt])}function oo(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&re.test(e))&&e>-1&&e%1==0&&e<t}function ro(e,t,n){if(!Vr(n))return!1;var l=typeof t;return!!("number"==l?Mr(n)&&oo(t,n.length):"string"==l&&t in n)&&wr(n[t],e)}function ao(e,t){if(Lr(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jr(e))||W.test(e)||!H.test(e)||null!=t&&e in ve(t)}function uo(e){var t=Ki(e),n=Pn[t];if("function"!=typeof n||!(t in In.prototype))return!1;if(e===n)return!0;var l=Gi(n);return!!l&&e===l[0]}(pn&&to(new pn(new ArrayBuffer(1)))!=b||mn&&to(new mn)!=m||vn&&"[object Promise]"!=to(vn.resolve())||fn&&to(new fn)!=E||hn&&to(new hn)!=_)&&(to=function(e){var t=ml(e),n=t==f?e.constructor:void 0,l=n?Po(n):"";if(l)switch(l){case _n:return b;case Sn:return m;case bn:return"[object Promise]";case Tn:return E;case Cn:return _}return t});var so=_e?Hr:ru;function co(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)}function po(e){return e==e&&!Vr(e)}function mo(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function vo(e,t,n){return t=rn(void 0===t?e.length-1:t,0),function(){for(var l=arguments,i=-1,o=rn(l.length-t,0),r=K(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=K(t+1);++i<t;)a[i]=l[i];return a[t]=n(r),tt(e,this,a)}}function fo(e,t){return t.length<2?e:dl(e,Vl(t,0,-1))}function ho(e,t){for(var n=e.length,l=an(t.length,n),i=hi(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var go=bo(Hl),yo=Zt||function(e,t){return ze.setTimeout(e,t)},_o=bo(Wl);function So(e,t,n){var l=t+"";return _o(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(Y,"{\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($);return t?t[1].split(X):[]}(l),n)))}function bo(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 To(e,t){var n=-1,l=e.length,i=l-1;for(t=void 0===t?l:t;++n<t;){var o=kl(n,i),r=e[o];e[o]=e[n],e[n]=r}return e.length=t,e}var Co,Ao,Do=(Co=Cr(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(z,function(e,n,l,i){t.push(l?i.replace(Q,"$1"):n||e)}),t},function(e){return 500===Ao.size&&Ao.clear(),e}),Ao=Co.cache,Co);function No(e){if("string"==typeof e||Jr(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function xo(e){if(e instanceof In)return e.clone();var t=new Rn(e.__wrapped__,e.__chain__);return t.__actions__=hi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var wo=Fl(function(e,t){return Fr(e)?Qn(e,ol(t,1,Fr,!0)):[]}),Ro=Fl(function(e,t){var n=jo(t);return Fr(n)&&(n=void 0),Fr(e)?Qn(e,ol(t,1,Fr,!0),$i(n,2)):[]}),Io=Fl(function(e,t){var n=jo(t);return Fr(n)&&(n=void 0),Fr(e)?Qn(e,ol(t,1,Fr,!0),void 0,n):[]});function Oo(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=rn(l+i,0)),ht(e,$i(t,3),i)}function Lo(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?rn(l+i,0):an(i,l-1)),ht(e,$i(t,3),i,!0)}function ko(e){return null!=e&&e.length?ol(e,1):[]}function Mo(e){return e&&e.length?e[0]:void 0}var Fo=Fl(function(e){var t=st(e,ii);return t.length&&t[0]===e[0]?El(t):[]}),Bo=Fl(function(e){var t=jo(e),n=st(e,ii);return t===jo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?El(n,$i(t,2)):[]}),Uo=Fl(function(e){var t=jo(e),n=st(e,ii);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?El(n,void 0,t):[]});function jo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Ho=Fl(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ol(e,t):e}var zo=zi(function(e,t){var n=null==e?0:e.length,l=Yn(e,t);return Ll(e,st(t,function(e){return oo(e,n)?+e:e}).sort(mi)),l});function Vo(e){return null==e?e:dn.call(e)}var qo=Fl(function(e){return Zl(ol(e,1,Fr,!0))}),Go=Fl(function(e){var t=jo(e);return Fr(t)&&(t=void 0),Zl(ol(e,1,Fr,!0),$i(t,2))}),Ko=Fl(function(e){var t=jo(e);return t="function"==typeof t?t:void 0,Zl(ol(e,1,Fr,!0),void 0,t)});function Yo(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Fr(e))return t=rn(e.length,t),!0}),At(t,function(t){return st(e,St(t))})}function $o(e,t){if(!e||!e.length)return[];var n=Yo(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xo=Fl(function(e,t){return Fr(e)?Qn(e,t):[]}),Zo=Fl(function(e){return ni(rt(e,Fr))}),Jo=Fl(function(e){var t=jo(e);return Fr(t)&&(t=void 0),ni(rt(e,Fr),$i(t,2))}),Qo=Fl(function(e){var t=jo(e);return t="function"==typeof t?t:void 0,ni(rt(e,Fr),void 0,t)}),er=Fl(Yo),tr=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,$o(e,n)});function nr(e){var t=Pn(e);return t.__chain__=!0,t}function lr(e,t){return t(e)}var ir=zi(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 In&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,args:[i],thisArg:void 0}),new Rn(l,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(i)}),or=gi(function(e,t,n){be.call(e,n)?++e[n]:Kn(e,n,1)}),rr=Ai(Oo),ar=Ai(Lo);function ur(e,t){return(Lr(e)?lt:el)(e,$i(t,3))}function sr(e,t){return(Lr(e)?it:tl)(e,$i(t,3))}var cr=gi(function(e,t,n){be.call(e,n)?e[n].push(t):Kn(e,n,[t])}),dr=Fl(function(e,t,n){var l=-1,i="function"==typeof t,o=Mr(e)?K(e.length):[];return el(e,function(e){o[++l]=i?tt(t,e,n):gl(e,t,n)}),o}),pr=gi(function(e,t,n){Kn(e,n,t)});function mr(e,t){return(Lr(e)?st:Dl)(e,$i(t,3))}var vr=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=Fl(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ro(e,t[0],t[1])?t=[]:n>2&&ro(t[0],t[1],t[2])&&(t=[t[0]]),Rl(e,ol(t,1),[])}),hr=Xt||function(){return ze.Date.now()};function Er(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 gr(e,t){var l;if("function"!=typeof t)throw new Ee(n);return e=ia(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var yr=Fl(function(e,t,n){var l=1;if(n.length){var i=Ut(n,Yi(yr));l|=32}return Bi(e,l,t,n,i)}),_r=Fl(function(e,t,n){var l=3;if(n.length){var i=Ut(n,Yi(_r));l|=32}return Bi(t,l,e,n,i)});function Sr(e,t,l){var i,o,r,a,u,s,c=0,d=!1,p=!1,m=!0;if("function"!=typeof e)throw new Ee(n);function v(t){var n=i,l=o;return i=o=void 0,c=t,a=e.apply(l,n)}function f(e){return c=e,u=yo(E,t),d?v(e):a}function h(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=r}function E(){var e=hr();if(h(e))return g(e);u=yo(E,function(e){var n=t-(e-s);return p?an(n,r-(e-c)):n}(e))}function g(e){return u=void 0,m&&i?v(e):(i=o=void 0,a)}function y(){var e=hr(),n=h(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(p)return si(u),u=yo(E,t),v(s)}return void 0===u&&(u=yo(E,t)),a}return t=ra(t)||0,Vr(l)&&(d=!!l.leading,r=(p="maxWait"in l)?rn(ra(l.maxWait)||0,t):r,m="trailing"in l?!!l.trailing:m),y.cancel=function(){void 0!==u&&si(u),c=0,i=s=o=u=void 0},y.flush=function(){return void 0===u?a:g(hr())},y}var br=Fl(function(e,t){return Jn(e,1,t)}),Tr=Fl(function(e,t,n){return Jn(e,ra(t)||0,n)});function Cr(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],o=l.cache;if(o.has(i))return o.get(i);var r=e.apply(this,n);return l.cache=o.set(i,r)||o,r};return l.cache=new(Cr.Cache||kn),l}function Ar(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)}}Cr.Cache=kn;var Dr=ai(function(e,t){var n=(t=1==t.length&&Lr(t[0])?st(t[0],Nt($i())):st(ol(t,1),Nt($i()))).length;return Fl(function(l){for(var i=-1,o=an(l.length,n);++i<o;)l[i]=t[i].call(this,l[i]);return tt(e,this,l)})}),Nr=Fl(function(e,t){return Bi(e,32,void 0,t,Ut(t,Yi(Nr)))}),Pr=Fl(function(e,t){return Bi(e,64,void 0,t,Ut(t,Yi(Pr)))}),xr=zi(function(e,t){return Bi(e,256,void 0,void 0,void 0,t)});function wr(e,t){return e===t||e!=e&&t!=t}var Rr=Oi(vl),Ir=Oi(function(e,t){return e>=t}),Or=yl(function(){return arguments}())?yl:function(e){return qr(e)&&be.call(e,"callee")&&!Ke.call(e,"callee")},Lr=K.isArray,kr=$e?Nt($e):function(e){return qr(e)&&ml(e)==S};function Mr(e){return null!=e&&zr(e.length)&&!Hr(e)}function Fr(e){return qr(e)&&Mr(e)}var Br=tn||ru,Ur=Xe?Nt(Xe):function(e){return qr(e)&&ml(e)==u};function jr(e){if(!qr(e))return!1;var t=ml(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Yr(e)}function Hr(e){if(!Vr(e))return!1;var t=ml(e);return t==d||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Wr(e){return"number"==typeof e&&e==ia(e)}function zr(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Vr(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qr(e){return null!=e&&"object"==typeof e}var Gr=Ze?Nt(Ze):function(e){return qr(e)&&to(e)==m};function Kr(e){return"number"==typeof e||qr(e)&&ml(e)==v}function Yr(e){if(!qr(e)||ml(e)!=f)return!1;var t=Ve(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 $r=Je?Nt(Je):function(e){return qr(e)&&ml(e)==h},Xr=Qe?Nt(Qe):function(e){return qr(e)&&to(e)==E};function Zr(e){return"string"==typeof e||!Lr(e)&&qr(e)&&ml(e)==g}function Jr(e){return"symbol"==typeof e||qr(e)&&ml(e)==y}var Qr=et?Nt(et):function(e){return qr(e)&&zr(e.length)&&!!Me[ml(e)]},ea=Oi(Al),ta=Oi(function(e,t){return e<=t});function na(e){if(!e)return[];if(Mr(e))return Zr(e)?zt(e):hi(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=to(e);return(t==m?Ft:t==E?jt:wa)(e)}function la(e){return e?(e=ra(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 oa(e){return e?$n(ia(e),0,4294967295):0}function ra(e){if("number"==typeof e)return e;if(Jr(e))return NaN;if(Vr(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Vr(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)?je(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return Ei(e,ba(e))}function ua(e){return null==e?"":Xl(e)}var sa=yi(function(e,t){if(co(t)||Mr(t))Ei(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),ca=yi(function(e,t){Ei(t,ba(t),e)}),da=yi(function(e,t,n,l){Ei(t,ba(t),e,l)}),pa=yi(function(e,t,n,l){Ei(t,Sa(t),e,l)}),ma=zi(Yn),va=Fl(function(e,t){e=ve(e);var n=-1,l=t.length,i=l>2?t[2]:void 0;for(i&&ro(t[0],t[1],i)&&(l=1);++n<l;)for(var o=t[n],r=ba(o),a=-1,u=r.length;++a<u;){var s=r[a],c=e[s];(void 0===c||wr(c,ye[s])&&!be.call(e,s))&&(e[s]=o[s])}return e}),fa=Fl(function(e){return e.push(void 0,ji),tt(Ca,void 0,e)});function ha(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function Ea(e,t){return null!=e&&no(e,t,hl)}var ga=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Va(Ka)),ya=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),be.call(e,t)?e[t].push(n):e[t]=[n]},$i),_a=Fl(gl);function Sa(e){return Mr(e)?Bn(e):Cl(e)}function ba(e){return Mr(e)?Bn(e,!0):function(e){if(!Vr(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=co(e),n=[];for(var l in e)("constructor"!=l||!t&&be.call(e,l))&&n.push(l);return n}(e)}var Ta=yi(function(e,t,n){xl(e,t,n)}),Ca=yi(function(e,t,n,l){xl(e,t,n,l)}),Aa=zi(function(e,t){var n={};if(null==e)return n;var l=!1;t=st(t,function(t){return t=ri(t,e),l||(l=t.length>1),t}),Ei(e,qi(e),n),l&&(n=Xn(n,7,Hi));for(var i=t.length;i--;)Jl(n,t[i]);return n}),Da=zi(function(e,t){return null==e?{}:function(e,t){return Il(e,t,function(t,n){return Ea(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=st(qi(e),function(e){return[e]});return t=$i(t),Il(e,n,function(e,n){return t(e,n[0])})}var Pa=Fi(Sa),xa=Fi(ba);function wa(e){return null==e?[]:Pt(e,Sa(e))}var Ra=Ti(function(e,t,n){return t=t.toLowerCase(),e+(n?Ia(t):t)});function Ia(e){return ja(ua(e).toLowerCase())}function Oa(e){return(e=ua(e))&&e.replace(ae,Ot).replace(xe,"")}var La=Ti(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ka=Ti(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Ma=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 Oe.test(e)}(e)?function(e){return e.match(Re)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wa=Fl(function(e,t){try{return tt(e,void 0,t)}catch(e){return jr(e)?e:new de(e)}}),za=zi(function(e,t){return lt(t,function(t){t=No(t),Kn(e,t,yr(e[t],e))}),e});function Va(e){return function(){return e}}var qa=Di(),Ga=Di(!0);function Ka(e){return e}function Ya(e){return Tl("function"==typeof e?e:Xn(e,1))}var $a=Fl(function(e,t){return function(n){return gl(n,e,t)}}),Xa=Fl(function(e,t){return function(n){return gl(e,n,t)}});function Za(e,t,n){var l=Sa(t),i=cl(t,l);null!=n||Vr(t)&&(i.length||!l.length)||(n=t,t=e,e=this,i=cl(t,Sa(t)));var o=!(Vr(n)&&"chain"in n&&!n.chain),r=Hr(e);return lt(i,function(n){var l=t[n];e[n]=l,r&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=hi(this.__actions__);return i.push({func:l,args:arguments,thisArg:e}),n.__chain__=t,n}return l.apply(e,ct([this.value()],arguments))})}),e}function Ja(){}var Qa=wi(st),eu=wi(ot),tu=wi(mt);function nu(e){return ao(e)?St(No(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=Ii(),iu=Ii(!0);function ou(){return[]}function ru(){return!1}var au,uu=xi(function(e,t){return e+t},0),su=ki("ceil"),cu=xi(function(e,t){return e/t},1),du=ki("floor"),pu=xi(function(e,t){return e*t},1),mu=ki("round"),vu=xi(function(e,t){return e-t},0);return Pn.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=Er,Pn.assign=sa,Pn.assignIn=ca,Pn.assignInWith=da,Pn.assignWith=pa,Pn.at=ma,Pn.before=gr,Pn.bind=yr,Pn.bindAll=za,Pn.bindKey=_r,Pn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Lr(e)?e:[e]},Pn.chain=nr,Pn.chunk=function(e,t,n){t=(n?ro(e,t,n):void 0===t)?1:rn(ia(t),0);var l=null==e?0:e.length;if(!l||t<1)return[];for(var i=0,o=0,r=K(Jt(l/t));i<l;)r[o++]=Vl(e,i,i+=t);return r},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=K(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Lr(n)?hi(n):[n],ol(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=$i();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new Ee(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)}})},Pn.conforms=function(e){return function(e){var t=Sa(e);return function(n){return Zn(n,e,t)}}(Xn(e,1))},Pn.constant=Va,Pn.countBy=or,Pn.create=function(e,t){var n=xn(e);return null==t?n:Gn(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=Sr,Pn.defaults=va,Pn.defaultsDeep=fa,Pn.defer=br,Pn.delay=Tr,Pn.difference=wo,Pn.differenceBy=Ro,Pn.differenceWith=Io,Pn.drop=function(e,t,n){var l=null==e?0:e.length;return l?Vl(e,(t=n||void 0===t?1:ia(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:ia(t)))<0?0:t):[]},Pn.dropRightWhile=function(e,t){return e&&e.length?ei(e,$i(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?ei(e,$i(t,3),!0):[]},Pn.fill=function(e,t,n,l){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ro(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:oa(l);n<l;)e[n++]=t;return e}(e,t,n,l)):[]},Pn.filter=function(e,t){return(Lr(e)?rt:il)(e,$i(t,3))},Pn.flatMap=function(e,t){return ol(mr(e,t),1)},Pn.flatMapDeep=function(e,t){return ol(mr(e,t),1/0)},Pn.flatMapDepth=function(e,t,n){return n=void 0===n?1:ia(n),ol(mr(e,t),n)},Pn.flatten=ko,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:ia(t)):[]},Pn.flip=function(e){return Bi(e,512)},Pn.flow=qa,Pn.flowRight=Ga,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?[]:cl(e,Sa(e))},Pn.functionsIn=function(e){return null==e?[]:cl(e,ba(e))},Pn.groupBy=cr,Pn.initial=function(e){return null!=e&&e.length?Vl(e,0,-1):[]},Pn.intersection=Fo,Pn.intersectionBy=Bo,Pn.intersectionWith=Uo,Pn.invert=ga,Pn.invertBy=ya,Pn.invokeMap=dr,Pn.iteratee=Ya,Pn.keyBy=pr,Pn.keys=Sa,Pn.keysIn=ba,Pn.map=mr,Pn.mapKeys=function(e,t){var n={};return t=$i(t,3),ul(e,function(e,l,i){Kn(n,t(e,l,i),e)}),n},Pn.mapValues=function(e,t){var n={};return t=$i(t,3),ul(e,function(e,l,i){Kn(n,l,t(e,l,i))}),n},Pn.matches=function(e){return Nl(Xn(e,1))},Pn.matchesProperty=function(e,t){return Pl(e,Xn(t,1))},Pn.memoize=Cr,Pn.merge=Ta,Pn.mergeWith=Ca,Pn.method=$a,Pn.methodOf=Xa,Pn.mixin=Za,Pn.negate=Ar,Pn.nthArg=function(e){return e=ia(e),Fl(function(t){return wl(t,e)})},Pn.omit=Aa,Pn.omitBy=function(e,t){return Na(e,Ar($i(t)))},Pn.once=function(e){return gr(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(Lr(t)||(t=null==t?[]:[t]),Lr(n=l?void 0:n)||(n=null==n?[]:[n]),Rl(e,t,n))},Pn.over=Qa,Pn.overArgs=Dr,Pn.overEvery=eu,Pn.overSome=tu,Pn.partial=Nr,Pn.partialRight=Pr,Pn.partition=vr,Pn.pick=Da,Pn.pickBy=Na,Pn.property=nu,Pn.propertyOf=function(e){return function(t){return null==e?void 0:dl(e,t)}},Pn.pull=Ho,Pn.pullAll=Wo,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,$i(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ol(e,t,void 0,n):e},Pn.pullAt=zo,Pn.range=lu,Pn.rangeRight=iu,Pn.rearg=xr,Pn.reject=function(e,t){return(Lr(e)?rt:il)(e,Ar($i(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=$i(t,3);++l<o;){var r=e[l];t(r,l,e)&&(n.push(r),i.push(l))}return Ll(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Fl(e,t=void 0===t?t:ia(t))},Pn.reverse=Vo,Pn.sampleSize=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),(Lr(e)?jn:Ul)(e,t)},Pn.set=function(e,t,n){return null==e?e:jl(e,t,n)},Pn.setWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:jl(e,t,n,l)},Pn.shuffle=function(e){return(Lr(e)?Hn:zl)(e)},Pn.slice=function(e,t,n){var l=null==e?0:e.length;return l?(n&&"number"!=typeof n&&ro(e,t,n)?(t=0,n=l):(t=null==t?0:ia(t),n=void 0===n?l:ia(n)),Vl(e,t,n)):[]},Pn.sortBy=fr,Pn.sortedUniq=function(e){return e&&e.length?Yl(e):[]},Pn.sortedUniqBy=function(e,t){return e&&e.length?Yl(e,$i(t,2)):[]},Pn.split=function(e,t,n){return n&&"number"!=typeof n&&ro(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!$r(t))&&!(t=Xl(t))&&Mt(e)?ui(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:rn(ia(t),0),Fl(function(n){var l=n[t],i=ui(n,0,t);return l&&ct(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:ia(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:ia(t)))<0?0:t,l):[]},Pn.takeRightWhile=function(e,t){return e&&e.length?ei(e,$i(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?ei(e,$i(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 Ee(n);return Vr(l)&&(i="leading"in l?!!l.leading:i,o="trailing"in l?!!l.trailing:o),Sr(e,t,{leading:i,maxWait:t,trailing:o})},Pn.thru=lr,Pn.toArray=na,Pn.toPairs=Pa,Pn.toPairsIn=xa,Pn.toPath=function(e){return Lr(e)?st(e,No):Jr(e)?[e]:hi(Do(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=Lr(e),i=l||Br(e)||Qr(e);if(t=$i(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:Vr(e)&&Hr(o)?xn(Ve(e)):{}}return(i?lt:ul)(e,function(e,l,i){return t(n,e,l,i)}),n},Pn.unary=function(e){return Er(e,1)},Pn.union=qo,Pn.unionBy=Go,Pn.unionWith=Ko,Pn.uniq=function(e){return e&&e.length?Zl(e):[]},Pn.uniqBy=function(e,t){return e&&e.length?Zl(e,$i(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||Jl(e,t)},Pn.unzip=Yo,Pn.unzipWith=$o,Pn.update=function(e,t,n){return null==e?e:Ql(e,t,oi(n))},Pn.updateWith=function(e,t,n,l){return l="function"==typeof l?l:void 0,null==e?e:Ql(e,t,oi(n),l)},Pn.values=wa,Pn.valuesIn=function(e){return null==e?[]:Pt(e,ba(e))},Pn.without=Xo,Pn.words=Ha,Pn.wrap=function(e,t){return Nr(oi(t),e)},Pn.xor=Zo,Pn.xorBy=Jo,Pn.xorWith=Qo,Pn.zip=er,Pn.zipObject=function(e,t){return li(e||[],t||[],zn)},Pn.zipObjectDeep=function(e,t){return li(e||[],t||[],jl)},Pn.zipWith=tr,Pn.entries=Pa,Pn.entriesIn=xa,Pn.extend=ca,Pn.extendWith=da,Za(Pn,Pn),Pn.add=uu,Pn.attempt=Wa,Pn.camelCase=Ra,Pn.capitalize=Ia,Pn.ceil=su,Pn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=ra(n))==n?n:0),void 0!==t&&(t=(t=ra(t))==t?t:0),$n(ra(e),t,n)},Pn.clone=function(e){return Xn(e,4)},Pn.cloneDeep=function(e){return Xn(e,5)},Pn.cloneDeepWith=function(e,t){return Xn(e,5,t="function"==typeof t?t:void 0)},Pn.cloneWith=function(e,t){return Xn(e,4,t="function"==typeof t?t:void 0)},Pn.conformsTo=function(e,t){return null==t||Zn(e,t,Sa(t))},Pn.deburr=Oa,Pn.defaultTo=function(e,t){return null==e||e!=e?t:e},Pn.divide=cu,Pn.endsWith=function(e,t,n){e=ua(e),t=Xl(t);var l=e.length,i=n=void 0===n?l:$n(ia(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Pn.eq=wr,Pn.escape=function(e){return(e=ua(e))&&F.test(e)?e.replace(k,Lt):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&q.test(e)?e.replace(V,"\\$&"):e},Pn.every=function(e,t,n){var l=Lr(e)?ot:nl;return n&&ro(e,t,n)&&(t=void 0),l(e,$i(t,3))},Pn.find=rr,Pn.findIndex=Oo,Pn.findKey=function(e,t){return ft(e,$i(t,3),ul)},Pn.findLast=ar,Pn.findLastIndex=Lo,Pn.findLastKey=function(e,t){return ft(e,$i(t,3),sl)},Pn.floor=du,Pn.forEach=ur,Pn.forEachRight=sr,Pn.forIn=function(e,t){return null==e?e:rl(e,$i(t,3),ba)},Pn.forInRight=function(e,t){return null==e?e:al(e,$i(t,3),ba)},Pn.forOwn=function(e,t){return e&&ul(e,$i(t,3))},Pn.forOwnRight=function(e,t){return e&&sl(e,$i(t,3))},Pn.get=ha,Pn.gt=Rr,Pn.gte=Ir,Pn.has=function(e,t){return null!=e&&no(e,t,fl)},Pn.hasIn=Ea,Pn.head=Mo,Pn.identity=Ka,Pn.includes=function(e,t,n,l){e=Mr(e)?e:wa(e),n=n&&!l?ia(n):0;var i=e.length;return n<0&&(n=rn(i+n,0)),Zr(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Et(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:ia(n);return i<0&&(i=rn(l+i,0)),Et(e,t,i)},Pn.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<rn(t,n)}(e=ra(e),t,n)},Pn.invoke=_a,Pn.isArguments=Or,Pn.isArray=Lr,Pn.isArrayBuffer=kr,Pn.isArrayLike=Mr,Pn.isArrayLikeObject=Fr,Pn.isBoolean=function(e){return!0===e||!1===e||qr(e)&&ml(e)==a},Pn.isBuffer=Br,Pn.isDate=Ur,Pn.isElement=function(e){return qr(e)&&1===e.nodeType&&!Yr(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Mr(e)&&(Lr(e)||"string"==typeof e||"function"==typeof e.splice||Br(e)||Qr(e)||Or(e)))return!e.length;var t=to(e);if(t==m||t==E)return!e.size;if(co(e))return!Cl(e).length;for(var n in e)if(be.call(e,n))return!1;return!0},Pn.isEqual=function(e,t){return _l(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?_l(e,t,void 0,n):!!l},Pn.isError=jr,Pn.isFinite=function(e){return"number"==typeof e&&nn(e)},Pn.isFunction=Hr,Pn.isInteger=Wr,Pn.isLength=zr,Pn.isMap=Gr,Pn.isMatch=function(e,t){return e===t||Sl(e,t,Zi(t))},Pn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sl(e,t,Zi(t),n)},Pn.isNaN=function(e){return Kr(e)&&e!=+e},Pn.isNative=function(e){if(so(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return bl(e)},Pn.isNil=function(e){return null==e},Pn.isNull=function(e){return null===e},Pn.isNumber=Kr,Pn.isObject=Vr,Pn.isObjectLike=qr,Pn.isPlainObject=Yr,Pn.isRegExp=$r,Pn.isSafeInteger=function(e){return Wr(e)&&e>=-9007199254740991&&e<=9007199254740991},Pn.isSet=Xr,Pn.isString=Zr,Pn.isSymbol=Jr,Pn.isTypedArray=Qr,Pn.isUndefined=function(e){return void 0===e},Pn.isWeakMap=function(e){return qr(e)&&to(e)==_},Pn.isWeakSet=function(e){return qr(e)&&"[object WeakSet]"==ml(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=La,Pn.last=jo,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=ia(n))<0?rn(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):ht(e,yt,i,!0)},Pn.lowerCase=ka,Pn.lowerFirst=Ma,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,Ka,vl):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,$i(t,2),vl):void 0},Pn.mean=function(e){return _t(e,Ka)},Pn.meanBy=function(e,t){return _t(e,$i(t,2))},Pn.min=function(e){return e&&e.length?ll(e,Ka,Al):void 0},Pn.minBy=function(e,t){return e&&e.length?ll(e,$i(t,2),Al):void 0},Pn.stubArray=ou,Pn.stubFalse=ru,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?wl(e,ia(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Ja,Pn.now=hr,Pn.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 Ri(Qt(i),n)+e+Ri(Jt(i),n)},Pn.padEnd=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?e+Ri(t-l,n):e},Pn.padStart=function(e,t,n){e=ua(e);var l=(t=ia(t))?Wt(e):0;return t&&l<t?Ri(t-l,n)+e:e},Pn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(ua(e).replace(G,""),t||0)},Pn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ro(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=cn();return an(e+i*(t-e+Ue("1e-"+((i+"").length-1))),t)}return kl(e,t)},Pn.reduce=function(e,t,n){var l=Lr(e)?dt:Tt,i=arguments.length<3;return l(e,$i(t,4),n,i,el)},Pn.reduceRight=function(e,t,n){var l=Lr(e)?pt:Tt,i=arguments.length<3;return l(e,$i(t,4),n,i,tl)},Pn.repeat=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),Ml(ua(e),t)},Pn.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Pn.result=function(e,t,n){var l=-1,i=(t=ri(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=Hr(o)?o.call(e):o}return e},Pn.round=mu,Pn.runInContext=e,Pn.sample=function(e){return(Lr(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Mr(e))return Zr(e)?Wt(e):e.length;var t=to(e);return t==m||t==E?e.size:Cl(e).length},Pn.snakeCase=Fa,Pn.some=function(e,t,n){var l=Lr(e)?mt:ql;return n&&ro(e,t,n)&&(t=void 0),l(e,$i(t,3))},Pn.sortedIndex=function(e,t){return Gl(e,t)},Pn.sortedIndexBy=function(e,t,n){return Kl(e,t,$i(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=Gl(e,t);if(l<n&&wr(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Kl(e,t,$i(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(wr(e[n],t))return n}return-1},Pn.startCase=Ba,Pn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:$n(ia(n),0,e.length),t=Xl(t),e.slice(n,n+t.length)==t},Pn.subtract=vu,Pn.sum=function(e){return e&&e.length?Ct(e,Ka):0},Pn.sumBy=function(e,t){return e&&e.length?Ct(e,$i(t,2)):0},Pn.template=function(e,t,n){var l=Pn.templateSettings;n&&ro(e,t,n)&&(t=void 0),e=ua(e),t=da({},t,l,Ui);var i,o,r=da({},t.imports,l.imports,Ui),a=Sa(r),u=Pt(r,a),s=0,c=t.interpolate||ue,d="__p += '",p=fe((t.escape||ue).source+"|"+c.source+"|"+(c===j?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ke+"]")+"\n";e.replace(p,function(t,n,l,r,a,u){return l||(l=r),d+=e.slice(s,u).replace(se,kt),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),l&&(d+="' +\n((__t = ("+l+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var v=be.call(t,"variable")&&t.variable;if(v){if(J.test(v))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(R,""):d).replace(I,"$1").replace(O,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"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=Wa(function(){return pe(a,m+"return "+d).apply(void 0,u)});if(f.source=d,jr(f))throw f;return f},Pn.times=function(e,t){if((e=ia(e))<1||e>9007199254740991)return[];var n=4294967295,l=an(e,4294967295);e-=4294967295;for(var i=At(l,t=$i(t));++n<e;)t(n);return i},Pn.toFinite=la,Pn.toInteger=ia,Pn.toLength=oa,Pn.toLower=function(e){return ua(e).toLowerCase()},Pn.toNumber=ra,Pn.toSafeInteger=function(e){return e?$n(ia(e),-9007199254740991,9007199254740991):0===e?e:0},Pn.toString=ua,Pn.toUpper=function(e){return ua(e).toUpperCase()},Pn.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Dt(e);if(!e||!(t=Xl(t)))return e;var l=zt(e),i=zt(t);return ui(l,wt(l,i),Rt(l,i)+1).join("")},Pn.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,Vt(e)+1);if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,0,Rt(l,zt(t))+1).join("")},Pn.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Xl(t)))return e;var l=zt(e);return ui(l,wt(l,zt(t))).join("")},Pn.truncate=function(e,t){var n=30,l="...";if(Vr(t)){var i="separator"in t?t.separator:i;n="length"in t?ia(t.length):n,l="omission"in t?Xl(t.omission):l}var o=(e=ua(e)).length;if(Mt(e)){var r=zt(e);o=r.length}if(n>=o)return e;var a=n-Wt(l);if(a<1)return l;var u=r?ui(r,0,a).join(""):e.slice(0,a);if(void 0===i)return u+l;if(r&&(a+=u.length-a),$r(i)){if(e.slice(a).search(i)){var s,c=u;for(i.global||(i=fe(i.source,ua(te.exec(i))+"g")),i.lastIndex=0;s=i.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Xl(i),a)!=a){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+l},Pn.unescape=function(e){return(e=ua(e))&&M.test(e)?e.replace(L,qt):e},Pn.uniqueId=function(e){var t=++Te;return ua(e)+t},Pn.upperCase=Ua,Pn.upperFirst=ja,Pn.each=ur,Pn.eachRight=sr,Pn.first=Mo,Za(Pn,(au={},ul(Pn,function(e,t){be.call(Pn.prototype,t)||(au[t]=e)}),au),{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){In.prototype[e]=function(n){n=void 0===n?1:rn(ia(n),0);var l=this.__filtered__&&!t?new In(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},In.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;In.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:$i(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");In.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");In.prototype[e]=function(){return this.__filtered__?new In(this):this[n](1)}}),In.prototype.compact=function(){return this.filter(Ka)},In.prototype.find=function(e){return this.filter(e).head()},In.prototype.findLast=function(e){return this.reverse().find(e)},In.prototype.invokeMap=Fl(function(e,t){return"function"==typeof e?new In(this):this.map(function(n){return gl(n,e,t)})}),In.prototype.reject=function(e){return this.filter(Ar($i(e)))},In.prototype.slice=function(e,t){e=ia(e);var n=this;return n.__filtered__&&(e>0||t<0)?new In(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)},In.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},In.prototype.toArray=function(){return this.take(4294967295)},ul(In.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__,r=l?[1]:arguments,a=t instanceof In,u=r[0],s=a||Lr(t),c=function(e){var t=i.apply(Pn,ct([e],r));return l&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,p=!!this.__actions__.length,m=o&&!d,v=a&&!p;if(!o&&s){t=v?t:new In(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[c],thisArg:void 0}),new Rn(f,d)}return m&&v?e.apply(this,r):(f=this.thru(c),m?l?f.value()[0]:f.value():f)})}),lt(["pop","push","shift","sort","splice","unshift"],function(e){var t=ge[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(Lr(i)?i:[],e)}return this[n](function(n){return t.apply(Lr(n)?n:[],e)})}}),ul(In.prototype,function(e,t){var n=Pn[t];if(n){var l=n.name+"";be.call(yn,l)||(yn[l]=[]),yn[l].push({name:t,func:n})}}),yn[Ni(void 0,2).name]=[{name:"wrapper",func:void 0}],In.prototype.clone=function(){var e=new In(this.__wrapped__);return e.__actions__=hi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=hi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=hi(this.__views__),e},In.prototype.reverse=function(){if(this.__filtered__){var e=new In(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},In.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Lr(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],r=o.size;switch(o.type){case"drop":e+=r;break;case"dropRight":t-=r;break;case"take":t=an(t,e+r);break;case"takeRight":e=rn(e,t-r)}}return{start:e,end:t}}(0,i,this.__views__),r=o.start,a=o.end,u=a-r,s=l?a:r-1,c=this.__iteratees__,d=c.length,p=0,m=an(u,this.__takeCount__);if(!n||!l&&i==u&&m==u)return ti(e,this.__actions__);var v=[];e:for(;u--&&p<m;){for(var f=-1,h=e[s+=t];++f<d;){var E=c[f],g=E.type,y=(0,E.iteratee)(h);if(2==g)h=y;else if(!y){if(1==g)continue e;break e}}v[p++]=h}return v},Pn.prototype.at=ir,Pn.prototype.chain=function(){return nr(this)},Pn.prototype.commit=function(){return new Rn(this.value(),this.__chain__)},Pn.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__++]}},Pn.prototype.plant=function(e){for(var t,n=this;n instanceof wn;){var l=xo(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 In){var t=e;return this.__actions__.length&&(t=new In(this)),(t=t.reverse()).__actions__.push({func:lr,args:[Vo],thisArg:void 0}),new Rn(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,bt&&(Pn.prototype[bt]=function(){return this}),Pn}();qe?((qe.exports=Gt)._=Gt,Ve._=Gt):ze._=Gt}).call(c)});const m=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},v=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},f=e=>{var i,o,a,s,c,d,m,v,f,h;const{pets:E,focusIndex:g,allOwners:y,setFocusIndex:_,setPets:S,t:b,formData:T,config:C,setError:A,clearErrors:D,formState:N,menu:P,breed_type:x,pet_sex:w}=e,[R,I]=n.useState(null),{control:O,formState:L,watch:k,trigger:M}=r.useForm(),F=k(),{errors:B}=L,U=(Digit.ULBService.getCurrentTenantId(),n.useMemo(()=>{var e;return null==T||null===(e=T.ownershipCategory)||void 0===e?void 0:e.code.includes("INDIVIDUAL")},[null==T||null===(i=T.ownershipCategory)||void 0===i?void 0:i.code])),[j,H]=l.useState({});n.useEffect(()=>{let e=U;p.isEqual(j,F)||(H(u({},F)),S(t=>t.map(t=>t.key&&t.key===E.key?u({},t,F,e):u({},t))),M())},[F]),n.useEffect(()=>{var e;Object.keys(B).length&&!p.isEqual((null===(e=N.errors[C.key])||void 0===e?void 0:e.type)||{},B)?A(C.key,{type:B}):!Object.keys(B).length&&N.errors[C.key]&&D(C.key)},[B]);const W={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==y?void 0:y.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_SEARCH_PET_TYPE")+" *"),l.createElement(r.Controller,{control:O,name:"petType",defaultValue:null==E?void 0:E.petType,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:P,optionKey:"i18nKey",t:b})})),l.createElement(t.CardLabelError,{style:W},L.touched.petType?null==B||null===(o=B.petType)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_SEARCH_BREED_TYPE")+" *"),l.createElement(r.Controller,{control:O,name:"breedType",defaultValue:null==E?void 0:E.breedType,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:x,optionKey:"i18nKey",t:b})})),l.createElement(t.CardLabelError,{style:W},L.touched.breedType?null==B||null===(a=B.breedType)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_PET_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"petName",defaultValue:null==E?void 0:E.petName,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:g.index===(null==E?void 0:E.key)&&"petName"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:E.key,type:"petName"})},onBlur:t=>{_({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:W},L.touched.petName?null==B||null===(s=B.petName)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_PET_AGE")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"petAge",defaultValue:null==E?void 0:E.petAge,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!(/^\d{1,4}$/.test(e)&&parseInt(e,10)>=0&&parseInt(e,10)<=1440)||b("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:g.index===(null==E?void 0:E.key)&&"petAge"===g.type,onChange:t=>{e.onChange(t),_({index:E.key,type:"petAge"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,placeholder:"in months"})}))),l.createElement("div",{style:{textAlign:"center"}},Math.floor(k("petAge")/12)," ",1===Math.floor(k("petAge")/12)?"YEAR":"YEARS"," ",k("petAge")%12," ",k("petAge")%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabelError,{style:W},L.touched.petAge?null==B||null===(c=B.petAge)||void 0===c?void 0:c.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_PET_SEX")+" *"),l.createElement(r.Controller,{control:O,name:"petGender",defaultValue:null==E?void 0:E.petGender,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,select:e.onChange,onBlur:e.onBlur,option:w,optionKey:"i18nKey",t:b})})),l.createElement(t.CardLabelError,{style:W},L.touched.petGender?null==B||null===(d=B.petGender)||void 0===d?void 0:d.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_DOCTOR_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"doctorName",defaultValue:null==E?void 0:E.doctorName,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:g.index===(null==E?void 0:E.key)&&"doctorName"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:E.key,type:"doctorName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},L.touched.doctorName?null==B||null===(m=B.doctorName)||void 0===m?void 0:m.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_CLINIC_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"clinicName",defaultValue:null==E?void 0:E.clinicName,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^\w+( +\w+)*$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:g.index===(null==E?void 0:E.key)&&"clinicName"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:E.key,type:"clinicName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},L.touched.clinicName?null==B||null===(v=B.clinicName)||void 0===v?void 0:v.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_VACCINATED_DATE")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"lastVaccineDate",defaultValue:null==E?void 0:E.lastVaccineDate,rules:{required:b("CORE_COMMON_REQUIRED_ERRMSG"),validDate:e=>!!/^\d{4}-\d{2}-\d{2}$/.test(e)||b("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},max:(new Date).toISOString().split("T")[0]})}))),l.createElement(t.CardLabelError,{style:W},L.touched.lastVaccineDate?null==B||null===(f=B.lastVaccineDate)||void 0===f?void 0:f.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_VACCINATION_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:O,name:"vaccinationNumber",defaultValue:null==E?void 0:E.vaccinationNumber,render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:g.index===(null==E?void 0:E.key)&&"vaccinationNumber"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:E.key,type:"vaccinationNumber"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},L.touched.vaccinationNumber?null==B||null===(h=B.vaccinationNumber)||void 0===h?void 0:h.message:""))),(null==R?void 0:R.label)&&l.createElement(t.Toast,{label:null==R?void 0:R.label,onClose:e=>{I(e=>null)}}))},h=e=>{var i,o,a,s,c;const{owner:d,focusIndex:m,allOwners:v,setFocusIndex:f,setOwners:h,t:E,config:g,setError:y,clearErrors:_,formState:S}=e,[b,T]=n.useState(null),{control:C,formState:A,watch:D,trigger:N}=r.useForm(),P=D(),{errors:x}=A;Digit.ULBService.getCurrentTenantId(),n.useEffect(()=>{N()},[]);const[w,R]=l.useState({});n.useEffect(()=>{p.isEqual(w,P)||(R(u({},P)),h(e=>e.map(e=>e.key&&e.key===d.key?u({},e,P):u({},e))),N())},[P]),n.useEffect(()=>{var e;Object.keys(x).length&&!p.isEqual((null===(e=S.errors[g.key])||void 0===e?void 0:e.type)||{},x)?y(g.key,{type:x}):!Object.keys(x).length&&S.errors[g.key]&&_(g.key)},[x]);const I={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"16px"}},l.createElement("div",{style:{border:"1px solid #E3E3E3",padding:"16px",marginTop:"8px"}},(null==v?void 0:v.length)>2?l.createElement("div",{style:{marginBottom:"16px",padding:"5px",cursor:"pointer",textAlign:"right"}},"X"):null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},E("PTR_APPLICANT_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:C,name:"applicantName",defaultValue:null==d?void 0:d.applicantName,rules:{required:E("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||E("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:m.index===(null==d?void 0:d.key)&&"applicantName"===m.type,onChange:t=>{e.onChange(t.target.value),f({index:d.key,type:"applicantName"})},onBlur:t=>{f({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},A.touched.applicantName?null==x||null===(i=x.applicantName)||void 0===i?void 0:i.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},E("PTR_FATHER_HUSBAND_NAME")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:C,name:"fatherName",defaultValue:null==d?void 0:d.fatherName,rules:{required:E("CORE_COMMON_REQUIRED_ERRMSG"),validate:{pattern:e=>!!/^[a-zA-Z\s]*$/.test(e)||E("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:m.index===(null==d?void 0:d.key)&&"fatherName"===m.type,onChange:t=>{e.onChange(t.target.value),f({index:d.key,type:"fatherName"})},onBlur:t=>{f({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:I},A.touched.fatherName?null==x||null===(o=x.fatherName)||void 0===o?void 0:o.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},E("PTR_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:C,name:"mobileNumber",defaultValue:null==d?void 0:d.mobileNumber,rules:{required:E("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[6789]\d{9}$/.test(e)||E("ERR_DEFAULT_INPUT_FIELD_MSG")},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:m.index===(null==d?void 0:d.key)&&"mobileNumber"===m.type,onChange:t=>{e.onChange(t),f({index:d.key,type:"mobileNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},A.touched.mobileNumber?null==x||null===(a=x.mobileNumber)||void 0===a?void 0:a.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},E("PTR_ALT_MOBILE_NUMBER")+" *"),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:C,name:"alternateNumber",defaultValue:null==d?void 0:d.alternateNumber,rules:{required:E("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>/^[6789]\d{9}$/.test(e)},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:m.index===(null==d?void 0:d.key)&&"alternateNumber"===m.type,onChange:t=>{e.onChange(t),f({index:d.key,type:"alternateNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},A.touched.alternateNumber?null==x||null===(s=x.alternateNumber)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},E("PTR_EMAIL_ID")),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:C,name:"emailId",defaultValue:null==d?void 0:d.emailId,rules:{validate:e=>{const t=e.trim().toLowerCase();return/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(t)||"TL_EMAIL_ID_ERROR_MESSAGE"}},render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:m.index===(null==d?void 0:d.key)&&"emailId"===m.type,onChange:t=>{e.onChange(t),f({index:d.key,type:"emailId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:I},A.touched.emailId?null==x||null===(c=x.emailId)||void 0===c?void 0:c.message:""))),(null==b?void 0:b.label)&&l.createElement(t.Toast,{label:null==b?void 0:b.label,onClose:e=>{T(e=>null)}}))};let E=[];const g=e=>{let{currentStep:n=1,flow:o=""}=e;const{t:r}=i.useTranslation(),a=window.Digit.Utils.browser.isMobile();return(e=>{switch(e){case"STAKEHOLDER":E=[];break;default:E=["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:a?{}:{maxWidth:"960px",minWidth:"640px",marginRight:"auto"}},E.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"},r(e))),i<o.length-1&&l.createElement("span",{className:"line "+(i<n-1&&"active")}))))};function y(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function S(e){var i;let{t:o,document:r,setDocuments:a,setError:s,documents:c,action:d,formData:p,setFormError:m,clearFormErrors:v,config:f,formState:h,id:E}=e;const g=null==c?void 0:c.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.getCurrentTenantId(),n.useState(g?u({},g,{active:"ACTIVE"===(null==g?void 0:g.status),code:null==g?void 0:g.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{})),[b,T]=n.useState(null),[C,A]=n.useState(()=>(null==g?void 0:g.fileStoreId)||null),{dropdownData:D}=r;var N=D;const[P,x]=n.useState(!1),w=()=>{var e,t;let n=null===(e=h.errors)||void 0===e||null===(t=e[f.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(null==r?void 0:r.code)&&(n=n.filter(e=>e!=(null==r?void 0:r.code)),n.length?m(f.key,{type:n}):v(f.key))};return n.useEffect(()=>{null!=_&&_.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==_?void 0:_.code));return 0===(null==C?void 0:C.length)||null===C?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==_?void 0:_.code,filestoreId:C,documentUid:C}]}),P?P&&w():C&&null!=_&&_.code?C&&null!=_&&_.code&&w():(()=>{var e,t;let n=null===(e=h.errors)||void 0===e||null===(t=e[f.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(r.code)||(n.push(r.code),m(f.key,{type:n}))})()},[C,_,P]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==r?void 0:r.code))[0],l=N.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return u({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(S(l),A(null==n?void 0:n.fileStoreId)):x(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(b){const e=function(){if(b.size>=5242880)s(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return A(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",b,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):s(o("CS_FILE_UPLOAD_ERROR"))})},function(){s(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)}}()},[b]),n.useEffect(()=>{P&&A(null)},[P]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:_,option:N.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:o})):null,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){T(e.target.files[0])},onDelete:()=>{A(null)},id:E,message:C?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!C}))))}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const b=[{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:"pincode",texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRCitizenAddress",key:"address",withoutLabel:!0,texts:{submitBarLabel:"PTR_COMMON_NEXT"},nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"PTR_COMMON_NEXT"}}]}];function T(e){var i;let{t:o,document:r,setDocuments:a,setError:s,documents:c,action:d,formData:p,id:m}=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==r?void 0:r.code)})[0];console.log("filetetetetet",v),Digit.ULBService.getCurrentTenantId();const[f,h]=n.useState(v?u({},v,{active:!0===(null==r?void 0:r.active),code:null==v?void 0:v.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{}),[E,g]=n.useState(null),[_,S]=n.useState(()=>(null==v?void 0:v.filestoreId)||null),{dropdownData:b}=r;var T=b;const[C,A]=n.useState(!1);return n.useEffect(()=>{null!=f&&f.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==f?void 0:f.code));return 0===(null==_?void 0:_.length)||null===_?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==f?void 0:f.code,filestoreId:_,documentUid:_}]})},[_,f]),n.useEffect(()=>{if("update"===d){var e,t;const n=null==p||null===(e=p.originalData)||void 0===e||null===(t=e.documents)||void 0===t?void 0:t.filter(e=>e.documentType.includes(null==r?void 0:r.code))[0],l=T.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return u({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(h(l),S(null==n?void 0:n.fileStoreId)):A(!0)}},[]),n.useEffect(()=>{!function(){try{s(null);const e=function(){if(E){const e=function(){if(E.size>=5242880)s(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",E,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?S(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):s(o("CS_FILE_UPLOAD_ERROR"))})},function(){s(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)}}()},[E]),n.useEffect(()=>{C&&S(null)},[C]),l.createElement("div",{style:{marginBottom:"24px"}},null!=r&&r.hasDropdown?l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *"),l.createElement(t.Dropdown,{className:"form-field",selected:f,style:{width:"100%"},option:T.map(e=>{var t;return u({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:o})):null,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){g(e.target.files[0])},onDelete:()=>{S(null)},id:m,message:_?"1 "+o("CS_ACTION_FILEUPLOADED"):o("CS_ACTION_NO_FILEUPLOADED"),textStyles:{width:"100%"},inputStyles:{width:"280px"},accept:".pdf, .jpeg, .jpg, .png",buttonType:"button",error:!_}))))}d(function(e){!function(t,n){e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:c,function(e,t){var n=[],l=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},r=n.push,a=n.indexOf,u={},s=u.toString,c=u.hasOwnProperty,d=c.toString,p=d.call(Object),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},f=function(e){return null!=e&&e===e.window},h=e.document,E={type:!0,src:!0,nonce:!0,noModule:!0};function g(e,t,n){var l,i,o=(n=n||h).createElement("script");if(o.text=e,t)for(l in E)(i=t[l]||t.getAttribute&&t.getAttribute(l))&&o.setAttribute(l,i);n.head.appendChild(o).parentNode.removeChild(o)}function y(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?u[s.call(e)]||"object":typeof e}var _=function(e,t){return new _.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=y(e);return!v(e)&&!f(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}_.fn=_.prototype={jquery:"3.6.0",constructor:_,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=_.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return _.each(this,e)},map:function(e){return this.pushStack(_.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(_.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(_.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:r,sort:n.sort,splice:n.splice},_.extend=_.fn.extend=function(){var e,t,n,l,i,o,r=arguments[0]||{},a=1,u=arguments.length,s=!1;for("boolean"==typeof r&&(s=r,r=arguments[a]||{},a++),"object"==typeof r||v(r)||(r={}),a===u&&(r=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)l=e[t],"__proto__"!==t&&r!==l&&(s&&l&&(_.isPlainObject(l)||(i=Array.isArray(l)))?(n=r[t],o=i&&!Array.isArray(n)?[]:i||_.isPlainObject(n)?n:{},i=!1,r[t]=_.extend(s,o,l)):void 0!==l&&(r[t]=l));return r},_.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==s.call(e)||(t=l(e))&&("function"!=typeof(n=c.call(t,"constructor")&&t.constructor)||d.call(n)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){g(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,l=0;if(S(e))for(n=e.length;l<n&&!1!==t.call(e[l],l,e[l]);l++);else for(l in e)if(!1===t.call(e[l],l,e[l]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?_.merge(n,"string"==typeof e?[e]:e):r.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,l=0,i=e.length;l<n;l++)e[i++]=t[l];return e.length=i,e},grep:function(e,t,n){for(var l=[],i=0,o=e.length,r=!n;i<o;i++)!t(e[i],i)!==r&&l.push(e[i]);return l},map:function(e,t,n){var l,i,r=0,a=[];if(S(e))for(l=e.length;r<l;r++)null!=(i=t(e[r],r,n))&&a.push(i);else for(r in e)null!=(i=t(e[r],r,n))&&a.push(i);return o(a)},guid:1,support:m}),"function"==typeof Symbol&&(_.fn[Symbol.iterator]=n[Symbol.iterator]),_.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){u["[object "+t+"]"]=t.toLowerCase()});var b=function(e){var t,n,l,i,o,r,a,u,s,c,d,p,m,v,f,h,E,g,y,_="sizzle"+1*new Date,S=e.document,b=0,T=0,C=ue(),A=ue(),D=ue(),N=ue(),P=function(e,t){return e===t&&(d=!0),0},x={}.hasOwnProperty,w=[],R=w.pop,I=w.push,O=w.push,L=w.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+F+"*("+B+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+F+"*\\]",j=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",H=new RegExp(F+"+","g"),W=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),z=new RegExp("^"+F+"*,"+F+"*"),V=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),q=new RegExp(F+"|>"),G=new RegExp(j),K=new RegExp("^"+B+"$"),Y={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},$=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+F+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},re=_e(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(w=L.call(S.childNodes),S.childNodes)}catch(e){O={apply:w.length?function(e,t){I.apply(e,L.call(t))}:function(e,t){for(var n=e.length,l=0;e[n++]=t[l++];);e.length=n-1}}}function ae(e,t,l,i){var o,a,s,c,d,v,E,g=t&&t.ownerDocument,S=t?t.nodeType:9;if(l=l||[],"string"!=typeof e||!e||1!==S&&9!==S&&11!==S)return l;if(!i&&(p(t),t=t||m,f)){if(11!==S&&(d=Q.exec(e)))if(o=d[1]){if(9===S){if(!(s=t.getElementById(o)))return l;if(s.id===o)return l.push(s),l}else if(g&&(s=g.getElementById(o))&&y(t,s)&&s.id===o)return l.push(s),l}else{if(d[2])return O.apply(l,t.getElementsByTagName(e)),l;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(l,t.getElementsByClassName(o)),l}if(n.qsa&&!N[e+" "]&&(!h||!h.test(e))&&(1!==S||"object"!==t.nodeName.toLowerCase())){if(E=e,g=t,1===S&&(q.test(e)||V.test(e))){for((g=ee.test(e)&&Ee(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(le,ie):t.setAttribute("id",c=_)),a=(v=r(e)).length;a--;)v[a]=(c?"#"+c:":scope")+" "+ye(v[a]);E=v.join(",")}try{return O.apply(l,g.querySelectorAll(E)),l}catch(t){N(e,!0)}finally{c===_&&t.removeAttribute("id")}}}return u(e.replace(W,"$1"),t,l,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>l.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function se(e){return e[_]=!0,e}function ce(e){var t=m.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)l.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,l=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(l)return l;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function me(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ve(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&re(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,l){for(var i,o=e([],n.length,t),r=o.length;r--;)n[i=o[r]]&&(n[i]=!(l[i]=n[i]))})})}function Ee(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ae.support={},o=ae.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!$.test(e&&e.namespaceURI||t&&t.nodeName||"HTML")},p=ae.setDocument=function(e){var t,i,r=e?e.ownerDocument||e:S;return r!=m&&9===r.nodeType&&r.documentElement?(v=(m=r).documentElement,f=!o(m),S!=m&&(i=m.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce(function(e){return v.appendChild(e).appendChild(m.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ce(function(e){return e.appendChild(m.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(m.getElementsByClassName),n.getById=ce(function(e){return v.appendChild(e).id=_,!m.getElementsByName||!m.getElementsByName(_).length}),n.getById?(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n=t.getElementById(e);return n?[n]:[]}}):(l.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},l.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n,l,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),l=0;o=i[l++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),l.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,l=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&l.push(n);return l}return o},l.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},E=[],h=[],(n.qsa=J.test(m.querySelectorAll))&&(ce(function(e){var t;v.appendChild(e).innerHTML="<a id='"+_+"'></a><select id='"+_+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+F+"*(?:value|"+M+")"),e.querySelectorAll("[id~="+_+"-]").length||h.push("~="),(t=m.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+F+"*name"+F+"*="+F+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=m.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+F+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),v.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(n.matchesSelector=J.test(g=v.matches||v.webkitMatchesSelector||v.mozMatchesSelector||v.oMatchesSelector||v.msMatchesSelector))&&ce(function(e){n.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),E.push("!=",j)}),h=h.length&&new RegExp(h.join("|")),E=E.length&&new RegExp(E.join("|")),t=J.test(v.compareDocumentPosition),y=t||J.test(v.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,l=t&&t.parentNode;return e===l||!(!l||1!==l.nodeType||!(n.contains?n.contains(l):e.compareDocumentPosition&&16&e.compareDocumentPosition(l)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},P=t?function(e,t){if(e===t)return d=!0,0;var l=!e.compareDocumentPosition-!t.compareDocumentPosition;return l||(1&(l=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===l?e==m||e.ownerDocument==S&&y(S,e)?-1:t==m||t.ownerDocument==S&&y(S,t)?1:c?k(c,e)-k(c,t):0:4&l?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,l=0,i=e.parentNode,o=t.parentNode,r=[e],a=[t];if(!i||!o)return e==m?-1:t==m?1:i?-1:o?1:c?k(c,e)-k(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;r[l]===a[l];)l++;return l?pe(r[l],a[l]):r[l]==S?-1:a[l]==S?1:0},m):m},ae.matches=function(e,t){return ae(e,null,null,t)},ae.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&f&&!N[t+" "]&&(!E||!E.test(t))&&(!h||!h.test(t)))try{var l=g.call(e,t);if(l||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return l}catch(e){N(t,!0)}return ae(t,m,null,[e]).length>0},ae.contains=function(e,t){return(e.ownerDocument||e)!=m&&p(e),y(e,t)},ae.attr=function(e,t){(e.ownerDocument||e)!=m&&p(e);var i=l.attrHandle[t.toLowerCase()],o=i&&x.call(l.attrHandle,t.toLowerCase())?i(e,t,!f):void 0;return void 0!==o?o:n.attributes||!f?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},ae.escape=function(e){return(e+"").replace(le,ie)},ae.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ae.uniqueSort=function(e){var t,l=[],i=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(P),d){for(;t=e[o++];)t===e[o]&&(i=l.push(o));for(;i--;)e.splice(l[i],1)}return c=null,e},i=ae.getText=function(e){var t,n="",l=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[l++];)n+=i(t);return n},(l=ae.selectors={cacheLength:50,createPseudo:se,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ae.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ae.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&G.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(l){var i=ae.attr(l,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,l,i){var o="nth"!==e.slice(0,3),r="last"!==e.slice(-4),a="of-type"===t;return 1===l&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var s,c,d,p,m,v,f=o!==r?"nextSibling":"previousSibling",h=t.parentNode,E=a&&t.nodeName.toLowerCase(),g=!u&&!a,y=!1;if(h){if(o){for(;f;){for(p=t;p=p[f];)if(a?p.nodeName.toLowerCase()===E:1===p.nodeType)return!1;v=f="only"===e&&!v&&"nextSibling"}return!0}if(v=[r?h.firstChild:h.lastChild],r&&g){for(y=(m=(s=(c=(d=(p=h)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=m&&h.childNodes[m];p=++m&&p&&p[f]||(y=m=0)||v.pop();)if(1===p.nodeType&&++y&&p===t){c[e]=[b,m,y];break}}else if(g&&(y=m=(s=(c=(d=(p=t)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1]),!1===y)for(;(p=++m&&p&&p[f]||(y=m=0)||v.pop())&&((a?p.nodeName.toLowerCase()!==E:1!==p.nodeType)||!++y||(g&&((c=(d=p[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[b,y]),p!==t)););return(y-=i)===l||y%l==0&&y/l>=0}}},PSEUDO:function(e,t){var n,i=l.pseudos[e]||l.setFilters[e.toLowerCase()]||ae.error("unsupported pseudo: "+e);return i[_]?i(t):i.length>1?(n=[e,e,"",t],l.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){for(var l,o=i(e,t),r=o.length;r--;)e[l=k(e,o[r])]=!(n[l]=o[r])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],l=a(e.replace(W,"$1"));return l[_]?se(function(e,t,n,i){for(var o,r=l(e,null,i,[]),a=e.length;a--;)(o=r[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,l(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return ae(e,t).length>0}}),contains:se(function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}}),lang:se(function(e){return K.test(e||"")||ae.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===v},focus:function(e){return e===m.activeElement&&(!m.hasFocus||m.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!l.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:he(function(e,t,n){for(var l=n<0?n+t:n;++l<t;)e.push(l);return e})}}).pseudos.nth=l.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})l.pseudos[t]=me(t);for(t in{submit:!0,reset:!0})l.pseudos[t]=ve(t);function ge(){}function ye(e){for(var t=0,n=e.length,l="";t<n;t++)l+=e[t].value;return l}function _e(e,t,n){var l=t.dir,i=t.next,o=i||l,r=n&&"parentNode"===o,a=T++;return t.first?function(t,n,i){for(;t=t[l];)if(1===t.nodeType||r)return e(t,n,i);return!1}:function(t,n,u){var s,c,d,p=[b,a];if(u){for(;t=t[l];)if((1===t.nodeType||r)&&e(t,n,u))return!0}else for(;t=t[l];)if(1===t.nodeType||r)if(c=(d=t[_]||(t[_]={}))[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[l]||t;else{if((s=c[o])&&s[0]===b&&s[1]===a)return p[2]=s[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function Se(e){return e.length>1?function(t,n,l){for(var i=e.length;i--;)if(!e[i](t,n,l))return!1;return!0}:e[0]}function be(e,t,n,l,i){for(var o,r=[],a=0,u=e.length,s=null!=t;a<u;a++)(o=e[a])&&(n&&!n(o,l,i)||(r.push(o),s&&t.push(a)));return r}function Te(e,t,n,l,i,o){return l&&!l[_]&&(l=Te(l)),i&&!i[_]&&(i=Te(i,o)),se(function(o,r,a,u){var s,c,d,p=[],m=[],v=r.length,f=o||function(e,t,n){for(var l=0,i=t.length;l<i;l++)ae(e,t[l],n);return n}(t||"*",a.nodeType?[a]:a,[]),h=!e||!o&&t?f:be(f,p,e,a,u),E=n?i||(o?e:v||l)?[]:r:h;if(n&&n(h,E,a,u),l)for(s=be(E,m),l(s,[],a,u),c=s.length;c--;)(d=s[c])&&(E[m[c]]=!(h[m[c]]=d));if(o){if(i||e){if(i){for(s=[],c=E.length;c--;)(d=E[c])&&s.push(h[c]=d);i(null,E=[],s,u)}for(c=E.length;c--;)(d=E[c])&&(s=i?k(o,d):p[c])>-1&&(o[s]=!(r[s]=d))}}else E=be(E===r?E.splice(v,E.length):E),i?i(null,r,E,u):O.apply(r,E)})}function Ce(e){for(var t,n,i,o=e.length,r=l.relative[e[0].type],a=r||l.relative[" "],u=r?1:0,c=_e(function(e){return e===t},a,!0),d=_e(function(e){return k(t,e)>-1},a,!0),p=[function(e,n,l){var i=!r&&(l||n!==s)||((t=n).nodeType?c(e,n,l):d(e,n,l));return t=null,i}];u<o;u++)if(n=l.relative[e[u].type])p=[_e(Se(p),n)];else{if((n=l.filter[e[u].type].apply(null,e[u].matches))[_]){for(i=++u;i<o&&!l.relative[e[i].type];i++);return Te(u>1&&Se(p),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(W,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ye(e))}p.push(n)}return Se(p)}return ge.prototype=l.filters=l.pseudos,l.setFilters=new ge,r=ae.tokenize=function(e,t){var n,i,o,r,a,u,s,c=A[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=l.preFilter;a;){for(r in n&&!(i=z.exec(a))||(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=V.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(W," ")}),a=a.slice(n.length)),l.filter)!(i=Y[r].exec(a))||s[r]&&!(i=s[r](i))||(n=i.shift(),o.push({value:n,type:r,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ae.error(e):A(e,u).slice(0)},a=ae.compile=function(e,t){var n,i=[],o=[],a=D[e+" "];if(!a){for(t||(t=r(e)),n=t.length;n--;)(a=Ce(t[n]))[_]?i.push(a):o.push(a);(a=D(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,r,a,u,c){var d,v,h,E=0,g="0",y=o&&[],_=[],S=s,T=o||i&&l.find.TAG("*",c),C=b+=null==S?1:Math.random()||.1,A=T.length;for(c&&(s=r==m||r||c);g!==A&&null!=(d=T[g]);g++){if(i&&d){for(v=0,r||d.ownerDocument==m||(p(d),a=!f);h=e[v++];)if(h(d,r||m,a)){u.push(d);break}c&&(b=C)}n&&((d=!h&&d)&&E--,o&&y.push(d))}if(E+=g,n&&g!==E){for(v=0;h=t[v++];)h(y,_,r,a);if(o){if(E>0)for(;g--;)y[g]||_[g]||(_[g]=R.call(u));_=be(_)}O.apply(u,_),c&&!o&&_.length>0&&E+t.length>1&&ae.uniqueSort(u)}return c&&(b=C,s=S),y};return n?se(o):o}(o,i))).selector=e}return a},u=ae.select=function(e,t,n,i){var o,u,s,c,d,p="function"==typeof e&&e,m=!i&&r(e=p.selector||e);if(n=n||[],1===m.length){if((u=m[0]=m[0].slice(0)).length>2&&"ID"===(s=u[0]).type&&9===t.nodeType&&f&&l.relative[u[1].type]){if(!(t=(l.find.ID(s.matches[0].replace(te,ne),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=Y.needsContext.test(e)?0:u.length;o--&&!l.relative[c=(s=u[o]).type];)if((d=l.find[c])&&(i=d(s.matches[0].replace(te,ne),ee.test(u[0].type)&&Ee(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return O.apply(n,i),n;break}}return(p||a(e,m))(i,t,!f,n,!t||ee.test(e)&&Ee(t.parentNode)||t),n},n.sortStable=_.split("").sort(P).join("")===_,n.detectDuplicates=!!d,p(),n.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(m.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||de(M,function(e,t,n){var l;if(!n)return!0===e[t]?t.toLowerCase():(l=e.getAttributeNode(t))&&l.specified?l.value:null}),ae}(e);_.find=b,_.expr=b.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=b.uniqueSort,_.text=b.getText,_.isXMLDoc=b.isXML,_.contains=b.contains,_.escapeSelector=b.escape;var T=function(e,t,n){for(var l=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&_(e).is(n))break;l.push(e)}return l},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},A=_.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(e,t,n){return v(t)?_.grep(e,function(e,l){return!!t.call(e,l,e)!==n}):t.nodeType?_.grep(e,function(e){return e===t!==n}):"string"!=typeof t?_.grep(e,function(e){return a.call(t,e)>-1!==n}):_.filter(t,e,n)}_.filter=function(e,t,n){var l=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===l.nodeType?_.find.matchesSelector(l,e)?[l]:[]:_.find.matches(e,_.grep(t,function(e){return 1===e.nodeType}))},_.fn.extend({find:function(e){var t,n,l=this.length,i=this;if("string"!=typeof e)return this.pushStack(_(e).filter(function(){for(t=0;t<l;t++)if(_.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<l;t++)_.find(e,i[t],n);return l>1?_.uniqueSort(n):n},filter:function(e){return this.pushStack(P(this,e||[],!1))},not:function(e){return this.pushStack(P(this,e||[],!0))},is:function(e){return!!P(this,"string"==typeof e&&A.test(e)?_(e):e||[],!1).length}});var x,w=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(e,t,n){var l,i;if(!e)return this;if(n=n||x,"string"==typeof e){if(!(l="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:w.exec(e))||!l[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(l[1]){if(_.merge(this,_.parseHTML(l[1],(t=t instanceof _?t[0]:t)&&t.nodeType?t.ownerDocument||t:h,!0)),N.test(l[1])&&_.isPlainObject(t))for(l in t)v(this[l])?this[l](t[l]):this.attr(l,t[l]);return this}return(i=h.getElementById(l[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(_):_.makeArray(e,this)}).prototype=_.fn,x=_(h);var R=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(_.contains(this,t[e]))return!0})},closest:function(e,t){var n,l=0,i=this.length,o=[],r="string"!=typeof e&&_(e);if(!A.test(e))for(;l<i;l++)for(n=this[l];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(r?r.index(n)>-1:1===n.nodeType&&_.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?a.call(_(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return null!=e.contentDocument&&l(e.contentDocument)?e.contentDocument:(D(e,"template")&&(e=e.content||e),_.merge([],e.childNodes))}},function(e,t){_.fn[e]=function(n,l){var i=_.map(this,t,n);return"Until"!==e.slice(-5)&&(l=n),l&&"string"==typeof l&&(i=_.filter(l,i)),this.length>1&&(I[e]||_.uniqueSort(i),R.test(e)&&i.reverse()),this.pushStack(i)}});var L=/[^\x20\t\r\n\f]+/g;function k(e){return e}function M(e){throw e}function F(e,t,n,l){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(l))}catch(e){n.apply(void 0,[e])}}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(L)||[],function(e,n){t[n]=!0}),t}(e):_.extend({},e);var t,n,l,i,o=[],r=[],a=-1,u=function(){for(i=i||e.once,l=t=!0;r.length;a=-1)for(n=r.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},s={add:function(){return o&&(n&&!t&&(a=o.length-1,r.push(n)),function t(n){_.each(n,function(n,l){v(l)?e.unique&&s.has(l)||o.push(l):l&&l.length&&"string"!==y(l)&&t(l)})}(arguments),n&&!t&&u()),this},remove:function(){return _.each(arguments,function(e,t){for(var n;(n=_.inArray(t,o,n))>-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?_.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=r=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=r=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],r.push(n),t||u()),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!l}};return s},_.extend({Deferred:function(t){var n=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],l="pending",i={state:function(){return l},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return _.Deferred(function(t){_.each(n,function(n,l){var i=v(e[l[4]])&&e[l[4]];o[l[1]](function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[l[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,l,i){var o=0;function r(t,n,l,i){return function(){var a=this,u=arguments,s=function(){var e,s;if(!(t<o)){if((e=l.apply(a,u))===n.promise())throw new TypeError("Thenable self-resolution");v(s=e&&("object"==typeof e||"function"==typeof e)&&e.then)?i?s.call(e,r(o,n,k,i),r(o,n,M,i)):(o++,s.call(e,r(o,n,k,i),r(o,n,M,i),r(o,n,k,n.notifyWith))):(l!==k&&(a=void 0,u=[e]),(i||n.resolveWith)(a,u))}},c=i?s:function(){try{s()}catch(e){_.Deferred.exceptionHook&&_.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(l!==M&&(a=void 0,u=[e]),n.rejectWith(a,u))}};t?c():(_.Deferred.getStackHook&&(c.stackTrace=_.Deferred.getStackHook()),e.setTimeout(c))}}return _.Deferred(function(e){n[0][3].add(r(0,e,v(i)?i:k,e.notifyWith)),n[1][3].add(r(0,e,v(t)?t:k)),n[2][3].add(r(0,e,v(l)?l:M))}).promise()},promise:function(e){return null!=e?_.extend(e,i):i}},o={};return _.each(n,function(e,t){var r=t[2],a=t[5];i[t[1]]=r.add,a&&r.add(function(){l=a},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),r.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=r.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,l=Array(n),o=i.call(arguments),r=_.Deferred(),a=function(e){return function(n){l[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||r.resolveWith(l,o)}};if(t<=1&&(F(e,r.done(a(n)).resolve,r.reject,!t),"pending"===r.state()||v(o[n]&&o[n].then)))return r.then();for(;n--;)F(o[n],a(n),r.reject);return r.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},_.readyException=function(t){e.setTimeout(function(){throw t})};var U=_.Deferred();function j(){h.removeEventListener("DOMContentLoaded",j),e.removeEventListener("load",j),_.ready()}_.fn.ready=function(e){return U.then(e).catch(function(e){_.readyException(e)}),this},_.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==e&&--_.readyWait>0||U.resolveWith(h,[_]))}}),_.ready.then=U.then,"complete"===h.readyState||"loading"!==h.readyState&&!h.documentElement.doScroll?e.setTimeout(_.ready):(h.addEventListener("DOMContentLoaded",j),e.addEventListener("load",j));var H=function(e,t,n,l,i,o,r){var a=0,u=e.length,s=null==n;if("object"===y(n))for(a in i=!0,n)H(e,t,a,n[a],!0,o,r);else if(void 0!==l&&(i=!0,v(l)||(r=!0),s&&(r?(t.call(e,l),t=null):(s=t,t=function(e,t,n){return s.call(_(e),n)})),t))for(;a<u;a++)t(e[a],n,r?l:l.call(e[a],a,t(e[a],n)));return i?e:s?t.call(e):u?t(e[0],n):o},W=/^-ms-/,z=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function q(e){return e.replace(W,"ms-").replace(z,V)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function K(){this.expando=_.expando+K.uid++}K.uid=1,K.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var l,i=this.cache(e);if("string"==typeof t)i[q(t)]=n;else for(l in t)i[q(l)]=t[l];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][q(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,l=e[this.expando];if(void 0!==l){if(void 0!==t){n=(t=Array.isArray(t)?t.map(q):(t=q(t))in l?[t]:t.match(L)||[]).length;for(;n--;)delete l[t[n]]}(void 0===t||_.isEmptyObject(l))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!_.isEmptyObject(t)}};var Y=new K,$=new K,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function J(e,t,n){var l;if(void 0===n&&1===e.nodeType)if(l="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(l))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:X.test(e)?JSON.parse(e):e)}(n)}catch(e){}$.set(e,t,n)}else n=void 0;return n}_.extend({hasData:function(e){return $.hasData(e)||Y.hasData(e)},data:function(e,t,n){return $.access(e,t,n)},removeData:function(e,t){$.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),_.fn.extend({data:function(e,t){var n,l,i,o=this[0],r=o&&o.attributes;if(void 0===e){if(this.length&&(i=$.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=r.length;n--;)r[n]&&0===(l=r[n].name).indexOf("data-")&&(l=q(l.slice(5)),J(o,l,i[l]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){$.set(this,e)}):H(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=$.get(o,e))||void 0!==(n=J(o,e))?n:void 0;this.each(function(){$.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){$.remove(this,e)})}}),_.extend({queue:function(e,t,n){var l;if(e)return l=Y.get(e,t=(t||"fx")+"queue"),n&&(!l||Array.isArray(n)?l=Y.access(e,t,_.makeArray(n)):l.push(n)),l||[]},dequeue:function(e,t){var n=_.queue(e,t=t||"fx"),l=n.length,i=n.shift(),o=_._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),l--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){_.dequeue(e,t)},o)),!l&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:_.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?_.queue(this[0],e):void 0===t?this:this.each(function(){var n=_.queue(this,e,t);_._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&_.dequeue(this,e)})},dequeue:function(e){return this.each(function(){_.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,l=1,i=_.Deferred(),o=this,r=this.length,a=function(){--l||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";r--;)(n=Y.get(o[r],e+"queueHooks"))&&n.empty&&(l++,n.empty.add(a));return a(),i.promise(t)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ee=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),te=["Top","Right","Bottom","Left"],ne=h.documentElement,le=function(e){return _.contains(e.ownerDocument,e)},ie={composed:!0};ne.getRootNode&&(le=function(e){return _.contains(e.ownerDocument,e)||e.getRootNode(ie)===e.ownerDocument});var oe=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&le(e)&&"none"===_.css(e,"display")};function re(e,t,n,l){var i,o,r=20,a=l?function(){return l.cur()}:function(){return _.css(e,t,"")},u=a(),s=n&&n[3]||(_.cssNumber[t]?"":"px"),c=e.nodeType&&(_.cssNumber[t]||"px"!==s&&+u)&&ee.exec(_.css(e,t));if(c&&c[3]!==s){for(s=s||c[3],c=+(u/=2)||1;r--;)_.style(e,t,c+s),(1-o)*(1-(o=a()/u||.5))<=0&&(r=0),c/=o;_.style(e,t,(c*=2)+s),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],l&&(l.unit=s,l.start=c,l.end=i)),i}var ae={};function ue(e){var t,n=e.ownerDocument,l=e.nodeName,i=ae[l];return i||(t=n.body.appendChild(n.createElement(l)),i=_.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ae[l]=i,i)}function se(e,t){for(var n,l,i=[],o=0,r=e.length;o<r;o++)(l=e[o]).style&&(n=l.style.display,t?("none"===n&&(i[o]=Y.get(l,"display")||null,i[o]||(l.style.display="")),""===l.style.display&&oe(l)&&(i[o]=ue(l))):"none"!==n&&(i[o]="none",Y.set(l,"display",n)));for(o=0;o<r;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}_.fn.extend({show:function(){return se(this,!0)},hide:function(){return se(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){oe(this)?_(this).show():_(this).hide()})}});var ce,de,pe=/^(?:checkbox|radio)$/i,me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;ce=h.createDocumentFragment().appendChild(h.createElement("div")),(de=h.createElement("input")).setAttribute("type","radio"),de.setAttribute("checked","checked"),de.setAttribute("name","t"),ce.appendChild(de),m.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",m.option=!!ce.lastChild;var fe={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function he(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?_.merge([e],n):n}function Ee(e,t){for(var n=0,l=e.length;n<l;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}fe.tbody=fe.tfoot=fe.colgroup=fe.caption=fe.thead,fe.th=fe.td,m.option||(fe.optgroup=fe.option=[1,"<select multiple='multiple'>","</select>"]);var ge=/<|&#?\w+;/;function ye(e,t,n,l,i){for(var o,r,a,u,s,c,d=t.createDocumentFragment(),p=[],m=0,v=e.length;m<v;m++)if((o=e[m])||0===o)if("object"===y(o))_.merge(p,o.nodeType?[o]:o);else if(ge.test(o)){for(r=r||d.appendChild(t.createElement("div")),a=(me.exec(o)||["",""])[1].toLowerCase(),r.innerHTML=(u=fe[a]||fe._default)[1]+_.htmlPrefilter(o)+u[2],c=u[0];c--;)r=r.lastChild;_.merge(p,r.childNodes),(r=d.firstChild).textContent=""}else p.push(t.createTextNode(o));for(d.textContent="",m=0;o=p[m++];)if(l&&_.inArray(o,l)>-1)i&&i.push(o);else if(s=le(o),r=he(d.appendChild(o),"script"),s&&Ee(r),n)for(c=0;o=r[c++];)ve.test(o.type||"")&&n.push(o);return d}var _e=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function be(){return!1}function Te(e,t){return e===function(){try{return h.activeElement}catch(e){}}()==("focus"===t)}function Ce(e,t,n,l,i,o){var r,a;if("object"==typeof t){for(a in"string"!=typeof n&&(l=l||n,n=void 0),t)Ce(e,a,n,l,t[a],o);return e}if(null==l&&null==i?(i=n,l=n=void 0):null==i&&("string"==typeof n?(i=l,l=void 0):(i=l,l=n,n=void 0)),!1===i)i=be;else if(!i)return e;return 1===o&&(r=i,(i=function(e){return _().off(e),r.apply(this,arguments)}).guid=r.guid||(r.guid=_.guid++)),e.each(function(){_.event.add(this,t,i,l,n)})}function Ae(e,t,n){n?(Y.set(e,t,!1),_.event.add(e,t,{namespace:!1,handler:function(e){var l,o,r=Y.get(this,t);if(1&e.isTrigger&&this[t]){if(r.length)(_.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),Y.set(this,t,r),l=n(this,t),this[t](),r!==(o=Y.get(this,t))||l?Y.set(this,t,!1):o={},r!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else r.length&&(Y.set(this,t,{value:_.event.trigger(_.extend(r[0],_.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,t)&&_.event.add(e,t,Se)}_.event={global:{},add:function(e,t,n,l,i){var o,r,a,u,s,c,d,p,m,v,f,h=Y.get(e);if(G(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&_.find.matchesSelector(ne,i),n.guid||(n.guid=_.guid++),(u=h.events)||(u=h.events=Object.create(null)),(r=h.handle)||(r=h.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(L)||[""]).length;s--;)m=f=(a=_e.exec(t[s])||[])[1],v=(a[2]||"").split(".").sort(),m&&(d=_.event.special[m]||{},d=_.event.special[m=(i?d.delegateType:d.bindType)||m]||{},c=_.extend({type:m,origType:f,data:l,handler:n,guid:n.guid,selector:i,needsContext:i&&_.expr.match.needsContext.test(i),namespace:v.join(".")},o),(p=u[m])||((p=u[m]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,l,v,r)||e.addEventListener&&e.addEventListener(m,r)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),_.event.global[m]=!0)},remove:function(e,t,n,l,i){var o,r,a,u,s,c,d,p,m,v,f,h=Y.hasData(e)&&Y.get(e);if(h&&(u=h.events)){for(s=(t=(t||"").match(L)||[""]).length;s--;)if(m=f=(a=_e.exec(t[s])||[])[1],v=(a[2]||"").split(".").sort(),m){for(d=_.event.special[m]||{},p=u[m=(l?d.delegateType:d.bindType)||m]||[],a=a[2]&&new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=o=p.length;o--;)c=p[o],!i&&f!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||l&&l!==c.selector&&("**"!==l||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));r&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,v,h.handle)||_.removeEvent(e,m,h.handle),delete u[m])}else for(m in u)_.event.remove(e,m+t[s],n,l,!0);_.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,l,i,o,r,a=new Array(arguments.length),u=_.event.fix(e),s=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=_.event.special[u.type]||{};for(a[0]=u,t=1;t<arguments.length;t++)a[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(r=_.event.handlers.call(this,u,s),t=0;(i=r[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(l=((_.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a))&&!1===(u.result=l)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,l,i,o,r,a=[],u=t.delegateCount,s=e.target;if(u&&s.nodeType&&!("click"===e.type&&e.button>=1))for(;s!==this;s=s.parentNode||this)if(1===s.nodeType&&("click"!==e.type||!0!==s.disabled)){for(o=[],r={},n=0;n<u;n++)void 0===r[i=(l=t[n]).selector+" "]&&(r[i]=l.needsContext?_(i,this).index(s)>-1:_.find(i,this,null,[s]).length),r[i]&&o.push(l);o.length&&a.push({elem:s,handlers:o})}return s=this,u<t.length&&a.push({elem:s,handlers:t.slice(u)}),a},addProp:function(e,t){Object.defineProperty(_.Event.prototype,e,{enumerable:!0,configurable:!0,get:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[_.expando]?e:new _.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click",Se),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&D(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&D(t,"input")&&Y.get(t,"click")||D(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},_.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},_.Event=function(e,t){if(!(this instanceof _.Event))return new _.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Se:be,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&_.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[_.expando]=!0},_.Event.prototype={constructor:_.Event,isDefaultPrevented:be,isPropagationStopped:be,isImmediatePropagationStopped:be,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Se,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Se,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Se,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},_.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},_.event.addProp),_.each({focus:"focusin",blur:"focusout"},function(e,t){_.event.special[e]={setup:function(){return Ae(this,e,Te),!1},trigger:function(){return Ae(this,e),!0},_default:function(){return!0},delegateType:t}}),_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){_.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,l=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===l||_.contains(l,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),_.fn.extend({on:function(e,t,n,l){return Ce(this,e,t,n,l)},one:function(e,t,n,l){return Ce(this,e,t,n,l,1)},off:function(e,t,n){var l,i;if(e&&e.preventDefault&&e.handleObj)return l=e.handleObj,_(e.delegateTarget).off(l.namespace?l.origType+"."+l.namespace:l.origType,l.selector,l.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=be),this.each(function(){_.event.remove(this,e,n,t)})}});var De=/<script|<style|<link/i,Ne=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function xe(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&_(e).children("tbody")[0]||e}function we(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,l,i,o,r,a;if(1===t.nodeType){if(Y.hasData(e)&&(a=Y.get(e).events))for(i in Y.remove(t,"handle events"),a)for(n=0,l=a[i].length;n<l;n++)_.event.add(t,i,a[i][n]);$.hasData(e)&&(o=$.access(e),r=_.extend({},o),$.set(t,r))}}function Oe(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Le(e,t,n,l){t=o(t);var i,r,a,u,s,c,d=0,p=e.length,f=p-1,h=t[0],E=v(h);if(E||p>1&&"string"==typeof h&&!m.checkClone&&Ne.test(h))return e.each(function(i){var o=e.eq(i);E&&(t[0]=h.call(this,i,o.html())),Le(o,t,n,l)});if(p&&(r=(i=ye(t,e[0].ownerDocument,!1,e,l)).firstChild,1===i.childNodes.length&&(i=r),r||l)){for(u=(a=_.map(he(i,"script"),we)).length;d<p;d++)s=i,d!==f&&(s=_.clone(s,!0,!0),u&&_.merge(a,he(s,"script"))),n.call(e[d],s,d);if(u)for(c=a[a.length-1].ownerDocument,_.map(a,Re),d=0;d<u;d++)ve.test((s=a[d]).type||"")&&!Y.access(s,"globalEval")&&_.contains(c,s)&&(s.src&&"module"!==(s.type||"").toLowerCase()?_._evalUrl&&!s.noModule&&_._evalUrl(s.src,{nonce:s.nonce||s.getAttribute("nonce")},c):g(s.textContent.replace(Pe,""),s,c))}return e}function ke(e,t,n){for(var l,i=t?_.filter(t,e):e,o=0;null!=(l=i[o]);o++)n||1!==l.nodeType||_.cleanData(he(l)),l.parentNode&&(n&&le(l)&&Ee(he(l,"script")),l.parentNode.removeChild(l));return e}_.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var l,i,o,r,a=e.cloneNode(!0),u=le(e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||_.isXMLDoc(e)))for(r=he(a),l=0,i=(o=he(e)).length;l<i;l++)Oe(o[l],r[l]);if(t)if(n)for(o=o||he(e),r=r||he(a),l=0,i=o.length;l<i;l++)Ie(o[l],r[l]);else Ie(e,a);return(r=he(a,"script")).length>0&&Ee(r,!u&&he(e,"script")),a},cleanData:function(e){for(var t,n,l,i=_.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Y.expando]){if(t.events)for(l in t.events)i[l]?_.event.remove(n,l):_.removeEvent(n,l,t.handle);n[Y.expando]=void 0}n[$.expando]&&(n[$.expando]=void 0)}}}),_.fn.extend({detach:function(e){return ke(this,e,!0)},remove:function(e){return ke(this,e)},text:function(e){return H(this,function(e){return void 0===e?_.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Le(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||xe(this,e).appendChild(e)})},prepend:function(){return Le(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=xe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Le(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(_.cleanData(he(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return _.clone(this,e,t)})},html:function(e){return H(this,function(e){var t=this[0]||{},n=0,l=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!De.test(e)&&!fe[(me.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(_.cleanData(he(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Le(this,arguments,function(t){var n=this.parentNode;_.inArray(this,e)<0&&(_.cleanData(he(this)),n&&n.replaceChild(t,this))},e)}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){_.fn[e]=function(e){for(var n,l=[],i=_(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),_(i[a])[t](n),r.apply(l,n.get());return this.pushStack(l)}});var Me=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Fe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=function(e,t,n){var l,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in l=n.call(e),t)e.style[i]=o[i];return l},Ue=new RegExp(te.join("|"),"i");function je(e,t,n){var l,i,o,r,a=e.style;return(n=n||Fe(e))&&(""!==(r=n.getPropertyValue(t)||n[t])||le(e)||(r=_.style(e,t)),!m.pixelBoxStyles()&&Me.test(r)&&Ue.test(t)&&(l=a.width,i=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=l,a.minWidth=i,a.maxWidth=o)),void 0!==r?r+"":r}function He(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(s).appendChild(c);var t=e.getComputedStyle(c);l="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",r=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=12===n(c.offsetWidth/3),ne.removeChild(s),c=null}}function n(e){return Math.round(parseFloat(e))}var l,i,o,r,a,u,s=h.createElement("div"),c=h.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,_.extend(m,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),r},pixelPosition:function(){return t(),l},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,l,i;return null==a&&(t=h.createElement("table"),n=h.createElement("tr"),l=h.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",l.style.height="9px",l.style.display="block",ne.appendChild(t).appendChild(n).appendChild(l),i=e.getComputedStyle(n),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,ne.removeChild(t)),a}}))}();var We=["Webkit","Moz","ms"],ze=h.createElement("div").style,Ve={};function qe(e){return _.cssProps[e]||Ve[e]||(e in ze?e:Ve[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in ze)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ke=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},$e={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,n){var l=ee.exec(t);return l?Math.max(0,l[2]-(n||0))+(l[3]||"px"):t}function Ze(e,t,n,l,i,o){var r="width"===t?1:0,a=0,u=0;if(n===(l?"border":"content"))return 0;for(;r<4;r+=2)"margin"===n&&(u+=_.css(e,n+te[r],!0,i)),l?("content"===n&&(u-=_.css(e,"padding"+te[r],!0,i)),"margin"!==n&&(u-=_.css(e,"border"+te[r]+"Width",!0,i))):(u+=_.css(e,"padding"+te[r],!0,i),"padding"!==n?u+=_.css(e,"border"+te[r]+"Width",!0,i):a+=_.css(e,"border"+te[r]+"Width",!0,i));return!l&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-a-.5))||0),u}function Je(e,t,n){var l=Fe(e),i=(!m.boxSizingReliable()||n)&&"border-box"===_.css(e,"boxSizing",!1,l),o=i,r=je(e,t,l),a="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(r)){if(!n)return r;r="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&D(e,"tr")||"auto"===r||!parseFloat(r)&&"inline"===_.css(e,"display",!1,l))&&e.getClientRects().length&&(i="border-box"===_.css(e,"boxSizing",!1,l),(o=a in e)&&(r=e[a])),(r=parseFloat(r)||0)+Ze(e,t,n||(i?"border":"content"),o,l,r)+"px"}function Qe(e,t,n,l,i){return new Qe.prototype.init(e,t,n,l,i)}_.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,l){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,r,a=q(t),u=Ke.test(t),s=e.style;if(u||(t=qe(a)),r=_.cssHooks[t]||_.cssHooks[a],void 0===n)return r&&"get"in r&&void 0!==(i=r.get(e,!1,l))?i:s[t];"string"==(o=typeof n)&&(i=ee.exec(n))&&i[1]&&(n=re(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(_.cssNumber[a]?"":"px")),m.clearCloneStyle||""!==n||0!==t.indexOf("background")||(s[t]="inherit"),r&&"set"in r&&void 0===(n=r.set(e,n,l))||(u?s.setProperty(t,n):s[t]=n))}},css:function(e,t,n,l){var i,o,r,a=q(t);return Ke.test(t)||(t=qe(a)),(r=_.cssHooks[t]||_.cssHooks[a])&&"get"in r&&(i=r.get(e,!0,n)),void 0===i&&(i=je(e,t,l)),"normal"===i&&t in $e&&(i=$e[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),_.each(["height","width"],function(e,t){_.cssHooks[t]={get:function(e,n,l){if(n)return!Ge.test(_.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,l):Be(e,Ye,function(){return Je(e,t,l)})},set:function(e,n,l){var i,o=Fe(e),r=!m.scrollboxSize()&&"absolute"===o.position,a=(r||l)&&"border-box"===_.css(e,"boxSizing",!1,o),u=l?Ze(e,t,l,a,o):0;return a&&r&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),u&&(i=ee.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=_.css(e,t)),Xe(0,n,u)}}}),_.cssHooks.marginLeft=He(m.reliableMarginLeft,function(e,t){if(t)return(parseFloat(je(e,"marginLeft"))||e.getBoundingClientRect().left-Be(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),_.each({margin:"",padding:"",border:"Width"},function(e,t){_.cssHooks[e+t]={expand:function(n){for(var l=0,i={},o="string"==typeof n?n.split(" "):[n];l<4;l++)i[e+te[l]+t]=o[l]||o[l-2]||o[0];return i}},"margin"!==e&&(_.cssHooks[e+t].set=Xe)}),_.fn.extend({css:function(e,t){return H(this,function(e,t,n){var l,i,o={},r=0;if(Array.isArray(t)){for(l=Fe(e),i=t.length;r<i;r++)o[t[r]]=_.css(e,t[r],!1,l);return o}return void 0!==n?_.style(e,t,n):_.css(e,t)},e,t,arguments.length>1)}}),_.Tween=Qe,(Qe.prototype={constructor:Qe,init:function(e,t,n,l,i,o){this.elem=e,this.prop=n,this.easing=i||_.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=l,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,n=Qe.propHooks[this.prop];return this.pos=t=this.options.duration?_.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=_.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){_.fx.step[e.prop]?_.fx.step[e.prop](e):1!==e.elem.nodeType||!_.cssHooks[e.prop]&&null==e.elem.style[qe(e.prop)]?e.elem[e.prop]=e.now:_.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},_.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},_.fx=Qe.prototype.init,_.fx.step={};var et,tt,nt=/^(?:toggle|show|hide)$/,lt=/queueHooks$/;function it(){tt&&(!1===h.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(it):e.setTimeout(it,_.fx.interval),_.fx.tick())}function ot(){return e.setTimeout(function(){et=void 0}),et=Date.now()}function rt(e,t){var n,l=0,i={height:e};for(t=t?1:0;l<4;l+=2-t)i["margin"+(n=te[l])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function at(e,t,n){for(var l,i=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),o=0,r=i.length;o<r;o++)if(l=i[o].call(n,t,e))return l}function ut(e,t,n){var l,i,o=0,r=ut.prefilters.length,a=_.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=et||ot(),n=Math.max(0,s.startTime+s.duration-t),l=1-(n/s.duration||0),o=0,r=s.tweens.length;o<r;o++)s.tweens[o].run(l);return a.notifyWith(e,[s,l,n]),l<1&&r?n:(r||a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s]),!1)},s=a.promise({elem:e,props:_.extend({},t),opts:_.extend(!0,{specialEasing:{},easing:_.easing._default},n),originalProperties:t,originalOptions:n,startTime:et||ot(),duration:n.duration,tweens:[],createTween:function(t,n){var l=_.Tween(e,s.opts,t,n,s.opts.specialEasing[t]||s.opts.easing);return s.tweens.push(l),l},stop:function(t){var n=0,l=t?s.tweens.length:0;if(i)return this;for(i=!0;n<l;n++)s.tweens[n].run(1);return t?(a.notifyWith(e,[s,1,0]),a.resolveWith(e,[s,t])):a.rejectWith(e,[s,t]),this}}),c=s.props;for(function(e,t){var n,l,i,o,r;for(n in e)if(i=t[l=q(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==l&&(e[l]=o,delete e[n]),(r=_.cssHooks[l])&&"expand"in r)for(n in o=r.expand(o),delete e[l],o)n in e||(e[n]=o[n],t[n]=i);else t[l]=i}(c,s.opts.specialEasing);o<r;o++)if(l=ut.prefilters[o].call(s,e,c,s.opts))return v(l.stop)&&(_._queueHooks(s.elem,s.opts.queue).stop=l.stop.bind(l)),l;return _.map(c,at,s),v(s.opts.start)&&s.opts.start.call(e,s),s.progress(s.opts.progress).done(s.opts.done,s.opts.complete).fail(s.opts.fail).always(s.opts.always),_.fx.timer(_.extend(u,{elem:e,anim:s,queue:s.opts.queue})),s}_.Animation=_.extend(ut,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return re(n.elem,e,ee.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(L);for(var n,l=0,i=e.length;l<i;l++)(ut.tweeners[n=e[l]]=ut.tweeners[n]||[]).unshift(t)},prefilters:[function(e,t,n){var l,i,o,r,a,u,s,c,d="width"in t||"height"in t,p=this,m={},v=e.style,f=e.nodeType&&oe(e),h=Y.get(e,"fxshow");for(l in n.queue||(null==(r=_._queueHooks(e,"fx")).unqueued&&(r.unqueued=0,a=r.empty.fire,r.empty.fire=function(){r.unqueued||a()}),r.unqueued++,p.always(function(){p.always(function(){r.unqueued--,_.queue(e,"fx").length||r.empty.fire()})})),t)if(nt.test(i=t[l])){if(delete t[l],o=o||"toggle"===i,i===(f?"hide":"show")){if("show"!==i||!h||void 0===h[l])continue;f=!0}m[l]=h&&h[l]||_.style(e,l)}if((u=!_.isEmptyObject(t))||!_.isEmptyObject(m))for(l in d&&1===e.nodeType&&(n.overflow=[v.overflow,v.overflowX,v.overflowY],null==(s=h&&h.display)&&(s=Y.get(e,"display")),"none"===(c=_.css(e,"display"))&&(s?c=s:(se([e],!0),s=e.style.display||s,c=_.css(e,"display"),se([e]))),("inline"===c||"inline-block"===c&&null!=s)&&"none"===_.css(e,"float")&&(u||(p.done(function(){v.display=s}),null==s&&(s="none"===(c=v.display)?"":c)),v.display="inline-block")),n.overflow&&(v.overflow="hidden",p.always(function(){v.overflow=n.overflow[0],v.overflowX=n.overflow[1],v.overflowY=n.overflow[2]})),u=!1,m)u||(h?"hidden"in h&&(f=h.hidden):h=Y.access(e,"fxshow",{display:s}),o&&(h.hidden=!f),f&&se([e],!0),p.done(function(){for(l in f||se([e]),Y.remove(e,"fxshow"),m)_.style(e,l,m[l])})),u=at(f?h[l]:0,l,p),l in h||(h[l]=u.start,f&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ut.prefilters.unshift(e):ut.prefilters.push(e)}}),_.speed=function(e,t,n){var l=e&&"object"==typeof e?_.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return _.fx.off?l.duration=0:"number"!=typeof l.duration&&(l.duration=l.duration in _.fx.speeds?_.fx.speeds[l.duration]:_.fx.speeds._default),null!=l.queue&&!0!==l.queue||(l.queue="fx"),l.old=l.complete,l.complete=function(){v(l.old)&&l.old.call(this),l.queue&&_.dequeue(this,l.queue)},l},_.fn.extend({fadeTo:function(e,t,n,l){return this.filter(oe).css("opacity",0).show().end().animate({opacity:t},e,n,l)},animate:function(e,t,n,l){var i=_.isEmptyObject(e),o=_.speed(t,n,l),r=function(){var t=ut(this,_.extend({},e),o);(i||Y.get(this,"finish"))&&t.stop(!0)};return r.finish=r,i||!1===o.queue?this.each(r):this.queue(o.queue,r)},stop:function(e,t,n){var l=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=_.timers,r=Y.get(this);if(i)r[i]&&r[i].stop&&l(r[i]);else for(i in r)r[i]&&r[i].stop&<.test(i)&&l(r[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||_.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Y.get(this),l=n[e+"queue"],i=n[e+"queueHooks"],o=_.timers,r=l?l.length:0;for(n.finish=!0,_.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<r;t++)l[t]&&l[t].finish&&l[t].finish.call(this);delete n.finish})}}),_.each(["toggle","show","hide"],function(e,t){var n=_.fn[t];_.fn[t]=function(e,l,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(rt(t,!0),e,l,i)}}),_.each({slideDown:rt("show"),slideUp:rt("hide"),slideToggle:rt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){_.fn[e]=function(e,n,l){return this.animate(t,e,n,l)}}),_.timers=[],_.fx.tick=function(){var e,t=0,n=_.timers;for(et=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||_.fx.stop(),et=void 0},_.fx.timer=function(e){_.timers.push(e),_.fx.start()},_.fx.interval=13,_.fx.start=function(){tt||(tt=!0,it())},_.fx.stop=function(){tt=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(t,n){return t=_.fx&&_.fx.speeds[t]||t,this.queue(n=n||"fx",function(n,l){var i=e.setTimeout(n,t);l.stop=function(){e.clearTimeout(i)}})},function(){var e=h.createElement("input"),t=h.createElement("select").appendChild(h.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=h.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var st,ct=_.expr.attrHandle;_.fn.extend({attr:function(e,t){return H(this,_.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){_.removeAttr(this,e)})}}),_.extend({attr:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?_.prop(e,t,n):(1===o&&_.isXMLDoc(e)||(i=_.attrHooks[t.toLowerCase()]||(_.expr.match.bool.test(t)?st:void 0)),void 0!==n?null===n?void _.removeAttr(e,t):i&&"set"in i&&void 0!==(l=i.set(e,n,t))?l:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(l=i.get(e,t))?l:null==(l=_.find.attr(e,t))?void 0:l)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,l=0,i=t&&t.match(L);if(i&&1===e.nodeType)for(;n=i[l++];)e.removeAttribute(n)}}),st={set:function(e,t,n){return!1===t?_.removeAttr(e,n):e.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||_.find.attr;ct[t]=function(e,t,l){var i,o,r=t.toLowerCase();return l||(o=ct[r],ct[r]=i,i=null!=n(e,t,l)?r:null,ct[r]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function mt(e){return(e.match(L)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(L)||[]}_.fn.extend({prop:function(e,t){return H(this,_.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[_.propFix[e]||e]})}}),_.extend({prop:function(e,t,n){var l,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(e)||(i=_.propHooks[t=_.propFix[t]||t]),void 0!==n?i&&"set"in i&&void 0!==(l=i.set(e,n,t))?l:e[t]=n:i&&"get"in i&&null!==(l=i.get(e,t))?l:e[t]},propHooks:{tabIndex:{get:function(e){var t=_.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(_.propHooks.selected={get:function(e){return null},set:function(e){}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this}),_.fn.extend({addClass:function(e){var t,n,l,i,o,r,a,u=0;if(v(e))return this.each(function(t){_(this).addClass(e.call(this,t,vt(this)))});if((t=ft(e)).length)for(;n=this[u++];)if(i=vt(n),l=1===n.nodeType&&" "+mt(i)+" "){for(r=0;o=t[r++];)l.indexOf(" "+o+" ")<0&&(l+=o+" ");i!==(a=mt(l))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,l,i,o,r,a,u=0;if(v(e))return this.each(function(t){_(this).removeClass(e.call(this,t,vt(this)))});if(!arguments.length)return this.attr("class","");if((t=ft(e)).length)for(;n=this[u++];)if(i=vt(n),l=1===n.nodeType&&" "+mt(i)+" "){for(r=0;o=t[r++];)for(;l.indexOf(" "+o+" ")>-1;)l=l.replace(" "+o+" "," ");i!==(a=mt(l))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,l="string"===n||Array.isArray(e);return"boolean"==typeof t&&l?t?this.addClass(e):this.removeClass(e):v(e)?this.each(function(n){_(this).toggleClass(e.call(this,n,vt(this),t),t)}):this.each(function(){var t,i,o,r;if(l)for(i=0,o=_(this),r=ft(e);t=r[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=vt(this))&&Y.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,l=0;for(t=" "+e+" ";n=this[l++];)if(1===n.nodeType&&(" "+mt(vt(n))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;_.fn.extend({val:function(e){var t,n,l,i=this[0];return arguments.length?(l=v(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=l?e.call(this,n,_(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=_.map(i,function(e){return null==e?"":e+""})),(t=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=_.valHooks[i.type]||_.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(ht,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(e){var t=_.find.attr(e,"value");return null!=t?t:mt(_.text(e))}},select:{get:function(e){var t,n,l,i=e.options,o=e.selectedIndex,r="select-one"===e.type,a=r?null:[],u=r?o+1:i.length;for(l=o<0?u:r?o:0;l<u;l++)if(((n=i[l]).selected||l===o)&&!n.disabled&&(!n.parentNode.disabled||!D(n.parentNode,"optgroup"))){if(t=_(n).val(),r)return t;a.push(t)}return a},set:function(e,t){for(var n,l,i=e.options,o=_.makeArray(t),r=i.length;r--;)((l=i[r]).selected=_.inArray(_.valHooks.option.get(l),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=_.inArray(_(e).val(),t)>-1}},m.checkOn||(_.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),m.focusin="onfocusin"in e;var Et=/^(?:focusinfocus|focusoutblur)$/,gt=function(e){e.stopPropagation()};_.extend(_.event,{trigger:function(t,n,l,i){var o,r,a,u,s,d,p,m,E=[l||h],g=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(r=m=a=l=l||h,3!==l.nodeType&&8!==l.nodeType&&!Et.test(g+_.event.triggered)&&(g.indexOf(".")>-1&&(y=g.split("."),g=y.shift(),y.sort()),s=g.indexOf(":")<0&&"on"+g,(t=t[_.expando]?t:new _.Event(g,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=y.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=l),n=null==n?[t]:_.makeArray(n,[t]),p=_.event.special[g]||{},i||!p.trigger||!1!==p.trigger.apply(l,n))){if(!i&&!p.noBubble&&!f(l)){for(Et.test((u=p.delegateType||g)+g)||(r=r.parentNode);r;r=r.parentNode)E.push(r),a=r;a===(l.ownerDocument||h)&&E.push(a.defaultView||a.parentWindow||e)}for(o=0;(r=E[o++])&&!t.isPropagationStopped();)m=r,t.type=o>1?u:p.bindType||g,(d=(Y.get(r,"events")||Object.create(null))[t.type]&&Y.get(r,"handle"))&&d.apply(r,n),(d=s&&r[s])&&d.apply&&G(r)&&(t.result=d.apply(r,n),!1===t.result&&t.preventDefault());return t.type=g,i||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(E.pop(),n)||!G(l)||s&&v(l[g])&&!f(l)&&((a=l[s])&&(l[s]=null),_.event.triggered=g,t.isPropagationStopped()&&m.addEventListener(g,gt),l[g](),t.isPropagationStopped()&&m.removeEventListener(g,gt),_.event.triggered=void 0,a&&(l[s]=a)),t.result}},simulate:function(e,t,n){var l=_.extend(new _.Event,n,{type:e,isSimulated:!0});_.event.trigger(l,null,t)}}),_.fn.extend({trigger:function(e,t){return this.each(function(){_.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return _.event.trigger(e,t,n,!0)}}),m.focusin||_.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){_.event.simulate(t,e.target,_.event.fix(e))};_.event.special[t]={setup:function(){var l=this.ownerDocument||this.document||this,i=Y.access(l,t);i||l.addEventListener(e,n,!0),Y.access(l,t,(i||0)+1)},teardown:function(){var l=this.ownerDocument||this.document||this,i=Y.access(l,t)-1;i?Y.access(l,t,i):(l.removeEventListener(e,n,!0),Y.remove(l,t))}}});var yt=e.location,_t={guid:Date.now()},St=/\?/;_.parseXML=function(t){var n,l;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return l=n&&n.getElementsByTagName("parsererror")[0],n&&!l||_.error("Invalid XML: "+(l?_.map(l.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var bt=/\[\]$/,Tt=/\r?\n/g,Ct=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function Dt(e,t,n,l){var i;if(Array.isArray(t))_.each(t,function(t,i){n||bt.test(e)?l(e,i):Dt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,l)});else if(n||"object"!==y(t))l(e,t);else for(i in t)Dt(e+"["+i+"]",t[i],n,l)}_.param=function(e,t){var n,l=[],i=function(e,t){var n=v(t)?t():t;l[l.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!_.isPlainObject(e))_.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return l.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=_.prop(this,"elements");return e?_.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!_(this).is(":disabled")&&At.test(this.nodeName)&&!Ct.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:n.replace(Tt,"\r\n")}}).get()}});var Nt=/%20/g,Pt=/#.*$/,xt=/([?&])_=[^&]*/,wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,It=/^\/\//,Ot={},Lt={},kt="*/".concat("*"),Mt=h.createElement("a");function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(L)||[];if(v(n))for(;l=o[i++];)"+"===l[0]?(l=l.slice(1)||"*",(e[l]=e[l]||[]).unshift(n)):(e[l]=e[l]||[]).push(n)}}function Bt(e,t,n,l){var i={},o=e===Lt;function r(a){var u;return i[a]=!0,_.each(e[a]||[],function(e,a){var s=a(t,n,l);return"string"!=typeof s||o||i[s]?o?!(u=s):void 0:(t.dataTypes.unshift(s),r(s),!1)}),u}return r(t.dataTypes[0])||!i["*"]&&r("*")}function Ut(e,t){var n,l,i=_.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:l||(l={}))[n]=t[n]);return l&&_.extend(!0,e,l),e}Mt.href=yt.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,_.ajaxSettings),t):Ut(_.ajaxSettings,e)},ajaxPrefilter:Ft(Ot),ajaxTransport:Ft(Lt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0);var l,i,o,r,a,u,s,c,d,p,m=_.ajaxSetup({},n=n||{}),v=m.context||m,f=m.context&&(v.nodeType||v.jquery)?_(v):_.event,E=_.Deferred(),g=_.Callbacks("once memory"),y=m.statusCode||{},S={},b={},T="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(s){if(!r)for(r={};t=wt.exec(o);)r[t[1].toLowerCase()+" "]=(r[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=r[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return s?o:null},setRequestHeader:function(e,t){return null==s&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,S[e]=t),this},overrideMimeType:function(e){return null==s&&(m.mimeType=e),this},statusCode:function(e){var t;if(e)if(s)C.always(e[C.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||T;return l&&l.abort(t),A(0,t),this}};if(E.promise(C),m.url=((t||m.url||yt.href)+"").replace(It,yt.protocol+"//"),m.type=n.method||n.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(L)||[""],null==m.crossDomain){u=h.createElement("a");try{u.href=m.url,u.href=u.href,m.crossDomain=Mt.protocol+"//"+Mt.host!=u.protocol+"//"+u.host}catch(e){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=_.param(m.data,m.traditional)),Bt(Ot,m,n,C),s)return C;for(d in(c=_.event&&m.global)&&0==_.active++&&_.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Rt.test(m.type),i=m.url.replace(Pt,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace(Nt,"+")):(p=m.url.slice(i.length),m.data&&(m.processData||"string"==typeof m.data)&&(i+=(St.test(i)?"&":"?")+m.data,delete m.data),!1===m.cache&&(i=i.replace(xt,"$1"),p=(St.test(i)?"&":"?")+"_="+_t.guid+++p),m.url=i+p),m.ifModified&&(_.lastModified[i]&&C.setRequestHeader("If-Modified-Since",_.lastModified[i]),_.etag[i]&&C.setRequestHeader("If-None-Match",_.etag[i])),(m.data&&m.hasContent&&!1!==m.contentType||n.contentType)&&C.setRequestHeader("Content-Type",m.contentType),C.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+kt+"; q=0.01":""):m.accepts["*"]),m.headers)C.setRequestHeader(d,m.headers[d]);if(m.beforeSend&&(!1===m.beforeSend.call(v,C,m)||s))return C.abort();if(T="abort",g.add(m.complete),C.done(m.success),C.fail(m.error),l=Bt(Lt,m,n,C)){if(C.readyState=1,c&&f.trigger("ajaxSend",[C,m]),s)return C;m.async&&m.timeout>0&&(a=e.setTimeout(function(){C.abort("timeout")},m.timeout));try{s=!1,l.send(S,A)}catch(e){if(s)throw e;A(-1,e)}}else A(-1,"No Transport");function A(t,n,r,u){var d,p,h,S,b,T=n;s||(s=!0,a&&e.clearTimeout(a),l=void 0,o=u||"",C.readyState=t>0?4:0,d=t>=200&&t<300||304===t,r&&(S=function(e,t,n){for(var l,i,o,r,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===l&&(l=e.mimeType||t.getResponseHeader("Content-Type"));if(l)for(i in a)if(a[i]&&a[i].test(l)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}r||(r=i)}o=o||r}if(o)return o!==u[0]&&u.unshift(o),n[o]}(m,C,r)),!d&&_.inArray("script",m.dataTypes)>-1&&_.inArray("json",m.dataTypes)<0&&(m.converters["text script"]=function(){}),S=function(e,t,n,l){var i,o,r,a,u,s={},c=e.dataTypes.slice();if(c[1])for(r in e.converters)s[r.toLowerCase()]=e.converters[r];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&l&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(r=s[u+" "+o]||s["* "+o]))for(i in s)if((a=i.split(" "))[1]===o&&(r=s[u+" "+a[0]]||s["* "+a[0]])){!0===r?r=s[i]:!0!==s[i]&&(o=a[0],c.unshift(a[1]));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(m,S,C,d),d?(m.ifModified&&((b=C.getResponseHeader("Last-Modified"))&&(_.lastModified[i]=b),(b=C.getResponseHeader("etag"))&&(_.etag[i]=b)),204===t||"HEAD"===m.type?T="nocontent":304===t?T="notmodified":(T=S.state,p=S.data,d=!(h=S.error))):(h=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(n||T)+"",d?E.resolveWith(v,[p,T,C]):E.rejectWith(v,[C,T,h]),C.statusCode(y),y=void 0,c&&f.trigger(d?"ajaxSuccess":"ajaxError",[C,m,d?p:h]),g.fireWith(v,[C,T]),c&&(f.trigger("ajaxComplete",[C,m]),--_.active||_.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return _.get(e,t,n,"json")},getScript:function(e,t){return _.get(e,void 0,t,"script")}}),_.each(["get","post"],function(e,t){_[t]=function(e,n,l,i){return v(n)&&(i=i||l,l=n,n=void 0),_.ajax(_.extend({url:e,type:t,dataType:i,data:n,success:l},_.isPlainObject(e)&&e))}}),_.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),_._evalUrl=function(e,t,n){return _.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){_.globalEval(e,t,n)}})},_.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=_(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return v(e)?this.each(function(t){_(this).wrapInner(e.call(this,t))}):this.each(function(){var t=_(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v(e);return this.each(function(n){_(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){_(this).replaceWith(this.childNodes)}),this}}),_.expr.pseudos.hidden=function(e){return!_.expr.pseudos.visible(e)},_.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var jt={0:200,1223:204},Ht=_.ajaxSettings.xhr();m.cors=!!Ht&&"withCredentials"in Ht,m.ajax=Ht=!!Ht,_.ajaxTransport(function(t){var n,l;if(m.cors||Ht&&!t.crossDomain)return{send:function(i,o){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];for(r in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(r,i[r]);n=function(e){return function(){n&&(n=l=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(jt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),l=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=l:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&l()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),_.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return _.globalEval(e),e}}}),_.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),_.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(l,i){t=_("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),h.head.appendChild(t[0])},abort:function(){n&&n()}}});var Wt,zt=[],Vt=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||_.expando+"_"+_t.guid++;return this[e]=!0,e}}),_.ajaxPrefilter("json jsonp",function(t,n,l){var i,o,r,a=!1!==t.jsonp&&(Vt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Vt,"$1"+i):!1!==t.jsonp&&(t.url+=(St.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return r||_.error(i+" was not called"),r[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){r=arguments},l.always(function(){void 0===o?_(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,zt.push(i)),r&&v(o)&&o(r[0]),r=o=void 0}),"script"}),m.createHTMLDocument=((Wt=h.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),_.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?((l=(t=h.implementation.createHTMLDocument("")).createElement("base")).href=h.location.href,t.head.appendChild(l)):t=h),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ye([e],t,o),o&&o.length&&_(o).remove(),_.merge([],i.childNodes)));var l,i,o},_.fn.load=function(e,t,n){var l,i,o,r=this,a=e.indexOf(" ");return a>-1&&(l=mt(e.slice(a)),e=e.slice(0,a)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),r.length>0&&_.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,r.html(l?_("<div>").append(_.parseHTML(e)).find(l):e)}).always(n&&function(e,t){r.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},_.expr.pseudos.animated=function(e){return _.grep(_.timers,function(t){return e===t.elem}).length},_.offset={setOffset:function(e,t,n){var l,i,o,r,a,u,s=_.css(e,"position"),c=_(e),d={};"static"===s&&(e.style.position="relative"),a=c.offset(),o=_.css(e,"top"),u=_.css(e,"left"),("absolute"===s||"fixed"===s)&&(o+u).indexOf("auto")>-1?(r=(l=c.position()).top,i=l.left):(r=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,_.extend({},a))),null!=t.top&&(d.top=t.top-a.top+r),null!=t.left&&(d.left=t.left-a.left+i),"using"in t?t.using.call(e,d):c.css(d)}},_.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){_.offset.setOffset(this,e,t)});var t,n,l=this[0];return l?l.getClientRects().length?{top:(t=l.getBoundingClientRect()).top+(n=l.ownerDocument.defaultView).pageYOffset,left:t.left+n.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,l=this[0],i={top:0,left:0};if("fixed"===_.css(l,"position"))t=l.getBoundingClientRect();else{for(t=this.offset(),n=l.ownerDocument,e=l.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===_.css(e,"position");)e=e.parentNode;e&&e!==l&&1===e.nodeType&&((i=_(e).offset()).top+=_.css(e,"borderTopWidth",!0),i.left+=_.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-_.css(l,"marginTop",!0),left:t.left-i.left-_.css(l,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===_.css(e,"position");)e=e.offsetParent;return e||ne})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;_.fn[e]=function(l){return H(this,function(e,l,i){var o;if(f(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[l];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[l]=i},e,l,arguments.length)}}),_.each(["top","left"],function(e,t){_.cssHooks[t]=He(m.pixelPosition,function(e,n){if(n)return n=je(e,t),Me.test(n)?_(e).position()[t]+"px":n})}),_.each({Height:"height",Width:"width"},function(e,t){_.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,l){_.fn[l]=function(i,o){var r=arguments.length&&(n||"boolean"!=typeof i),a=n||(!0===i||!0===o?"margin":"border");return H(this,function(t,n,i){var o;return f(t)?0===l.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?_.css(t,n,a):_.style(t,n,i,a)},t,r?i:void 0,r)}})}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){_.fn[t]=function(e){return this.on(t,e)}}),_.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,l){return this.on(t,e,n,l)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),_.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){_.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var qt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;_.proxy=function(e,t){var n,l,o;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return l=i.call(arguments,2),(o=function(){return e.apply(t||this,l.concat(i.call(arguments)))}).guid=e.guid=e.guid||_.guid++,o},_.holdReady=function(e){e?_.readyWait++:_.ready(!0)},_.isArray=Array.isArray,_.parseJSON=JSON.parse,_.nodeName=D,_.isFunction=v,_.isWindow=f,_.camelCase=q,_.type=y,_.now=Date.now,_.isNumeric=function(e){var t=_.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},_.trim=function(e){return null==e?"":(e+"").replace(qt,"")};var Gt=e.jQuery,Kt=e.$;return _.noConflict=function(t){return e.$===_&&(e.$=Kt),t&&e.jQuery===_&&(e.jQuery=Gt),_},void 0===t&&(e.jQuery=e.$=_),_})});const C=e=>{var n,o,r;let{data:a,OpenImage:u}=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(t.TelePhone,{mobile:a.mobileNumber}),a.source&&l.createElement("p",null,s("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,s("WF_COMMON_COMMENTS")),l.createElement("p",{style:{overflowX:"scroll"}},e)))):null,(null==a||null===(o=a.thumbnailsToShow)||void 0===o||null===(r=o.thumbs)||void 0===r?void 0:r.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)},A=e=>{var r,a,u,s,c,d,p;const{t:m}=i.useTranslation(),v=null==e||null===(r=e.application)||void 0===r||null===(a=r.workflow)||void 0===a?void 0:a.businessService,{isLoading:f,data:h}=Digit.Hooks.useWorkflowDetails({tenantId:null===(u=e.application)||void 0===u?void 0:u.tenantId,id:null===(s=e.application)||void 0===s?void 0:s.applicationNumber,moduleCode:v});function E(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const g=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(C,{data:o})}if(t.state){var o,r,a,u,s;const e={date:null==t||null===(o=t.auditDetails)||void 0===o?void 0:o.lastModified,name:null==t||null===(r=t.assignes)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.name,mobileNumber:null==t||null===(u=t.assignes)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.mobileNumber,comment:m(null==t?void 0:t.comment),wfComment:t.wfComment,thumbnailsToShow:null==t?void 0:t.thumbnailsToShow};return l.createElement(C,{data:e,OpenImage:E})}{var c,d;const n={date:Digit.DateUtils.ConvertTimestampToDate(null===(c=e.application)||void 0===c?void 0:c.auditDetails.lastModified),name:null==t||null===(d=t.assigner)||void 0===d?void 0:d.name,comment:m(null==t?void 0:t.comment)};return l.createElement(C,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==h||null===(c=h.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},m("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=h&&h.timeline&&1===(null==h||null===(d=h.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:m((null==h||null===(p=h.timeline[0])||void 0===p?void 0:p.state)&&"WF_"+v+"_"+h.timeline[0].state||"NA"),customChild:g(null==h?void 0:h.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==h?void 0:h.timeline)&&(null==h?void 0:h.timeline.map((e,n,i)=>{var o;let r="";var a,u,s,c,d,p,v,f;return window.location.href.includes("/obps/")&&(r=null!==(a=workflowDetails)&&void 0!==a&&null!==(u=a.data)&&void 0!==u&&null!==(s=u.timeline[n-1])&&void 0!==s&&null!==(c=s.state)&&void 0!==c&&c.includes("BACK_FROM")||null!==(d=workflowDetails)&&void 0!==d&&null!==(p=d.data)&&void 0!==p&&null!==(v=p.timeline[n-1])&&void 0!==v&&null!==(f=v.state)&&void 0!==f&&f.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,label:m("ES_PTR_COMMON_STATUS_"+(null==h||null===(o=h.processInstances[n].state)||void 0===o?void 0:o.state)+r),customChild:g(e)}))})))),h&&(n=>{var i,r,a;let u=n[0];const s=n.map(e=>e.action);if(s.includes("PAY")||s.includes("EDIT")){let e=s.indexOf("EDIT")||s.indexOf("PAY");e=-1!=e?e:s.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/"+v+"/"+(null==e||null===(r=e.application)||void 0===r?void 0:r.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:m("CS_APPLICATION_DETAILS_MAKE_PAYMENT")}))):null;case"SUBMIT_FEEDBACK":return l.createElement("div",{style:{marginTop:"24px"}},l.createElement(o.Link,{to:"/digit-ui/citizen/fsm/rate/"+e.id},l.createElement(t.SubmitBar,{label:m("CS_APPLICATION_DETAILS_RATE")})));default:return null}})(null==h?void 0:h.nextActions))},D=["path","url"],N=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],P=()=>{var e,n,r,a,c,d;const p=o.useRouteMatch(),{path:m}=p,{t:v}=(s(p,D),i.useTranslation()),f=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRCreatePet"),h=null===(r=Digit)||void 0===r||null===(a=r.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRApplicationDetails"),E=null===(c=Digit)||void 0===c||null===(d=c.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===(g=N)&&(g=[]),g.filter(e=>window.location.href.includes(e.screenPath)).length>0?"":l.createElement(t.BackButton,null,"Back")),l.createElement(t.PrivateRoute,{path:m+"/petservice/new-application",component:f}),l.createElement(t.PrivateRoute,{path:m+"/petservice/application/:acknowledgementIds/:tenantId",component:h}),l.createElement(t.PrivateRoute,{path:m+"/petservice/my-applications",component:E}),l.createElement(t.PrivateRoute,{path:m+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:v,parentRoute:m}))}))));var g},x=e=>{let{jumpTo:n}=e;const{t:r}=i.useTranslation(),a=o.useHistory();return l.createElement(t.LinkButton,{label:r("CS_COMMON_CHANGE"),className:"check-page-link-button",onClick:function(){a.push(n)}})},w=e=>e.substr(0,1).toUpperCase()+e.substr(1),R=(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},{title:t("PTR_PET_SEX"),value:null==e?void 0:e.petDetails.petGender}];return{title:t("ES_TITILE_PET_DETAILS"),values:n}},I=function(e,t,n){try{var l;function i(l){var i,o,r,a,u,s,c;return{t:n,tenantId:null==t?void 0:t.code,name:n(null==t?void 0:t.i18nKey)+" "+(c=n("ULBGRADE_"+(null==t||null===(i=t.city)||void 0===i?void 0:i.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))),c.toLowerCase().split(" ").map(w).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_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}]},R(e,n),{title:n("PTR_LOCATION_DETAILS"),values:[{title:n("PTR_PINCODE"),value:null==e||null===(r=e.address)||void 0===r?void 0:r.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===(s=e.address)||void 0===s?void 0:s.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)}},O=e=>{const{t:t}=i.useTranslation();return e.isSuccess?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_SUCCESS"):t("ES_PTR_RESPONSE_CREATE_ACTION"):e.isLoading?window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_PENDING"):t("CS_PTR_APPLICATION_PENDING"):e.isSuccess?void 0:window.location.href.includes("edit-application")?t("CS_PTR_UPDATE_APPLICATION_FAILED"):t("CS_PTR_APPLICATION_FAILED")},L={padding:"4px 0px",justifyContent:"space-between"},k=e=>{var n;return l.createElement(t.Banner,{message:O(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%"}})},M=e=>{var n;let{application:r,buttonLabel:a}=e;const{t:u}=i.useTranslation();return l.createElement(t.Card,null,l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_NO_LABEL"),note:null==r?void 0:r.applicationNumber}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICANT_NAME"),note:null==r?void 0:r.applicantName}),l.createElement(t.KeyNote,{keyValue:u("PTR_APPLICATION_CATEGORY"),note:u("PTR_APPLICATION")}),l.createElement(t.KeyNote,{keyValue:u("PTR_SEARCH_PET_TYPE"),note:null==r||null===(n=r.petDetails)||void 0===n?void 0:n.petType}),l.createElement(t.KeyNote,{keyValue:u("PT_COMMON_TABLE_COL_STATUS_LABEL"),note:u("PTR_COMMON_"+(null==r?void 0:r.status))}),l.createElement(o.Link,{to:"/digit-ui/citizen/ptr/petservice/application/"+(null==r?void 0:r.applicationNumber)+"/"+(null==r?void 0:r.tenantId)},l.createElement(t.SubmitBar,{label:a})))};var F,B=Array.isArray,U="object"==typeof c&&c&&c.Object===Object&&c,j="object"==typeof self&&self&&self.Object===Object&&self,H=U||j||Function("return this")(),W=H.Symbol,z=Object.prototype,V=z.hasOwnProperty,q=z.toString,G=W?W.toStringTag:void 0,K=Object.prototype.toString,Y=W?W.toStringTag:void 0,$=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Y&&Y in Object(e)?function(e){var t=V.call(e,G),n=e[G];try{e[G]=void 0;var l=!0}catch(e){}var i=q.call(e);return l&&(t?e[G]=n:delete e[G]),i}(e):function(e){return K.call(e)}(e)},X=function(e){return null!=e&&"object"==typeof e},Z=function(e){return"symbol"==typeof e||X(e)&&"[object Symbol]"==$(e)},J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\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=$(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ne=H["__core-js_shared__"],le=(F=/[^.]+$/.exec(ne&&ne.keys&&ne.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",ie=Function.prototype.toString,oe=function(e){if(null!=e){try{return ie.call(e)}catch(e){}try{return e+""}catch(e){}}return""},re=/^\[object .+?Constructor\]$/,ae=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)?ae:re).test(oe(e));var t}(n)?n:void 0},se=ue(Object,"create"),ce=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__=se?se(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(se){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ce.call(t,e)?t[e]:void 0},pe.prototype.has=function(e){var t=this.__data__;return se?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]=se&&void 0===t?"__lodash_hash_undefined__":t,this};var me=pe,ve=function(e,t){return e===t||e!=e&&t!=t},fe=function(e,t){for(var n=e.length;n--;)if(ve(e[n][0],t))return n;return-1},he=Array.prototype.splice;function Ee(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])}}Ee.prototype.clear=function(){this.__data__=[],this.size=0},Ee.prototype.delete=function(e){var t=this.__data__,n=fe(t,e);return!(n<0||(n==t.length-1?t.pop():he.call(t,n,1),--this.size,0))},Ee.prototype.get=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]},Ee.prototype.has=function(e){return fe(this.__data__,e)>-1},Ee.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 ge=Ee,ye=ue(H,"Map"),_e=function(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map};function Se(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])}}Se.prototype.clear=function(){this.size=0,this.__data__={hash:new me,map:new(ye||ge),string:new me}},Se.prototype.delete=function(e){var t=_e(this,e).delete(e);return this.size-=t?1:0,t},Se.prototype.get=function(e){return _e(this,e).get(e)},Se.prototype.has=function(e){return _e(this,e).has(e)},Se.prototype.set=function(e,t){var n=_e(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var be=Se;function Te(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 r=e.apply(this,l);return n.cache=o.set(i,r)||o,r};return n.cache=new(Te.Cache||be),n}Te.Cache=be;var Ce,Ae,De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ne=/\\(\\)?/g,Pe=(Ce=Te(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===Ae.size&&Ae.clear(),e}),Ae=Ce.cache,Ce),xe=W?W.prototype:void 0,we=xe?xe.toString:void 0,Re=function(e){if("string"==typeof e||Z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Ie=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))||Q.test(e)||!J.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 we?we.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[Re(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Oe=["tenantId","payments"],Le=e=>{let{t:n,currentPage:i,columns:o,data:r,getCellProps:a,disableSort:u,onSort:s,onNextPage:c,onPrevPage:d,onPageSizeChange:p,pageSizeLimit:m,sortParams:v,totalRecords:f}=e;return l.createElement(t.Table,{t:n,data:r,currentPage:i,columns:o,getCellProps:a,onNextPage:c,onPrevPage:d,pageSizeLimit:m,disableSort:u,onPageSizeChange:p,onSort:s,sortParams:v,totalRecords:f})},ke=e=>{let{businessService:r}=e;const{t:a}=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:[]}],[s,c]=n.useState([]),{roles:d}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=u.filter(e=>e.businessService===r).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)});c(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"},s.map((e,t)=>{let{link:n,text:i,hyperlink:r=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},r?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},a(i)))}))))},Me={date:t.DatePicker,mobileNumber:t.MobileNumber},Fe=e=>{var n;let{onSearch:o,type:a,onClose:s,searchFields:c,searchParams:d,isInboxPage:p,clearSearch:m}=e;const{t:v}=i.useTranslation(),{handleSubmit:f,reset:h,watch:E,control:g,formState:y,setValue:_}=r.useForm({defaultValues:p?d:u({locality:null,city:null},d)}),S=E(),b=innerWidth<=640;function T(){const e=c.reduce((e,t)=>u({},e,{[null==t?void 0:t.name]:""}),{});if(h(e),p){const e=u({},d);e.delete=[],c.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(u({},e))}else m()}const C=e=>l.createElement(t.LinkLabel,{style:u({display:"inline"},e?{margin:0}:{}),onClick:T},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)}),o(e),"mobile"===a&&s()})},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"===a||b)&&l.createElement("div",{className:"complaint-header"},l.createElement("h2",null,v("ES_COMMON_SEARCH_BY")),l.createElement("span",{onClick:s},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(p?"":"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,o,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(r.Controller,e.type?{render:t=>l.createElement(null==Me?void 0:Me[e.type],{formValue:S,setValue:_,onChange:t.onChange,value:t.value}),name:e.name,control:g,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:g,defaultValue:""})),null!=y&&null!==(i=y.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==y||null===(o=y.errors)||void 0===o||null===(a=o[e.name])||void 0===a?void 0:a.message):null)}),p&&l.createElement("div",{style:{gridColumn:"2/3",textAlign:"right",paddingTop:"10px"},className:"input-fields"},l.createElement("div",null,C())),"desktop"===a&&!b&&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(y.errors).length||(()=>{var e;let t=!0;return Object.keys(S).forEach(e=>{!["locality","city"].includes(e)&&S[e]&&(t=!1)}),null==c||!c.find(e=>"locality"===e.name)||null!=S&&null!==(e=S.locality)&&void 0!==e&&e.code||(t=!0),t})(),submit:!0}),!p&&l.createElement("div",null,C()))))),("mobile"===a||b)&&l.createElement(t.ActionBar,{className:"clear-search-container"},l.createElement("button",{className:"clear-search",style:{flex:1}},C(b)),l.createElement(t.SubmitBar,{disabled:!!Object.keys(y.errors).length,label:v("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},Be=["tableConfig","filterComponent"],Ue=e=>{let{tableConfig:o,filterComponent:r}=e,a=s(e,Be);const{data:u,useNewInboxAPI:c}=a,{t:d}=i.useTranslation(),[p,m]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(r)}),[v,f]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[h,E]=n.useState(!1),g=l.useMemo(()=>a.isSearch?o.searchColumns(a):o.inboxColumns(a)||[],[]);let y;return a.isLoading?y=l.createElement(t.Loader,null):h?y=null:!u||0===(null==u?void 0:u.length)||c&&null!=u&&u[0].dataEmpty?y=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}},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&&(y=l.createElement(Le,{t:d,data:u,columns:g,getCellProps:e=>({style:{minWidth:e.column.Header===d("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(ke,{parentRoute:a.parentRoute,businessService:a.moduleCode}),l.createElement("div",null,l.createElement(p,{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(Fe,{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}},y)))},je=e=>{const{t:o}=i.useTranslation(),[r,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: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:r,optionsKey:"name",options:[{code:"DESC",name:o("ES_INBOX_DATE_LATEST_FIRST")},{code:"ASC",name:o("ES_INBOX_DATE_LATEST_LAST")}]})))))},He=e=>{let{t:i,data:o,onFilterChange:r,onSearch:a,onSort:u,serviceRequestIdKey:s,isFstpOperator:c,isLoading:d,isSearch:p,searchParams:m,searchFields:v,sortParams:f,linkPrefix:h,filterComponent:E}=e;const[g,y]=n.useState(p?"SEARCH":""),[_,S]=n.useState(!!p),[b,T]=n.useState(f),[C]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(E)});n.useEffect(()=>{g&&S(!0)},[g]);const A=()=>{S(!1),y(""),T(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:s,linkPrefix:h||"/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"},a&&l.createElement(t.SearchAction,{text:"SEARCH",handleActionClick:()=>{y("SEARCH"),S(!0)}}),!p&&r&&l.createElement(t.FilterAction,{text:"FILTER",handleActionClick:()=>{y("FILTER"),S(!0)}}),l.createElement(t.FilterAction,{text:"SORT",handleActionClick:()=>{y("SORT"),S(!0)}})),D,_&&l.createElement(t.PopUp,null,"FILTER"===g&&l.createElement("div",{className:"popup-module"},l.createElement(C,{onFilterChange:e=>{r(e),S(!1)},Close:A,type:"mobile",searchParams:m})),"SORT"===g&&l.createElement("div",{className:"popup-module"},l.createElement(je,{type:"mobile",sortParams:f,onClose:A,onSort:u})),"SEARCH"===g&&l.createElement("div",{className:"popup-module"},l.createElement(Fe,{type:"mobile",onClose:A,onSearch:a,isFstpOperator:c,searchParams:m,searchFields:v}))))},We=e=>{let{linkPrefix:r,classNameForMobileView:a=""}=e;const{t:u}=i.useTranslation(),s=[{text:u("ES_TITLE_NEW_REGISTRATION"),link:"/digit-ui/employee/ptr/new-application"},{text:u("ES_TITILE_SEARCH_APPLICATION"),link:r+"/search"}],[c,d]=n.useState([]),{roles:p}=Digit.UserService.getUser().info;return n.useEffect(()=>{let e=[];s.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"},c.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:r,onFilterChange:a,onSearch:u,onSort:s,parentRoute:c,searchParams:d,sortParams:p,linkPrefix:m,tableConfig:v,filterComponent:f}=e;const{t:h}=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:c,isMobile:!0}),l.createElement(He,{t:h,data:null==t?void 0:t.map(e=>{const t={};return(o?v.searchColumns():v.inboxColumns()).forEach(n=>{n.mobileCell&&(t[n.Header]=n.mobileCell(e))}),t}),onFilterChange:a,isLoading:n,isSearch:o,onSearch:u,onSort:s,searchParams:d,searchFields:r,linkPrefix:m,sortParams:p,serviceRequestIdKey:null==v?void 0:v.serviceRequestIdKey,filterComponent:f}))))},Ve=["isFetching","isLoading","searchResponseKey","data","searchFields"],qe=e=>{var o,r,a,c,d;let{useNewInboxAPI:p,parentRoute:m,moduleCode:v="PTR",initialStates:f={},filterComponent:h,isInbox:E,rawWfHandler:g,rawSearchHandler:y,combineResponse:_,wfConfig:S,searchConfig:b,middlewaresWf:T,middlewareSearch:C,EmptyResultInboxComp:A}=e;const D=Digit.ULBService.getCurrentTenantId();console.log("here");const{t:N}=i.useTranslation(),[P,x]=n.useState(()=>E?{}:{enabled:!1}),[w,R]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[I,O]=n.useState(f.pageOffset||0),[L,k]=n.useState(f.pageSize||10),[M,F]=n.useState(f.sortParams||[{id:"createdTime",desc:!0}]),[B,U]=n.useState(f.searchParams||{});let j=window.Digit.Utils.browser.isMobile(),H=j?{limit:100,offset:0,sortBy:null==M||null===(o=M[0])||void 0===o?void 0:o.id,sortOrder:null!=M&&null!==(r=M[0])&&void 0!==r&&r.desc?"DESC":"ASC"}:{limit:L,offset:I,sortBy:null==M||null===(a=M[0])||void 0===a?void 0:a.id,sortOrder:null!=M&&null!==(c=M[0])&&void 0!==c&&c.desc?"DESC":"ASC"};const W=p?Digit.Hooks.useNewInboxGeneral({tenantId:D,ModuleCode:v,filters:u({},B,H,{sortParams:M})}):Digit.Hooks.useInboxGeneral({tenantId:D,businessService:v,isInbox:E,filters:u({},B,H,{sortParams:M}),rawWfHandler:g,rawSearchHandler:y,combineResponse:_,wfConfig:S,searchConfig:u({},P,b),middlewaresWf:T,middlewareSearch:C}),{isLoading:z,data:V,searchFields:q}=W,G=s(W,Ve);n.useEffect(()=>{O(0)},[B]);const K=e=>{let t=e.delete,n=u({},B,e);t&&t.forEach(e=>delete n[e]),delete e.delete,U(u({},n)),x({enabled:!0})},Y=n.useCallback(e=>{0!==e.length&&F(e)},[]);var $,X;if(null!==(null==G||null===(d=G.data)||void 0===d?void 0:d.length))return j?l.createElement(ze,{data:V,isLoading:z,isSearch:!E,searchFields:q,onFilterChange:K,onSearch:K,onSort:Y,parentRoute:m,searchParams:B,sortParams:M,linkPrefix:m+"/application-details/",tableConfig:null!=G&&G.tableConfig?null===($=res)||void 0===$?void 0:$.tableConfig:w(N).PTR,filterComponent:h,EmptyResultInboxComp:A,useNewInboxAPI:p}):l.createElement("div",null,E&&l.createElement(t.Header,null,N("ES_COMMON_INBOX")),l.createElement(Ue,{moduleCode:v,data:V,tableConfig:w(N).PTR,isLoading:z,defaultSearchParams:f.searchParams,isSearch:!E,onFilterChange:K,searchFields:q,onSearch:K,onSort:Y,onNextPage:()=>{O(e=>e+L)},onPrevPage:()=>{O(e=>e-L)},currentPage:Math.floor(I/L),pageSizeLimit:L,disableSort:!1,onPageSizeChange:e=>{k(Number(e.target.value))},parentRoute:m,searchParams:B,sortParams:M,totalRecords:Number(null==V||null===(X=V[0])||void 0===X?void 0:X.totalCount),filterComponent:h,EmptyResultInboxComp:A,useNewInboxAPI:p}))},Ge=e=>{var i,a;let{isLoading:u,t:s,onSubmit:c,data:d,count:p,setShowToast:m}=e;const v=window.Digit.Utils.browser.isMobile(),{register:f,control:h,handleSubmit:E,setValue:g,getValues:y,reset:_,formState:S}=r.useForm({defaultValues:{offset:0,limit:!v&&10,sortBy:"commencementDate",sortOrder:"DESC"}});n.useEffect(()=>{f("offset",0),f("limit",10),f("sortBy","commencementDate"),f("sortOrder","DESC")},[f]);const b=Digit.ULBService.getStateId(),{data:T}=Digit.Hooks.ptr.usePTRPetMDMS(b,"PetService","PetType");let C=[];T&&T.map(e=>{C.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const A=e=>l.createElement("span",{className:"cell-text"},e),D=n.useMemo(()=>[{Header:s("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:s("PTR_APPLICANT_NAME"),Cell:e=>{var t,n;return A(""+(null==e||null===(t=e.row)||void 0===t||null===(n=t.original)||void 0===n?void 0:n.applicantName))},disableSortBy:!0},{Header:s("PTR_PET_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType))},disableSortBy:!0},{Header:s("PTR_BREED_TYPE"),Cell:e=>{var t,n;let{row:l}=e;return A(""+(null===(t=l.original)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType))},disableSortBy:!0},{Header:s("PTR_MOBILE_NUMBER"),Cell:e=>{var t;let{row:n}=e;return A(""+(null==n||null===(t=n.original)||void 0===t?void 0:t.mobileNumber))},disableSortBy:!0}],[]),N=n.useCallback(e=>{0!==e.length&&(g("sortBy",e.id),g("sortOrder",e.desc?"DESC":"ASC"))},[]);function P(){g("offset",y("offset")-y("limit")),E(c)()}return l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement(t.Header,null,s("PTR_SEARCH_PET_APPLICATIONS")),l.createElement(t.Card,{className:"card-search-heading"},l.createElement("span",{style:{color:"#505A5F"}},s("Provide at least one parameter to search for an application"))),l.createElement(t.SearchForm,{onSubmit:c,handleSubmit:E},l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_APPLICATION_NO_LABEL")),l.createElement(t.TextInput,{name:"applicationNumber",inputRef:f({})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_SEARCH_PET_TYPE")),l.createElement(r.Controller,{control:h,name:"petType",render:e=>l.createElement(t.Dropdown,{selected:e.value,select:e.onChange,onBlur:e.onBlur,option:C,optionKey:"i18nKey",t:s,disable:!1})})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_OWNER_MOBILE_NO")),l.createElement(t.MobileNumber,{name:"mobileNumber",inputRef:f({minLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},maxLength:{value:10,message:s("CORE_COMMON_MOBILE_ERROR")},pattern:{value:/[6789][0-9]{9}/,message:s("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,s("PTR_FROM_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"fromDate",control:h})),l.createElement(t.SearchField,null,l.createElement("label",null,s("PTR_TO_DATE")),l.createElement(r.Controller,{render:e=>l.createElement(t.DatePicker,{date:e.value,disabled:!1,onChange:e.onChange}),name:"toDate",control:h})),l.createElement(t.SearchField,{className:"submit"},l.createElement(t.SubmitBar,{label:s("ES_COMMON_SEARCH"),submit:!0}),l.createElement("p",{style:{marginTop:"10px"},onClick:()=>{_({applicationNumber:"",fromDate:"",toDate:"",petType:"",mobileNumber:"",status:"",breedType:"",offset:0,limit:10,sortBy:"commencementDate",sortOrder:"DESC"}),m(null),P()}},s("ES_COMMON_CLEAR_ALL")))),!u&&null!=d&&d.display?l.createElement(t.Card,{style:{marginTop:20}},s(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:s,data:d,totalRecords:p,columns:D,getCellProps:e=>({style:{minWidth:e.column.Header===s("PTR_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){g("limit",Number(e.target.value)),E(c)()},currentPage:y("offset")/y("limit"),onNextPage:function(){g("offset",y("offset")+y("limit")),E(c)()},onPrevPage:P,pageSizeLimit:y("limit"),onSort:N,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},Ke=e=>{o.useParams();const{t:r}=i.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[s,c]=n.useState({}),[d,p]=n.useState(null),m={enabled:!!(s&&Object.keys(s).length>0)},{isLoading:v,isSuccess:f,data:{PetRegistrationApplications:h,Count:E}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:s},m);return l.createElement(l.Fragment,null,l.createElement(Ge,{t:r,isLoading:v,tenantId:a,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"}):c(i):p({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):p({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:f&&!v?h.length>0?h:{display:"ES_COMMON_NO_DATA"}:"",count:E}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:r(d.label),isDleteBtn:!0,onClose:()=>{p(null)}}))},Ye=e=>{var n,r,a,s,c,d,p,m;let{path:v,url:f,userType:h}=e;console.log("before coming here");const{t:E}=i.useTranslation(),g=o.useLocation();sessionStorage.removeItem("revalidateddone");const y=window.Digit.Utils.browser.isMobile(),_={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},S=e=>{let{location:n}=e;const{t:r}=i.useTranslation(),a=o.useLocation().search,u=(new URLSearchParams(a).get("from"),Digit.Hooks.useQueryParams(),[{path:"/digit-ui/employee",content:r("ES_COMMON_HOME"),show:!0},{path:"/digit-ui/employee/ptr/petservice/inbox",content:r("ES_TITLE_INBOX"),show:!!n.pathname.includes("ptr/petservice/inbox")},{path:"/digit-ui/employee/ptr/petservice/my-applications",content:r("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:y?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},b=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRNewApplication"),T=null===(a=Digit)||void 0===a||null===(s=a.ComponentRegistryService)||void 0===s?void 0:s.getComponent("ApplicationDetails"),C=null===(c=Digit)||void 0===c||null===(d=c.ComponentRegistryService)||void 0===d?void 0:d.getComponent("PTRResponse"),A=(null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m||m.getComponent("PTRDocsRequired"),window.location.href.includes("ptr/response")),D=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return console.log("path",v),l.createElement(o.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},A?null:l.createElement("div",{style:D?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(S,{location:g})),l.createElement(t.PrivateRoute,{exact:!0,path:v+"/",component:()=>l.createElement(Fi,{matchPath:v,userType:h})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/inbox",component:()=>l.createElement(qe,{useNewInboxAPI:!0,parentRoute:v,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:_,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/new-application",component:()=>l.createElement(b,{parentUrl:f})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/application-details/:id",component:()=>l.createElement(T,{parentRoute:v})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(T,{parentRoute:v})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/response",component:e=>l.createElement(C,u({},e,{parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/petservice/search",component:e=>l.createElement(Search,u({},e,{t:E,parentRoute:v}))}),l.createElement(t.PrivateRoute,{path:v+"/searchold",component:()=>l.createElement(qe,{parentRoute:v,businessService:"ptr",middlewareSearch:searchMW,initialStates:_,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:v+"/petservice/my-applications",component:e=>l.createElement(Ke,u({},e,{parentRoute:v}))}))))},$e=e=>{var n;let{status:o,searchParams:r,onAssignmentChange:a,statusMap:s}=e;return i.useTranslation(),l.createElement(t.CheckBox,{styles:{height:"unset"},onChange:e=>a(u({},e,{state:o.state}),o),checked:null==r?void 0:r.applicationStatus.some(e=>e.uuid===o.uuid),label:o.name+" ("+((null==s||null===(n=s.find(e=>e.statusid===o.uuid))||void 0===n?void 0:n.count)||"-")+")"})},Xe=e=>{var o,r,a,s,c;let{onAssignmentChange:d,searchParams:p,businessServices:m,statusMap:v}=e;const{t:f}=i.useTranslation(),[h,E]=n.useState(!1),{data:g,isLoading:y}=Digit.Hooks.useApplicationStatusGeneral({businessServices:m},{}),{userRoleStates:_}=g||{},S=(e,t)=>t(map[e.stateBusinessService])+" - "+t("ES_PTR_COMMON_STATUS_"+(e.state||"CREATED"));return y?l.createElement(t.Loader,null):null!=_&&_.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==_||null===(o=_.filter(e=>!e.isTerminateState))||void 0===o||null===(r=o.slice(0,4))||void 0===r?void 0:r.map((e,t)=>l.createElement($e,{businessServices:m,key:t,onAssignmentChange:d,status:u({name:S(e,f),code:e.applicationStatus},e),searchParams:p,statusMap:v})),(null==_||null===(a=_.filter(e=>!e.isTerminateState))||void 0===a?void 0:a.slice(4).length)>0?l.createElement(l.Fragment,null,h&&(null==_||null===(s=_.filter(e=>!e.isTerminateState))||void 0===s||null===(c=s.slice(4))||void 0===c?void 0:c.map((e,t)=>l.createElement($e,{businessServices:m,key:e.uuid,onAssignmentChange:d,status:u({name:S(e,f),code:e.applicationStatus},e),searchParams:p,statusMap:v}))),l.createElement("div",{className:"filter-button",onClick:()=>E(!h)}," ",f(h?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},Ze=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],Je=e=>{var o;let{searchParams:r,onFilterChange:c,defaultSearchParams:d,statusMap:p,moduleCode:m}=e,v=s(e,Ze);const{t:f}=i.useTranslation(),h=a.useQueryClient(),[E,g]=n.useState(()=>u({},r,{services:[]})),y=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],_=e=>{let t=e.delete,n=u({},E,e);t&&t.forEach(e=>delete n[e]),delete e.delete,g(u({},n))},S=()=>{g(u({},d,{services:[]})),c(u({},d))},b=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:S},f("ES_COMMON_CLEAR_ALL")),"desktop"===v.type&&l.createElement("span",{className:"clear-search",onClick:S,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"===v.type&&l.createElement("span",{onClick:v.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=>{_({locality:[...(null==E?void 0:E.locality)||[],e]})},tenantId:b,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==E||null===(o=E.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:f(e.i18nkey),onClick:()=>{_({locality:null==E?void 0:E.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")),y.map((e,n)=>{var i;const o=null==E||null===(i=E.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;_(e.target.checked?{services:Array.isArray(E.services)?[...E.services,t]:[t]}:{services:E.services.filter(e=>e!==t),applicationStatus:null===(n=E.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(Xe,{searchParams:E,businessServices:E.services,statusMap:p||h.getQueryData("INBOX_STATUS_MAP_"+m),moduleCode:m,onAssignmentChange:(e,t)=>{if(e.target.checked)_({applicationStatus:[...null==E?void 0:E.applicationStatus,t]});else{let e=null==E?void 0:E.applicationStatus.filter(e=>e.state!==t.state);_({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{c(0===E.services.length?u({},E,{services:y.map(e=>e.value)}):E)},label:f("ES_COMMON_APPLY")}))))))},Qe=e=>l.createElement("span",{className:"cell-text"},e),et=e=>l.createElement("span",{className:"sla-cell"},e),tt=[{head:"ES_TITILE_OWNER_DETAILS",body:[{component:"PTROwnerDetails",withoutLabel:!0,key:"owners",type:"component"}]},{head:"ES_TITILE_PET_DETAILS",body:[{component:"PTRPetdetails",withoutLabel:!0,key:"pets",type:"component"}]},{head:"PTR_LOCATION_DETAILS",body:[{route:"pincode",component:"PTRSelectPincode",texts:{headerCaption:"PTR_CAPTION",header:"PTR_PINCODE_LABEL",cardText:"PTR_PINCODE_TEXT",submitBarLabel:"PTR_COMMON_NEXT",skipText:"CORE_COMMON_SKIP_CONTINUE"},withoutLabel:!0,key:"address",nextStep:"address",type:"component"},{route:"address",component:"PTRSelectAddress",withoutLabel:!0,key:"address",nextStep:"street",isMandatory:!0,type:"component"},{type:"component",route:"street",component:"PTRSelectStreet",key:"address",withoutLabel:!0,nextStep:"landmark"},{type:"component",route:"landmark",component:"PTSelectLandmark",withoutLabel:!0,key:"address",hideInEmployee:!0}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{component:"PTRDocumentUpload",withoutLabel:!0,key:"documents",type:"component"}]}],nt=e=>l.createElement("h1",{className:"heading-m"},e.label),lt=()=>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"})),it=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(lt,null)),ot=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;const{data:f,isLoading:h}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:E,data:g}=Digit.Hooks.pt.useMDMS(s,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[_,S]=n.useState({}),[b,T]=n.useState({}),[C,A]=n.useState([]),[D,N]=n.useState(null),[P,x]=n.useState(null),[w,R]=n.useState(null),[I,O]=n.useState(null),[L,k]=n.useState([]),[M,F]=n.useState(null),[B,U]=n.useState(!1);function j(e){x(e.target.files[0])}return n.useEffect(()=>{var e;g&&g["egf-master"]&&k(null===(e=g["egf-master"])||void 0===e?void 0:e.FinancialYear)},[g]),n.useEffect(()=>{var e;A(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(P){const e=function(){if(P.size>=5242880)O(r("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?R(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):O(r("CS_FILE_UPLOAD_ERROR"))})},function(){O(r("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(()=>{a&&S(null!=a&&a.showFinancialYearsModal?(e=>{let{t:n,action:i,financialYears:o,selectedFinancialYear:r,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:o,optionsKey:"name",onSelect:a,selectedOption:r})}]}]}})({t:r,action:a,financialYears:L,selectedFinancialYear:M,setSelectedFinancialYear:F}):(e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:m}=e;return{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(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:r,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")+(o.docUploadRequired?" *":""),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:s,onDelete:()=>{d(null)},showHint:!0,hintText:i("PT_ATTACH_RESTRICTIONS_SIZE"),message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("ES_PT_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:C,selectedApprover:D,setSelectedApprover:N,selectFile:j,uploadedFile:w,setUploadedFile:R,businessService:m}))},[a,C,L,M,w]),a&&_.form?l.createElement(t.Modal,{headerBarMain:l.createElement(nt,{label:r(_.label.heading)}),headerBarEnd:l.createElement(it,{onClick:c}),actionCancelLabel:r(_.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(_.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!M:h||(null==a?void 0:a.docUploadRequired)&&!w,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:_.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"};p.creationReason="STATUS",d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:u({},p,{workflow:t})})}else if(null!=a&&a.showFinancialYearsModal)d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==M?void 0:M.name,propertyId:null==p?void 0:p.propertyId,tenantId:s,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!D?[]:[D],w&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:w}]),d({Property:u({},p,{workflow:t})})}},defaultValues:b,formId:"modal-action"})):l.createElement(t.Loader,null)},rt=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"})),ut=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(at,null)),st=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:m}=e;const{data:v}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),{isLoading:f,data:h}=Digit.Hooks.pt.useMDMS(s,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[E,g]=n.useState({}),[_,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState({}),[D,N]=n.useState(null),[P,x]=n.useState(null),[w,R]=n.useState(null),[I,O]=n.useState([]),[L,k]=n.useState(null);n.useEffect(()=>{var e;h&&h["egf-master"]&&O(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]);const{data:M}=Digit.Hooks.useCustomMDMS(s,"common-masters",[{name:"Department"}]);function F(e){N(e.target.files[0])}return n.useEffect(()=>{if(v&&M){var e;const t=M["common-masters"].Department;T(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var n,l,i;const o=null==e||null===(n=e.assignments)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.department,r=null==t?void 0:t.find(e=>(null==e?void 0:e.code)===o);return console.log("matchedDept===",r),{uuid:null==e?void 0:e.uuid,name:(null==e||null===(i=e.user)||void 0===i?void 0:i.name)+" - "+(null==r?void 0:r.name)}}))}},[v]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)R(r("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?x(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(r("CS_FILE_UPLOAD_ERROR"))})},function(){R(r("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((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,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:a,selected:r}):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:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:F,uploadedFile:P,setUploadedFile:x,businessService:m}))},[a,b,I,L,P]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(rt,{label:r(E.label.heading)}),headerBarEnd:l.createElement(ut,{onClick:c}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(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){p=u({},p,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,wfDocuments:P?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null}),d({Licenses:[p]})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},ct=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),dt=()=>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"})),pt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(dt,null)),mt=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:m}=e;const{data:v,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,w]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function I(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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{w(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))w(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",A,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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),n.useEffect(()=>{a&&E((e=>{let{t:n,action:i,approvers:o,selectedApprover:r,setSelectedApprover:a,selectFile:u,uploadedFile:s,setUploadedFile:c,businessService:d,error:p}=e,m=!0;return"SENDBACKTOCITIZEN"==(null==i?void 0:i.action)&&(m=!1),i.isTerminateState&&(m=!1),{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==d?void 0:d.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_BPAREG_CANCEL"},form:[{body:[{label:m?n("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:m?n("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:m?l.createElement(t.Dropdown,{option:o,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:a,selected:r}):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:()=>{c(null)},message:s?"1 "+n("ES_PT_ACTION_FILEUPLOADED"):n("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:p})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:I,uploadedFile:N,setUploadedFile:P,businessService:m,error:x}))},[a,S,N,x]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ct,{label:r(h.label.heading)}),headerBarEnd:l.createElement(pt,{onClick:c}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:R?{width:"720px"}:{},style:R?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:R?{paddingLeft:"5px"}:{}},f?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){p=u({},p,{action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null,wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null}),d({Licenses:[p]},!1,{isStakeholder:!0,bpa:!1})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},vt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ft=()=>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"})),ht=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ft,null)),Et=e=>{var i,o,r,s,c,d,p,m,v,f,h,E;let{t:g,action:_,tenantId:S,closeModal:b,submitAction:T,applicationDetails:C,applicationData:A,businessService:D,workflowDetails:N,blockReason:P}=e;console.log("applicationData",A),console.log("workflowDetails",N),Digit.Hooks.obps.useObpsAPI(null!==(i=A)&&void 0!==i&&null!==(o=i.landInfo)&&void 0!==o&&null!==(r=o.address)&&void 0!==r&&r.city?null===(s=A)||void 0===s||null===(c=s.landInfo)||void 0===c||null===(d=c.address)||void 0===d?void 0:d.city:S,!1);const{data:x,isLoading:w}=Digit.Hooks.useEmployeeSearch(S,{roles:null==N||null===(p=N.data)||void 0===p||null===(m=p.initialActionState)||void 0===m||null===(v=m.nextActions)||void 0===v||null===(f=v.filter(e=>(null==e?void 0:e.action)==(null==_?void 0:_.action)))||void 0===f||null===(h=f[0])||void 0===h||null===(E=h.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=_&&_.isTerminateState)}),[R,I]=(a.useQueryClient(),n.useState({})),[O,L]=n.useState({}),[k,M]=n.useState([]),[F,B]=n.useState([]),[U,j]=n.useState({}),[H,W]=n.useState({}),[z,V]=n.useState(null),[q,G]=n.useState(null),[K,Y]=n.useState(null),[$,X]=n.useState(null),Z=!!Digit.Utils.browser.isMobile();function J(e){V(e.target.files[0])}n.useEffect(()=>{var e;M(null==x||null===(e=x.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}}))},[x]),n.useEffect(()=>{!function(){try{Y(null);const e=function(){if(z){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(z.size>=5242880)Y(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=z&&z.type&&!e.test(null==z?void 0:z.type))Y(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",z,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?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):Y(g("CS_FILE_UPLOAD_ERROR"))})},function(){Y(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[z]);const Q=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},ee=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},te=e=>{var t,n;let l=[],i=[];var o,r;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),i=i.filter(e=>{if(!e.date)return!1;const t=new Date;return new Date(e.date)<=t}),"FIELDINSPECTION_INPROGRESS"==e.status?(l=JSON.parse(sessionStorage.getItem("INSPECTION_DATA")),(null===(r=l)||void 0===r?void 0:r.length)>0&&l.map((e,t)=>{i.push({docs:Q(e.Documents),date:e.InspectionDate,questions:ee(e),time:null==e?void 0:e.InspectionTime})}),console.log("FIELDINSPECTION_INPROGRESS",i),i=i.filter(e=>e.date&&e.time),console.log("inspectionObinspectionOb",i)):sessionStorage.removeItem("INSPECTION_DATA"),[...i]},ne=e=>{let t=JSON.parse(sessionStorage.getItem("BPA_DOCUMENTS")),n=[];return t.map(e=>{var t,l,i,o,r,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===(o=e.uploadedDocuments)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.values]),(null==e||null===(a=e.newUploadedDocs)||void 0===a?void 0:a.length)>0&&(n=[...n,...null==e?void 0:e.newUploadedDocs])}),n},le=()=>{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(()=>{B(null==P?void 0:P.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),_&&I((e=>{var n,i,o,r,a,u,s;let{t:c,action:d,approvers:p,selectedApprover:m,setSelectedApprover:v,selectedBlockReason:f,setBlockReason:h,selectFile:E,uploadedFile:g,setUploadedFile:y,assigneeLabel:_,businessService:S,error:b,blockReasonFiltered:T}=e,C=!1;return"REVOCATE"!=(null==d?void 0:d.action)&&"REJECT"!=(null==d?void 0:d.action)&&"SKIP_PAYMENT"!=d.action&&"SEND_BACK_TO_CITIZEN"!=(null==d?void 0:d.action)&&"APPROVE"!=(null==d?void 0:d.action)||(C=!0),{label:{heading:"WF_"+(null==d?void 0:d.action)+"_APPLICATION",submit:"WF_"+S+"_"+(null==d?void 0:d.action),cancel:"BPA_CITIZEN_CANCEL_BUTTON"},form:[{body:[{label:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(n=d.state)||void 0===n?void 0:n.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(i=d.state)||void 0===i?void 0:i.state)?null:c(_||"WF_ROLE_"+(null===(o=d.assigneeRoles)||void 0===o?void 0:o[0])),type:"dropdown",populators:d.isTerminateState||C||"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(r=d.state)||void 0===r?void 0:r.state)||"FORWARD"==(null==d?void 0:d.action)&&"FIELDINSPECTION_PENDING"==(null==d||null===(a=d.state)||void 0===a?void 0:a.state)?null:l.createElement(t.Dropdown,{option:p,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:v,selected:m})},{label:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(u=d.state)||void 0===u?void 0:u.state)?c("BLOCK_REASON"):null,type:"dropdown",populators:"BLOCK"==(null==d?void 0:d.action)&&"PENDINGAPPROVAL"==(null==d||null===(s=d.state)||void 0===s?void 0:s.state)?l.createElement(t.Dropdown,{option:T,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:h,selected:f,isMandatory:!0}):null},{label:c("WF_COMMON_COMMENTS"),type:"textarea",isMandatory:!0,populators:{name:"comments"}},{label:""+c("WF_APPROVAL_UPLOAD_HEAD"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",onUpload:E,onDelete:()=>{y(null)},message:g?"1 "+c("ES_PT_ACTION_FILEUPLOADED"):c("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:b})}]}]}})({t:g,action:_,approvers:k,selectedApprover:U,setSelectedApprover:j,selectedBlockReason:H,setBlockReason:W,selectFile:J,uploadedFile:q,setUploadedFile:G,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:K,blockReasonFiltered:F}))},[_,k,$,q,K]),_&&R.form?l.createElement(t.Modal,{headerBarMain:l.createElement(vt,{label:g(R.label.heading)}),headerBarEnd:l.createElement(ht,{onClick:b}),actionCancelLabel:g(R.label.cancel),actionCancelOnSubmit:b,actionSaveLabel:g(R.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:Z?{width:"720px"}:{},style:Z?{minHeight:"45px",height:"auto",width:"44%"}:{minHeight:"45px",height:"auto",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:Z?{paddingLeft:"5px"}:{}},w?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,o,r,a,s,c,d,p,m,v,f,h,E,y,D,P,x,w,R,I,O,L,k,M;A=u({},A,{documents:ne(),additionalDetails:u({},null===(t=A)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:te(A),pendingapproval:le(),blockingReason:null==H?void 0:H.name}),workflow:{action:null==_?void 0:_.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:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(i=N.data)||void 0===i||null===(o=i.processInstances)||void 0===o||null===(r=o[0])||void 0===r||null===(a=r.state)||void 0===a?void 0:a.applicationStatus)?[null==N||null===(s=N.data)||void 0===s||null===(c=s.processInstances)||void 0===c||null===(d=c[0])||void 0===d||null===(p=d.assigner)||void 0===p?void 0:p.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,assignes:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(m=N.data)||void 0===m||null===(v=m.processInstances)||void 0===v||null===(f=v[0])||void 0===f||null===(h=f.state)||void 0===h?void 0:h.applicationStatus)?[null==N||null===(E=N.data)||void 0===E||null===(y=E.processInstances)||void 0===y||null===(D=y[0])||void 0===D||null===(P=D.assigner)||void 0===P?void 0:P.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,varificationDocuments:q?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:q}]:null},action:null==_?void 0:_.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(x=N.data)||void 0===x||null===(w=x.processInstances)||void 0===w||null===(R=w[0])||void 0===R||null===(I=R.state)||void 0===I?void 0:I.applicationStatus)?[null==N||null===(O=N.data)||void 0===O||null===(L=O.processInstances)||void 0===L||null===(k=L[0])||void 0===k||null===(M=k.assigner)||void 0===M?void 0:M.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:q?[{documentType:(null==_?void 0:_.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:q}]:null});const F=function(e,t,n,l,i,o,r,a,s,c,d,p){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null===(e=A)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null===(l=A)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null===(r=A)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(s=a.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null===(c=A)||void 0===c||null===(d=c.additionalDetails)||void 0===d||null===(p=d.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS))){var m,v,f;A.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",A.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",A.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",A.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),A.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const e=null==C||null===(m=C.nocData)||void 0===m?void 0:m.map(e=>{const t=Digit.SessionStorage.get(null==e?void 0:e.nocType)||[];return{Noc:u({},e,{documents:[...null!=e&&e.documents?null==e?void 0:e.documents:[],...t||[]]})}});let t={sourceRefId:null==e||null===(v=e[0])||void 0===v||null===(f=v.Noc)||void 0===f?void 0:f.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(S,t)).then(function(t){var n;let l=!0,i=!0;null==t||null===(n=t.Noc)||void 0===n||n.map(e=>{var t,n,o,r,a;"APPROVED"!==(null==e||null===(t=e.applicationStatus)||void 0===t?void 0:t.toUpperCase())&&"AUTO_APPROVED"!==(null==e||null===(n=e.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"REJECTED"!==(null==e||null===(o=e.applicationStatus)||void 0===o?void 0:o.toUpperCase())&&"AUTO_REJECTED"!==(null==e||null===(r=e.applicationStatus)||void 0===r?void 0:r.toUpperCase())&&"VOIDED"!==(null==e||null===(a=e.applicationStatus)||void 0===a?void 0:a.toUpperCase())||1!=l&&1!=i||("AIRPORT_AUTHORITY"===(null==e?void 0:e.nocType)?l=!1:"FIRE_NOC"===(null==e?void 0:e.nocType)&&(i=!1))});let o=[];if(e&&e.map(e=>{var t,n,r,a,u,s,c,d,p,m,v,f;("APPROVED"!=(null==e||null===(t=e.Noc)||void 0===t||null===(n=t.applicationStatus)||void 0===n?void 0:n.toUpperCase())&&"AUTO_APPROVED"!=(null==e||null===(r=e.Noc)||void 0===r||null===(a=r.applicationStatus)||void 0===a?void 0:a.toUpperCase())&&"REJECTED"!=(null==e||null===(u=e.Noc)||void 0===u||null===(s=u.applicationStatus)||void 0===s?void 0:s.toUpperCase())&&"AUTO_REJECTED"!=(null==e||null===(c=e.Noc)||void 0===c||null===(d=c.applicationStatus)||void 0===d?void 0:d.toUpperCase())&&"VOIDED"!=(null==e||null===(p=e.Noc)||void 0===p||null===(m=p.applicationStatus)||void 0===m?void 0:m.toUpperCase())&&"AIRPORT_AUTHORITY"===(null==e||null===(v=e.Noc)||void 0===v?void 0:v.nocType)&&l||"FIRE_NOC"===(null==e||null===(f=e.Noc)||void 0===f?void 0:f.nocType)&&i)&&o.push(e)}),"FIELDINSPECTION_INPROGRESS"==A.status){let e=JSON.parse(sessionStorage.getItem("INSPECTION_DATA"));(null==e?void 0:e.length)>0&&e.map((e,t)=>{e.InspectionDate&&e.InspectionTime?T({BPA:A},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0}):(b(),alert(g("Please fill Inspection Date and Time"))),console.log(" ob.InspectionDate && ob.InspectionTime",e.InspectionDate,e.InspectionTime)})}else T({BPA:A},(null==o?void 0:o.length)>0&&o,{isStakeholder:!1,bpa:!0})})}b(),alert(g("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(F&&F.then?F.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:O,formId:"modal-action"})):l.createElement(t.Loader,null)},gt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),yt=()=>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"})),_t=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(yt,null)),St=e=>{var i,r;let{t:s,action:c,tenantId:d,closeModal:p,submitAction:m,applicationData:v,businessService:f}=e;const{data:h,isLoading:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(i=c.assigneeRoles)||void 0===i||null===(r=i.map)||void 0===r?void 0:r.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),[g,_]=(a.useQueryClient(),n.useState({})),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,D]=n.useState({}),[N,P]=n.useState(null),[x,w]=n.useState(null),[R,I]=n.useState(null),O=!!Digit.Utils.browser.isMobile();function L(e){P(e.target.files[0])}return o.useHistory(),n.useEffect(()=>{var e;C(null==h||null===(e=h.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}}))},[h]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(N){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(N.size>=5242880)I(s("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=N&&N.type&&!e.test(null==N?void 0:N.type))I(s("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?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(s("CS_FILE_UPLOAD_ERROR"))})},function(){I(s("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[N]),n.useEffect(()=>{c&&_((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,assigneeLabel:p,businessService:m,error:v}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let h=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||h?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||h?null:l.createElement(t.Dropdown,{option:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:u,selected:a})},{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:s,onDelete:()=>{d(null)},showHint:!0,message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),accept:"image/*, .pdf, .png, .jpeg, .jpg",iserror:v})}]}]}})({t:s,action:c,approvers:T,selectedApprover:A,setSelectedApprover:D,selectFile:L,uploadedFile:x,setUploadedFile:w,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:R}))},[c,T,x,R]),c&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(gt,{label:s(g.label.heading)}),headerBarEnd:l.createElement(_t,{onClick:p}),actionCancelLabel:s(g.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:s(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:O?{width:"720px"}:{},style:O?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:O?{paddingLeft:"5px"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.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=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)=>{o.push(e)}),v=u({},v,{workflow:{action:null==c?void 0:c.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=A&&A.uuid?[null==A?void 0:A.uuid]:null,documents:x?[{documentType:(null==c?void 0:c.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:x}]:null},documents:o}),m({Noc:v},!1,{isNoc:!0})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)};function bt(e){var t=this.__data__=new ge(e);this.size=t.size}bt.prototype.clear=function(){this.__data__=new ge,this.size=0},bt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},bt.prototype.get=function(e){return this.__data__.get(e)},bt.prototype.has=function(e){return this.__data__.has(e)},bt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ge){var l=n.__data__;if(!ye||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new be(l)}return n.set(e,t),this.size=n.size,this};var Tt=bt,Ct=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),At=function(e,t,n){"__proto__"==t&&Ct?Ct(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Dt=Object.prototype.hasOwnProperty,Nt=function(e,t,n){var l=e[t];Dt.call(e,t)&&ve(l,n)&&(void 0!==n||t in e)||At(e,t,n)},Pt=function(e,t,n,l){var i=!n;n||(n={});for(var o=-1,r=t.length;++o<r;){var a=t[o],u=l?l(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),i?At(n,a,u):Nt(n,a,u)}return n},xt=function(e){return X(e)&&"[object Arguments]"==$(e)},wt=Object.prototype,Rt=wt.hasOwnProperty,It=wt.propertyIsEnumerable,Ot=xt(function(){return arguments}())?xt:function(e){return X(e)&&Rt.call(e,"callee")&&!It.call(e,"callee")},Lt=function(){return!1},kt=d(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?H.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},Bt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ut={};Ut["[object Float32Array]"]=Ut["[object Float64Array]"]=Ut["[object Int8Array]"]=Ut["[object Int16Array]"]=Ut["[object Int32Array]"]=Ut["[object Uint8Array]"]=Ut["[object Uint8ClampedArray]"]=Ut["[object Uint16Array]"]=Ut["[object Uint32Array]"]=!0,Ut["[object Arguments]"]=Ut["[object Array]"]=Ut["[object ArrayBuffer]"]=Ut["[object Boolean]"]=Ut["[object DataView]"]=Ut["[object Date]"]=Ut["[object Error]"]=Ut["[object Function]"]=Ut["[object Map]"]=Ut["[object Number]"]=Ut["[object Object]"]=Ut["[object RegExp]"]=Ut["[object Set]"]=Ut["[object String]"]=Ut["[object WeakMap]"]=!1;var jt=function(e){return function(t){return e(t)}},Ht=d(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}),Wt=Ht&&Ht.isTypedArray,zt=Wt?jt(Wt):function(e){return X(e)&&Bt(e.length)&&!!Ut[$(e)]},Vt=Object.prototype.hasOwnProperty,qt=function(e,t){var n=B(e),l=!n&&Ot(e),i=!n&&!l&&kt(e),o=!n&&!l&&!i&&zt(e),r=n||l||i||o,a=r?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 s in e)!t&&!Vt.call(e,s)||r&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ft(s,u))||a.push(s);return a},Gt=Object.prototype,Kt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Gt)},Yt=function(e,t){return function(n){return e(t(n))}},$t=Yt(Object.keys,Object),Xt=Object.prototype.hasOwnProperty,Zt=function(e){return null!=e&&Bt(e.length)&&!te(e)},Jt=function(e){return Zt(e)?qt(e):function(e){if(!Kt(e))return $t(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,en=function(e){return Zt(e)?qt(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=Kt(e),n=[];for(var l in e)("constructor"!=l||!t&&Qt.call(e,l))&&n.push(l);return n}(e)},tn=d(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?H.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}}),nn=function(){return[]},ln=Object.prototype.propertyIsEnumerable,on=Object.getOwnPropertySymbols,rn=on?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,r=[];++l<i;){var a=t[l];ln.call(e,a)&&(r[o++]=a)}return r}(on(e)))}:nn,an=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},un=Yt(Object.getPrototypeOf,Object),sn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)an(t,rn(e)),e=un(e);return t}:nn,cn=function(e,t,n){var l=t(e);return B(e)?l:an(l,n(e))},dn=function(e){return cn(e,Jt,rn)},pn=function(e){return cn(e,en,sn)},mn=ue(H,"DataView"),vn=ue(H,"Promise"),fn=ue(H,"Set"),hn=ue(H,"WeakMap"),En=oe(mn),gn=oe(ye),yn=oe(vn),_n=oe(fn),Sn=oe(hn),bn=$;(mn&&"[object DataView]"!=bn(new mn(new ArrayBuffer(1)))||ye&&"[object Map]"!=bn(new ye)||vn&&"[object Promise]"!=bn(vn.resolve())||fn&&"[object Set]"!=bn(new fn)||hn&&"[object WeakMap]"!=bn(new hn))&&(bn=function(e){var t=$(e),n="[object Object]"==t?e.constructor:void 0,l=n?oe(n):"";if(l)switch(l){case En:return"[object DataView]";case gn:return"[object Map]";case yn:return"[object Promise]";case _n:return"[object Set]";case Sn:return"[object WeakMap]"}return t});var Tn=bn,Cn=Object.prototype.hasOwnProperty,An=H.Uint8Array,Dn=function(e){var t=new e.constructor(e.byteLength);return new An(t).set(new An(e)),t},Nn=/\w*$/,Pn=W?W.prototype:void 0,xn=Pn?Pn.valueOf:void 0,wn=Object.create,Rn=function(){function e(){}return function(t){if(!ee(t))return{};if(wn)return wn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),In=Ht&&Ht.isMap,On=In?jt(In):function(e){return X(e)&&"[object Map]"==Tn(e)},Ln=Ht&&Ht.isSet,kn=Ln?jt(Ln):function(e){return X(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,r){var a,u=1&n,s=2&n,c=4&n;if(l&&(a=o?l(t,i,o,r):l(t)),void 0!==a)return a;if(!ee(t))return t;var d=B(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Cn.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=Tn(t),m="[object Function]"==p||"[object GeneratorFunction]"==p;if(kt(t))return tn(t,u);if("[object Object]"==p||"[object Arguments]"==p||m&&!o){if(a=s||m?{}:function(e){return"function"!=typeof e.constructor||Kt(e)?{}:Rn(un(e))}(t),!u)return s?function(e,t){return Pt(e,sn(e),t)}(t,function(e,t){return e&&Pt(t,en(t),e)}(a,t)):function(e,t){return Pt(e,rn(e),t)}(t,function(e,t){return e&&Pt(t,Jt(t),e)}(a,t))}else{if(!Mn[p])return o?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return Dn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?Dn(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?Dn(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,Nn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return xn?Object(xn.call(e)):{}}}(t,p,u)}}r||(r=new Tt);var v=r.get(t);if(v)return v;r.set(t,a),kn(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,r))}):On(t)&&t.forEach(function(i,o){a.set(o,e(i,n,l,o,t,r))});var f=d?void 0:(c?s?pn:dn:s?en:Jt)(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]),Nt(a,o,e(i,n,l,o,t,r))}),a},Bn=function(e){return Fn(e,5)};const Un=e=>l.createElement("h1",{className:"heading-m"},e.label),jn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(jn,null)),Wn=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}},zn=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:m}=e;const{data:v,isLoading:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,w]=n.useState(null),R=window.Digit.Utils.browser.isMobile(),I=window.location.href.includes("/employee");function O(e){D(e.target.files[0])}return n.useEffect(()=>{var e;b(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{w(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))w(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),w(r("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[A]),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)?a&&E((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:s,selectFile:c,uploadedFile:d,setUploadedFile:p,businessService:m,error:v}=e,f=!0,h=!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)||(h=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==m?void 0:m.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:r,autoComplete:"off",optionKey:"name",id:"fieldInspector",select:s,selected:a}):null},h&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!h,type:"custom",populators:h?{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:c,onDelete:()=>{p(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:m,error:x})):a&&E((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:c,setUploadedFile:d,businessService:p,error:m}=e,v=!0;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_CONNECTION"==(null==o?void 0:o.action))&&(v=!1),o.isTerminateState&&(v=!1),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==p?void 0:p.toUpperCase())+"_"+(null==o?void 0:o.action),cancel:"CS_COMMON_CANCEL"},form:[{body:[{label:v?i("WF_ASSIGNEE_NAME_LABEL"):null,placeholder:v?i("WF_ASSIGNEE_NAME_PLACEHOLDER"):null,type:"dropdown",populators:v?l.createElement(t.Dropdown,{option:r,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:s,onDelete:()=>{d(null)},message:c?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:m,iserror:m,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:m,error:x}))},[a,S,N,x]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Un,{label:r(h.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:c}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:R&&I?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,r,c,m,v,f;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var h,E,g,y,_,S,b,C,D;const t=u({},null===(h=p)||void 0===h||null===(E=h.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=u({},null===(g=p)||void 0===g?void 0:g.billAmendmentDetails,{workflow:{businessId:null===(y=p)||void 0===y||null===(_=y.billAmendmentDetails)||void 0===_?void 0:_.amendmentId,action:null==a?void 0:a.action,tenantId:s,businessService:null!==(S=p)&&void 0!==S&&null!==(b=S.applicationType)&&void 0!==b&&b.includes("WATER")?"WS.AMENDMENT":"SW.AMENDMENT",moduleName:null!==(C=p)&&void 0!==C&&null!==(D=C.applicationType)&&void 0!==D&&D.includes("WATER")?"WS":"SW",assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]},additionalDetails:t,comment:(null==e?void 0:e.comments)||"",wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:{action:null==a?void 0:a.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:[]}});d({AmendmentUpdate:n})}else{if(p=u({},p,{action:null==a?void 0:a.action,comment:(null==e?void 0:e.comments)||"",assignee:null!=T&&T.uuid?[null==T?void 0:T.uuid]:[],assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],wfDocuments:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]:null,processInstance:u({},null===(n=p)||void 0===n?void 0:n.processInstance,{action:null==a?void 0:a.action,assignes:null!=T&&T.uuid?[{uuid:null==T?void 0:T.uuid}]:[],comment:(null==e?void 0:e.comments)||"",documents:N?[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.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=Bn(null==e?void 0:e.date);p.disconnectionExecutionDate=Wn(t)}else if(null!=e&&e.date){const t=Bn(null==e?void 0:e.date);p.connectionExecutionDate=Wn(t)}var P;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(r=o.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(c=p)||void 0===c||null===(m=c.processInstance)||void 0===m?void 0:m.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===(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 x,w,R,I,O,L,k,M,F,B,U,j,H;const e=sessionStorage.getItem("Digit.ADHOC_ADD_REBATE_DATA"),t=e?JSON.parse(e):"";null!=t&&null!==(x=t.value)&&void 0!==x&&x.adhocPenalty&&(p.additionalDetails.adhocPenalty=parseInt(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenalty)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(I=t.value)||void 0===I?void 0:I.adhocPenaltyComment)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyReason)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(M=t.value)||void 0===M?void 0:M.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.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===(j=t.value)||void 0===j?void 0:j.adhocRebateReason)||""),"WATER"==(null===(H=p)||void 0===H?void 0:H.serviceType)?d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Vn=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"})),Gn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(qn,null)),Kn=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;console.log("applicationData",p);const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,w]=n.useState(null),[R,I]=n.useState(!1);function O(e){D(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{w(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return 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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("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((e=>{let{t:t,action:n,businessService:l}=e;return{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_PTR_COMMON_CANCEL"},form:[{body:[{label:t("ES_PTR_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:m}))},[a,S,N]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vn,{label:r(h.label.heading)}),headerBarEnd:l.createElement(Gn,{onClick:c}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("COMMON_APPROVED"==(null==a?void 0:a.action)){let t={action:"OPEN",comments:null==e?void 0:e.comments,businessService:"ptr",moduleName:"pet-services"};p.creationReason="CREATE",d({PetRegistrationApplications:[u({},p,{workflow:t})]})}let t={action:null==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!T?[]:[T],N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]),d({PetRegistrationApplications:[u({},p,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Yn=e=>l.createElement("h1",{className:"heading-m"},e.label),$n=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($n,null)),Zn=e=>{var i,o,r;let{t:a,action:s,closeModal:c,submitAction:d,applicationData:p,businessService:m}=e;const v=Digit.ULBService.getStateId(),{data:f,isLoading:h}=Digit.Hooks.tl.useTradeLicenseMDMS(v,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==f||null===(i=f.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",p);const[E,g]=n.useState({}),[y,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState(""),[A,D]=n.useState([]),[N,P]=n.useState(null),x=null===(o=p)||void 0===o||null===(r=o.tradeLicenseDetail)||void 0===r?void 0:r.tradeUnits;console.log("tradeUnits",x);const w=n.useMemo(()=>{var e;if(h||!f||!x.length)return[];const t=new Set(x.map(e=>e.tradeType)),n=(null===(e=f.TradeLicense)||void 0===e?void 0:e.TradeType.filter(e=>t.has(e.code))).some(e=>null==e?void 0:e.ishazardous);return console.log("hasHazardous",n),n?["1"]:["1","2","3"]},[h,f,x]);return console.log("years",w),n.useEffect(()=>{s&&g((e=>{let{t:n,action:i,years:o,selectedApprover:r,setSelectedApprover:a,businessService:u}=e;return{label:{heading:"WF_"+(null==i?void 0:i.action)+"_APPLICATION",submit:"WF_"+(null==u?void 0:u.toUpperCase())+"_"+(null==i?void 0:i.action),cancel:"WF_EMPLOYEE_NEWTL_CANCEL"},form:[{body:[{label:n("TL_VALID_FOR_NO_OF_YEARS"),type:"dropdown",populators:l.createElement(t.Dropdown,{option:o,autoComplete:"off",select:a,selected:r})}]}]}})({t:a,action:s,years:w,selectedApprover:T,setSelectedApprover:C,businessService:m}))},[s,w,A,N]),s&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Yn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Xn,{onClick:c}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},h?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n=null===(t=p)||void 0===t?void 0:t.financialYear;const l=null==n?void 0:n.split("-")[1],i="20"+Number(l)+"-"+(Number(l)+1);p=u({},p,{financialYear:i,action:"INITIATE",additionalDetail:u({},p.additionalDetail,{validityYears:T.length>0?parseInt(T):""})}),d({Licenses:[p]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},Jn=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"})),el=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Qn,null)),tl=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:null==a?void 0:a.isTerminateState}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,w]=n.useState(null),[R,I]=n.useState(!1);function O(e){I(!0),D(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{w(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",A,s)).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):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("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)}}()},[A]),console.log("actyhdesh,jhfsefsef",a,p),n.useEffect(()=>{E((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,setUploadedFile:a,approvers:u,selectedApprover:s,setSelectedApprover:c,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:c,selected:s})},{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:()=>{a(null)},message:d?l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(p,null),l.createElement("span",null,"Uploading...")):r?"1 "+n("SV_FILE_UPLOADED"):n("SV_NO_FILE")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:m,isUploading:R}))},[a,S,N]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Jn,{label:r(h.label.heading)}),headerBarEnd:l.createElement(el,{onClick:c}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:h.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:m,moduleName:v,assignes:"SENDBACKTOCITIZEN"===(null==a?void 0:a.action)?[null==p||null===(t=p.auditDetails)||void 0===t?void 0:t.createdBy]:null!=T&&T.uuid?[null==T?void 0:T.uuid]:null};N&&(n.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,fileStoreId:N}]),d({streetVendingDetail:u({},p,{workflow:n})})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},nl=e=>l.createElement("h1",{className:"heading-m"},e.label),ll=()=>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"})),il=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ll,null)),ol=e=>{var i,o;let{t:r,action:a,tenantId:s,closeModal:c,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;console.log("applicationData",p);const{data:f}=Digit.Hooks.useEmployeeSearch(s,{roles:null==a||null===(i=a.assigneeRoles)||void 0===i||null===(o=i.map)||void 0===o?void 0:o.call(i,e=>({code:e})),isActive:!0},{enabled:!(null!=a&&a.isTerminateState)}),[h,E]=n.useState({}),[g,_]=n.useState({}),[S,b]=n.useState([]),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,w]=n.useState(null),[R,I]=n.useState(!1);function O(e){D(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{w(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("CHB",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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):w(r("CS_FILE_UPLOAD_ERROR"))})},function(){w(r("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((e=>{let{t:n,action:i,selectFile:o,uploadedFile:r,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:o,onDelete:()=>{a(null)},showHint:!0,hintText:n("CHB_ATTACH_RESTRICTIONS_SIZE"),message:r?"1 "+n("ES_CHB_ACTION_FILEUPLOADED"):n("ES_CHB_ACTION_NO_FILEUPLOADED")})}]}]}})({t:r,action:a,approvers:S,selectedApprover:T,setSelectedApprover:C,selectFile:O,uploadedFile:N,setUploadedFile:P,businessService:m}))},[a,S,N]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(nl,{label:r(h.label.heading)}),headerBarEnd:l.createElement(il,{onClick:c}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:c,actionSaveLabel:r(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==a?void 0:a.action,comments:null==e?void 0:e.comments,businessService:m,moduleName:v};N&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==A?void 0:A.name,filestoreId:N}]),d({hallsBookingApplication:[u({},p,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},rl=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"})),ul=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(al,null)),sl=e=>{var i,r,a;let{t:s,action:c,tenantId:d,closeModal:p,submitAction:m,applicationData:v,businessService:f,moduleCode:h}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(d,{roles:null==c||null===(i=c.roles)||void 0===i||null===(r=i[0])||void 0===r||null===(a=r.map)||void 0===a?void 0:a.call(r,e=>({code:e})),isActive:!0},{enabled:!(null!=c&&c.isTerminateState)}),g=o.useHistory(),[y,_]=n.useState({}),[S,b]=n.useState({}),[T,C]=n.useState([]),[A,D]=n.useState(null),[N,P]=n.useState(null);return n.useEffect(()=>{var e;C(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{"INITIATED"===(null==c?void 0:c.state)?g.push("/digit-ui/employee/asset/assetservice/edit/"+(null==v?void 0:v.applicationNo)):_((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:s,action:c,approvers:T,selectedApprover:A,setSelectedApprover:D,uploadedFile:N,setUploadedFile:P,businessService:f}))},[c,T,N]),c&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(rl,{label:s(y.label.heading)}),headerBarEnd:l.createElement(ul,{onClick:p}),actionCancelLabel:s(y.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:s(y.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:y.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:h};N&&(t.documents=[]),m({Asset:u({},v,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},cl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(ot,e):null!=e&&e.businessService.includes("ptr")?l.createElement(Kn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(st,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Zn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(mt,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(zn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(tl,e):null!=e&&e.businessService.includes("chb")?l.createElement(ol,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(sl,e):void 0;var dl=function(e,t){return function(){for(var n=new Array(arguments.length),l=0;l<n.length;l++)n[l]=arguments[l];return e.apply(t,n)}},pl=Object.prototype.toString;function ml(e){return"[object Array]"===pl.call(e)}function vl(e){return void 0===e}function fl(e){return null!==e&&"object"==typeof e}function hl(e){if("[object Object]"!==pl.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function El(e){return"[object Function]"===pl.call(e)}function gl(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),ml(e))for(var n=0,l=e.length;n<l;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var yl={isArray:ml,isArrayBuffer:function(e){return"[object ArrayBuffer]"===pl.call(e)},isBuffer:function(e){return null!==e&&!vl(e)&&null!==e.constructor&&!vl(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:fl,isPlainObject:hl,isUndefined:vl,isDate:function(e){return"[object Date]"===pl.call(e)},isFile:function(e){return"[object File]"===pl.call(e)},isBlob:function(e){return"[object Blob]"===pl.call(e)},isFunction:El,isStream:function(e){return fl(e)&&El(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:gl,merge:function e(){var t={};function n(n,l){t[l]=hl(t[l])&&hl(n)?e(t[l],n):hl(n)?e({},n):ml(n)?n.slice():n}for(var l=0,i=arguments.length;l<i;l++)gl(arguments[l],n);return t},extend:function(e,t,n){return gl(t,function(t,l){e[l]=n&&"function"==typeof t?dl(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}};function _l(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Sl=function(e,t,n){if(!t)return e;var l;if(n)l=n(t);else if(yl.isURLSearchParams(t))l=t.toString();else{var i=[];yl.forEach(t,function(e,t){null!=e&&(yl.isArray(e)?t+="[]":e=[e],yl.forEach(e,function(e){yl.isDate(e)?e=e.toISOString():yl.isObject(e)&&(e=JSON.stringify(e)),i.push(_l(t)+"="+_l(e))}))}),l=i.join("&")}if(l){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+l}return e};function bl(){this.handlers=[]}bl.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},bl.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},bl.prototype.forEach=function(e){yl.forEach(this.handlers,function(t){null!==t&&e(t)})};var Tl=bl,Cl=function(e,t,n){return yl.forEach(n,function(n){e=n(e,t)}),e},Al=function(e){return!(!e||!e.__CANCEL__)},Dl=function(e,t){yl.forEach(e,function(n,l){l!==t&&l.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[l])})},Nl=function(e,t,n,l,i){return function(e,t,n,l,i){return e.config=t,n&&(e.code=n),e.request=l,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,n,l,i)},Pl=yl.isStandardBrowserEnv()?{write:function(e,t,n,l,i,o){var r=[];r.push(e+"="+encodeURIComponent(t)),yl.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),yl.isString(l)&&r.push("path="+l),yl.isString(i)&&r.push("domain="+i),!0===o&&r.push("secure"),document.cookie=r.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},xl=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],wl=yl.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function l(e){var l=e;return t&&(n.setAttribute("href",l),l=n.href),n.setAttribute("href",l),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=l(window.location.href),function(t){var n=yl.isString(t)?l(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},Rl={"Content-Type":"application/x-www-form-urlencoded"};function Il(e,t){!yl.isUndefined(e)&&yl.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Ol,Ll={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ol=function(e){return new Promise(function(t,n){var l=e.data,i=e.headers;yl.isFormData(l)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var r=e.auth.username||"",a=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.Authorization="Basic "+btoa(r+":"+a)}var u,s,c=(s=e.url,(u=e.baseURL)&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(s)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,s):s);if(o.open(e.method.toUpperCase(),Sl(c,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var l,i,r,a,u,s="getAllResponseHeaders"in o?(l=o.getAllResponseHeaders(),u={},l?(yl.forEach(l.split("\n"),function(e){if(a=e.indexOf(":"),i=yl.trim(e.substr(0,a)).toLowerCase(),r=yl.trim(e.substr(a+1)),i){if(u[i]&&xl.indexOf(i)>=0)return;u[i]="set-cookie"===i?(u[i]?u[i]:[]).concat([r]):u[i]?u[i]+", "+r:r}}),u):u):null;!function(e,t,n){var l=n.config.validateStatus;n.status&&l&&!l(n.status)?t(Nl("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}(t,n,{data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:s,config:e,request:o}),o=null}},o.onabort=function(){o&&(n(Nl("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){n(Nl("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Nl(t,e,"ECONNABORTED",o)),o=null},yl.isStandardBrowserEnv()){var d=(e.withCredentials||wl(c))&&e.xsrfCookieName?Pl.read(e.xsrfCookieName):void 0;d&&(i[e.xsrfHeaderName]=d)}if("setRequestHeader"in o&&yl.forEach(i,function(e,t){void 0===l&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)}),yl.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){o&&(o.abort(),n(e),o=null)}),l||(l=null),o.send(l)})}),Ol),transformRequest:[function(e,t){return Dl(t,"Accept"),Dl(t,"Content-Type"),yl.isFormData(e)||yl.isArrayBuffer(e)||yl.isBuffer(e)||yl.isStream(e)||yl.isFile(e)||yl.isBlob(e)?e:yl.isArrayBufferView(e)?e.buffer:yl.isURLSearchParams(e)?(Il(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):yl.isObject(e)?(Il(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};yl.forEach(["delete","get","head"],function(e){Ll.headers[e]={}}),yl.forEach(["post","put","patch"],function(e){Ll.headers[e]=yl.merge(Rl)});var kl=Ll;function Ml(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Fl=function(e){return Ml(e),e.headers=e.headers||{},e.data=Cl(e.data,e.headers,e.transformRequest),e.headers=yl.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),yl.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||kl.adapter)(e).then(function(t){return Ml(e),t.data=Cl(t.data,t.headers,e.transformResponse),t},function(t){return Al(t)||(Ml(e),t&&t.response&&(t.response.data=Cl(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},Bl=function(e,t){t=t||{};var n={},l=["url","method","data"],i=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],r=["validateStatus"];function a(e,t){return yl.isPlainObject(e)&&yl.isPlainObject(t)?yl.merge(e,t):yl.isPlainObject(t)?yl.merge({},t):yl.isArray(t)?t.slice():t}function u(l){yl.isUndefined(t[l])?yl.isUndefined(e[l])||(n[l]=a(void 0,e[l])):n[l]=a(e[l],t[l])}yl.forEach(l,function(e){yl.isUndefined(t[e])||(n[e]=a(void 0,t[e]))}),yl.forEach(i,u),yl.forEach(o,function(l){yl.isUndefined(t[l])?yl.isUndefined(e[l])||(n[l]=a(void 0,e[l])):n[l]=a(void 0,t[l])}),yl.forEach(r,function(l){l in t?n[l]=a(e[l],t[l]):l in e&&(n[l]=a(void 0,e[l]))});var s=l.concat(i).concat(o).concat(r),c=Object.keys(e).concat(Object.keys(t)).filter(function(e){return-1===s.indexOf(e)});return yl.forEach(c,u),n};function Ul(e){this.defaults=e,this.interceptors={request:new Tl,response:new Tl}}Ul.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Bl(this.defaults,e)).method=e.method?e.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var t=[Fl,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},Ul.prototype.getUri=function(e){return e=Bl(this.defaults,e),Sl(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},yl.forEach(["delete","get","head","options"],function(e){Ul.prototype[e]=function(t,n){return this.request(Bl(n||{},{method:e,url:t,data:(n||{}).data}))}}),yl.forEach(["post","put","patch"],function(e){Ul.prototype[e]=function(t,n,l){return this.request(Bl(l||{},{method:e,url:t,data:n}))}});var jl=Ul;function Hl(e){this.message=e}Hl.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Hl.prototype.__CANCEL__=!0;var Wl=Hl;function zl(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new Wl(e),t(n.reason))})}zl.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},zl.source=function(){var e;return{token:new zl(function(t){e=t}),cancel:e}};var Vl=zl;function ql(e){var t=new jl(e),n=dl(jl.prototype.request,t);return yl.extend(n,jl.prototype,t),yl.extend(n,t),n}var Gl=ql(kl);Gl.Axios=jl,Gl.create=function(e){return ql(Bl(Gl.defaults,e))},Gl.Cancel=Wl,Gl.CancelToken=Vl,Gl.isCancel=Al,Gl.all=function(e){return Promise.all(e)},Gl.spread=function(e){return function(t){return e.apply(null,t)}},Gl.isAxiosError=function(e){return"object"==typeof e&&!0===e.isAxiosError};var Kl=Gl;function Yl(e){let{documents:n,svgStyles:o={},isSendBackFlow:r=!1,isHrLine:a=!1,titleStyles:u}=e;const{t:s}=i.useTranslation(),c=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px",display:"flex",flexWrap:"wrap",flexDirection:"row",borderRadius:"4px",background:"#FAFAFA",border:"1px solid #D6D5D4",padding:"8px"}},!c&&(null==n?void 0:n.map((e,i)=>{var o,c,d;return l.createElement(l.Fragment,{key:i},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},l.createElement("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start"}},null!=e&&e.values&&(null==e?void 0:e.values.length)>0?null==e||null===(o=e.values)||void 0===o?void 0:o.map((n,i)=>{var o;return l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},s(null==e?void 0:e.title)),l.createElement("a",{target:"_",href:null==n?void 0:n.url,style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}},s(null==n?void 0:n.title)),r?null!=n&&null!==(o=n.documentType)&&void 0!==o&&o.includes("NOC")?l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType.split(".")[1])):l.createElement("p",{style:{textAlign:"center"}},s(null==n?void 0:n.documentType)):""))}):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")),l.createElement("div",{style:{width:"180px"}},l.createElement(t.CardSubHeader,{style:u||{marginTop:"32px",marginBottom:"8px",color:"#505A5F",fontSize:"24px"}}),l.createElement("div",{style:{minWidth:"80px",marginRight:"10px",maxWidth:"100px",height:"auto",minWidth:"100px"},key:i},l.createElement("div",{style:{display:"flex",justifyContent:"flex-start"}},l.createElement(t.PDFSvg,null)),l.createElement("p",{style:{marginTop:"8px",fontWeight:"bold",textAlign:"start",color:"#505A5F"}}),r?(null!==(c=value)&&void 0!==c&&null!==(d=c.documentType)&&void 0!==d&&d.includes("NOC"),l.createElement("p",{style:{textAlign:"center"}})):"")))),a&&(null==n?void 0:n.length)!=i+1?l.createElement("hr",{style:{color:"#D6D5D4",backgroundColor:"#D6D5D4",height:"2px",marginTop:"20px",marginBottom:"20px"}}):null))})),c&&(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"}},s(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"}},s(null==e?void 0:e.title)),null!=e&&e.docInfo?l.createElement("div",{style:{fontSize:"12px",color:"#505A5F",fontWeight:400,lineHeight:"15px",marginBottom:"10px"}},""+s(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"}},""+s(null==e?void 0:e.title))))):!window.location.href.includes("citizen")&&l.createElement("div",null,l.createElement("p",null,s("BPA_NO_DOCUMENTS_UPLOADED_LABEL")))))})))}Kl.default=Gl,Kl.interceptors.response.use(e=>e,e=>{var t,n;const l=window.location.pathname.split("/").includes("employee");if(null!=e&&null!==(t=e.response)&&void 0!==t&&null!==(n=t.data)&&void 0!==n&&n.Errors)for(const t of e.response.data.Errors){var i,o,r,a;t.message.includes("InvalidAccessTokenException")?(localStorage.clear(),sessionStorage.clear(),window.location.href=(l?"/digit-ui/employee/user/login":"/digit-ui/citizen/login")+"?from="+encodeURIComponent(window.location.pathname+window.location.search)):null!=t&&null!==(i=t.message)&&void 0!==i&&null!==(o=i.toLowerCase())&&void 0!==o&&o.includes("internal server error")||null!=t&&null!==(r=t.message)&&void 0!==r&&null!==(a=r.toLowerCase())&&void 0!==a&&a.includes("some error occured")?window.location.href=(l?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=maintenance&from="+encodeURIComponent(window.location.pathname+window.location.search):t.message.includes("ZuulRuntimeException")&&(window.location.href=(l?"/digit-ui/employee/user/error":"/digit-ui/citizen/error")+"?type=notfound&from="+encodeURIComponent(window.location.pathname+window.location.search))}throw e}),window.Digit=window.Digit||{},window.Digit=u({},window.Digit,{RequestCache:window.Digit.RequestCache||{}});const $l=e=>{var t,i;let{t:o,formData:r,applicationData:a,docs:u,bpaActionsDetails:s}=e;const c=(null==a?void 0:a.status)||"",d=(null==s||null===(t=s.data)||void 0===t?void 0:t.nextActions)||[],p=Digit.ULBService.getStateId(),[m,v]=n.useState((null==r||null===(i=r.documents)||void 0===i?void 0:i.documents)||[]),[f,h]=n.useState(null),[E,g]=n.useState([]),[y,_]=n.useState(!0),[S,b]=n.useState(!1),[T,C]=n.useState(!1),{isLoading:A,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,r;null!=D&&null!==(e=D.BPA)&&void 0!==e&&e.DocTypeMapping&&(i=null==D||null===(o=D.BPA)||void 0===o||null===(r=o.DocTypeMapping)||void 0===r?void 0:r.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 s=[];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)}),s.push(e)}),sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(s)),g(s)},[!A,!N]),n.useEffect(()=>{let e=0;E.map(t=>{let n=!1;m.map(e=>{t.required&&t.code==e.documentType.split(".")[0]+"."+e.documentType.split(".")[1]&&(n=!0)}),!n&&t.required&&(e+=1)}),_("0"!=e&&0!=e||!(m.length>0))},[m,S]),n.useEffect(()=>{C("DOC_VERIFICATION_INPROGRESS"===c&&(null==d?void 0:d.length)>0)},[a,s]),l.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},null==E?void 0:E.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(Xl,{key:t,index:t,document:e,t:o,error:f,setError:h,setDocuments:v,documents:m,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:E,checkEnablingDocs:T}))))};function Xl(e){var i,o;let{t:r,document:a,setDocuments:s,documents:c,index:d,bpaTaxDocuments:p,checkEnablingDocs:m}=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(),[h,E]=n.useState(v?u({},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]:{}),[g,y]=n.useState(null),[_,S]=n.useState(()=>(null==v?void 0:v.fileStoreId)||null),[b,T]=n.useState([]);return n.useEffect(()=>{null!=h&&h.code&&s(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==h?void 0:h.code));return 0===(null==_?void 0:_.length)||null===_?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==h?void 0:h.code,fileStoreId:_,documentUid:_,fileName:(null==g?void 0:g.name)||"",id:c?null===(t=c.find(e=>e.documentType===(null==h?void 0:h.code)))||void 0===t?void 0:t.id:void 0}]})},[_,h]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=h&&h.code&&a.newUploadedDocs.push({documentType:null==h?void 0:h.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]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[b,h]),n.useEffect(()=>{},[g]),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"}},""+r(null==a?void 0:a.code)),(null==a||null===(o=a.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(Yl,{documents:null==a?void 0:a.uploadedDocuments,svgStyles:{width:"100px",height:"100px",viewBox:"0 0 25 25",minWidth:"100px"}}),m?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?r(null==a?void 0:a.code)+"* ":""+r(null==a?void 0:a.code)),l.createElement(t.Dropdown,{className:"form-field",t:r,isMandatory:!1,option:null==a?void 0:a.dropdownData,selected:h,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&&T(l),(i=l[l.length-1])&&y(i.file)})(0,e),t:r,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"})))):null)}function Zl(e){let{fiReport:n,isCitizen:o=!1}=e;const{t:r}=i.useTranslation();return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginTop:"10px"}},l.createElement(o?t.CardHeader:t.CardSectionHeader,{style:{fontSize:"24px"}},""+r("BPA_FI_REPORT")),n.map((e,i)=>{var o,a,u,s,c,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)?""+r("BPA_FI_REPORT"):r("BPA_FI_REPORT")+" - "+(i+1)),l.createElement(t.Row,{className:"border-none",label:""+r("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===(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:""+r("BPA_FI_TIME_LABEL"),text:null!=e&&e.time?null==e?void 0:e.time:"NA"}),(null==e||null===(s=e.questions)||void 0===s?void 0:s.length)&&(null==e||null===(c=e.questions)||void 0===c?void 0:c.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:""+r(""+e.question),text:null!=e&&e.value?null==e?void 0:e.value:"NA"}),l.createElement(t.Row,{className:"border-none",label:""+r("BPA_ENTER_REMARKS"),text:e.remarks?e.remarks:"NA"})))),l.createElement(Yl,{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 Jl(e){let{t:i,document:o,setNocDocuments:r,setError:a,nocDocuments:u}=e;const s=null==u?void 0:u.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==o?void 0:o.code)})[0],c=Digit.ULBService.getStateId(),[d,p]=n.useState(),[m,v]=n.useState(null),[f,h]=n.useState(()=>(null==s?void 0:s.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&&r(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==m?void 0:m.name)||""}]})},[f]),n.useEffect(()=>{!function(){try{a(null);const e=function(){if(m){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(m.size>=5242880)a(i("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=m&&m.type&&!e.test(null==m?void 0:m.type))a(i("NOT_SUPPORTED_FILE_TYPE"));else{const e=y(function(){return h(null),Promise.resolve(Digit.UploadServices.Filestorage("PT",m,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?h(null==e||null===(l=e.data)||void 0===l||null===(o=l.files[0])||void 0===o?void 0:o.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)}}()},[m]),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:c,getFormState:e=>(e=>{let t=Object.fromEntries(e),n=Object.values(t);var l;(l=n[n.length-1])&&v(l.file)})(e),t:i,allowedFileTypesRegex:/(.*?)(jpg|jpeg|png|image|pdf)$/i,allowedMaxSizeInMB:5,acceptFiles:"image/*, .pdf, .png, .jpeg, .jpg"}))))}const Ql=e=>{var i;let{t:o,noc:r,docs:a,isNoc:u,applicationData:s,NOCdata:c,bpaActionsDetails:d}=e;Digit.ULBService.getStateId();const p=Digit.ULBService.getStateId(),m=(null==s?void 0:s.status)||"",v=(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:h}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:E}=Digit.Hooks.obps.useMDMS(p,"common-masters",["DocumentType"]),[g,y]=n.useState([]),[_,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=Digit.Hooks.useSessionStorage(null==r?void 0:r.nocType,[]),[D,N]=n.useState(null),P=window.location.href.includes("/employee/");return n.useEffect(()=>{var e;y(null==E||null===(e=E["common-masters"])||void 0===e?void 0:e.DocumentType)},[E]),n.useEffect(()=>{var e,t,n;let l,i=[];var o,a,c,d;l=u?null==f||null===(o=f.NOC)||void 0===o||null===(a=o.DocumentTypeMapping)||void 0===a?void 0:a.filter(e=>(null==e?void 0:e.applicationType)===(null==r?void 0:r.applicationType)&&(null==e?void 0:e.nocType)===(null==r?void 0:r.nocType)):null==h||null===(c=h.BPA)||void 0===c||null===(d=c.DocTypeMapping)||void 0===d?void 0:d.filter(e=>{var t,n;return e.WFState==(null==s?void 0:s.status)&&e.RiskType==(null==s?void 0:s.riskType)&&e.ServiceType==(null==s||null===(t=s.additionalDetails)||void 0===t?void 0:t.serviceType)&&e.applicationType==(null==s||null===(n=s.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==r?void 0:r.additionalDetails,applicationStatus:null==r?void 0:r.applicationStatus,appNumberLink:null==r?void 0:r.applicationNo,nocNo:null==r?void 0:r.nocNo},i.push(l[0].docTypes[0]));let p=[];i&&i.length>0&&(i.map(e=>{let t=e.documentType;e.dropdownData=[],null==g||g.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))},[f,g]),n.useEffect(()=>{T("NOC_VERIFICATION_INPROGRESS"===m&&(null==v?void 0:v.length)>0)},[s,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==r?void 0:r.nocType)+"_HEADER"):o("BPA_"+(null==r?void 0:r.nocType)+"_HEADER"),labelStyle:{fontSize:"20px",width:"150%"}}),c&&c.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(Yl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==_?void 0:_.map((e,t)=>l.createElement(Jl,{key:t,document:e,t:o,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},ei=e=>{let{permissions:i,t:o}=e;const[r,a,s]=Digit.Hooks.useSessionStorage("OBPS_APPROVAL_CHECKS",null==i?void 0:i.map(e=>({label:e,checked:!1}))),[c,d,p]=Digit.Hooks.useSessionStorage("OBPS_NEW_APPROVALS",[]);n.useEffect(()=>()=>{Digit.SessionStorage.del("OBPS_NEW_APPROVALS"),Digit.SessionStorage.del("OBPS_APPROVAL_CHECKS")},[]);const m=window.Digit.Utils.browser.isMobile();return l.createElement("div",null,l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},o("BPA_PERMIT_CONDITIONS")),null==r?void 0:r.map((e,n)=>l.createElement(t.CheckBox,{key:n,styles:{margin:"20px 0 40px",maxWidth:m?"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==r?void 0:r.map((e,t)=>n===t?u({},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)=>{d(()=>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:m?"96%":"830px",width:m?"96%":"830px"},style:m?{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:m?"5%":"35%"}}))),style:{},onClick:e=>(e=>{const t=[...c];t.splice(e,1),d([...t])})(n)}))),l.createElement(t.LinkButton,{style:{color:"#a82227",maxWidth:m?"fit-content":"10%",marginRight:"3%"},label:o("BPA_ADD_MORE"),onClick:()=>{d([...c,{label:""}])}}))};function ti(e){let{documents:o,svgStyles:r={},isSendBackFlow:a=!1}=e;const{t:u}=i.useTranslation(),[s,c]=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:[]]}),c(null===(e=t)||void 0===e?void 0:e.map(e=>null==e?void 0:e.fileStoreId))},[o]),n.useEffect(()=>{var e;null!=s&&s.length&&"BillAmend"===(null==o||null===(e=o[0])||void 0===e?void 0:e.BS)?Digit.UploadServices.Filefetch(s,Digit.ULBService.getCurrentTenantId()).then(e=>{p(null==e?void 0:e.data)}):null!=s&&s.length&&Digit.UploadServices.Filefetch(s,Digit.ULBService.getStateId()).then(e=>{p(null==e?void 0:e.data)})},[s]);const m=window.location.href.includes("employee/tl")||window.location.href.includes("/obps")||window.location.href.includes("employee/ws"),v=window.location.href.includes("stakeholder");return l.createElement("div",{style:{marginTop:"19px"}},!v&&(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:m?{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:m?{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!==(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")))))})),v&&(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!=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"}},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 ni(e){let{taxHeadEstimatesCalculation:n}=e;const{taxHeadEstimates:o}=n,{t:r}=i.useTranslation();return l.createElement("div",{style:{marginTop:"40px"}},l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:r("ES_PT_TITLE_TAX_HEADS"),text:r("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:r(e.taxHeadCode),label:r(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:r("ES_PT_TITLE_TOTAL_DUE_AMOUNT"),text:"₹ "+(null==n?void 0:n.totalAmount)||"N/A",className:"border-none",textStyle:{fontSize:"24px",fontWeight:"bold"}})))}function li(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 ii(e){let{owners:n}=e,o={};o=window.location.href.includes("/employee/pt/")?n.slice().reverse():n;const{t:r}=i.useTranslation(),a=(null==n?void 0:n.length)||1;let s={marginTop:"19px"},c={position:"relative",padding:"8px"},d={justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"};return Number(a)>1?s={marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:Number(a)>1||(s={marginTop:"19px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"},c={position:"relative",marginTop:"19px"}),window.location.href.includes("obps")&&(s=u({},s,{maxWidth:"950px"}),s=u({},s,{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:r(null==e?void 0:e.title),style:s,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?r(null==e?void 0:e.title)+" "+(n+1):r(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:r(e.title),label:r(e.title),text:l.createElement("img",{src:r(e.value),alt:"",privacy:null==e?void 0:e.privacy})}):l.createElement("span",null,l.createElement(t.Row,{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",textStyle:e.textStyle,privacy:null==e?void 0:e.privacy,rowContainerStyle:d}))}))))})))}const oi=e=>{var o,r,a,u,s,c,d,p,m,v,f,h,E,g,_,S,b,T,C,A,D,N,P;let{scrutinyDetails:x,paymentsList:w=[],additionalDetails:R,applicationData:I}=e;const O=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==I?void 0:I.status))&&window.location.href.includes("bpa"),[L,k]=n.useState(),[M,F]=n.useState(),[B,U]=n.useState(),j=Digit.ULBService.getStateId(),[H,W]=n.useState(),[z,V]=n.useState(),[q,G]=n.useState([]),[K,Y]=n.useState(),[$,X]=n.useState(""),[Z,J]=n.useState(null),[Q,ee]=n.useState({}),te={buttonStyle:{display:"flex",justifyContent:"flex-start",color:"#a82227"},headerStyle:{marginTop:"10px",fontSize:"16px",fontWeight:"700",lineHeight:"24px",color:" rgba(11, 12, 12, var(--text-opacity))"}},[ne,le]=n.useState(!1),[ie,oe]=n.useState(!1);n.useEffect(()=>{!function(){try{J(null);const e=function(){if(K&&null!=K&&K.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==K||null===(t=K.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(K.size>=2e6)J(re("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=y(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",K,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?G([...q,{fileStoreId:null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId,time:new Date}]):J(re("PT_FILE_UPLOAD_ERROR"))})},function(){});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}else J(re("PT_UPLOAD_FORMAT_NOT_SUPPORTED"))}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[K]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(q))},[q]),n.useEffect(()=>{var e,t,n,l,i,o,r;if(null!=R&&null!==(e=R.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==R?void 0:R.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==R||null===(n=R.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==R||null===(l=R.lessAdjustmentFeeFiles[(null==R||null===(i=R.lessAdjustmentFeeFiles)||void 0===i?void 0:i.length)-1])||void 0===l?void 0:l.fileStoreId:null});Digit.UploadServices.Filefetch(e,j).then(e=>ee(null==e?void 0:e.data))}k(null==R||null===(t=R.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==R||null===(n=R.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),F(null==R||null===(l=R.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==R||null===(i=R.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==R||null===(o=R.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==R||null===(r=R.selfCertificationCharges)||void 0===r?void 0:r.BPA_LESS_ADJUSMENT_PLOT),W(null==R?void 0:R.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==R?void 0:R.otherFeesDiscription),G(null==R?void 0:R.lessAdjustmentFeeFiles)},[R]);const{t:re}=i.useTranslation(),ae=e=>null!=e&&e.value&&null!=e&&e.isTransLate?l.createElement("span",{style:{color:"#00703C"}},re(null==e?void 0:e.value)):null!=e&&e.value&&null!=e&&e.isTransLate?re(null==e?void 0:e.value):null!=e&&e.value?null==e?void 0:e.value:void re("NA");return l.createElement(n.Fragment,null,!(null!=x&&x.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==x||null===(o=x.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:""+re(""+e.title),text:null!=e&&e.value?ae(e)+" "+re(null==e?void 0:e.isUnit):re("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:""+re(""+e.title),text:ae(e),labelStyle:null!=e&&e.isHeader?{fontSize:"20px"}:{}}):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px",margin:"0px"}},re(null==e?void 0:e.title)):l.createElement(t.CardSubHeader,{style:{fontSize:"20px",paddingBottom:"10px"}},re(null==e?void 0:e.title))),null==x||null===(r=x.permit)||void 0===r?void 0:r.map((e,n)=>l.createElement(t.CardLabel,{style:{fontWeight:"400"}},null==e?void 0:e.title))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==x||null===(a=x.values[0])||void 0===a?void 0:a.title)&&l.createElement("div",null,!ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!0)}},re("SHOW_P1_FEES_DETAILS"))),ie&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{oe(!1)}},re("HIDE_P1_FEES_DETAILS"))),ie&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P1_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BUILDING_APPLICATION_FEES"),text:"₹ "+Math.round(10.7639*(null==R?void 0:R.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:re("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==R?void 0:R.boundaryWallLength)}),l.createElement(t.Row,{className:"border-none"}))),window.location.href.includes("employee")&&"BPA_APPL_FEES_DETAILS"==(null==x||null===(u=x.values[0])||void 0===u?void 0:u.title)&&l.createElement("div",null,!ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!0)}},re("SHOW_P2_FEES_DETAILS"))),ne&&l.createElement("div",{style:te.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{le(!1)}},re("HIDE_P2_FEES_DETAILS"))),ne&&l.createElement("div",null,l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST")),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_MALBA_AMT"),text:"₹ "+(null==R||null===(s=R.selfCertificationCharges)||void 0===s?void 0:s.BPA_MALBA_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_LABOUR_AMT"),text:"₹ "+(null==R||null===(c=R.selfCertificationCharges)||void 0===c?void 0:c.BPA_LABOUR_CESS)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_WATER_AMT"),text:"₹ "+(null==R||null===(d=R.selfCertificationCharges)||void 0===d?void 0:d.BPA_WATER_CHARGES)}),l.createElement(t.Row,{className:"border-none",label:re("BPA_COMMON_GAUSHALA_AMT"),text:"₹ "+(null==R||null===(p=R.selfCertificationCharges)||void 0===p?void 0:p.BPA_GAUSHALA_CHARGES_CESS)}),l.createElement(t.CardSubHeader,null,re("BPA_P2_SUMMARY_FEE_EST_MANUAL")),l.createElement(t.CardLabel,null,re("BPA_COMMON_DEVELOPMENT_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"development",defaultValue:(null==R||null===(m=R.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:L,disabled:!O,onChange:e=>{!function(e){/^\d{0,9}$/.test(e)&&(k(e),sessionStorage.setItem("development",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"otherCharges",defaultValue:(null==R||null===(v=R.selfCertificationCharges)||void 0===v?void 0:v.BPA_OTHER_CHARGES)||0,value:M,disabled:!O,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(F(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(M)>0?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_OTHER_AMT_DISCRIPTION")),l.createElement(t.TextArea,{t:re,type:"text",name:"otherChargesDiscription",defaultValue:null==R||null===(f=R.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:H,disabled:!O,onChange:e=>{!function(e){W(e),sessionStorage.setItem("otherChargesDisc",e)}(e.target.value)},required:!0})):null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT")),l.createElement(t.TextInput,{t:re,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"lessAdjusment",defaultValue:(null==R||null===(h=R.selfCertificationCharges)||void 0===h?void 0:h.BPA_LESS_ADJUSMENT_PLOT)||"",value:B,disabled:!O,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==R||null===(t=R.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==R||null===(n=R.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==R||null===(l=R.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==R||null===(i=R.selfCertificationCharges)||void 0===i?void 0:i.BPA_GAUSHALA_CHARGES_CESS)?alert("Less adjustment fees cannot be grater than Total of other P2 fees"):(U(e),sessionStorage.setItem("lessAdjusment",e)))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(B)>0&&O?l.createElement("div",null,l.createElement(t.CardLabel,null,re("BPA_COMMON_LESS_AMT_FILE")),l.createElement(t.UploadFile,{id:"noc-doc",style:{marginBottom:"200px"},onUpload:function(e){V(e.target.files[0]),Y(e.target.files[0])},disabled:!O,onDelete:()=>{V(null),Y("")},message:z?"1 "+re("FILEUPLOADED"):re("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:$})):null,(null==Q||null===(E=Q.fileStoreIds)||void 0===E?void 0:E.length)&&parseInt(null==R||null===(g=R.selfCertificationCharges)||void 0===g?void 0:g.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement(t.CardLabel,{style:{marginTop:"15px"}},re("BPA_COMMON_LESS_AMT_PREVIOUS_FILE")),(null==Q||null===(_=Q.fileStoreIds)||void 0===_?void 0:_.length)&&parseInt(null==R||null===(S=R.selfCertificationCharges)||void 0===S?void 0:S.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(b=Q.fileStoreIds[(null==Q||null===(T=Q.fileStoreIds)||void 0===T?void 0:T.length)-1])||void 0===b?void 0:b.url},l.createElement(t.PDFSvg,null)),l.createElement(t.Row,{className:"border-none"}),l.createElement(t.Row,{className:"border-none",label:re("BPA_P2_TOTAL_FEE"),text:"₹ "+((parseFloat(L)?parseFloat(L):0)+parseFloat(M?parseFloat(M):0)+parseFloat(null==R||null===(C=R.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==R||null===(A=R.selfCertificationCharges)||void 0===A?void 0:A.BPA_LABOUR_CESS)+parseFloat(null==R||null===(D=R.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==R||null===(N=R.selfCertificationCharges)||void 0===N?void 0:N.BPA_GAUSHALA_CHARGES_CESS)-(parseFloat(B)?parseFloat(B):0))}))),l.createElement("div",null,null==x||null===(P=x.scruntinyDetails)||void 0===P?void 0:P.map((e,i)=>l.createElement(n.Fragment,null,l.createElement(t.Row,{className:"border-none",label:""+re(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"}},re(null==e?void 0:e.text))))))))},ri=e=>{var o,r,a,u,s;let{edcrDetails:c,applicationData:d}=e;const{t:p}=i.useTranslation(),m=window.Digit.Utils.browser.isMobile(),v=[{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"}],f=e=>{const t=e;return(e,n,l)=>e[t]},h=n.useMemo(()=>v.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function E(e){var t;let n=[];return null==e||null===(t=e.building)||void 0===t||t.floors.map(e=>{var t,l,i,o,r,a,u,s;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===(r=e.occupancies)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.floorArea)||0,CarpetArea:(null===(u=e.occupancies)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.CarpetArea)||0,key:p("BPA_FLOOR_NAME_"+e.number)})}),n}function g(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==c||null===(o=c.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==c||null===(r=c.subOccupancyTableDetails)||void 0===r||null===(a=r[0])||void 0===a||null===(u=a.value)||void 0===u||null===(s=u.planDetail)||void 0===s?void 0:s.blocks.map((e,n)=>{var i,o,r,a,u;return l.createElement("div",{key:n,style:(null==c||null===(i=c.subOccupancyTableDetails)||void 0===i||null===(o=i[0])||void 0===o||null===(r=o.value)||void 0===r||null===(a=r.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:g(n)})),l.createElement("div",{style:window.location.href.includes("citizen")||m?{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(e),columns:h,getCellProps:e=>({style:{}})})))})))},ai=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))},ui=e=>{var o,r,a;let{data:u,OpenImage:s,privacy:c={}}=e;const[d,p]=n.useState(!1),{t:m}=i.useTranslation();return l.createElement("div",null,u.date&&l.createElement("p",null,u.date),l.createElement("p",null,u.name),u.mobileNumber&&l.createElement("span",{style:{display:"inline-flex",width:"fit-content",marginLeft:"10px"}},l.createElement(t.TelePhone,{mobile:u.mobileNumber,privacy:c}),l.createElement("p",null," ")),u.source&&l.createElement("p",null,m("ES_APPLICATION_DETAILS_APPLICATION_CHANNEL_"+u.source.toUpperCase())),u.comment&&l.createElement(ai,{otherComment:null==u?void 0:u.otherComment,headComment:null==u?void 0:u.comment}),null!=u&&u.wfComment?l.createElement("div",null,null==u||null===(o=u.wfComment)||void 0===o?void 0:o.map(e=>l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("WF_COMMON_COMMENTS")),!d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical"}},e),e.length>36?l.createElement("button",{type:"button",onClick:()=>{p(!0)},style:{color:"#800000"}},m("View More")):null),d&&l.createElement("div",null,l.createElement("p",{style:{overflow:"visible"}},e),l.createElement("button",{type:"button",onClick:()=>{p(!1)},style:{color:"#800000"}},m("View Less")))))):null,(null==u||null===(r=u.thumbnailsToShow)||void 0===r||null===(a=r.thumbs)||void 0===a?void 0:a.length)>0?l.createElement("div",{className:"TLComments"},l.createElement("h3",null,m("CS_COMMON_ATTACHMENTS")),l.createElement(t.DisplayPhotos,{srcs:null==u?void 0:u.thumbnailsToShow.thumbs,onClick:(e,t)=>{s(e,t,null==u?void 0:u.thumbnailsToShow)}})):null)};function si(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 ci(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 di=e=>{var o,r,a,u,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation();let p=(m=location.search)?(/^[?#]/.test(m)?m.slice(1):m).split("&").reduce((e,t)=>{let[n,l]=t.split("=");return e[n]=l?decodeURIComponent(l.replace(/\+/g," ")):"",e},{}):{};var m;const v=null==p?void 0:p.mode;var{connectionDetails:f,plumberDetails:h,roadCuttingDetails:E,roadCuttingAddlDetails:g,activationDetails:y}=(null==c?void 0:c.additionalDetails)||{connectionDetails:[],plumberDetails:[],roadCuttingAddlDetails:[]};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"}},d("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:""+d(""+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===(r=c.additionalDetails)||void 0===r?void 0:r.plumberDetails)&&"MODIFY"!=v&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_COMMON_PLUMBER_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==h?void 0:h.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+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"}},d("WS_COMMON_ROAD_CUTTING_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"road-cutting-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:""+d(""+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.roadCuttingAddlDetails)&&l.createElement("div",null,l.createElement("br",null),l.createElement("div",{className:"road-cutting-addl-details-new-value-wrapper"},null==g?void 0:g.map((e,n)=>l.createElement("div",null,l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+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===(s=c.additionalDetails)||void 0===s?void 0:s.activationDetails)&&l.createElement(t.StatusTable,null,l.createElement(t.CardSubHeader,{style:{fontSize:"24px",marginBottom:"16px",marginTop:"32px"}},d("WS_ACTIVATION_DETAILS")),l.createElement("div",null,l.createElement("div",{className:"plumber-details-new-value-wrapper"},null==y?void 0:y.map((e,n)=>l.createElement(t.Row,{className:"border-none",key:""+e.title,label:""+d(""+e.title),text:null!=e&&e.oldValue?null==e?void 0:e.oldValue:null!=e&&e.value?null==e?void 0:e.value:""})))))))},pi=[{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"}],mi=[{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"}],vi=e=>{var o,r,a,s;let{wsAdditionalDetails:c}=e;const{t:d}=i.useTranslation(),[p,m,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,h,E]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==c||null===(o=c.additionalDetails)||void 0===o||!o.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[C,A]=n.useState(null),[D,N]=n.useState(c.additionalDetails.data?c.additionalDetails.data:{}),[P,x]=n.useState(c.additionalDetails.values?c.additionalDetails.values:[]),w=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(w,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=u({},null==c||null===(e=c.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,r,a,s,d,v,f;const e=[{title:"WS_APPLICATION_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(o=p.billDetails)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.fee)},{title:"WS_SERVICE_FEE_HEADER",value:l.createElement("span",null,"₹",null==p||null===(a=p.billDetails)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(v=d[0])||void 0===v?void 0:v.taxAmount)}];x(e),N(null==p||null===(f=p.billDetails)||void 0===f?void 0:f[0])}else m(i),T(i)},[]);let R={};const I=e=>l.createElement("h1",{className:"heading-m"},e.label),O=()=>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(O,null)),k=function(e,t,n){void 0===t&&(t=!1);let l=u({},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,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:""}T(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!=c&&null!==(r=c.additionalDetails)&&void 0!==r&&r.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(I,{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==c||null===(l=c.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,r,a,s,p,v,f,E,g,y;const e=null==c||null===(o=c.additionalDetails)||void 0===o||null===(r=o.appDetails)||void 0===r?void 0:r.applicationNo,t=null==c||null===(a=c.additionalDetails)||void 0===a||null===(s=a.appDetails)||void 0===s?void 0:s.tenantId,n=u({},null==c||null===(p=c.additionalDetails)||void 0===p||null===(v=p.appDetails)||void 0===v?void 0:v.additionalDetails,b);c.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==c||null===(f=c.additionalDetails)||void 0===f||null===(E=f.appDetails)||void 0===E?void 0:E.service)?[{applicationNo:e,tenantId:t,waterConnection:c.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:c.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==c||null===(g=c.additionalDetails)||void 0===g||null===(y=g.appDetails)||void 0===y?void 0:y.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,r,a,u,s,c,d,p,v,f,E,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===(E=f[0])||void 0===E||null===(g=E.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===(r=o[0])||void 0===r?void 0:r.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===(s=e.Calculation)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.charge},{title:"WS_TAX_HEADER",value:null===(d=e.Calculation)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.taxAmount}];h(Bn(e.Calculation[0])),N(null==e||null===(v=e.Calculation)||void 0===v?void 0:v[0]),x(y),b.billDetails=null==e?void 0:e.Calculation,m(b),S(!1)}).catch(e=>{var t,n,l,i,o,r;A({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===(r=o.Errors[0])||void 0===r?void 0:r.code)):d("PT_COMMON_ADD_REBATE_PENALITY")})})}else A({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:pi,optionKey:"title",select:e=>k("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=>k("adhocPenaltyComment",!1,e)},R={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=>k("adhocPenalty",!1,e)},R={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:mi,optionKey:"title",select:e=>k("adhocRebateReason",!0,e),selected:(null==b?void 0:b.adhocRebateReason_data)||"",name:"adhocRebateReason_data",isPropertyAssess:!0,t:d})),"PT_OTHERS"===(null==b||null===(s=b.adhocRebateReason_data)||void 0===s?void 0:s.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=>k("adhocRebateComment",!1,e)},R={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=>k("adhocRebate",!1,e)},R={isRequired:!0,pattern:"^[1-9]+[0-9]*$",title:d("ERR_DEFAULT_INPUT_FIELD_MSG")})))))," "),C&&l.createElement(t.Toast,{style:{zIndex:"10000"},warning:null==C?void 0:C.isWarning,error:null==C||!C.isWarning,label:d(null==C?void 0:C.message),onClose:()=>{A(!1)},isDleteBtn:!0})))},fi=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:u({},t),display:"inline",width:"22",height:"16",viewBox:"0 0 22 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M11 0.5C6 0.5 1.73 3.61 0 8C1.73 12.39 6 15.5 11 15.5C16 15.5 20.27 12.39 22 8C20.27 3.61 16 0.5 11 0.5ZM11 13C8.24 13 6 10.76 6 8C6 5.24 8.24 3 11 3C13.76 3 16 5.24 16 8C16 10.76 13.76 13 11 13ZM11 5C9.34 5 8 6.34 8 8C8 9.66 9.34 11 11 11C12.66 11 14 9.66 14 8C14 6.34 12.66 5 11 5Z",fill:"#a82227"})))},hi=e=>{let{t:n,userType:i=!1,infoBannerLabel:o="",infoClickLable:r="",infoClickInfoLabel:a="",infoClickInfoLabel1:u=""}=e;i=i||Digit.SessionStorage.get("userType");const s=window.Digit.Utils.browser.isMobile();return l.createElement(l.Fragment,null,l.createElement("div",{style:s?{}:{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(r)+" ",l.createElement(fi,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},Ei=e=>{var o,r,a,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:m}=i.useTranslation(),[v,f]=n.useState(!1),[h,E]=n.useState({}),g=e=>l.createElement("h1",{className:"heading-m"},e.label),y=()=>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"})),_=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(y,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),E(t),f(!0)})(),style:{marginTop:"12px"}},l.createElement("span",{style:{cursor:"pointer",color:"#a82227"}},m("WS_PAYMENT_VIEW_BREAKUP"))):null,v&&l.createElement(t.Modal,{headerBarMain:l.createElement(g,{label:m("WS_CALCULATION_BREAKUP")}),headerBarEnd:l.createElement(_,{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"}},m("WS_APPLICATION_FEE_HEADER")),null==h||null===(r=h.billSlabData)||void 0===r||null===(a=r.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:""+m(""+(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:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==h||null===(u=h.billSlabData)||void 0===u||null===(s=u.CHARGES)||void 0===s?void 0:s.map(e=>l.createElement(t.Row,{className:"border-none",rowContainerStyle:{margin:"0px"},labelStyle:{width:"50%"},key:""+(null==e?void 0:e.taxHeadCode),label:""+m(""+(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:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==h||null===(c=h.billSlabData)||void 0===c||null===(d=c.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:""+m(""+(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:""+m("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),text:l.createElement("span",null,"₹",Number(null==h?void 0:h.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},gi=e=>{let{assessmentData:t,applicationData:r}=e;const a=o.useHistory(),{t:u}=i.useTranslation(),[s,c]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{c(!s)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},s?"<":">"))),s&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===t.length?l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Assessments found"):t.map((e,n)=>l.createElement("div",{key:n,className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Date"),l.createElement("span",{style:{flex:"1",color:"black"}},new Date(e.assessmentDate).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-"))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Year"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.financialYear)),l.createElement("div",{className:"assessment-row with-buttons",style:{display:"flex",marginBottom:"8px",justifyContent:"space-between",alignItems:"center"}},l.createElement("div",{style:{display:"flex",gap:"75px"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Assessment Number"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},e.assessmentNumber)),l.createElement("div",{className:"button-group",style:{display:"flex",gap:"10px"}}," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",backgroundColor:"#2947a3",padding:"10px",color:"white"},onClick:()=>{a.push({pathname:"/digit-ui/citizen/pt/property/assessment-details/"+e.assessmentNumber,state:{Assessment:{channel:r.channel,financialYear:e.financialYear,propertyId:e.propertyId,source:r.source},submitLabel:u("PT_REASSESS_PROPERTY_BUTTON"),reAssess:!0}})}},"Re-assess")," ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("You are not allowed to perform this operation!!}")},"Cancel")," ")),n!==t.length-1&&l.createElement("hr",null)))))},yi=e=>{var t;let{applicationData:i}=e;const[r,a]=n.useState(!1);return o.useHistory(),l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{a(!r)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Application History"),l.createElement("span",{style:{fontSize:"1.2em"}},r?"<":">"))),r&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},l.createElement("div",{className:"assessment-item",style:{marginBottom:"15px"}},l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"100px",marginBottom:"8px"}},l.createElement("span",{style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Number"),l.createElement("span",{style:{flex:"1",color:"black"}},i.acknowldgementNumber)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"132px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Property ID No."),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.propertyId)),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"120px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Application Type"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},"NEW PROPERTY")),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"140px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Creation Date"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},(u=null===(t=i.auditDetails)||void 0===t?void 0:t.createdTime,new Date(u).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}).replace(/ /g,"-")))),l.createElement("div",{className:"assessment-row",style:{display:"flex",gap:"180px",marginBottom:"8px",color:"black"}},l.createElement("span",{className:"label",style:{fontWeight:"bold",minWidth:"60px",color:"black"}},"Status"),l.createElement("span",{className:"value",style:{flex:"1",color:"black"}},i.status)),l.createElement("div",null,l.createElement(o.Link,{to:{pathname:"/digit-ui/citizen/pt/property/application-preview/"+i.acknowldgementNumber,state:{propertyId:i.propertyId}},style:{color:"#2947a3",display:"inline",border:"1px solid",padding:"8px",borderRadius:"8px"}},"View History")))));var u},_i=e=>{let{payments:t}=e;const[i,o]=n.useState(!1);return l.createElement("div",{className:"accordion",style:{width:"100%",margin:"auto",fontFamily:"Roboto, sans-serif",border:"1px solid #ccc",borderRadius:"4px",marginBottom:"10px"}},l.createElement("div",{className:"accordion-header",style:{backgroundColor:"#f0f0f0",padding:"15px",cursor:"pointer"},onClick:()=>{o(!i)}},l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},l.createElement("h3",{style:{color:"#0d43a7",fontFamily:"Noto Sans,sans-serif",fontSize:"24px",fontWeight:"500"}},"Payment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},0===(null==t?void 0:t.length)&&l.createElement("div",{style:{color:"red",fontSize:"16px"}},"No Payemnts found")))};function Si(e){var r,a,s,c,d,p,m,v,f,h,E,g,y,S,b,T,C,A;let{applicationDetails:D,demandData:N,workflowDetails:P,isDataLoading:x,applicationData:w,timelineStatusPrefix:R,showTimeLine:I=!0,statusAttribute:O="status",paymentsList:L,oldValue:k,isInfoLabel:M=!1,propertyId:F,setIsCheck:B,isCheck:U}=e;const{t:j}=i.useTranslation(),H=o.useHistory(),W=Digit.ULBService.getCurrentTenantId(),[z,V]=n.useState(null),[q,G]=n.useState([]),[K,Y]=n.useState(!1),[$,X]=n.useState();let Z=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");console.log("appl",D);let{data:J}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"egf-master",[{name:"FinancialYear"}],{select:e=>{var t;return null==e||null===(t=e["egf-master"])||void 0===t?void 0:t.FinancialYear}});(null===(r=J)||void 0===r?void 0:r.length)>0&&(J=J.filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code)),J=J.sort((e,t)=>t.endingDate-e.endingDate)),console.log("financial year",J);const Q=e=>l.createElement("h1",{className:"heading-m"},e.label),ee=()=>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"})),te=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ee,null));function ne(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}const[le,ie]=n.useState({}),[oe,re]=n.useState(),[ae,ue]=n.useState([]);console.log("fetch bill data",le);const[se,ce]=n.useState({loading:!1,loaded:!1,canLoad:!1});console.log("filtered",ae),"ACTIVE"!=(null==w?void 0:w.status)||se.loading||se.loaded||se.canLoad||ce({loading:!1,loaded:!1,canLoad:!0}),null==se||!se.canLoad||se.loading||se.loaded||(ce({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(){console.log("bill Data",r),n(r),l({loading:!1,loaded:!0,canLoad:!0})}let r={};console.log("assessment data",i);const a=function(n){if((null==i||null===(n=i.Assessments)||void 0===n?void 0:n.length)>0){const n=i.Assessments.filter(e=>"ACTIVE"===e.status),l=new Map;n.forEach(e=>{const t=function(e){const t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}(e.assessmentDate)+"_"+e.financialYear,n=l.get(t);(!n||e.createdDate>n.createdDate)&&l.set(t,e)}),console.log("grouped",l);const o=Array.from(l.values());return ue(o),console.log(o),re(null==i?void 0:i.Assessments),Promise.resolve(Digit.PaymentService.fetchBill(e,{businessService:"PT",consumerCode:t})).then(function(e){r=e})}}();return a&&a.then?a.then(o):o()})}catch(e){return Promise.reject(e)}}((null==w?void 0:w.tenantId)||W,null==w?void 0:w.propertyId,ie,ce));const de=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()},pe=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:de(null==w||null===(i=w.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==w?void 0:w.channel)||""};return l.createElement(ui,{data:e})}if(window.location.href.includes("/obps/")||window.location.href.includes("/noc/")||window.location.href.includes("/ws/")){var o,r,a,u,s,c,d,p,m,v,f,h,E,g,y,S,b,T;const i={uuid:null==e||null===(o=e.assignes)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.uuid,fieldName:"mobileNumber",model:"User",showValue:!1,loadData:{serviceName:"/egov-workflow-v2/egov-wf/process/_search",requestBody:{},requestParam:{tenantId:null==D?void 0:D.tenantId,businessIds:null==D?void 0:D.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}}},C=n[t-1],A={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===(s=u[0])||void 0===s?void 0:s.name,mobileNumber:(null==w||null===(c=w.processInstance)||void 0===c||null===(d=c.assignes)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.uuid)===(null==e||null===(m=e.assignes)||void 0===m||null===(v=m[0])||void 0===v?void 0:v.uuid)&&null!=w&&null!==(f=w.processInstance)&&void 0!==f&&null!==(h=f.assignes)&&void 0!==h&&null!==(E=h[0])&&void 0!==E&&E.mobileNumber?null==w||null===(g=w.processInstance)||void 0===g||null===(y=g.assignes)||void 0===y||null===(S=y[0])||void 0===S?void 0:S.mobileNumber:null==e||null===(b=e.assignes)||void 0===b||null===(T=b[0])||void 0===T?void 0:T.mobileNumber,comment:j(null==e?void 0:e.comment),wfComment:C?C.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(ui,{data:A,OpenImage:ne,privacy:i})}{var C,A,N,P,x;const t={date:de(null==w||null===(C=w.auditDetails)||void 0===C?void 0:C.lastModifiedTime),name:null==e||null===(A=e.assignes)||void 0===A||null===(N=A[0])||void 0===N?void 0:N.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(P=e.assignes)||void 0===P||null===(x=P[0])||void 0===x?void 0:x.mobileNumber};return l.createElement(ui,{data:t})}},me=(e,t)=>e?t?e:j(e):j("NA"),ve=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),fe=window.location.href.includes("employee/noc"),he=window.location.href.includes("employee/obps"),Ee=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ve?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),ge=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?me(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+j(null==e?void 0:e.isUnit):j("N/A"):null!=e&&e.value?me(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):j("N/A"),[ye,_e]=n.useState(!1);console.log("demand Data arr",N),null==N||N.reduce((e,t)=>e+t.demandInterest,0),null==N||N.reduce((e,t)=>e+t.demandPenality,0),null==N||N.reduce((e,t)=>e+t.collectionTax,0),null==N||N.reduce((e,t)=>e+t.collectionInterest,0),null==N||N.reduce((e,t)=>e+t.collectionPenality,0),null==N||N.reduce((e,t)=>e+t.balanceTax,0),null==N||N.reduce((e,t)=>e+t.balanceInterest,0),null==N||N.reduce((e,t)=>e+t.balancePenality,0);const Se=function(e,t,n){try{if(!window.confirm("Are you sure you want to make this property "+t+"?"))return Promise.resolve();const l=u({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:u({},e.additionalDetails,{propertytobestatus:t}),workflow:u({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:u({},l)},W,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},be=D.applicationData,Te=(null==D||null===(a=D.applicationData)||void 0===a?void 0:a.propertyId)||"",Ce=null==D||null===(s=D.additionalDetails)||void 0===s?void 0:s.propertytobestatus;return console.log("applicationDetails?.applicationDetails",null==D?void 0:D.applicationDetails),console.log("infolabel",M),console.log("assessment details",oe),n.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:W,filters:{consumerCodes:F},auth:!0}).then(e=>{G(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},M?l.createElement(hi,{t:j,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==D||null===(c=D.applicationDetails)||void 0===c?void 0:c.map((e,i)=>{var r,a,u,s,c,d,p,m,v,f,h,E,g,y,_,S,b,T,C,A,N,x,w,R,I,O,M,F,H,W,z,V,q,G,K,Y,$,X,J,Q,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"}:ve?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&ve?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},fe?""+j(e.title):j(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},j(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"}},j(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"}},j(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},j(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ve?{position:"relative",marginTop:"19px"}:{}},(null==e?void 0:e.title)&&!(null!=e&&e.title.includes("NOC"))&&(null==e||null===(r=e.values)||void 0===r?void 0:r.map((n,i)=>{var r,a;return!0===n.map&&"N/A"!==n.value?l.createElement(t.Row,{labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"},key:j(n.title),label:null!=n&&n.labelComp?"<div>"+j(n.title)+" "+(null==n?void 0:n.labelComp)+"</div>":"t(value.title)",text:l.createElement("img",{src:j(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:j(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"}},j(null==n?void 0:n.title)))):fe||he?""+j(n.title):j(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===(a=e.values)||void 0===a?void 0:a.length)-1,caption:n.caption,className:"border-none",rowContainerStyle:Ee(),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:""+j(""+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:j(n.title),label:j(n.title),text:ge(n),last:i===(null==e||null===(r=e.values)||void 0===r?void 0:r.length)-1,caption:n.caption,className:"border-none",privacy:null==n?void 0:n.privacy,rowContainerStyle:Ee(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}))})))),(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(oi,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:L,additionalDetails:null==D||null===(u=D.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==D?void 0:D.applicationData}),(null==D||null===(s=D.applicationData)||void 0===s||null===(c=s.additionalDetails)||void 0===c||null===(d=c.fieldinspection_pending)||void 0===d?void 0:d.length)>0&&(null==e||null===(p=e.additionalDetails)||void 0===p?void 0:p.fiReport)&&l.createElement(Zl,{fiReport:null==D||null===(m=D.applicationData)||void 0===m||null===(v=m.additionalDetails)||void 0===v?void 0:v.fieldinspection_pending}),(null==e||null===(f=e.additionalDetails)||void 0===f?void 0:f.floors)&&l.createElement(li,{floors:null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.floors}),(null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.owners)&&l.createElement(ii,{owners:null==e||null===(g=e.additionalDetails)||void 0===g?void 0:g.owners}),(null==e||null===(y=e.additionalDetails)||void 0===y?void 0:y.units)&&l.createElement(ci,{units:null==e||null===(_=e.additionalDetails)||void 0===_?void 0:_.units}),(null==e||null===(S=e.additionalDetails)||void 0===S?void 0:S.accessories)&&l.createElement(si,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!Z&&(null==e||null===(T=e.additionalDetails)||void 0===T?void 0:T.permissions)&&(null==P||null===(C=P.data)||void 0===C||null===(A=C.nextActions)||void 0===A?void 0:A.length)>0&&l.createElement(ei,{applicationData:null==D?void 0:D.applicationData,t:j,permissions:null==e||null===(N=e.additionalDetails)||void 0===N?void 0:N.permissions}),(null==e||null===(x=e.additionalDetails)||void 0===x?void 0:x.obpsDocuments)&&l.createElement("div",{style:{display:"flex"}},l.createElement($l,{t:j,applicationData:null==D?void 0:D.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:P})),(null==e||null===(w=e.additionalDetails)||void 0===w?void 0:w.noc)&&l.createElement(Ql,{t:j,isNoc:!0,NOCdata:e.values,applicationData:null==D?void 0:D.applicationData,docs:e.additionalDetails.noc,noc:null===(R=e.additionalDetails)||void 0===R?void 0:R.data,bpaActionsDetails:P}),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.scruntinyDetails)&&l.createElement(oi,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.buildingExtractionDetails)&&l.createElement(oi,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.subOccupancyTableDetails)&&l.createElement(ri,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==D?void 0:D.applicationData}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.documentsWithUrl)&&l.createElement(Yl,{documents:null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.documentsWithUrl}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.taxHeadEstimatesCalculation)&&l.createElement(ni,{taxHeadEstimatesCalculation:null==e||null===(z=e.additionalDetails)||void 0===z?void 0:z.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(di,{wsAdditionalDetails:e,oldValue:k}),(null==e||null===(V=e.additionalDetails)||void 0===V?void 0:V.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(q=e.additionalDetails)||void 0===q||null===(G=q.redirectUrl)||void 0===G?void 0:G.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(K=e.additionalDetails)||void 0===K||null===(Y=K.redirectUrl)||void 0===Y?void 0:Y.title))),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.estimationDetails)&&l.createElement(vi,{wsAdditionalDetails:e,workflowDetails:P}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Ei,{wsAdditionalDetails:e,workflowDetails:P}),"Property Documents"===e.title&&null===(null==e||null===(J=e.additionalDetails)||void 0===J?void 0:J.assessmentDocuments)?l.createElement("p",null,"0"):l.createElement(ti,{documents:null==e||null===(Q=e.additionalDetails)||void 0===Q?void 0:Q.assessmentDocuments}),"DECLARATION"===e.title&&(null==e||null===(ee=e.additionalDetails)||void 0===ee?void 0:ee.declaration)&&l.createElement("div",null,l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},l.createElement(t.CheckBox,{onChange:e=>{B(e.target.checked)}}),l.createElement("p",null,null==e||null===(te=e.additionalDetails)||void 0===te?void 0:te.declaration)),!1===U&&l.createElement("p",{style:{color:"red"}},j("PT_CHECK_DECLARATION_BOX"))))}),!window.location.href.includes("/assessment-details")&&l.createElement(gi,{assessmentData:ae,applicationData:null==D?void 0:D.applicationData}),!window.location.href.includes("/assessment-details")&&l.createElement(_i,{payments:q}),!window.location.href.includes("/assessment-details")&&l.createElement(yi,{applicationData:null==D?void 0:D.applicationData}),I&&(null==P||null===(d=P.data)||void 0===d||null===(p=d.timeline)||void 0===p?void 0:p.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==P?void 0:P.isLoading)||x)&&l.createElement(t.Loader,null),!(null!=P&&P.isLoading)&&!x&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},j("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=P&&null!==(m=P.data)&&void 0!==m&&m.timeline&&1===(null==P||null===(v=P.data)||void 0===v||null===(f=v.timeline)||void 0===f?void 0:f.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:j(""+R+(null==P||null===(h=P.data)||void 0===h||null===(E=h.timeline[0])||void 0===E?void 0:E.state)),customChild:pe(null==P||null===(g=P.data)||void 0===g?void 0:g.timeline[0],null==P||null===(y=P.data)||void 0===y?void 0:y.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==P||null===(S=P.data)||void 0===S?void 0:S.timeline)&&(null==P||null===(b=P.data)||void 0===b?void 0:b.timeline.slice(0,ye?null==P?void 0:P.data.timeline.length:2).map((e,n,i)=>{var o;let r="";var a,u,s,c,d,p;return window.location.href.includes("/obps/")&&(r=null!=P&&null!==(a=P.data)&&void 0!==a&&null!==(u=a.timeline[n-1])&&void 0!==u&&null!==(s=u.state)&&void 0!==s&&s.includes("BACK_FROM")||null!=P&&null!==(c=P.data)&&void 0!==c&&null!==(d=c.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:j(""+R+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[O])+r),customChild:pe(e,n,null==P||null===(o=P.data)||void 0===o?void 0:o.timeline)}))}))),(null==P||null===(T=P.data)||void 0===T||null===(C=T.timeline)||void 0===C?void 0:C.length)>2&&l.createElement(t.LinkButton,{label:j(ye?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{_e(e=>!e)}})))),l.createElement(t.ActionBar,{className:"clear-search-container",style:{display:"block"}},l.createElement(t.SubmitBar,{label:"Make Property Active",style:{flex:1},onSubmit:()=>{window.location.href.includes("/citizen")?alert("Action to activate property is not allowed for citizen"):"INACTIVE"==Ce?Se(be,"ACTIVE",Te):alert("Property is already active.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("/citizen")?alert("Action to Inactivate property is not allowed for citizen"):"ACTIVE"==Ce?Se(be,"INACTIVE",Te):alert("Property is already inactive.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==D||null===(e=D.applicationData)||void 0===e?void 0:e.propertyId;t&&H.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{Y(!0)}})),z&&l.createElement(t.Toast,{error:z.isError,label:j(z.label),onClose:()=>{V(null)},isDleteBtn:"false"}),K&&l.createElement(t.Modal,{headerBarMain:l.createElement(Q,{label:j("PT_FINANCIAL_YEAR_PLACEHOLDER")}),headerBarEnd:l.createElement(te,{onClick:()=>{Y(!1)}}),actionCancelLabel:"Cancel",actionCancelOnSubmit:e=>{console.log("in Print"),Y(!1)},actionSaveLabel:"Access",actionSaveOnSubmit:()=>{console.log("in Apply")},formId:"modal-action",popupStyles:{width:"60%",marginTop:"5px"}},l.createElement(l.Fragment,null,(null===(A=J)||void 0===A?void 0:A.length)>0&&l.createElement(n.Fragment,null,J.map((e,t)=>l.createElement("div",{key:t,style:{marginBottom:"8px"}},l.createElement("label",null,l.createElement("input",{type:"radio",value:e.code,checked:$===e.code,onChange:e=>X(e.target.value),name:"custom-radio"}),e.name)))))))}function bi(e){var n,i,o,r,a,u,s,c,d,p,m,v,f,h,E,g,y,_;let{t:S,showToast:b,closeToast:T,businessService:C}=e;if(null!=C&&C.includes("NewTL")||null!=C&&C.includes("TL")||null!=C&&C.includes("EDITRENEWAL")){var A;let e="";switch(null==b||null===(A=b.action)||void 0===A?void 0:A.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===(o=b.error)||void 0===o?void 0:o.message:S("TL_APPROVAL_CHECKLIST_MESSAGE_HEAD");break;case"SENDBACKTOCITIZEN":e="error"===(null==b?void 0:b.key)?null==b||null===(r=b.error)||void 0===r?void 0:r.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===(s=b.error)||void 0===s?void 0:s.message:S("TL_TL_CANCELLED_MESSAGE_HEAD");break;default:e="error"===(null==b?void 0:b.key)?null==b||null===(c=b.error)||void 0===c?void 0:c.message:S("ES_"+C+"_"+(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!=C&&C.includes("BPA")||null!=C&&C.includes("BPA_LOW")||null!=C&&C.includes("BPA_OC")){var D;const e=function(e){var t;void 0===e&&(e=[]);let n=e[0];return n=2==(null===(t=e)||void 0===t?void 0:t.length)&&null!=C&&C.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===(m=b.error)||void 0===m?void 0:m.message:e(["BPA_FORWARD_SUCCESS_MESSAGE_MAIN"]);break;case"SEND_BACK_TO_CITIZEN":n="error"===(null==b?void 0:b.key)?null==b||null===(v=b.error)||void 0===v?void 0:v.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;case"APPROVE":n="error"===(null==b?void 0:b.key)?null==b||null===(f=b.error)||void 0===f?void 0:f.message:e(["BPA_APPROVAL_CHECKLIST_MESSAGE_HEAD"]);break;case"REJECT":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.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===(E=b.error)||void 0===E?void 0:E.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===(g=b.error)||void 0===g?void 0:g.message:e(["BPA_SENDBACK_SUCCESS_MESSAGE_MAIN"]);break;default:n="error"===(null==b?void 0:b.key)?null==b||null===(y=b.error)||void 0===y?void 0:y.message:S("ES_"+C+"_"+(null==b||null===(_=b.action)||void 0===_?void 0:_.action)+"_UPDATE_SUCCESS")}return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:n,onClose:T}))}{var N,P;const e="error"===(null==b?void 0:b.key)?null==b||null===(N=b.error)||void 0===N?void 0:N.message:"ES_"+C+"_"+(null==b||null===(P=b.action)||void 0===P?void 0:P.action)+"_UPDATE_SUCCESS";return l.createElement(l.Fragment,null,b&&l.createElement(t.Toast,{error:"error"===b.key,label:S(e),onClose:T}))}}function Ti(e){var o,r,a,s,c,d,p,m,v,f,h,E,g,y,_,S;let{workflowDetails:b,displayMenu:T,onActionSelect:C,setDisplayMenu:A,businessService:D,forcedActionPrefix:N,ActionBarStyle:P={},MenuStyle:x={}}=e;const{t:w}=i.useTranslation();let R=Digit.UserService.getUser();const I=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):{};R=null==t?void 0:t.value}const O=null===(o=R)||void 0===o||null===(r=o.info)||void 0===r||null===(a=r.roles)||void 0===a?void 0:a.map(e=>e.code);let L=!1,k=!1,M=(null==b||null===(s=b.data)||void 0===s||null===(c=s.actionState)||void 0===c||null===(d=c.nextActions)||void 0===d?void 0:d.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles))||(null==b||null===(p=b.data)||void 0===p||null===(m=p.nextActions)||void 0===m?void 0:m.filter(e=>(null==O?void 0:O.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(I,()=>{A(!1)},T),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==M?void 0:M.length)||null!=M&&null!==(v=M[0])&&void 0!==v&&null!==(f=v.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==M?void 0:M.length)?(k=!1,L=!0):(null==M?void 0:M.length)>0&&(k=!0,L=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&k&&!L&&l.createElement(t.ActionBar,{style:u({},P)},T&&(null!=b&&null!==(h=b.data)&&void 0!==h&&null!==(E=h.actionState)&&void 0!==E&&E.nextActions||null!=b&&null!==(g=b.data)&&void 0!==g&&g.nextActions)?l.createElement(t.Menu,{localeKeyPrefix:N||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()),options:M,optionKey:"action",t:w,onSelect:C,style:x}):null,l.createElement(t.SubmitBar,{ref:I,label:w("WF_TAKE_ACTION"),onSubmit:()=>A(!T)})),!(null!=b&&b.isLoading)&&!k&&L&&l.createElement(t.ActionBar,{style:u({},P)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==M||null===(y=M[0])||void 0===y?void 0:y.action,value:null==M||null===(_=M[0])||void 0===_?void 0:_.action,onClick:e=>{C((null==M?void 0:M[0])||{})}},w((N||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==M||null===(S=M[0])||void 0===S?void 0:S.action)))))}const Ci=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Ai=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ci,null));function Di(e){let{action:n,closeWarningPopup:o}=e;const{t:r}=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"},r("PT_DUES_ARE_PENDING")),headerBarEnd:l.createElement(Ai,{onClick:()=>{o()}}),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,r("PT_YOU_HAVE")," ₹",null==n?void 0:n.AmountDueForPay," ",r("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:""+r("PT_AMOUNT_DUE"),text:"₹"+r(null==n?void 0:n.AmountDueForPay)}),l.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-end"}},l.createElement(t.ButtonSelector,{theme:"border",label:r("ES_PT_COMMON_CANCEL"),onSubmit:o,style:{marginLeft:"10px"}}),l.createElement(t.ButtonSelector,{label:r("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 Ni=e=>{var r,s;console.log("props",e);let c=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");const d=Digit.ULBService.getCurrentTenantId(),p=Digit.ULBService.getStateId(),{data:m}=Digit.Hooks.obps.useMDMS(p,"BPA",["BlockReason"]),{t:v}=i.useTranslation(),f=o.useHistory();let{id:h}=o.useParams();const[E,g]=n.useState(!1),[_,S]=n.useState(null),[b,T]=n.useState(!1),[C,A]=n.useState(!1),[D,N]=n.useState(!1),{data:P}=Digit.Hooks.obps.useMDMS(p,"BPA",["RiskTypeComputation"]),{applicationDetails:x,demandData:w,totalDemandTax:R,totalBalanceTax:I,showToast:O,setShowToast:L,isLoading:k,isDataLoading:M,applicationData:F,mutate:B,nocMutation:U,workflowDetails:j,id:H,businessService:W,closeToast:z,moduleCode:V,timelineStatusPrefix:q,forcedActionPrefix:G,statusAttribute:K,ActionBarStyle:Y,MenuStyle:$,paymentsList:X,showTimeLine:Z=!0,oldValue:J,isInfoLabel:Q=!1,clearDataDetails:ee,propertyId:te,setIsCheck:ne,isCheck:le}=e;n.useEffect(()=>{O&&j.revalidate()},[O]);const ie=a.useQueryClient(),oe=()=>{S(null),T(!1)};return k||C?l.createElement(t.Loader,null):(console.log("application Details in template",x),l.createElement(l.Fragment,null,k?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Si,{applicationDetails:x,demandData:w,id:H,workflowDetails:j,isDataLoading:M,applicationData:F,totalDemandTax:R,totalBalanceTax:I,businessService:W,timelineStatusPrefix:q,statusAttribute:K,paymentsList:X,showTimeLine:Z,oldValue:J,isInfoLabel:Q,propertyId:te,setIsCheck:ne,isCheck:le}),b?l.createElement(cl,{t:v,action:_,tenantId:d,state:p,id:h,applicationDetails:x,applicationData:null==x?void 0:x.applicationData,closeModal:oe,submitAction:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n={});try{let l=!1;const i=function(i,o,r,a,s,c,d,p,m,h,E,g,S,b,T,C,D,N){if(0==(null==e||null===(i=e.Property)||void 0===i||null===(o=i.workflow)||void 0===o||null===(r=o.comment)||void 0===r?void 0:r.length)||("INITIATE"===(null==e||null===(a=e.Licenses)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.action)?0==(null==e||null===(c=e.Licenses)||void 0===c||null===(d=c[0])||void 0===d||null===(p=d.additionalDetail)||void 0===p||null===(m=p.validityYears)||void 0===m?void 0:m.length):0==(null==e||null===(h=e.Licenses)||void 0===h||null===(E=h[0])||void 0===E||null===(g=E.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(S=e.WaterConnection)||void 0===S||null===(b=S.comment)||void 0===b?void 0:b.length)||0==(null==e||null===(T=e.SewerageConnection)||void 0===T||null===(C=T.comment)||void 0===C?void 0:C.length)||0==(null==e||null===(D=e.BPA)||void 0===D||null===(N=D.comment)||void 0===N?void 0:N.length)){var P,x;"INITIATE"===(null==e||null===(P=e.Licenses)||void 0===P||null===(x=P[0])||void 0===x?void 0:x.action)?alert(v("Please fill in the validity before submitting")):alert(v("Please fill in the comments before submitting"))}else{const i=function(i,o,r,a,s){if("BPA"!=(null==e||null===(i=e.BPA)||void 0===i?void 0:i.businessService)||null!=e&&null!==(o=e.BPA)&&void 0!==o&&null!==(r=o.additionalDetails)&&void 0!==r&&r.blockingReason||"BLOCK"!=(null==e||null===(a=e.BPA)||void 0===a||null===(s=a.workflow)||void 0===s?void 0:s.action)){function c(t){if(l)return t;B&&(A(!0),B(e,{onError:(e,t)=>{A(!1),L({key:"error",error:e}),setTimeout(z,5e3)},onSuccess:(e,t)=>{var l,i,o,r,a,u;if(sessionStorage.removeItem("WS_SESSION_APPLICATION_DETAILS"),A(!1),null!==(l=n)&&void 0!==l&&l.bpa&&(e.selectedAction=_,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=_,f.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&f.push("/digit-ui/employee/noc/response",{data:e}),(null==e||null===(r=e.Amendments)||void 0===r?void 0:r.length)>0){var s,c,d,p,m,h,E,g;null!=t&&null!==(s=t.AmendmentUpdate)&&void 0!==s&&null!==(c=s.workflow)&&void 0!==c&&c.action.includes("SEND_BACK")?L({key:"success",label:v("ES_MODIFYSWCONNECTION_SEND_BACK_UPDATE_SUCCESS")}):null!=t&&null!==(d=t.AmendmentUpdate)&&void 0!==d&&null!==(p=d.workflow)&&void 0!==p&&p.action.includes("RE-SUBMIT")?L({key:"success",label:v("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(h=m.workflow)&&void 0!==h&&h.action.includes("APPROVE")?L({key:"success",label:v("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(E=t.AmendmentUpdate)&&void 0!==E&&null!==(g=E.workflow)&&void 0!==g&&g.action.includes("REJECT")&&L({key:"success",label:v("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var y;if((null==e||null===(a=e.Licenses)||void 0===a?void 0:a.length)>0&&null!=e&&null!==(u=e.Licenses[0])&&void 0!==u&&u.applicationNumber)return L({key:"success",action:_}),void f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(y=e.Licenses[0])||void 0===y?void 0:y.applicationNumber));L({key:"success",action:_}),ee&&setTimeout(ee,3e3),setTimeout(z,5e3),ie.clear(),ie.refetchQueries("APPLICATION_SEARCH")}}})),oe()}A(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(u({},e)));const i=function(){if(!1!==t&&U){var e;const n=null===(e=t)||void 0===e?void 0:e.map(e=>null==U?void 0:U.mutateAsync(e)),i=y(function(){return A(!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,r,a,u,s,c,d,p,m;A(!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?v(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.code):(null==e||null===(c=e.response)||void 0===c||null===(d=c.data)||void 0===d||null===(p=d.Errors)||void 0===p||null===(m=p[0])||void 0===m?void 0:m.message)||e;oe(),L({key:"error",error:{message:f}}),setTimeout(z,5e3),l=!0});if(i&&i.then)return i.then(function(){})}}();return i&&i.then?i.then(c):c(i)}alert(v("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==j||null===(r=j.data)||void 0===r?void 0:r.timeline,businessService:W,workflowDetails:j,moduleCode:V,blockReason:null==m||null===(s=m.BPA)||void 0===s?void 0:s.BlockReason}):null,D?l.createElement(Di,{action:_,workflowDetails:j,businessService:W,isWarningPop:D,closeWarningPopup:()=>{N(!1)}}):null,l.createElement(bi,{t:v,showToast:O,closeToast:z,businessService:W}),c?l.createElement("div",null,l.createElement(t.SubmitBar,{style:{marginRight:20},label:v("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(d,{applicationNo:null==F?void 0:F.applicationNo})).then(function(e){var t,n,l,i,o,r;const a=Digit.Utils.obps.calculateRiskType(null==P||null===(t=P.BPA)||void 0===t?void 0:t.RiskTypeComputation,null==x||null===(n=x.edcrDetails)||void 0===n||null===(l=n.planDetail)||void 0===l||null===(i=l.plot)||void 0===i?void 0:i.area,null==x||null===(o=x.edcrDetails)||void 0===o||null===(r=o.planDetail)||void 0===r?void 0:r.blocks),u={BPA:e.BPA[0]};u.BPA.riskType=a,u.BPA.workflow={action:"EDIT PAY 2",assignes:[],comments:null,varificationDocuments:null},u.BPA.additionalDetails.selfCertificationCharges.BPA_DEVELOPMENT_CHARGES=sessionStorage.getItem("development")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_OTHER_CHARGES=sessionStorage.getItem("otherCharges")||"0",u.BPA.additionalDetails.selfCertificationCharges.BPA_LESS_ADJUSMENT_PLOT=sessionStorage.getItem("lessAdjusment")||"0",u.BPA.additionalDetails.otherFeesDiscription=sessionStorage.getItem("otherChargesDisc"),u.BPA.additionalDetails.lessAdjustmentFeeFiles=JSON.parse(sessionStorage.getItem("uploadedFileLess"));const s=function(e,t,n,l,i,o,r,a,s,c,p,m){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(n=t.selfCertificationCharges)||void 0===n?void 0:n.BPA_MALBA_CHARGES)+parseInt(null==u||null===(l=u.BPA)||void 0===l||null===(i=l.additionalDetails)||void 0===i||null===(o=i.selfCertificationCharges)||void 0===o?void 0:o.BPA_LABOUR_CESS)+parseInt(null==u||null===(r=u.BPA)||void 0===r||null===(a=r.additionalDetails)||void 0===a||null===(s=a.selfCertificationCharges)||void 0===s?void 0:s.BPA_WATER_CHARGES)+parseInt(null==u||null===(c=u.BPA)||void 0===c||null===(p=c.additionalDetails)||void 0===p||null===(m=p.selfCertificationCharges)||void 0===m?void 0:m.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,d)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(v("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0})):l.createElement(Ti,{workflowDetails:j,displayMenu:E,onActionSelect:function(e){var t,n,l;if(e)if("EDIT PAY 2"==(null==e?void 0:e.action)&&window.location.href.includes("bpa")&&window.location.assign(window.location.href.split("bpa")[0]+"editApplication/bpa"+window.location.href.split("bpa")[1]),null!=e&&e.isToast)L({key:"error",error:{message:null==e?void 0:e.toastMessage}}),setTimeout(z,5e3);else if(null!=e&&e.isWarningPopUp)N(!0);else if(null!=e&&e.redirectionUrll){var i,o,r,a,s;if("ACTIVATE_CONNECTION"===(null==e||null===(i=e.redirectionUrll)||void 0===i?void 0:i.action))f.push(""+(null==e||null===(r=e.redirectionUrll)||void 0===r?void 0:r.pathname),JSON.stringify({data:null==e||null===(a=e.redirectionUrll)||void 0===a?void 0:a.state,url:""+(null===(s=location)||void 0===s?void 0:s.pathname)+location.search}));else if("RE-SUBMIT-APPLICATION"===(null==e||null===(o=e.redirectionUrll)||void 0===o?void 0:o.action)){var c,d;f.push(""+(null==e||null===(c=e.redirectionUrll)||void 0===c?void 0:c.pathname),{data:null==e||null===(d=e.redirectionUrll)||void 0===d?void 0:d.state})}else{var p;window.location.assign(window.location.origin+"/digit-ui/employee/payment/collect/"+(null==e||null===(p=e.redirectionUrll)||void 0===p?void 0:p.pathname))}}else if(null!=e&&e.redirectionUrl||"EDIT PAY 2"==(null==e?void 0:e.action))if("DIRECTRENEWAL"===(null==e||null===(t=e.redirectionUrl)||void 0===t||null===(n=t.state)||void 0===n||null===(l=n.applicationData)||void 0===l?void 0:l.workflowCode))console.log("Got Inside Direct"),T(!0);else{var m,v;f.push({pathname:null===(m=e.redirectionUrl)||void 0===m?void 0:m.pathname,state:u({},null===(v=e.redirectionUrl)||void 0===v?void 0:v.state)})}else T(!0);S(e),g(!1)},setDisplayMenu:g,businessService:W,forcedActionPrefix:G,ActionBarStyle:Y,MenuStyle:$}))))},Pi=["tenantId","payments"];var xi=l.memo(()=>{var e,r,a,c,d,m,v,f,h,E,g,y,_;const{t:S}=i.useTranslation(),{data:b}=Digit.Hooks.useStore.getInitData(),T=Digit.ULBService.getCurrentTenantId(),{tenants:C}=b||{},{id:A}=o.useParams(),[D,N]=n.useState(null),[P,x]=n.useState({}),[w,R]=n.useState(!1),[O,L]=n.useState(!1),[k,M]=n.useState("ptr");console.log("gggggg",P),sessionStorage.setItem("applicationNoinAppDetails",A);const{isLoading:F,data:B}=Digit.Hooks.ptr.usePtrApplicationDetail(S,T,A),{mutate:U}=Digit.Hooks.ptr.usePTRApplicationAction(T);let j=Digit.Hooks.useWorkflowDetails({tenantId:(null==B||null===(e=B.applicationData)||void 0===e?void 0:e.tenantId)||T,id:null==B||null===(r=B.applicationData)||void 0===r||null===(a=r.applicationData)||void 0===a?void 0:a.applicationNumber,moduleCode:k,role:"PT_CEMP"});var H,W;console.log("workkkkflooowowow",j),Digit.Hooks.ptr.usePTRSearch({tenantId:T,filters:{applicationNumber:A,audit:!0}}),n.useEffect(()=>{B&&x(p.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"===k||M(null==j||null===(n=j.data)||void 0===n?void 0:n.applicationBusinessService)},[j.data]),!Digit.UserService.hasAccess(["PT_CEMP"])||"ptr"!==(null==j||null===(c=j.data)||void 0===c?void 0:c.applicationBusinessService)||null==j||null===(d=j.data)||void 0===d||null===(m=d.actionState)||void 0===m||null===(v=m.nextActions)||void 0===v||!v.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:"/digit-ui/employee/payment/collect/pet-services/"+(null==P||null===(t=P.applicationData)||void 0===t||null===(n=t.applicationData)||void 0===n?void 0:n.applicationNumber)}}:e}));let z=[{order:1,label:S("PTR_APPLICATION"),onClick:()=>function(){try{const e=null==P?void 0:P.applicationData,t=C.find(t=>t.code===e.tenantId);return Promise.resolve(I(e.applicationData,t,S)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}];const{data:V,isLoading:q}=Digit.Hooks.useRecieptSearch({tenantId:T,businessService:"pet-services",consumerCodes:null==P||null===(f=P.applicationData)||void 0===f||null===(h=f.applicationData)||void 0===h?void 0:h.applicationNumber,isEmployee:!1},{enabled:!(null==P||null===(E=P.applicationData)||void 0===E||null===(g=E.applicationData)||void 0===g||!g.applicationNumber)});return V&&(null==V?void 0:V.Payments.length)>0&&0==q&&z.push({label:S("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,Pi);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==V||null===(e=V.Payments[0])||void 0===e?void 0:e.tenantId,payments:null==V?void 0:V.Payments[0]})}}),"APPROVED"===(null==V||null===(y=V.Payments[0])||void 0===y?void 0:y.instrumentStatus)&&z.push({label:S("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(T,{PetRegistrationApplications:[null==B||null===(e=B.applicationData)||void 0===e?void 0:e.applicationData]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(T,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),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"}},S("PTR_PET_APPLICATION_DETAILS")),z&&z.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper employee-mulitlink-main-div",onHeadClick:()=>R(!w),displayOptions:w,options:z,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(Ni,{applicationDetails:null==P?void 0:P.applicationData,isLoading:F,isDataLoading:F,applicationData:null==P||null===(_=P.applicationData)||void 0===_?void 0:_.applicationData,mutate:U,workflowDetails:j,businessService:k,moduleCode:"pet-services",showToast:D,setShowToast:N,closeToast:()=>{N(null)},timelineStatusPrefix:"PTR_COMMON_STATUS_",forcedActionPrefix:"EMPLOYEE_PTR",statusAttribute:"state",MenuStyle:{color:"#FFFFFF",fontSize:"18px"}}))});const wi=(e,t,n,l,i)=>i((l?"E":"C")+"S_PTR_RESPONSE_"+(t||"CREATE")+"_"+e+(n?"":"_ERROR")),Ri=(e,t,n,l)=>wi("LABEL",e,t,n,l),Ii=e=>{var n,i,o,r,a,u,s,c,d,p,m,v,f;return l.createElement(t.Banner,{message:(p=(null==e||null===(n=e.data)||void 0===n||null===(i=n.PetRegistrationApplications)||void 0===i||null===(o=i[0])||void 0===o?void 0:o.applicationStatus)||e.action,m=e.isSuccess,v=e.isEmployee,f=e.t,wi("ACTION",p,m,v,f)),applicationNumber:null==e||null===(r=e.data)||void 0===r||null===(a=r.PetRegistrationApplications)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.applicationNumber,info:Ri((null===(s=e.data)||void 0===s||null===(c=s.PetRegistrationApplications)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.applicationStatus)||e.action,e.isSuccess,e.isEmployee,e.t),successful:e.isSuccess})},Oi=e=>{const{t:t}=i.useTranslation();return t(null!=e&&e.isSuccess?"CS_PROPERTY_FEEDBACK_SUCCESS":"CS_PROPERTY_FEEDBACK_FAILED")},Li=e=>l.createElement(t.Banner,{message:Oi(e),applicationNumber:"",style:e.isMobile?{width:"unset"}:{width:"740px"},successful:null==e?void 0:e.isSuccess}),ki={PTRCheckPage:e=>{var r,a,u,s;let{onSubmit:c,value:d={}}=e;const{t:p}=i.useTranslation(),{address:v,pets:f,isEditPET:h,isUpdatePET:E,ownerss:y}=(o.useHistory(),d),_=h||E?"edit-application":"new-application",[S,b]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(g,{currentStep:5}):null,l.createElement(t.Card,null,l.createElement(t.CardHeader,null,p("PTR_CHECK_YOUR_DETAILS")),l.createElement("div",null,l.createElement("br",null),l.createElement(t.CardSubHeader,null,p("ES_TITILE_OWNER_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:p("PTR_APPLICANT_NAME"),text:""+p(m(null==y?void 0:y.applicantName)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/owners"})}),l.createElement(t.Row,{label:p("PTR_FATHER_HUSBAND_NAME"),text:""+p(m(null==y?void 0:y.fatherName)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/owners"})}),l.createElement(t.Row,{label:p("PTR_MOBILE_NUMBER"),text:""+p(m(null==y?void 0:y.mobileNumber)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/owners"})}),l.createElement(t.Row,{label:p("PTR_EMAIL_ID"),text:""+p(m(null==y?void 0:y.emailId)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/owners"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,p("ES_TITILE_PET_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:p("PTR_SEARCH_PET_TYPE"),text:""+p(m(null==f||null===(r=f.petType)||void 0===r?void 0:r.value)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_SEARCH_BREED_TYPE"),text:""+p(m(null==f||null===(a=f.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_PET_NAME"),text:""+p(m(null==f?void 0:f.petName)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_DOCTOR_NAME"),text:""+p(m(null==f?void 0:f.doctorName)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_CLINIC_NAME"),text:""+p(m(null==f?void 0:f.clinicName)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_VACCINATED_DATE"),text:""+p(m(null==f?void 0:f.lastVaccineDate)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/pet-details"})})),l.createElement("br",null),l.createElement(t.CardSubHeader,null,p("PTR_LOCATION_DETAILS")),l.createElement("br",null),l.createElement(t.StatusTable,null,l.createElement(t.Row,{label:p("PTR_HOUSE_NO"),text:""+p(m(null==v?void 0:v.doorNo)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/street"})}),l.createElement(t.Row,{label:p("PTR_STREET_NAME"),text:""+p(m(null==v?void 0:v.street)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/street"})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_LINE1"),text:""+p(m(null==v?void 0:v.addressLine1)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/street"})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_PINCODE"),text:""+p(m(null==v?void 0:v.pincode)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/pincode"})}),l.createElement(t.Row,{label:p("MYCITY_CODE_LABEL"),text:""+p(m(null==v||null===(u=v.city)||void 0===u?void 0:u.name)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/address"})}),l.createElement(t.Row,{label:p("PTR_LOCALITY"),text:""+p(m(null==v||null===(s=v.locality)||void 0===s?void 0:s.name)),actionButton:l.createElement(x,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+_+"/address"})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:p("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{b(!S)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:p("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:c,disabled:!S})))},PTRAcknowledgement:e=>{var r,a;let{data:s,onSuccess:c}=e;const{t:d}=i.useTranslation(),p=(Digit.ULBService.getCurrentTenantId(),Digit.Hooks.ptr.usePTRCreateAPI(null===(r=s.address)||void 0===r||null===(a=r.city)||void 0===a?void 0:a.code)),{data:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=(o.useRouteMatch(),m||{});return n.useEffect(()=>{try{var e,t;s.tenantId=null===(e=s.address)||void 0===e||null===(t=e.city)||void 0===t?void 0:t.code;let n=(e=>{var t;return e=(e=>{var t,n,l;let{pets:i}=e,o=u({},i,{petType:null==i||null===(t=i.petType)||void 0===t?void 0:t.value,breedType:null==i||null===(n=i.breedType)||void 0===n?void 0:n.value,petGender:null==i||null===(l=i.petGender)||void 0===l?void 0:l.name,clinicName:null==i?void 0:i.clinicName,petName:null==i?void 0:i.petName,doctorName:null==i?void 0:i.doctorName,lastVaccineDate:null==i?void 0:i.lastVaccineDate,petAge:null==i?void 0:i.petAge,vaccinationNumber:null==i?void 0:i.vaccinationNumber});return e.pets=o,e})(e=(e=>{var t,n,l;let{address:i}=e,o=u({},i,{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.doorNo,street:null==i?void 0:i.street,locality:{code:(null==i||null===(n=i.locality)||void 0===n?void 0:n.code)||"NA",area:null==i||null===(l=i.locality)||void 0===l?void 0:l.name}});return e.address=o,e})(e=(e=>{let{ownerss:t}=e,n=u({},t);return e.ownerss=n,e})(e=(e=>{let{documents:t}=e,n=u({},t);return e.documents=n,e})(e)))),{PetRegistrationApplications:[u({tenantId:e.tenantId},null===(t=e)||void 0===t?void 0:t.ownerss,{address:e.address,petDetails:e.pets},e.documents,{workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}})]}})(s);p.mutate(n,{onSuccess:c})}catch(e){}},[]),p.isLoading||p.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(k,{t:d,data:p.data,isSuccess:p.isSuccess,isLoading:p.isIdle||p.isLoading}),l.createElement(t.StatusTable,null,p.isSuccess&&l.createElement(t.Row,{rowContainerStyle:L,last:!0,textStyle:{whiteSpace:"pre",width:"60%"}})),p.isSuccess&&l.createElement(t.SubmitBar,{label:d("PTR_PET_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=p.data;let t=e&&e[0]||{};const n=v.find(e=>e.code===t.tenantId);return Promise.resolve(I(u({},t),n,d)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}}),l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.LinkButton,{label:d("CORE_COMMON_GO_TO_HOME")})))},PTRWFCaption:C,PTRWFReason: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))},PTRNewApplication:()=>{const e=Digit.ULBService.getCurrentTenantId(),{t:r}=(Digit.Hooks.ptr.useTenants(),i.useTranslation()),[a,s]=n.useState(!1),c=o.useHistory(),[d,p,m]=Digit.Hooks.useSessionStorage("store-data",null),[v,f,h]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[E,g,y]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{});n.useEffect(()=>{f(!1),y()},[]);const _=tt;return l.createElement(t.FormComposer,{heading:r("ES_TITLE_NEW_PET_REGISTARTION"),isDisabled:!a,label:r("ES_COMMON_APPLICATION_SUBMIT"),config:_.map(e=>u({},e,{body:e.body.filter(e=>!e.hideInEmployee)})),fieldStyle:{marginRight:0},onSubmit:t=>{var n,l,i,o,r,a,s,d,p,m,v,f,h;const E=[u({tenantId:e},null==t?void 0:t.owners[0],{petDetails:u({},null==t?void 0:t.pets[0],{petType:null==t||null===(n=t.pets[0])||void 0===n||null===(l=n.petType)||void 0===l?void 0:l.value,breedType:null==t||null===(i=t.pets[0])||void 0===i||null===(o=i.breedType)||void 0===o?void 0:o.value,petGender:null==t||null===(r=t.pets[0])||void 0===r||null===(a=r.petGender)||void 0===a?void 0:a.name}),address:u({},null==t?void 0:t.address,{city:null==t||null===(s=t.address)||void 0===s||null===(d=s.city)||void 0===d?void 0:d.name,locality:{code:null==t||null===(p=t.address)||void 0===p||null===(m=p.locality)||void 0===m?void 0:m.code,area:null==t||null===(v=t.address)||void 0===v||null===(f=v.locality)||void 0===f?void 0:f.area}}),documents:null==t||null===(h=t.documents)||void 0===h?void 0:h.documents,workflow:{businessService:"ptr",action:"APPLY",moduleName:"pet-services"}})];c.replace("/digit-ui/employee/ptr/petservice/response",{PetRegistrationApplications:E})},defaultValues:{},onFormValueChange:(e,t,n)=>{s(!Object.keys(n.errors).length)}})},ApplicationDetails:xi,PTRResponse:e=>{const{t:r}=i.useTranslation(),s=a.useQueryClient(),[c,d]=(o.useHistory(),n.useState(null)),[p,m]=n.useState(null),[v,f]=n.useState(!1),[h,E,g]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[y,_,S]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",!1),b=Digit.ULBService.getCurrentTenantId(),{state:T}=e.location,C=Digit.Hooks.ptr.usePTRCreateAPI(b,"UPDATE"!==T.key),A=Digit.Hooks.ptr.usePTRCreateAPI(b,!1),{data:D}=Digit.Hooks.useStore.getInitData(),{tenants:N}=D||{},{data:P}=Digit.Hooks.ptr.usePTRSearch({tenantId:b,filters:{applicationNumber:T.PetRegistrationApplications.applicationNumber,audit:!0}},{enabled:v,select:e=>{var t;return null===(t=e.PetRegistrationApplications)||void 0===t?void 0:t.filter(e=>"ACTIVE"===e.status)}});return n.useEffect(()=>{A.data&&A.isSuccess&&_(A.data)},[C.data]),n.useEffect(()=>{A.data&&A.isSuccess&&_(A.data)},[A.data]),n.useEffect(()=>{h||C.mutate({PetRegistrationApplications:null==T?void 0:T.PetRegistrationApplications},{onError:(e,t)=>{var n,l,i;m({key:"error"}),d((null==e||null===(n=e.response)||void 0===n||null===(l=n.data)||void 0===l||null===(i=l.Errors[0])||void 0===i?void 0:i.message)||null)},onSuccess:function(e){try{var t;return E(!0),s.clear(),"CREATE"===(null==e||null===(t=e.PetRegistrationApplications[0])||void 0===t?void 0:t.creationReason)&&f(!0),Promise.resolve()}catch(e){return Promise.reject(e)}}})},[]),C.isLoading||C.isIdle&&!h?l.createElement(t.Loader,null):l.createElement("div",null,l.createElement(t.Card,null,l.createElement(Ii,{t:r,data:(null==C?void 0:C.data)||y,action:null==T?void 0:T.action,isSuccess:!!Object.keys(y||{}).length||(null==C?void 0:C.isSuccess),isLoading:C.isIdle&&!h||(null==C?void 0:C.isLoading),isEmployee:e.parentRoute.includes("employee")}),l.createElement(t.CardText,null,((e,t,n,l)=>wi("DISPLAY",e,t,n,l))(T.action,(C.isSuccess||!!y)&&!C.isError,e.parentRoute.includes("employee"),r)),(C.isSuccess||!!y)&&!C.isError&&l.createElement(t.SubmitBar,{style:{overflow:"hidden"},label:r("PTR_DOWNLOAD_ACK_FORM"),onSubmit:function(){try{const{PetRegistrationApplications:e=[]}=C.data||y,t=e&&e[0]||{},n=N.find(e=>e.code===t.tenantId);return Promise.resolve(I(u({},t,{auditData:P}),n,r)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}})),p&&l.createElement(t.Toast,{error:"error"===p.key,label:c,onClose:()=>{m(null),d(null)}}),l.createElement(t.ActionBar,null,l.createElement(o.Link,{to:e.parentRoute.includes("employee")?"/digit-ui/employee":"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:r("CORE_COMMON_GO_TO_HOME")}))))},PTRMyApplications:()=>{const{t:e}=i.useTranslation(),n=Digit.ULBService.getCitizenCurrentTenant(!0)||Digit.ULBService.getCurrentTenantId(),r=Digit.UserService.getUser().info;let a,u,s=window.location.href.split("/").pop();isNaN(parseInt(s))?a=4:(u=s,a=parseInt(s)+50);let c=isNaN(parseInt(s))?{limit:"4",sortOrder:"ASC",sortBy:"createdTime",offset:"0",mobileNumber:null==r?void 0:r.mobileNumber,tenantId:n}:{limit:"50",sortOrder:"ASC",sortBy:"createdTime",offset:u,tenantId:n};const{isLoading:d,data:p}=Digit.Hooks.ptr.usePTRSearch({filters:c},{filters:c}),{PetRegistrationApplications:m}=p||{};let v=(null==m?void 0:m.length)>0?null==m?void 0:m.map(e=>null==e?void 0:e.applicationNumber):[],f={tenantId:n,referenceIds:v};const{isLoading:h,data:E}=Digit.Hooks.useFeedBackSearch({filters:{serviceSearchArgs:f}},{filters:{serviceSearchArgs:f},enabled:(null==v?void 0:v.length)>0,cacheTime:0});function g(t){var n;let l=null==E||null===(n=E.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||h?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("CS_TITLE_MY_APPLICATIONS")+" "+(m?"("+m.length+")":"")),l.createElement("div",null,(null==m?void 0:m.length)>0&&m.map((e,t)=>l.createElement("div",{key:t},l.createElement(M,{application:e,tenantId:null==r?void 0:r.permanentCity,buttonLabel:g(e)}))),!(null!=m&&m.length)>0&&l.createElement("p",{style:{marginLeft:"16px",marginTop:"16px"}},e("PTR_NO_APPLICATION_FOUND_MSG")),0!==(null==m?void 0:m.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/"+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(o.Link,{to:"/digit-ui/citizen/ptr/petservice/new-application/info"},e("PTR_COMMON_CLICK_HERE_TO_REGISTER_NEW_PET")))))},PTRApplicationDetails:()=>{var e,r,a,c,d,p,m,v,f,h,E,g;const{t:y}=i.useTranslation(),{acknowledgementIds:_,tenantId:S}=(o.useHistory(),o.useParams()),[b,T]=n.useState([]),[C,D]=n.useState(!1),[N,P]=n.useState(!1),[x,w]=n.useState(null),{data:R}=Digit.Hooks.useStore.getInitData(),{tenants:O}=R||{},{isLoading:L,data:k}=Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:_}}),[M,F]=n.useState(null),B=Ie(k,"PetRegistrationApplications",[]),U=Ie(k,"PetRegistrationApplications[0].applicationNumber",[]);let j=B&&B.length>0&&B[0]||{};const H=j;sessionStorage.setItem("ptr-pet",JSON.stringify(H));const[W,z]=n.useState(!1);n.useEffect(()=>{!function(){try{z(!0),Promise.resolve(Digit.PaymentService.fetchBill(S,{businessService:"pet-services",consumerCode:_})).then(function(e){F(e),z(!1)})}catch(e){return Promise.reject(e)}}()},[S,_]);const{isLoading:V}=Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:U,audit:!0}},{enabled:!0}),{data:q,isLoading:G}=Digit.Hooks.useRecieptSearch({tenantId:S,businessService:"pet-services",consumerCodes:_,isEmployee:!1},{enabled:!!_});if(j.workflow||(j.workflow={id:null,tenantId:S,businessService:"pet-services",businessId:null==H?void 0:H.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),L||V)return l.createElement(t.Loader,null);let K=y("CS_NA");if(null!=j&&null!==(e=j.additionalDetails)&&void 0!==e&&e.documentDate){var Y;const e=new Date(null==j||null===(Y=j.additionalDetails)||void 0===Y?void 0:Y.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];K=e.getDate()+" "+t+" "+e.getFullYear()}let $=[];return $.push({label:y("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=H||{},t=O.find(t=>t.code===e.tenantId);return Promise.resolve(I(u({},e),t,y)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),q&&(null==q?void 0:q.Payments.length)>0&&0==G&&$.push({label:y("PTR_FEE_RECIEPT"),onClick:()=>{var e;return function(e){let{tenantId:t,payments:n}=e;s(e,Oe);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]})}}),"DEPOSITED"===(null==q||null===(r=q.Payments[0])||void 0===r?void 0:r.paymentStatus)&&$.push({label:y("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(S,{PetRegistrationApplications:[null==k||null===(e=k.PetRegistrationApplications)||void 0===e?void 0:e[0]]},"petservicecertificate")).then(function(e){return Promise.resolve(Digit.PaymentService.printReciept(S,{fileStoreIds:e.filestoreIds[0]})).then(function(t){window.open(t[null==e?void 0:e.filestoreIds[0]],"_blank")})})}catch(e){return Promise.reject(e)}}()}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"cardHeaderWithOptions",style:{marginRight:"auto",maxWidth:"960px"}},l.createElement(t.Header,{styles:{fontSize:"32px"}},y("PTR_PET_APPLICATION_DETAILS")),$&&$.length>0&&l.createElement(t.MultiLink,{className:"multilinkWrapper",onHeadClick:()=>D(!C),displayOptions:C,options:$})),l.createElement(t.Card,null,l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("PTR_APPLICATION_NO_LABEL"),text:null==j?void 0:j.applicationNumber})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},y("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("PTR_PINCODE"),text:(null==j||null===(a=j.address)||void 0===a?void 0:a.pincode)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_CITY"),text:(null==j||null===(c=j.address)||void 0===c?void 0:c.city)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_STREET_NAME"),text:(null==j||null===(d=j.address)||void 0===d?void 0:d.street)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_HOUSE_NO"),text:(null==j||null===(p=j.address)||void 0===p?void 0:p.doorNo)||y("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},y("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("PTR_APPLICANT_NAME"),text:(null==j?void 0:j.applicantName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_FATHER/HUSBAND_NAME"),text:(null==j?void 0:j.fatherName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_APPLICANT_MOBILE_NO"),text:(null==j?void 0:j.mobileNumber)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_APPLICANT_EMAILID"),text:(null==j?void 0:j.emailId)||y("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},y("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:y("PTR_PET_TYPE"),text:(null==j||null===(m=j.petDetails)||void 0===m?void 0:m.petType)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_BREED_TYPE"),text:(null==j||null===(v=j.petDetails)||void 0===v?void 0:v.breedType)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_DOCTOR_NAME"),text:(null==j||null===(f=j.petDetails)||void 0===f?void 0:f.doctorName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_CLINIC_NAME"),text:(null==j||null===(h=j.petDetails)||void 0===h?void 0:h.clinicName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_VACCINATED_DATE"),text:(null==j||null===(E=j.petDetails)||void 0===E?void 0:E.lastVaccineDate)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_VACCINATION_NUMBER"),text:(null==j||null===(g=j.petDetails)||void 0===g?void 0:g.vaccinationNumber)||y("CS_NA")})),l.createElement(A,{application:H,id:null==H?void 0:H.applicationNumber,userType:"citizen"}),x&&l.createElement(t.Toast,{error:x.key,label:y(x.label),style:{bottom:"0px"},onClose:()=>{w(null)}})),N&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:P,setShowToast:w,data:k})))},SelectOtp:e=>{let{config:i,otp:o,onOtpChange:r,onResend:a,onSelect:s,t:c,error:d,userType:p="citizen",canSubmit:m}=e;const[v,f]=n.useState(30),h={type:"register"},[E,g]=n.useState(!1);!function(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}(()=>{f(v-1)},v>0?1e3:null),n.useEffect(function(){try{if(window.location.href.includes("code")){let e=window.location.href.split("=")[1].split("&")[0],t={code_verifier:sessionStorage.getItem("code_verfier_register"),code:e,module:"REGISTER"};console.log("token",e,t,sessionStorage.getItem("code_verfier_register")),fetch("https://api.digitallocker.gov.in/public/oauth2/1/token",{method:"POST",mode:"cors",headers:{"Content-Type":"application/x-www-form-urlencoded","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, DELETE,POST"},body:new URLSearchParams({code:e,grant_type:"authorization_code",client_id:"YN77ADDADE",client_secret:"71abd480b5811ab72277",redirect_uri:"http://localhost:3001/digit-ui/citizen/login/otp",code_verifier:sessionStorage.getItem("code_verfier_register")})}).then(e=>{e.json().then(e=>_(e))})}return Promise.resolve()}catch(e){return Promise.reject(e)}},[]);const _=function(e){try{console.log("registerUser",e);const t={dob:"1998-02-03",mobileNumber:e.mobile,name:e.name,tenantId:"pg",userType:Digit.UserService.getType()};return Promise.resolve(b({otp:u({},t,h)})).then(function(e){null!=e&&e[1]&&(console.log("gggg",null==e?void 0:e[1],typeof(null==e?void 0:e[1])),g(!0),setTimeout(()=>{window.location.href=window.location.href.split("/otp")[0]},3e3))})}catch(e){return Promise.reject(e)}},S=()=>{a(),f(2)},b=function(e){return Promise.resolve(y(function(){return console.log("sendOtpsendOtp",e),Promise.resolve(Digit.UserService.sendOtp(e,"pg")).then(function(e){return[e,null]})},function(e){return[null,e]}))};return"employee"===p?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:r,value:o}),v>0?l.createElement(t.CardText,null,c("CS_RESEND_ANOTHER_OTP")+" "+v+" "+c("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:S},c("CS_RESEND_OTP")),!d&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:s,config:i,t:c,isDisabled:!(6===(null==o?void 0:o.length)&&m)},l.createElement(t.OTPInput,{length:6,onChange:r,value:o}),v>0?l.createElement(t.CardText,null,c("CS_RESEND_ANOTHER_OTP")+" "+v+" "+c("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:S},c("CS_RESEND_OTP")),!d&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP")),!E&&l.createElement(t.CardLabelError,null,c("CS_ALREADY_REGISTERED")))},AcknowledgementCF:e=>{var n,r,a,u,s,c,d,p,m;const{t:v}=i.useTranslation(),f=(Digit.ULBService.getCurrentTenantId(),o.useLocation()),h=(Digit.Hooks.useStore.getInitData(),window.Digit.Utils.browser.isMobile());return l.createElement("form",null,l.createElement(t.Card,{style:h?{padding:"unset"}:{}},l.createElement(Li,{t:v,data:f.state,isSuccess:!(null===(n=f.state)||void 0===n||null===(r=n.result)||void 0===r||null===(a=r.Service)||void 0===a||!a[0]),isMobile:h,isLoading:!1}),(null===(u=f.state)||void 0===u||null===(s=u.result)||void 0===s||null===(c=s.Service)||void 0===c?void 0:c[0])&&l.createElement(t.CardText,{style:{padding:"0px 10px 0px 10px"}},v("CS_CF_FEEDBACK_RESPONSE")),!(null!==(d=f.state)&&void 0!==d&&null!==(p=d.result)&&void 0!==p&&null!==(m=p.Service)&&void 0!==m&&m[0])&&l.createElement(t.CardText,null,v("CS_FILE_PROPERTY_FAILED_RESPONSE")),l.createElement("div",{style:{padding:"0px 10px 20px 10px"}},l.createElement(o.Link,{to:"/digit-ui/citizen"},l.createElement(t.SubmitBar,{label:v("CS_COMMON_GO_BACK_TO_HOME")})))))},CitizenFeedback:e=>{var r,a,s,c;let{popup:d=!1,onClose:p,setShowToast:m,data:v}=e;const{t:f}=i.useTranslation(),h=o.useHistory(),E=Digit.UserService.getUser();let{redirectedFrom:g,propertyId:y,acknowldgementNumber:_,creationReason:S,tenantId:b,locality:T}=Digit.Hooks.useQueryParams();const C=window.Digit.Utils.browser.isMobile();b=b||Digit.ULBService.getCurrentTenantId();const A=Digit.ULBService.getStateId(),{data:D,isLoading:N}=Digit.Hooks.pt.useRatingAndFeedbackMDMS.RatingAndFeedBack(A),[P,x]=n.useState(""),[w,R]=n.useState(0);if(N)return l.createElement(t.Loader,null);const I=e=>{var t,n;let l=null==D||null===(t=D.enabledScreensList)||void 0===t||null===(n=t.filter(e=>{var t,n,l;return"PT"===(null==e?void 0:e.module)&&((null==g?void 0:g.includes(null==e?void 0:e.screenfrom))||(null==e||null===(t=e.bussinessService)||void 0===t?void 0:t.includes(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason)))}))||void 0===n?void 0:n[0];return"Header"===e?null==l?void 0:l.cardHeader:"Text"===e?null==l?void 0:l.cardText:void 0};return l.createElement(l.Fragment,null,l.createElement("form",null,l.createElement(t.Card,null,l.createElement("div",{style:d?{display:"flex",justifyContent:"space-between"}:{}},l.createElement(t.CardHeader,null,f(I("Header"))||f("PT_RATE_HELP_TEXT")),d&&l.createElement("span",{style:{marginTop:"8px"},onClick:()=>p(!1)},l.createElement(t.CloseSvg,null))),l.createElement(t.CardText,null,f(I("Text"),{acknowldgementNumber:_||(null==v||null===(r=v.Properties)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.acknowldgementNumber),propertyId:y||(null==v||null===(s=v.Properties)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.propertyId)})||f("PT_RATE_TEXT")),l.createElement(t.Rating,{styles:{justifyContent:"center"},currentRating:w,maxRating:5,onFeedback:(e,t,n)=>{R(n)}}),0!==w&&l.createElement("div",null,l.createElement(t.CardLabel,null,f((null==D||null===(O=D.headerByRating)||void 0===O||null===(L=O.filter(e=>w>=(null==e?void 0:e.minvalue)&&w<=(null==e?void 0:e.maxvalue)))||void 0===L||null===(k=L[0])||void 0===k?void 0:k.code)||f("CS_WHAT_WENT_WRONG"))),l.createElement(t.TextArea,{name:"",minLength:"64",onChange:e=>{x(e.target.value)}}),P&&(null==P?void 0:P.length)<64&&l.createElement(t.CardLabelError,{style:{marginTop:"-20px",marginBottom:"25px"}},f("CS_MIN_LENGTH_64"))),l.createElement(t.SubmitBar,{label:f("PT_SUBMIT"),onSubmit:()=>{var e,t,n,l;let i={},o={tenantId:(null==v||null===(e=v.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.tenantId)||b,code:["PT_"+(null!=g&&g.includes("payment")?"PAYMENT":S||(null==v||null===(n=v.Properties)||void 0===n||null===(l=n[0])||void 0===l?void 0:l.creationReason))],module:["PT"]};Digit.PTService.cfdefinitionsearch({filters:{ServiceDefinitionCriteria:o}}).then((e,t)=>{var n,l,o,r,a,s,c,f,g,S,C,A,D,N;(null==e||null===(n=e.ServiceDefinition)||void 0===n?void 0:n.length)>0&&(i={tenantId:(null==v||null===(l=v.Properties)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.tenantId)||b,serviceDefId:null==e||null===(r=e.ServiceDefinition)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.id,isActive:!0,attributes:[{attributeCode:"consumerCode",value:y||(null==v||null===(s=v.Properties)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.propertyId),additionalDetails:{}},{attributeCode:"rating",value:w,additionalDetails:{}},{attributeCode:"comments",value:P,additionalDetails:{}},{attributeCode:"channel",value:"Online",additionalDetails:{}}],additionalDetails:{locality:T||(null==v||null===(f=v.Properties)||void 0===f||null===(g=f[0])||void 0===g||null===(S=g.address)||void 0===S||null===(C=S.locality)||void 0===C?void 0:C.code)||""},accountId:null==E||null===(A=E.info)||void 0===A?void 0:A.uuid},i=u({},i,{referenceId:_||(null==v||null===(D=v.Properties)||void 0===D||null===(N=D[0])||void 0===N?void 0:N.acknowldgementNumber)}),Digit.PTService.cfcreate({Service:u({},i)},b).then((e,t)=>{var n;(null==e||null===(n=e.Service)||void 0===n?void 0:n.length)>0&&(d?(p(!1),m({key:!1,label:"PT_FEEDBACK_SUBMITTED_SUCCESSFULLY"})):h.push({pathname:"/digit-ui/citizen/feedback-acknowledgement",state:{rating:w,comment:P,result:e}}))}).catch(e=>{var t,n,l;m({key:"error",label:""+(null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.Errors[0])||void 0===l?void 0:l.message)})}))})},disabled:!!(P&&(null==P?void 0:P.length)<64)||!w}),!d&&l.createElement("div",{className:"link",style:C?{marginTop:"8px",width:"100%",textAlign:"center"}:{marginTop:"8px"}},l.createElement(o.Link,{to:"/digit-ui/citizen"},f("CS_GO_BACK_HOME"))))));var O,L,k},PTRPetdetails:e=>{let{config:t,onSelect:r,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=i.useTranslation(),[m,v]=(o.useLocation(),n.useState((null==a?void 0:a.pets)||[{doctorName:"",vaccinationNumber:"",lastVaccineDate:"",petAge:"",petType:"",breedType:"",clinicName:"",petName:"",petGender:"",key:Date.now()}])),[h,E]=n.useState({index:-1,type:""}),g=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:y}=Digit.Hooks.ptr.usePTRPetMDMS(g,"PetService","PetType"),{data:_}=Digit.Hooks.ptr.useBreedTypeMDMS(g,"PetService","BreedType");let S=[],b=[];y&&y.map(e=>{S.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})}),_&&_.map(e=>{var t,n;e.PetType==(null===(t=m[0])||void 0===t||null===(n=t.petType)||void 0===n?void 0:n.code)&&b.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:T}=Digit.Hooks.ptr.usePTRGenderMDMS(g,"common-masters","GenderType");let C=[];T&&T.map(e=>{"TRANSGENDER"!==e.code&&C.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})}),n.useEffect(()=>{r(null==t?void 0:t.key,m)},[m]);const A={focusIndex:h,allOwners:m,setFocusIndex:E,formData:a,formState:c,setPets:v,t:p,setError:s,clearErrors:d,config:t,menu:S,breed_type:b,pet_sex:C};return l.createElement(l.Fragment,null,m.map((e,t)=>l.createElement(f,u({key:e.key,index:t,pets:e},A))))},PTROwnerDetails:e=>{let{config:t,onSelect:r,formData:a,setError:s,formState:c,clearErrors:d}=e;const{t:p}=i.useTranslation(),[m,v]=(o.useLocation(),n.useState((null==a?void 0:a.owners)||[{applicantName:"",mobileNumber:"",fatherName:"",emailId:"",alternateNumber:"",key:Date.now()}])),[f,E]=n.useState({index:-1,type:""});Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId(),n.useEffect(()=>{r(null==t?void 0:t.key,m)},[m]);const g={focusIndex:f,allOwners:m,setFocusIndex:E,formData:a,formState:c,setOwners:v,t:p,setError:s,clearErrors:d,config:t};return l.createElement(l.Fragment,null,m.map((e,t)=>l.createElement(h,u({key:e.key,index:t,owner:e},g))))},PTRCreatePet:e=>{var n,r,s,c;const d=a.useQueryClient(),p=o.useRouteMatch(),{t:m}=i.useTranslation(),{pathname:v}=o.useLocation(),f=o.useHistory(),h=Digit.ULBService.getStateId();let E=[];const[g,y,_]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:S,isLoading:T}=Digit.Hooks.pt.useMDMS(h,"PropertyTax","CommonFieldsConfig");function C(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=g.owners||[];n[l]=t,y(u({},g,{[e]:[...n]}))}else if("units"===e){let e=g.units||[];e=t,y(u({},g,{units:e}))}else y(u({},g,{[e]:u({},g[e],t)}));((e,t,n,l)=>{let i,o=v.split("/").pop(),r=o.charAt(o.length-1),a=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=v.slice(0,-3),o=o.split("/").pop(),a=!0):(o=v.slice(0,-2),o=o.split("/").pop(),a=!0):a=!1,isNaN(r)||(a=!0);let{nextStep:u={}}=E.find(e=>e.route===(o||"0")),s=f.push;if(e&&(s=f.replace),n&&(u=l),null===u)return s(p.path+"/check");i=isNaN(u.split("/").pop())&&a&&"map"!==u?p.path+"/"+u+"/"+t:p.path+"/"+u,s(i)})(n,l,i,e)}g&&Object.keys(g).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(_(),d.invalidateQueries("PTR_CREATE_PET"));const A=()=>{},D=()=>{};if(T)return l.createElement(t.Loader,null);S=b,S.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.indexRoute="info";const N=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRCheckPage"),P=null===(s=Digit)||void 0===s||null===(c=s.ComponentRegistryService)||void 0===c?void 0:c.getComponent("PTRAcknowledgement");return l.createElement(o.Switch,null,E.map((e,t)=>{const{component:n,texts:i,inputs:r,key:a}=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:r,key:a},onSelect:C,onSkip:A,t:m,formData:g,onAdd:D}))}),l.createElement(o.Route,{path:p.path+"/check"},l.createElement(N,{onSubmit:function(){try{return f.push(p.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:g})),l.createElement(o.Route,{path:p.path+"/acknowledgement"},l.createElement(P,{data:g,onSuccess:()=>{_(),d.invalidateQueries("PTR_CREATE_PET")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:p.path+"/"+E.indexRoute})))},PTRDocumentUpload:e=>{var i,r;let{t:a,config:s,onSelect:c,formData:d,setError:p,clearErrors:m,formState:v}=e;Digit.ULBService.getCurrentTenantId();const f=Digit.ULBService.getStateId(),[h,E]=n.useState((null==d||null===(i=d.documents)||void 0===i?void 0:i.documents)||[]),[g,y]=n.useState(null);o.useLocation();const{isLoading:_,data:b}=Digit.Hooks.ptr.usePetMDMS(f,"PetService","Documents"),T=null==b||null===(r=b.PetService)||void 0===r?void 0:r.Documents.map(e=>u({},e,{hasDropdown:!0}));return n.useEffect(()=>{c(s.key,{documents:h,PTRDocumentLength:null==T?void 0:T.length})},[h]),_?l.createElement(t.Loader,null):l.createElement("div",null,null==T?void 0:T.map((e,t)=>l.createElement(S,{key:t,document:e,action:"create",t:a,id:"ptr-document-"+t,error:g,setError:y,setDocuments:E,accept:".pdf, .jpeg, .jpg, .png",documents:h,formData:d,setFormError:p,clearFormErrors:m,config:s,formState:v})),g&&l.createElement(t.Toast,{label:g,onClose:()=>y(null),error:!0}))},PTRSelectStreet:e=>{let{t:i,config:o,onSelect:a,userType:s,formData:c,formState:d,setError:m,clearErrors:v}=e;const[f,h]=n.useState({index:-1,type:""}),{control:E,formState:g,watch:y,trigger:_}=r.useForm(),S=y(),{errors:b}=g,T=window.location.href.includes("ptr/petservice/new-application");let C;var A;return C=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{}}],n.useEffect(()=>{_()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(b).length&&!p.isEqual((null===(e=d.errors[o.key])||void 0===e?void 0:e.type)||{},b)?m(o.key,{type:b}):!Object.keys(b).length&&d.errors[o.key]&&v(o.key))},[b]),n.useEffect(()=>{const e=Object.keys(S),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[o.key])||void 0===n?void 0:n[e]}),p.isEqual(S,t)||(a(o.key,u({},c[o.key],S)),_())},[S]),"employee"===s?null===(A=C)||void 0===A?void 0:A.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},T?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:E,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:{pattern:e=>!!/^[A-Za-z]+( +[A-Za-z]+)*$/.test(e)||i("ERR_DEFAULT_INPUT_FIELD_MSG")}},render:i=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:i.value,onChange:e=>{h({index:n}),i.onChange(e.target.value)},onBlur:i.onBlur,autoFocus:(null==f?void 0:f.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,l.createElement(t.FormStep,{config:u({},o,{inputs:C}),_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRCitizenDetails:e=>{var i,r,a,s,c;let{t:d,config:p,onSelect:m,userType:v,formData:f}=e;o.useLocation();let h={};const[E,y]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].applicantName||(null==f||null===(i=f.ownerss)||void 0===i?void 0:i.applicantName)||""),[_,S]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].emailId||(null==f||null===(r=f.ownerss)||void 0===r?void 0:r.emailId)||""),[b,T]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].mobileNumber||(null==f||null===(a=f.ownerss)||void 0===a?void 0:a.mobileNumber)||""),[C,A]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].alternateNumber||(null==f||null===(s=f.ownerss)||void 0===s?void 0:s.alternateNumber)||""),[D,N]=n.useState(f.ownerss&&f.ownerss[0]&&f.ownerss[0].fatherName||(null==f||null===(c=f.ownerss)||void 0===c?void 0:c.fatherName)||"");Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const P=()=>{let e,t=f.ownerss&&f.ownerss[0];"citizen"===v?(e=u({},t,{applicantName:E,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:_}),m(p.key,u({},f[p.key],e),!1,0)):(e=u({},t,{applicantName:E,mobileNumber:b,alternateNumber:C,fatherName:D,emailId:_}),m(p.key,e,!1,0))};return n.useEffect(()=>{"citizen"===v&&P()},[E,b,D,_]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(g,{currentStep:1}):null,l.createElement(t.FormStep,{config:p,onSelect:P,onSkip:()=>m(),t:d,isDisabled:!(E&&b&&D&&_)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+d("PTR_APPLICANT_NAME")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"applicantName",value:E,onChange:function(e){y(e.target.value)},ValidationRequired:!0},h={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(t.MobileNumber,{value:b,name:"mobileNumber",onChange:e=>{T({value:e}.value)},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:C,name:"alternateNumber",onChange:e=>{A({value:e}.value)},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(t.TextInput,u({t:d,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"fatherName",value:D,onChange:function(e){N(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+d("PTR_EMAIL_ID")),l.createElement(t.TextInput,u({t:d,type:"text",isMandatory:!0,optionKey:"i18nKey",name:"emailId",value:_,onChange:function(e){S(e.target.value)},ValidationRequired:!0},h={isRequired:!0,pattern:"[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,}$",type:"text",title:d("PTR_NAME_ERROR_MESSAGE")})))))},PTRCitizenPet:e=>{var i,a,s,c,d,p,m,v,f;let{t:h,config:E,onSelect:y,userType:_,formData:S}=e;o.useLocation();let b=window.location.href.charAt(window.location.href.length-1),T={};const[C,A]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petType||(null==S||null===(i=S.pets)||void 0===i?void 0:i.petType)||""),[D,N]=n.useState(S.pets&&S.pets[b]&&S.pets[b].breedType||(null==S||null===(a=S.pets)||void 0===a?void 0:a.breedType)||""),[P,x]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petGender||(null==S||null===(s=S.pets)||void 0===s?void 0:s.petGender)||""),[w,R]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petName||(null==S||null===(c=S.pets)||void 0===c?void 0:c.petName)||""),[I,O]=n.useState(S.pets&&S.pets[b]&&S.pets[b].petAge||(null==S||null===(d=S.pets)||void 0===d?void 0:d.petAge)||""),[L,k]=n.useState(S.pets&&S.pets[b]&&S.pets[b].doctorName||(null==S||null===(p=S.pets)||void 0===p?void 0:p.doctorName)||""),[M,F]=n.useState(S.pets&&S.pets[b]&&S.pets[b].clinicName||(null==S||null===(m=S.pets)||void 0===m?void 0:m.clinicName)||""),[B,U]=n.useState(S.pets&&S.pets[b]&&S.pets[b].vaccinationNumber||(null==S||null===(v=S.pets)||void 0===v?void 0:v.vaccinationNumber)||""),[j,H]=n.useState(S.pets&&S.pets[b]&&S.pets[b].lastVaccineDate||(null==S||null===(f=S.pets)||void 0===f?void 0:f.lastVaccineDate)||""),W=(Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId()),{data:z}=Digit.Hooks.ptr.usePTRPetMDMS(W,"PetService","PetType"),{data:V}=Digit.Hooks.ptr.useBreedTypeMDMS(W,"PetService","BreedType");let q=[],G=[];z&&z.map(e=>{q.push({i18nKey:"PTR_PET_"+e.code,code:""+e.code,value:""+e.name})});const{control:K}=r.useForm();V&&V.map(e=>{e.PetType==(null==C?void 0:C.code)&&G.push({i18nKey:"PTR_BREED_TYPE_"+e.code,code:""+e.code,value:""+e.name})});const{data:Y}=Digit.Hooks.ptr.usePTRGenderMDMS(W,"common-masters","GenderType");let $=[];Y&&Y.map(e=>{"TRANSGENDER"!==e.code&&$.push({i18nKey:"PTR_GENDER_"+e.code,code:""+e.code,name:""+e.code})});const X=()=>{let e,t=S.pets&&S.pets[b];"citizen"===_?(e=u({},t,{petType:C,breedType:D,petGender:P,petName:w,petAge:I,doctorName:L,clinicName:M,lastVaccineDate:j,vaccinationNumber:B}),y(E.key,u({},S[E.key],e),!1,b)):(e=u({},t,{petType:C,breedType:D,petGender:P,petName:w,petAge:I,doctorName:L,clinicName:M,lastVaccineDate:j,vaccinationNumber:B}),y(E.key,e,!1,b))};return n.useEffect(()=>{"citizen"===_&&X()},[C,D,P,w,I,L,j]),l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(g,{currentStep:2}):null,l.createElement(t.FormStep,{config:E,onSelect:X,onSkip:()=>y(),t:h,isDisabled:!(C&&D&&P&&w&&I&&L&&M&&j&&B)},l.createElement("div",null,l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_PET_TYPE")),l.createElement(r.Controller,{control:K,name:"petType",defaultValue:C,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:C,select:A,option:q,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_SEARCH_BREED_TYPE")),l.createElement(r.Controller,{control:K,name:"breedType",defaultValue:D,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:D,select:N,option:G,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petName",value:w,onChange:function(e){R(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_PET_SEX")),l.createElement(r.Controller,{control:K,name:"petGender",defaultValue:P,rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG")},render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:P,select:x,option:$,optionKey:"i18nKey",t:h})}),l.createElement(t.CardLabel,null,""+h("PTR_PET_AGE")),l.createElement(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"petAge",value:I,onChange:function(e){O(e.target.value)},style:{width:"86%"},placeholder:"in months",rules:{required:h("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>!!/^[0123456789]\d{2}$/.test(e)||h("ERR_DEFAULT_INPUT_FIELD_MSG")}}),l.createElement("div",null,Math.floor(I/12)," ",1===Math.floor(I/12)?"YEAR":"YEARS"," ",I%12," ",I%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabel,null,""+h("PTR_DOCTOR_NAME")),l.createElement(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"doctorName",value:L,onChange:function(e){k(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={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(t.TextInput,u({t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"clinicName",value:M,onChange:function(e){F(e.target.value)},style:{width:"86%"},ValidationRequired:!1},T={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:h("PT_NAME_ERROR_MESSAGE")})),l.createElement(t.CardLabel,null,""+h("PTR_VACCINATED_DATE")),l.createElement(t.TextInput,{t:h,type:"date",isMandatory:!1,optionKey:"i18nKey",name:"lastVaccineDate",value:j,onChange:function(e){H(e.target.value)},style:{width:"86%"},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(t.TextInput,{t:h,type:"text",isMandatory:!1,optionKey:"i18nKey",name:"vaccinationNumber",value:B,onChange:function(e){U(e.target.value)},style:{width:"86%"}}))))},PTRCitizenAddress:e=>{let{t:i,config:o,onSelect:a,userType:s,formData:c,formState:d,setError:m,clearErrors:v}=e;const[f,h]=n.useState({index:-1,type:""}),{control:E,formState:y,watch:_,trigger:S}=r.useForm(),b=_(),{errors:T}=y,C=window.location.href.includes("ptr/petservice/new-application");let A;A=[{label:"PTR_STREET_NAME",type:"text",name:"street",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_STREET_INVALID")}},{label:"PTR_HOUSE_NO",type:"text",name:"doorNo",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_HOUSE_NAME",type:"text",name:"buildingName",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE1",type:"text",name:"addressLine1",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_ADDRESS_LINE2",type:"text",name:"addressLine2",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}},{label:"PTR_landmark",type:"text",name:"landmark",validation:{pattern:"[a-zA-Z0-9 !@#$%^&*()_+-={};':\\\\|,.<>/?]{1,64}",title:i("CORE_COMMON_DOOR_INVALID")}}];const D=e=>{let{validation:t,name:n,messages:l}=e;if(t){let{pattern:e,maxlength:i,minlength:o,required:r}=t||{};return{pattern:t=>{if(e){var i;if(e instanceof RegExp)return!!e.test(t)||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN";if("string"==typeof e)return!(null===(i=new RegExp(e))||void 0===i||!i.test(t))||(null==l?void 0:l.pattern)||n.toUpperCase()+"_PATTERN"}return!0},required:e=>!r||!!e||(null==l?void 0:l.required)||n.toUpperCase()+"_REQUIRED",maxLength:e=>!i||(null==e?void 0:e.length)<=i||(null==l?void 0:l.maxlength)||n.toUpperCase()+"_MAXLENGTH",minlength:o}}return{}};var N;return n.useEffect(()=>{S()},[]),n.useEffect(()=>{var e;"employee"===s&&(Object.keys(T).length&&!p.isEqual((null===(e=d.errors[o.key])||void 0===e?void 0:e.type)||{},T)?m(o.key,{type:T}):!Object.keys(T).length&&d.errors[o.key]&&v(o.key))},[T]),n.useEffect(()=>{const e=Object.keys(b),t={};e.forEach(e=>{var n;return t[e]=null===(n=c[o.key])||void 0===n?void 0:n[e]}),p.isEqual(b,t)||(a(o.key,u({},c[o.key],b)),S())},[b]),"employee"===s?null===(N=A)||void 0===N?void 0:N.map((e,n)=>{var a;return l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},C?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:E,defaultValue:null==c||null===(a=c.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:D(e)},render:i=>l.createElement(t.TextInput,u({id:e.name,key:e.name,value:i.value,onChange:e=>{h({index:n}),i.onChange(e.target.value)},onBlur:i.onBlur,autoFocus:(null==f?void 0:f.index)==n},e.validation))})))}):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(g,{currentStep:3}):null,l.createElement(t.FormStep,{config:u({},o,{inputs:A}),_defaultValues:{street:null==c?void 0:c.address.street,doorNo:null==c?void 0:c.address.doorNo,buildingName:null==c?void 0:c.address.buildingName,addressLine1:null==c?void 0:c.address.addressLine1,addressLine2:null==c?void 0:c.address.addressLine2,landmark:null==c?void 0:c.address.landmark},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRSelectPincode:e=>{var i;let{t:r,config:a,onSelect:s,formData:c={},userType:d}=e;const p=Digit.Hooks.ptr.useTenants(),{pathname:m}=o.useLocation(),v=m.includes("modify");console.log("formData in oincode ",c);const[f,h]=n.useState(()=>{var e,t,n;return v&&"employee"===d?(null==c||null===(e=c.originalData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.pincode)||"":(null==c||null===(n=c.address)||void 0===n?void 0:n.pincode)||""}),E=[{label:"PTR_ADDRESS_PINCODE",type:"text",name:"pincode",validation:{minlength:6,maxlength:7,pattern:"[0-9]+",max:"9999999",title:r("PTR_ADDRESS_PINCODE_INVALID")}}],[y,_]=n.useState(null),[S,b]=n.useState("");function T(e){h(e.target.value),_(null),b("");let t=Digit.Utils.getPattern("Pincode").test(e.target.value);"employee"===d&&(e.target.value&&!t&&b(r("ERR_DEFAULT_INPUT_FIELD_MSG")),t&&((null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t.toString()===e.target.value)}))||b(r("PTR_COMMON_PINCODE_NOT_SERVICABLE"))),s(a.key,u({},c.address,{pincode:e.target.value})))}return n.useEffect(()=>{var e;null!=c&&null!==(e=c.address)&&void 0!==e&&e.pincode&&h(c.address.pincode)},[null==c||null===(i=c.address)||void 0===i?void 0:i.pincode]),"employee"===d?null==E?void 0:E.map((e,n)=>l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{key:n},l.createElement(t.CardLabel,{className:"card-label-smaller"},r(e.label)),l.createElement("div",{className:"field"},l.createElement(t.TextInput,u({key:e.name,value:f,onChange:T},e.validation,{disable:v,autoFocus:v})))),S?l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},S):null)):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(g,{currentStep:3}):null,l.createElement(t.FormStep,{t:r,config:u({},a,{inputs:E}),onSelect:function(e){try{return(null==p?void 0:p.find(t=>{var n;return null===(n=t.pincode)||void 0===n?void 0:n.find(t=>t==(null==e?void 0:e.pincode))}))?s(a.key,{pincode:f}):_("PTR_COMMON_PINCODE_NOT_SERVICABLE"),Promise.resolve()}catch(e){return Promise.reject(e)}},_defaultValues:{pincode:f},onChange:T,onSkip:()=>s(),forcedError:r(y)}))},PTRSelectAddress:e=>{var i;let{t:a,config:s,onSelect:c,userType:d,formData:m}=e;const v=Digit.Hooks.ptr.useTenants();let f=Digit.ULBService.getCurrentTenantId();const{pathname:h}=o.useLocation(),E=h.includes("modify");let y=(null==m?void 0:m.isEditAddress)||!1;E&&(y=!0);const{pincode:_}=(null==m?void 0:m.address)||"",S="employee"===d?v.filter(e=>e.code===f):_?v.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==_)}):v,[b,T]=n.useState(()=>{var e;return(null==m||null===(e=m.address)||void 0===e?void 0:e.city)||null}),{data:C}=Digit.Hooks.useBoundaryLocalities(null==b?void 0:b.code,"revenue",{enabled:!!b},a),[A,D]=n.useState(),[N,P]=n.useState();n.useEffect(()=>{if("employee"===d&&E&&null!=A&&A.length){var e,t,n;const l=null==m||null===(e=m.originalData)||void 0===e||null===(t=e.address)||void 0===t||null===(n=t.locality)||void 0===n?void 0:n.code,i=null==A?void 0:A.filter(e=>e.code===l)[0];I("locality",i)}},[A]),n.useEffect(()=>{S&&1===S.length&&T(S[0])},[S]),n.useEffect(()=>{if(b&&C){var e,t;let l=C,i=[];var n;null!=m&&null!==(e=m.address)&&void 0!==e&&e.locality&&P(m.address.locality),null!=m&&null!==(t=m.address)&&void 0!==t&&t.pincode&&(i=l.filter(e=>{var t;return null===(t=e.pincode)||void 0===t?void 0:t.find(e=>e==m.address.pincode)}),null!=m&&null!==(n=m.address)&&void 0!==n&&n.locality||P()),D(()=>i.length>0?i:l),1===i.length&&P(i[0])}},[b,null==m||null===(i=m.address)||void 0===i?void 0:i.pincode,C]);const{control:x,formState:w,watch:R,setValue:I}=r.useForm(),O=R(),{errors:L}=w,k={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};var M,F;return n.useEffect(()=>{if("employee"===d){let e=Object.keys(O);const t={};e.forEach(e=>{var n;return t[e]=null===(n=m[s.key])||void 0===n?void 0:n[e]}),p.isEqual(O,t)||c(s.key,u({},m[s.key],O))}},[O]),n.useEffect(()=>{},[w]),"employee"===d?l.createElement("div",null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("MYCITY_CODE_LABEL")+" *"),l.createElement(r.Controller,{name:"city",defaultValue:1===(null==S?void 0:S.length)?S[0]:b,control:x,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,disable:y||1===(null==S?void 0:S.length),option:S,select:e.onChange,optionKey:"code",onBlur:e.onBlur,t:a})})),l.createElement(t.CardLabelError,{style:k},w.touched.city?null==L||null===(M=L.city)||void 0===M?void 0:M.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},a("PTR_LOCALITY")+" *"),l.createElement(r.Controller,{name:"locality",defaultValue:null,control:x,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,option:A,select:e.onChange,onBlur:e.onBlur,optionKey:"i18nkey",t:a,disable:y||!1})})),l.createElement(t.CardLabelError,{style:k},w.touched.locality?null==L||null===(F=L.locality)||void 0===F?void 0:F.message:"")):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(g,{currentStep:3}):null,l.createElement(t.FormStep,{config:s,onSelect:function(){c(s.key,{city:b,locality:N})},t:a,isDisabled:!N},l.createElement("div",null,l.createElement(t.CardLabel,null,a("MYCITY_CODE_LABEL")+" "),l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{options:S.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:b,optionKey:"i18nKey",onSelect:function(e){P(null),D(null),T(e)},t:a,isPTFlow:!0,disabled:y})),b&&A&&l.createElement(t.CardLabel,null,a("PTR_LOCALITY")+" "),b&&A&&l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{dropdownStyle:{paddingBottom:"20px"},isMandatory:s.isMandatory,options:A.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:N,optionKey:"i18nkey",onSelect:function(e){var t;null!=m&&null!==(t=m.address)&&void 0!==t&&t.locality&&(m.address.locality=e),P(e),"employee"===d&&c(s.key,u({},m[s.key],{locality:e}))},t:a,labelKey:"",disabled:y})))))},PTRSelectProofIdentity:e=>{var i,o,r;let{t:a,config:s,onSelect:c,formData:d}=e;Digit.ULBService.getStateId();const[p,m]=n.useState((null==d||null===(i=d.documents)||void 0===i?void 0:i.documents)||[]),[v,f]=n.useState(null),[h,E]=n.useState(!0),[y,_]=n.useState(!1),S=Digit.ULBService.getStateId(),{isLoading:b,data:C}=Digit.Hooks.ptr.usePetMDMS(S,"PetService","Documents");return n.useEffect(()=>{var e;let t=0;null==C||null===(e=C.PetService)||void 0===e||e.Documents.map(e=>{e.hasDropdown=!0;let n=!1;p.map(t=>{e.required&&null!=t&&t.documentType.includes(e.code)&&(n=!0)}),!n&&e.required&&(t+=1)}),E("0"!=t&&0!=t||!(p.length>0))},[p,y]),l.createElement("div",null,l.createElement(g,{currentStep:4}),b?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:a,config:s,onSelect:()=>{let e;e=u({},d.documents,{documents:p}),c(s.key,e)},onSkip:()=>c(),isDisabled:h,onAdd:function(){}},null==C||null===(o=C.PetService)||void 0===o||null===(r=o.Documents)||void 0===r?void 0:r.map((e,t)=>l.createElement(T,{key:t,document:e,t:a,error:v,setError:f,setDocuments:m,documents:p,setCheckRequiredFields:_})),v&&l.createElement(t.Toast,{label:v,onClose:()=>f(null),error:!0})))},PTRServiceDoc:e=>{var n;let{t:i,config:o,onSelect:r}=e;Digit.ULBService.getCurrentTenantId();const a=Digit.ULBService.getStateId();sessionStorage.removeItem("docReqScreenByBack");const u=null!=o&&o.isMutation?["MutationDocuments"]:"Documents",{isLoading:s,data:c={}}=Digit.Hooks.ptr.usePetMDMS(a,"PetService",u);let d=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,s&&l.createElement(t.Loader,null),Array.isArray(d)?d.map(null!=o&&o.isMutation?(e,n)=>{let{code:o,dropdownData:r}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(o)),l.createElement(t.CardText,{className:"primaryColor"},r.map(e=>i(null==e?void 0:e.code)).join(", ")))}:(e,n)=>{let{code:o,dropdownData:r}=e;return l.createElement("div",{key:n},l.createElement(t.CardSubHeader,null,n+1,". ",i(v(o,".","_"))),r.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(v(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("PTR_COMMON_NEXT"),onSubmit:r}))))},PTRWFApplicationTimeline:A},Mi=e=>{let{stateCode:t,userType:i,tenants:r}=e;const{path:a,url:u}=o.useRouteMatch(),s=Digit.StoreData.getCurrentLanguage();return Digit.Services.useStore({stateCode:t,moduleCode:"PTR",language:s}),Object.entries(ki).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)}),Digit.SessionStorage.set("PTR_TENANTS",r),n.useEffect(()=>"employee"===i&&Digit.LocalizationService.getLocale({modules:["rainmaker-"+Digit.ULBService.getCurrentTenantId()],locale:Digit.StoreData.getCurrentLanguage(),tenantId:Digit.ULBService.getCurrentTenantId()}),[]),"employee"===i?l.createElement(Ye,{path:a,url:u,userType:i}):l.createElement(P,null)},Fi=e=>{let{matchPath:o}=e;const{t:r}=i.useTranslation(),[a,u,s]=Digit.Hooks.useSessionStorage("PTR_PET",{});n.useEffect(()=>{s()},[]);const c=[{link:o+"/ptr/petservice/new-application",i18nKey:r("PTR_CREATE_PET_APPLICATION")},{link:o+"/ptr/petservice/my-application",i18nKey:r("PTR_MY_APPLICATIONS_HEADER")},{link:o+"/howItWorks",i18nKey:r("PTR_HOW_IT_WORKS")},{link:o+"/faqs",i18nKey:r("PTR_FAQ_S")}];return l.createElement(t.CitizenHomeCard,{header:r("ACTION_TEST_PTR"),links:c,Icon:()=>l.createElement(t.PTRIcon,{className:"fill-path-primary-main"})})};exports.PTRComponents={PTRCard:()=>{const{t:e}=i.useTranslation(),[o,r]=n.useState("-"),{data:a,isLoading:u,isFetching:s,isSuccess:c}=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.ptAccess()}});if(n.useEffect(()=>{!s&&c&&r(a)},[s]),!Digit.Utils.ptAccess())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:"PT_CEMP"},{label:e("ES_COMMON_APPLICATION_SEARCH"),link:"/digit-ui/employee/ptr/petservice/my-applications"}],p=Digit.UserService.hasAccess(["PT_CEMP"])||!1,m={Icon:l.createElement(t.PTRIcon,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,m)},PTRModule:Mi,PTRLinks:Fi,PTR_INBOX_FILTER:e=>l.createElement(Je,e),PTRInboxTableConfig:e=>({PTR:{inboxColumns:t=>[{Header:e("PTR_APPLICATION_NUMBER"),Cell:e=>{var n,i,r,a;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===(r=u.original)||void 0===r||null===(a=r.searchData)||void 0===a?void 0:a.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 Qe(""+(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 Qe(""+(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 Qe(""+(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 Qe(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=Fi,exports.PTRModule=Mi;
|