@mseva/digit-ui-module-ptr 1.0.55 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +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"),u=require("redux"),s=require("react-redux");function c(){return(c=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 d(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 p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(e,t){return e(t={exports:{}},t.exports),t.exports}var v=m(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]",c="[object Function]",d="[object GeneratorFunction]",m="[object Map]",v="[object Number]",f="[object Object]",E="[object RegExp]",h="[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]",I="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,O=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,F=RegExp(O.source),M=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,V=/[\\^$.*+?()[\]{}|]/g,q=RegExp(V.source),G=/^\s+/,Y=/\s/,K=/\{(?:\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]",Ee="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",he="\\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+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ce="(?:"+me+"|"+he+")?",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"),Ie=RegExp(he+"(?="+he+")|"+Ne+Ae,"g"),we=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"),Re=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Oe=["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,Fe={};Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[N]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[x]=Fe[I]=!0,Fe[o]=Fe[r]=Fe[S]=Fe[a]=Fe[b]=Fe[u]=Fe[s]=Fe[c]=Fe[m]=Fe[v]=Fe[f]=Fe[E]=Fe[h]=Fe[g]=Fe[_]=!1;var Me={};Me[o]=Me[r]=Me[S]=Me[b]=Me[a]=Me[u]=Me[T]=Me[C]=Me[A]=Me[D]=Me[N]=Me[m]=Me[v]=Me[f]=Me[E]=Me[h]=Me[g]=Me[y]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[x]=Me[I]=!0,Me[s]=Me[c]=Me[_]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof p&&p&&p.Object===Object&&p,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ve=t&&!t.nodeType&&t,qe=Ve&&e&&!e.nodeType&&e,Ge=qe&&qe.exports===Ve,Ye=Ge&&je.process,Ke=function(){try{return qe&&qe.require&&qe.require("util").types||Ye&&Ye.binding&&Ye.binding("util")}catch(e){}}(),$e=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)&&ht(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 Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function ht(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,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 It(e,t){for(var n=-1,l=e.length;++n<l&&ht(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&ht(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=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"}),Ot=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function kt(e){return"\\"+Be[e]}function Ft(e){return Re.test(e)}function Mt(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 Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):vt(e)}function zt(e){return Ft(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var qt=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),Gt=function e(t){var p,Y=(t=null==t?ze:Gt.defaults(ze.Object(),t,Gt.pick(ze,Oe))).Array,ce=t.Date,de=t.Error,pe=t.Function,me=t.Math,ve=t.Object,fe=t.RegExp,Ee=t.String,he=t.TypeError,ge=Y.prototype,ye=ve.prototype,_e=t["__core-js_shared__"],Se=pe.prototype.toString,be=ye.hasOwnProperty,Te=0,Ce=(p=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",Ae=ye.toString,De=Se.call(ve),Ne=ze._,Ie=fe("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=Ge?t.Buffer:void 0,Be=t.Symbol,je=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,Ve=Bt(ve.getPrototypeOf,ve),qe=ve.create,Ye=ye.propertyIsEnumerable,Ke=ge.splice,vt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Yt=Be?Be.toStringTag:void 0,Kt=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=Re?Re.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"),En=Ji(t,"WeakMap"),hn=Ji(ve,"create"),gn=En&&new En,yn={},_n=Po(pn),Sn=Po(mn),bn=Po(vn),Tn=Po(fn),Cn=Po(En),An=Be?Be.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function Pn(e){if(qr(e)&&!Or(e)&&!(e instanceof Rn)){if(e instanceof wn)return e;if(be.call(e,"__wrapped__"))return xo(e)}return new wn(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 In(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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 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 Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new kn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new On(e);this.size=t.size}function Bn(e,t){var n=Or(e),l=!n&&Lr(e),i=!n&&!l&&Br(e),o=!n&&!l&&!i&&Qr(e),r=n||l||i||o,a=r?At(e.length,Ee):[],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(Ei(e),$n(t,0,e.length))}function jn(e){return To(Ei(e))}function Wn(e,t,n){(void 0!==n&&!Ir(e[t],n)||void 0===n&&!(t in e))&&Yn(e,t,n)}function zn(e,t,n){var l=e[t];be.call(e,t)&&Ir(l,n)&&(void 0!==n||t in e)||Yn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(Ir(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&&hi(t,Sa(t),e)}function Yn(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=Y(l),o=null==e;++n<l;)i[n]=o?void 0:Ea(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,p=1&t,_=2&t,w=4&t;if(n&&(s=i?n(e,l,i,r):n(e)),void 0!==s)return s;if(!Vr(e))return e;var R=Or(e);if(R){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),!p)return Ei(e,s)}else{var L=to(e),O=L==c||L==d;if(Br(e))return ci(e,p);if(L==f||L==o||O&&!i){if(s=_||O?{}:lo(e),!p)return _?function(e,t){return hi(e,eo(e),t)}(e,function(e,t){return e&&hi(t,ba(t),e)}(s,e)):function(e,t){return hi(e,Qi(e),t)}(e,Gn(s,e))}else{if(!Me[L])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 I:return pi(e,n);case m:return new l;case v:case g:return new l(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return new l;case y:return Dn?ve(Dn.call(e)):{}}}(e,L,p)}}r||(r=new Mn);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 F=R?void 0:(w?_?qi:Vi:_?ba:Sa)(e);return lt(F||e,function(l,i){F&&(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 he(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 Fn(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=In.prototype).constructor=Pn,(wn.prototype=xn(In.prototype)).constructor=wn,(Rn.prototype=xn(In.prototype)).constructor=Rn,Ln.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:be.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},On.prototype.clear=function(){this.__data__=[],this.size=0},On.prototype.delete=function(e){var t=this.__data__,n=Vn(t,e);return!(n<0||(n==t.length-1?t.pop():Ke.call(t,n,1),--this.size,0))},On.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},On.prototype.has=function(e){return Vn(this.__data__,e)>-1},On.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 Ln,map:new(mn||On),string:new Ln}},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},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new On,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof On){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 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 Or(e)?l:ct(l,n(e))}function ml(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Yt&&Yt in ve(e)?function(e){var t=be.call(e,Yt),n=e[Yt];try{e[Yt]=void 0;var l=!0}catch(e){}var i=Ae.call(e);return l&&(t?e[Yt]=n:delete e[Yt]),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 El(e,t){return null!=e&&t in ve(e)}function hl(e,t,n){for(var l=n?ut:at,i=e[0].length,o=e.length,r=o,a=Y(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 Fn(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(Ho(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=Or(e),p=Or(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 Mn),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 je(e),new je(t)));case a:case u:case v:return Ir(+e,+t);case s:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case m:var c=Mt;case h:if(c||(c=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(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,I=P?t.value():t;return c||(c=new Mn),i(x,I,n,l,c)}}return!!D&&(c||(c=new Mn),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]],E=t[c];if(l)var h=r?l(E,f,c,t,e,o):l(f,E,c,e,t,o);if(!(void 0===h?f===E||i(f,E,n,l,o):h)){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 Mn;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))&&(jr(e)?Ie:ie).test(Po(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ya:"object"==typeof e?Or(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=Fr(e)?Y(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=Ea(n,e);return void 0===l&&l===t?ha(n,e):_l(t,l,3)}}function xl(e,t,n,l,i){e!==t&&rl(t,function(o,r){if(i||(i=new Mn),Vr(o))!function(e,t,n,l,i,o,r){var a=ho(e,n),u=ho(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=Or(u),m=!p&&Br(u),v=!p&&!m&&Qr(u);c=u,p||m||v?Or(a)?c=a:Mr(a)?c=Ei(a):m?(d=!1,c=ci(u,!0)):v?(d=!1,c=pi(u,!0)):c=[]:Kr(u)||Lr(u)?(c=a,Lr(a)?c=aa(a):Vr(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(ho(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),Wn(e,r,a)}},ba)}function Il(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?st(t,function(e){return Or(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Ya];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 Rl(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 Ll(e,t,n,l){var i=l?gt:ht,o=-1,r=t.length,a=e;for(e===t&&(t=Ei(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 Ol(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 Fl(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 Ml(e,t){return _o(vo(e,t,Ya),e+"")}function Bl(e){return Un(Ia(e))}function Ul(e,t){var n=Ia(e);return To(n,$n(t,0,n.length))}function Hl(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 jl=gn?function(e,t){return gn.set(e,t),e}:Ya,Wl=Kt?function(e,t){return Kt(e,"toString",{configurable:!0,enumerable:!1,value:Va(t),writable:!0})}:Ya;function zl(e){return To(Ia(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=Y(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 Yl(e,t,Ya,n)}function Yl(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 E=l||v;else E=s?v&&(l||p):a?v&&p&&(l||!m):u?v&&p&&!m&&(l||!f):!m&&!f&&(l?d<=t:d<t);E?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||!Ir(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(Or(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:Fi(e);if(s)return Ht(s);r=!1,i=xt,u=new Fn}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?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 Rn&&(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=Y(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 Mr(e)?e:[]}function oi(e){return"function"==typeof e?e:Ya}function ri(e,t){return Or(e)?e:ao(e,t)?[e]:Do(ua(e))}var ai=Ml;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 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 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=Y(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=Y(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 Ei(e,t){var n=-1,l=e.length;for(t||(t=Y(l));++n<l;)t[n]=e[n];return t}function hi(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?Yn(n,a,u):zn(n,a,u)}return n}function gi(e,t){return function(n,l){var i=Or(n)?nt:qn,o=t?t():{};return i(n,e,$i(l,2),o)}}function yi(e){return Ml(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(!Fr(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=Ft(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(La(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(!Fr(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=wn.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new he(n);if(o&&!a&&"wrapper"==Yi(r))var a=new wn([],!0)}for(i=a?i:l;++i<l;){var u=Yi(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[Yi(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&&Or(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 E(){for(var h=arguments.length,g=Y(h),y=h;y--;)g[y]=arguments[y];if(m)var _=Ki(E),S=Rt(g,_);if(l&&(g=vi(g,l,i,m)),o&&(g=fi(g,o,r,m)),h-=S,m&&h<s){var b=Ut(g,_);return Oi(e,t,Ni,E.placeholder,n,g,b,a,u,s-h)}var T=d?n:this,C=p?T[e]:e;return h=g.length,a?g=Eo(g,a):v&&h>1&&g.reverse(),c&&u<h&&(g.length=u),this&&this!==ze&&this instanceof E&&(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 Ii(e){return zi(function(t){return t=st(t,Nt($i())),Ml(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wi(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Jt(e/Wt(t)));return Ft(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function Ri(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=Y(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 Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Oi(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 Fi=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Mi(e){return function(t){var n=to(t);return n==m?Mt(t):n==h?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 he(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)E=8==t||16==t?function(e,t,n){var l=Ci(e);return function i(){for(var o=arguments.length,r=Y(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 Oi(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=Y(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 E=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?jl:go)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ir(e,ye[n])&&!be.call(l,n)?t:e}function Hi(e,t,n,l,i,o){return Vr(e)&&Vr(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,m=2&n?new Fn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var v=e[d],f=t[d];if(l)var E=r?l(f,v,d,t,e,o):l(v,f,d,e,t,o);if(void 0!==E){if(E)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 Yi(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 $i(){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=ve(e),rt(en(e),function(t){return Ye.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)&&(Or(e)||Lr(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:xn(Ve(e))}function io(e){return Or(e)||Lr(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?Fr(n)&&oo(t,n.length):"string"==l&&t in n)&&Ir(n[t],e)}function ao(e,t){if(Or(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 ve(t)}function uo(e){var t=Yi(e),n=Pn[t];if("function"!=typeof n||!(t in Rn.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)!=h||En&&to(new En)!=_)&&(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 h;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&&!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=Y(o);++i<o;)r[i]=l[t+i];i=-1;for(var a=Y(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 Eo(e,t){for(var n=e.length,l=an(t.length,n),i=Ei(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function ho(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($);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 Rn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Ml(function(e,t){return Mr(e)?Qn(e,ol(t,1,Mr,!0)):[]}),wo=Ml(function(e,t){var n=Ho(t);return Mr(n)&&(n=void 0),Mr(e)?Qn(e,ol(t,1,Mr,!0),$i(n,2)):[]}),Ro=Ml(function(e,t){var n=Ho(t);return Mr(n)&&(n=void 0),Mr(e)?Qn(e,ol(t,1,Mr,!0),void 0,n):[]});function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ia(n);return i<0&&(i=rn(l+i,0)),Et(e,$i(t,3),i)}function Oo(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)),Et(e,$i(t,3),i,!0)}function ko(e){return null!=e&&e.length?ol(e,1):[]}function Fo(e){return e&&e.length?e[0]:void 0}var Mo=Ml(function(e){var t=st(e,ii);return t.length&&t[0]===e[0]?hl(t):[]}),Bo=Ml(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]?hl(n,$i(t,2)):[]}),Uo=Ml(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]?hl(n,void 0,t):[]});function Ho(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jo=Ml(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var zo=zi(function(e,t){var n=null==e?0:e.length,l=Kn(e,t);return Ol(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=Ml(function(e){return Zl(ol(e,1,Mr,!0))}),Go=Ml(function(e){var t=Ho(e);return Mr(t)&&(t=void 0),Zl(ol(e,1,Mr,!0),$i(t,2))}),Yo=Ml(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,Zl(ol(e,1,Mr,!0),void 0,t)});function Ko(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Mr(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=Ko(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Xo=Ml(function(e,t){return Mr(e)?Qn(e,t):[]}),Zo=Ml(function(e){return ni(rt(e,Mr))}),Jo=Ml(function(e){var t=Ho(e);return Mr(t)&&(t=void 0),ni(rt(e,Mr),$i(t,2))}),Qo=Ml(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,ni(rt(e,Mr),void 0,t)}),er=Ml(Ko),tr=Ml(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 Kn(t,e)};return!(t>1||this.__actions__.length)&&l instanceof Rn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,args:[i],thisArg:void 0}),new wn(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]:Yn(e,n,1)}),rr=Ai(Lo),ar=Ai(Oo);function ur(e,t){return(Or(e)?lt:el)(e,$i(t,3))}function sr(e,t){return(Or(e)?it:tl)(e,$i(t,3))}var cr=gi(function(e,t,n){be.call(e,n)?e[n].push(t):Yn(e,n,[t])}),dr=Ml(function(e,t,n){var l=-1,i="function"==typeof t,o=Fr(e)?Y(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){Yn(e,n,t)});function mr(e,t){return(Or(e)?st:Dl)(e,$i(t,3))}var vr=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=Ml(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]]),wl(e,ol(t,1),[])}),Er=Xt||function(){return ze.Date.now()};function hr(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 he(n);return e=ia(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var yr=Ml(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=Ml(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,m=!0;if("function"!=typeof e)throw new he(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(h,t),d?v(e):a}function E(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=r}function h(){var e=Er();if(E(e))return g(e);u=yo(h,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=Er(),n=E(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(p)return si(u),u=yo(h,t),v(s)}return void 0===u&&(u=yo(h,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(Er())},y}var br=Ml(function(e,t){return Jn(e,1,t)}),Tr=Ml(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 he(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 he(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&&Or(t[0])?st(t[0],Nt($i())):st(ol(t,1),Nt($i()))).length;return Ml(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=Ml(function(e,t){return Bi(e,32,void 0,t,Ut(t,Ki(Nr)))}),Pr=Ml(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 Ir(e,t){return e===t||e!=e&&t!=t}var wr=Li(vl),Rr=Li(function(e,t){return e>=t}),Lr=yl(function(){return arguments}())?yl:function(e){return qr(e)&&be.call(e,"callee")&&!Ye.call(e,"callee")},Or=Y.isArray,kr=$e?Nt($e):function(e){return qr(e)&&ml(e)==S};function Fr(e){return null!=e&&zr(e.length)&&!jr(e)}function Mr(e){return qr(e)&&Fr(e)}var Br=tn||ru,Ur=Xe?Nt(Xe):function(e){return qr(e)&&ml(e)==u};function Hr(e){if(!qr(e))return!1;var t=ml(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Kr(e)}function jr(e){if(!Vr(e))return!1;var t=ml(e);return t==c||t==d||"[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 Yr(e){return"number"==typeof e||qr(e)&&ml(e)==v}function Kr(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)==E},Xr=Qe?Nt(Qe):function(e){return qr(e)&&to(e)==h};function Zr(e){return"string"==typeof e||!Or(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)&&!!Fe[ml(e)]},ea=Li(Al),ta=Li(function(e,t){return e<=t});function na(e){if(!e)return[];if(Fr(e))return Zr(e)?zt(e):Ei(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=to(e);return(t==m?Mt:t==h?Ht:Ia)(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)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return hi(e,ba(e))}function ua(e){return null==e?"":Xl(e)}var sa=yi(function(e,t){if(co(t)||Fr(t))hi(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),ca=yi(function(e,t){hi(t,ba(t),e)}),da=yi(function(e,t,n,l){hi(t,ba(t),e,l)}),pa=yi(function(e,t,n,l){hi(t,Sa(t),e,l)}),ma=zi(Kn),va=Ml(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||Ir(c,ye[s])&&!be.call(e,s))&&(e[s]=o[s])}return e}),fa=Ml(function(e){return e.push(void 0,Hi),tt(Ca,void 0,e)});function Ea(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function ha(e,t){return null!=e&&no(e,t,El)}var ga=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Va(Ya)),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=Ml(gl);function Sa(e){return Fr(e)?Bn(e):Cl(e)}function ba(e){return Fr(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}),hi(e,qi(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 Rl(e,t,function(t,n){return ha(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),Rl(e,n,function(e,n){return t(e,n[0])})}var Pa=Mi(Sa),xa=Mi(ba);function Ia(e){return null==e?[]:Pt(e,Sa(e))}var wa=Ti(function(e,t,n){return t=t.toLowerCase(),e+(n?Ra(t):t)});function Ra(e){return Ha(ua(e).toLowerCase())}function La(e){return(e=ua(e))&&e.replace(ae,Lt).replace(xe,"")}var Oa=Ti(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ka=Ti(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=bi("toLowerCase"),Ma=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 Le.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wa=Ml(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),Yn(e,t,yr(e[t],e))}),e});function Va(e){return function(){return e}}var qa=Di(),Ga=Di(!0);function Ya(e){return e}function Ka(e){return Tl("function"==typeof e?e:Xn(e,1))}var $a=Ml(function(e,t){return function(n){return gl(n,e,t)}}),Xa=Ml(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=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__=Ei(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=Ii(st),eu=Ii(ot),tu=Ii(mt);function nu(e){return ao(e)?St(No(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=Ri(),iu=Ri(!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 he(n);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=hr,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 Or(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=Y(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=Y(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Or(n)?Ei(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 he(n);return[l(e[0]),e[1]]}):[],Ml(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=Io,Pn.differenceBy=wo,Pn.differenceWith=Ro,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(Or(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=Mo,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=mr,Pn.mapKeys=function(e,t){var n={};return t=$i(t,3),ul(e,function(e,l,i){Yn(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){Yn(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),Ml(function(t){return Il(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?[]:(Or(t)||(t=null==t?[]:[t]),Or(n=l?void 0:n)||(n=null==n?[]:[n]),wl(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=jo,Pn.pullAll=Wo,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,$i(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},Pn.pullAt=zo,Pn.range=lu,Pn.rangeRight=iu,Pn.rearg=xr,Pn.reject=function(e,t){return(Or(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 Ol(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ml(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),(Or(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(Or(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)),Vl(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,$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))&&Ft(e)?ui(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:rn(ia(t),0),Ml(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 he(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 Or(e)?st(e,No):Jr(e)?[e]:Ei(Do(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=Or(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)&&jr(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 hr(e,1)},Pn.union=qo,Pn.unionBy=Go,Pn.unionWith=Yo,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=Ko,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=Ia,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=wa,Pn.capitalize=Ra,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=La,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=Ir,Pn.escape=function(e){return(e=ua(e))&&M.test(e)?e.replace(k,Ot):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&q.test(e)?e.replace(V,"\\$&"):e},Pn.every=function(e,t,n){var l=Or(e)?ot:nl;return n&&ro(e,t,n)&&(t=void 0),l(e,$i(t,3))},Pn.find=rr,Pn.findIndex=Lo,Pn.findKey=function(e,t){return ft(e,$i(t,3),ul)},Pn.findLast=ar,Pn.findLastIndex=Oo,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=Ea,Pn.gt=wr,Pn.gte=Rr,Pn.has=function(e,t){return null!=e&&no(e,t,fl)},Pn.hasIn=ha,Pn.head=Fo,Pn.identity=Ya,Pn.includes=function(e,t,n,l){e=Fr(e)?e:Ia(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&&ht(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)),ht(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=Lr,Pn.isArray=Or,Pn.isArrayBuffer=kr,Pn.isArrayLike=Fr,Pn.isArrayLikeObject=Mr,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&&!Kr(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Fr(e)&&(Or(e)||"string"==typeof e||"function"==typeof e.splice||Br(e)||Qr(e)||Lr(e)))return!e.length;var t=to(e);if(t==m||t==h)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=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 Yr(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=Yr,Pn.isObject=Vr,Pn.isObjectLike=qr,Pn.isPlainObject=Kr,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=Oa,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):Et(e,yt,i,!0)},Pn.lowerCase=ka,Pn.lowerFirst=Fa,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,Ya,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,Ya)},Pn.meanBy=function(e,t){return _t(e,$i(t,2))},Pn.min=function(e){return e&&e.length?ll(e,Ya,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?Il(e,ia(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Ja,Pn.now=Er,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 wi(Qt(i),n)+e+wi(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+wi(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?wi(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=Or(e)?dt:Tt,i=arguments.length<3;return l(e,$i(t,4),n,i,el)},Pn.reduceRight=function(e,t,n){var l=Or(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),Fl(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=mu,Pn.runInContext=e,Pn.sample=function(e){return(Or(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Fr(e))return Zr(e)?Wt(e):e.length;var t=to(e);return t==m||t==h?e.size:Cl(e).length},Pn.snakeCase=Ma,Pn.some=function(e,t,n){var l=Or(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 Yl(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&&Ir(e[l],t))return l}return-1},Pn.sortedLastIndex=function(e,t){return Gl(e,t,!0)},Pn.sortedLastIndexBy=function(e,t,n){return Yl(e,t,$i(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gl(e,t,!0)-1;if(Ir(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,Ya):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===H?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(w,""):d).replace(R,"$1").replace(L,"$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,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=$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,It(l,i),wt(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,wt(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,It(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(Ft(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))&&F.test(e)?e.replace(O,qt):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=Fo,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){Rn.prototype[e]=function(n){n=void 0===n?1:rn(ia(n),0);var l=this.__filtered__&&!t?new Rn(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},Rn.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;Rn.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":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Ya)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return gl(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Ar($i(e)))},Rn.prototype.slice=function(e,t){e=ia(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(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)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},ul(Rn.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 Rn,u=r[0],s=a||Or(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 Rn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[c],thisArg:void 0}),new wn(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(Or(i)?i:[],e)}return this[n](function(n){return t.apply(Or(n)?n:[],e)})}}),ul(Rn.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}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Or(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,E=e[s+=t];++f<d;){var h=c[f],g=h.type,y=(0,h.iteratee)(E);if(2==g)E=y;else if(!y){if(1==g)continue e;break e}}v[p++]=E}return v},Pn.prototype.at=ir,Pn.prototype.chain=function(){return nr(this)},Pn.prototype.commit=function(){return new wn(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 In;){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 Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:lr,args:[Vo],thisArg:void 0}),new wn(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(p)});const f=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},E=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},h=e=>{var i,o,a,u,s,d,p,m,f,E;const{pets:h,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:I}=e,[w,R]=n.useState(null),{control:L,formState:O,watch:k,trigger:F}=r.useForm(),M=k(),{errors:B}=O,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])),[H,j]=l.useState({});n.useEffect(()=>{let e=U;v.isEqual(H,M)||(j(c({},M)),S(t=>t.map(t=>t.key&&t.key===h.key?c({},t,M,e):c({},t))),F())},[M]),n.useEffect(()=>{var e;Object.keys(B).length&&!v.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:L,name:"petType",defaultValue:null==h?void 0:h.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},O.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:L,name:"breedType",defaultValue:null==h?void 0:h.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},O.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:L,name:"petName",defaultValue:null==h?void 0:h.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==h?void 0:h.key)&&"petName"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:h.key,type:"petName"})},onBlur:t=>{_({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:W},O.touched.petName?null==B||null===(u=B.petName)||void 0===u?void 0:u.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:L,name:"petAge",defaultValue:null==h?void 0:h.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==h?void 0:h.key)&&"petAge"===g.type,onChange:t=>{e.onChange(t),_({index:h.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},O.touched.petAge?null==B||null===(s=B.petAge)||void 0===s?void 0:s.message:""),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},b("PTR_PET_SEX")+" *"),l.createElement(r.Controller,{control:L,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:I,optionKey:"i18nKey",t:b})})),l.createElement(t.CardLabelError,{style:W},O.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:L,name:"doctorName",defaultValue:null==h?void 0:h.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==h?void 0:h.key)&&"doctorName"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:h.key,type:"doctorName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},O.touched.doctorName?null==B||null===(p=B.doctorName)||void 0===p?void 0:p.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:L,name:"clinicName",defaultValue:null==h?void 0:h.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==h?void 0:h.key)&&"clinicName"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:h.key,type:"clinicName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},O.touched.clinicName?null==B||null===(m=B.clinicName)||void 0===m?void 0:m.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:L,name:"lastVaccineDate",defaultValue:null==h?void 0:h.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},O.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:L,name:"vaccinationNumber",defaultValue:null==h?void 0:h.vaccinationNumber,render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:g.index===(null==h?void 0:h.key)&&"vaccinationNumber"===g.type,onChange:t=>{e.onChange(t.target.value),_({index:h.key,type:"vaccinationNumber"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:W},O.touched.vaccinationNumber?null==B||null===(E=B.vaccinationNumber)||void 0===E?void 0:E.message:""))),(null==w?void 0:w.label)&&l.createElement(t.Toast,{label:null==w?void 0:w.label,onClose:e=>{R(e=>null)}}))},g=e=>{var i,o,a,u,s;const{owner:d,focusIndex:p,allOwners:m,setFocusIndex:f,setOwners:E,t:h,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[I,w]=l.useState({});n.useEffect(()=>{v.isEqual(I,P)||(w(c({},P)),E(e=>e.map(e=>e.key&&e.key===d.key?c({},e,P):c({},e))),N())},[P]),n.useEffect(()=>{var e;Object.keys(x).length&&!v.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 R={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==m?void 0:m.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:C,name:"applicantName",defaultValue:null==d?void 0:d.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==d?void 0:d.key)&&"applicantName"===p.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:R},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"},h("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: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==d?void 0:d.key)&&"fatherName"===p.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:R},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"},h("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: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==d?void 0:d.key)&&"mobileNumber"===p.type,onChange:t=>{e.onChange(t),f({index:d.key,type:"mobileNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:R},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"},h("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: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==d?void 0:d.key)&&"alternateNumber"===p.type,onChange:t=>{e.onChange(t),f({index:d.key,type:"alternateNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:R},A.touched.alternateNumber?null==x||null===(u=x.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: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:p.index===(null==d?void 0:d.key)&&"emailId"===p.type,onChange:t=>{e.onChange(t),f({index:d.key,type:"emailId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:R},A.touched.emailId?null==x||null===(s=x.emailId)||void 0===s?void 0:s.message:""))),(null==b?void 0:b.label)&&l.createElement(t.Toast,{label:null==b?void 0:b.label,onClose:e=>{T(e=>null)}}))},y=[{i18nKey:"PTR_GENDER",code:"123",name:"test"}],S=e=>{let{onGoBack:i,goNext:o,currentStepData:a,t:u}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const{control:s,handleSubmit:c,setValue:d}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.petDetails;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;d(t,n)}))},[a,d]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:c(e=>{console.log("data in first step",e),o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,""+u("PTR_PET_NAME")),l.createElement(r.Controller,{control:s,name:"petName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,""+u("PTR_SEARCH_PET_TYPE")),l.createElement(r.Controller,{control:s,name:"petType",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:y,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,""+u("PTR_SEARCH_BREED_TYPE")),l.createElement(r.Controller,{control:s,name:"breedType",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:y,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,""+u("PTR_PET_GENDER")),l.createElement(r.Controller,{control:s,name:"petGender",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:y,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,""+u("PTR_COLOR")),l.createElement(r.Controller,{control:s,name:"color",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,""+u("PTR_VACCINATED_DATE")),l.createElement(r.Controller,{control:s,name:"lastVaccineDate",render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,""+u("PTR_VACCINATION_NUMBER")),l.createElement(r.Controller,{control:s,name:"vaccinationNumber",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})})),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:i}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))};function b(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function T(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:d,formData:p,setFormError:m,clearFormErrors:v,config:f,formState:E,id:h}=e;const g=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(g?c({},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]:{})),[S,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),I=()=>{var e,t;let n=null===(e=E.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!=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==C?void 0:C.length)||null===C?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==C),{documentType:null==y?void 0:y.code,filestoreId:C,documentUid:C}]}),P?P&&I():C&&null!=y&&y.code?C&&null!=y&&y.code&&I():(()=>{var e,t;let n=null===(e=E.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,y,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 c({},e,{i18nKey:null==e||null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})})[0];l?(_(l),A(null==n?void 0:n.fileStoreId)):x(!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=b(function(){return A(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?A(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(()=>{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:y,option:N.map(e=>{var t;return c({},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){T(e.target.files[0])},onDelete:()=>{A(null)},id:h,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")));let C=[];const A=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":C=[];break;default:C=["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"}},C.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")}))))},D=[{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:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];m(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:p,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},E=e.document,h={type:!0,src:!0,nonce:!0,noModule:!0};function g(e,t,n){var l,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(l in h)(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,E,h,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,I=[],w=I.pop,R=I.push,L=I.push,O=I.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+M+"*("+B+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+M+"*\\]",H=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(M+"+","g"),W=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),z=new RegExp("^"+M+"*,"+M+"*"),V=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),q=new RegExp(M+"|>"),G=new RegExp(H),Y=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)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","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}"+M+"?|\\\\([^\\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{L.apply(I=O.call(S.childNodes),S.childNodes)}catch(e){L={apply:I.length?function(e,t){R.apply(e,O.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,h,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 L.apply(l,t.getElementsByTagName(e)),l;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(l,t.getElementsByClassName(o)),l}if(n.qsa&&!N[e+" "]&&(!E||!E.test(e))&&(1!==S||"object"!==t.nodeName.toLowerCase())){if(h=e,g=t,1===S&&(q.test(e)||V.test(e))){for((g=ee.test(e)&&he(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]);h=v.join(",")}try{return L.apply(l,g.querySelectorAll(h)),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 Ee(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 he(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)},h=[],E=[],(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&&E.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||E.push("\\["+M+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+_+"-]").length||E.push("~="),(t=m.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||E.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||E.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||E.push(".#.+[+~]"),e.querySelectorAll("\\\f"),E.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&&E.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&E.push(":enabled",":disabled"),v.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&E.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),E.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"),h.push("!=",H)}),E=E.length&&new RegExp(E.join("|")),h=h.length&&new RegExp(h.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+" "]&&(!h||!h.test(t))&&(!E||!E.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: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&&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("(^|"+M+")"+e+"("+M+"|$)"))&&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,m,v,f=o!==r?"nextSibling":"previousSibling",E=t.parentNode,h=a&&t.nodeName.toLowerCase(),g=!u&&!a,y=!1;if(E){if(o){for(;f;){for(p=t;p=p[f];)if(a?p.nodeName.toLowerCase()===h:1===p.nodeType)return!1;v=f="only"===e&&!v&&"nextSibling"}return!0}if(v=[r?E.firstChild:E.lastChild],r&&g){for(y=(m=(s=(c=(d=(p=E)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=m&&E.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()!==h: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 Y.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:Ee(function(){return[0]}),last:Ee(function(e,t){return[t-1]}),eq:Ee(function(e,t,n){return[n<0?n+t:n]}),even:Ee(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Ee(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Ee(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:Ee(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,[]),E=!e||!o&&t?f:be(f,p,e,a,u),h=n?i||(o?e:v||l)?[]:r:E;if(n&&n(E,h,a,u),l)for(s=be(h,m),l(s,[],a,u),c=s.length;c--;)(d=s[c])&&(h[m[c]]=!(E[m[c]]=d));if(o){if(i||e){if(i){for(s=[],c=h.length;c--;)(d=h[c])&&s.push(E[c]=d);i(null,h=[],s,u)}for(c=h.length;c--;)(d=h[c])&&(s=i?k(o,d):p[c])>-1&&(o[s]=!(r[s]=d))}}else h=be(h===r?h.splice(v,h.length):h),i?i(null,r,h,u):L.apply(r,h)})}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=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,v,E,h=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);E=e[v++];)if(E(d,r||m,a)){u.push(d);break}c&&(b=C)}n&&((d=!E&&d)&&h--,o&&y.push(d))}if(h+=g,n&&g!==h){for(v=0;E=t[v++];)E(y,_,r,a);if(o){if(h>0)for(;g--;)y[g]||_[g]||(_[g]=w.call(u));_=be(_)}L.apply(u,_),c&&!o&&_.length>0&&h+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=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)&&he(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return L.apply(n,i),n;break}}return(p||a(e,m))(i,t,!f,n,!t||ee.test(e)&&he(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(F,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,I=/^(?:\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]:I.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:E,!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=E.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=_(E);var w=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function L(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 L(e,"nextSibling")},prev:function(e){return L(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&&(R[e]||_.uniqueSort(i),w.test(e)&&i.reverse()),this.pushStack(i)}});var O=/[^\x20\t\r\n\f]+/g;function k(e){return e}function F(e){throw e}function M(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(O)||[],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,F,i)):(o++,s.call(e,r(o,n,k,i),r(o,n,F,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!==F&&(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:F))}).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&&(M(e,r.done(a(n)).resolve,r.reject,!t),"pending"===r.state()||v(o[n]&&o[n].then)))return r.then();for(;n--;)M(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(){E.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(E,[_]))}}),_.ready.then=U.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?e.setTimeout(_.ready):(E.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,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 Y(){this.expando=_.expando+Y.uid++}Y.uid=1,Y.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(O)||[]).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 Y,$=new Y,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)||K.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 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=$.get(o),1===o.nodeType&&!K.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]));K.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){$.set(this,e)}):j(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=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=E.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,me=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ve=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(de=E.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 Ee(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 he(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,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=Ee(d.appendChild(o),"script"),s&&he(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 E.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,m,v,f,E=K.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=E.events)||(u=E.events=Object.create(null)),(r=E.handle)||(r=E.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(O)||[""]).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,E=K.hasData(e)&&K.get(e);if(E&&(u=E.events)){for(s=(t=(t||"").match(O)||[""]).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,E.handle)||_.removeEvent(e,m,E.handle),delete u[m])}else for(m in u)_.event.remove(e,m+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: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")&&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 Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function we(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Re(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]);$.hasData(e)&&(o=$.access(e),r=_.extend({},o),$.set(t,r))}}function Le(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 Oe(e,t,n,l){t=o(t);var i,r,a,u,s,c,d=0,p=e.length,f=p-1,E=t[0],h=v(E);if(h||p>1&&"string"==typeof E&&!m.checkClone&&Ne.test(E))return e.each(function(i){var o=e.eq(i);h&&(t[0]=E.call(this,i,o.html())),Oe(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(Ee(i,"script"),Ie)).length;d<p;d++)s=i,d!==f&&(s=_.clone(s,!0,!0),u&&_.merge(a,Ee(s,"script"))),n.call(e[d],s,d);if(u)for(c=a[a.length-1].ownerDocument,_.map(a,we),d=0;d<u;d++)ve.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(Ee(l)),l.parentNode&&(n&&le(l)&&he(Ee(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=Ee(a),l=0,i=(o=Ee(e)).length;l<i;l++)Le(o[l],r[l]);if(t)if(n)for(o=o||Ee(e),r=r||Ee(a),l=0,i=o.length;l<i;l++)Re(o[l],r[l]);else Re(e,a);return(r=Ee(a,"script")).length>0&&he(r,!u&&Ee(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[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[$.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 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 Oe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||xe(this,e).appendChild(e)})},prepend:function(){return Oe(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 Oe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Oe(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(Ee(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[(me.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(_.cleanData(Ee(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,function(t){var n=this.parentNode;_.inArray(this,e)<0&&(_.cleanData(Ee(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 Fe=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Me=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||Me(e))&&(""!==(r=n.getPropertyValue(t)||n[t])||le(e)||(r=_.style(e,t)),!m.pixelBoxStyles()&&Fe.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=E.createElement("div"),c=E.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=E.createElement("table"),n=E.createElement("tr"),l=E.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=E.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]).+)/,Ye=/^--/,Ke={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=Me(e),i=(!m.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(Fe.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=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=q(t),u=Ye.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 Ye.test(t)||(t=qe(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 $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,Ke,function(){return Je(e,t,l)})},set:function(e,n,l){var i,o=Me(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=je(m.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=Me(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===E.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(O);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),E=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||!E||void 0===E[l])continue;f=!0}m[l]=E&&E[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=E&&E.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(){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||(E?"hidden"in E&&(f=E.hidden):E=K.access(e,"fxshow",{display:s}),o&&(E.hidden=!f),f&&se([e],!0),p.done(function(){for(l in f||se([e]),K.remove(e,"fxshow"),m)_.style(e,l,m[l])})),u=at(f?E[l]:0,l,p),l in E||(E[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||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&&lt.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=E.createElement("input"),t=E.createElement("select").appendChild(E.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=E.createElement("input")).value="t",e.type="radio",m.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(!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(O);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(O)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(O)||[]}_.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"}}),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))&&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&&(" "+mt(vt(n))+" ").indexOf(t)>-1)return!0;return!1}});var Et=/\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(Et,""):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 ht=/^(?:focusinfocus|focusoutblur)$/,gt=function(e){e.stopPropagation()};_.extend(_.event,{trigger:function(t,n,l,i){var o,r,a,u,s,d,p,m,h=[l||E],g=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(r=m=a=l=l||E,3!==l.nodeType&&8!==l.nodeType&&!ht.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(ht.test((u=p.delegateType||g)+g)||(r=r.parentNode);r;r=r.parentNode)h.push(r),a=r;a===(l.ownerDocument||E)&&h.push(a.defaultView||a.parentWindow||e)}for(o=0;(r=h[o++])&&!t.isPropagationStopped();)m=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&&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(h.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=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=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=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,wt=/^(?:GET|HEAD)$/,Rt=/^\/\//,Lt={},Ot={},kt="*/".concat("*"),Ft=E.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(O)||[];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===Ot;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}Ft.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:Mt(Lt),ajaxTransport:Mt(Ot),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,h=_.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=It.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(h.promise(C),m.url=((t||m.url||yt.href)+"").replace(Rt,yt.protocol+"//"),m.type=n.method||n.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(O)||[""],null==m.crossDomain){u=E.createElement("a");try{u.href=m.url,u.href=u.href,m.crossDomain=Ft.protocol+"//"+Ft.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(Lt,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=!wt.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(Ot,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,E,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=!(E=S.error))):(E=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(n||T)+"",d?h.resolveWith(v,[p,T,C]):h.rejectWith(v,[C,T,E]),C.statusCode(y),y=void 0,c&&f.trigger(d?"ajaxSuccess":"ajaxError",[C,m,d?p:E]),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 Ht={0:200,1223:204},jt=_.ajaxSettings.xhr();m.cors=!!jt&&"withCredentials"in jt,m.ajax=jt=!!jt,_.ajaxTransport(function(t){var n,l;if(m.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)}),E.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=E.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=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(l)):t=E),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 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(m.pixelPosition,function(e,n){if(n)return n=He(e,t),Fe.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 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,Yt=e.$;return _.noConflict=function(t){return e.$===_&&(e.$=Yt),t&&e.jQuery===_&&(e.jQuery=Gt),_},void 0===t&&(e.jQuery=e.$=_),_})});const N=e=>{let{t:i,goNext:o,currentStepData:a}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const{control:u,handleSubmit:s,setValue:c}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.ownerDetails;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;c(t,n)}))},[a,c]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:s(e=>{console.log("data in first step",e),o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,""+i("NDC_FIRST_NAME")),l.createElement(r.Controller,{control:u,name:"firstName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NDC_LAST_NAME")),l.createElement(r.Controller,{control:u,name:"lastName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_EMAIL_LABEL")),l.createElement(r.Controller,{control:u,name:"emailId",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(r.Controller,{control:u,name:"mobileNumber",render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:i})}),l.createElement(t.CardLabel,null,""+i("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_FATHER_HUSBAND")),l.createElement(r.Controller,{control:u,name:"fatherName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("PT_COMMON_COL_ADDRESS")),l.createElement(r.Controller,{control:u,name:"address",render:e=>l.createElement(t.TextArea,{name:"address",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})})),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))};function P(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:d,formData:p,handleSubmit:m,id:v}=e;const f=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==r?void 0:r.code)})[0],[E,h]=(Digit.ULBService.getCurrentTenantId(),n.useState(f?c({},f,{active:!0===(null==r?void 0:r.active),code:null==f?void 0:f.documentType}):1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{})),[g,y]=n.useState(null),[_,S]=n.useState(()=>(null==f?void 0:f.filestoreId)||null),{dropdownData:T}=r;var C=T;const[A,D]=n.useState(!1),[N,P]=n.useState(!1);return n.useEffect(()=>{null!=E&&E.code&&(console.log("selectedDocument",s),a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==_?void 0:_.length)||null===_?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==_))||[],{documentType:null==E?void 0:E.code,filestoreId:_,documentUid:_}]}))},[_,E]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents",s),m())},[s]),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=C.filter(e=>e.code===(null==n?void 0:n.documentType)).map(e=>{var t;return c({},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)):D(!0)}},[]),n.useEffect(()=>{var e;null!=r&&r.hasDropdown||h({code:null==r?void 0:r.code,i18nKey:null==r||null===(e=r.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(g){P(!0);const e=function(){if(g.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(function(){return S(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",g,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;P(!1),(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):u(o("CS_FILE_UPLOAD_ERROR"))})},function(){P(!1),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)}}()},[g]),n.useEffect(()=>{A&&S(null)},[A]),l.createElement("div",{style:{marginBottom:"24px"}},N&&l.createElement(t.Loader,null),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:E,style:{width:"100%"},option:C.map(e=>{var t;return c({},e,{i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")})}),select:e=>h(e),optionKey:"i18nKey",t:o})):null,null!=r&&r.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *")),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){y(e.target.files[0])},onDelete:()=>{S(null)},id:v,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:!_}))))}const x=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)},I=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:E}=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 h(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(x,{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(x,{data:e,OpenImage:h})}{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(x,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==E||null===(c=E.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!=E&&E.timeline&&1===(null==E||null===(d=E.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:m((null==E||null===(p=E.timeline[0])||void 0===p?void 0:p.state)&&"WF_"+v+"_"+E.timeline[0].state||"NA"),customChild:g(null==E?void 0:E.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==E?void 0:E.timeline)&&(null==E?void 0:E.timeline.map((e,n,i)=>{var o;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==E||null===(o=E.processInstances[n].state)||void 0===o?void 0:o.state)+r),customChild:g(e)}))})))),E&&(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==E?void 0:E.nextActions))},w=["path","url"],R=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],L=()=>{var e,n,r,a,u,s;const p=o.useRouteMatch(),{path:m}=p,{t:v}=(d(p,w),i.useTranslation()),f=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRApplicationDetails"),E=null===(r=Digit)||void 0===r||null===(a=r.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRMyApplications"),h=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NewPTRStepperForm");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(g=R)&&(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:h}),l.createElement(t.PrivateRoute,{path:m+"/petservice/application/:acknowledgementIds/:tenantId",component:f}),l.createElement(t.PrivateRoute,{path:m+"/petservice/my-applications",component:E}),l.createElement(t.PrivateRoute,{path:m+"/petservice/search",component:e=>l.createElement(Search,c({},e,{t:v,parentRoute:m}))}))));var g},O=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)}})},k=e=>e.substr(0,1).toUpperCase()+e.substr(1),F=(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}},M=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(k).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}]},F(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)}},B=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")},U={padding:"4px 0px",justifyContent:"space-between"},H=e=>{var n;return l.createElement(t.Banner,{message:B(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%"}})},j=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 W,z=Array.isArray,V="object"==typeof p&&p&&p.Object===Object&&p,q="object"==typeof self&&self&&self.Object===Object&&self,G=V||q||Function("return this")(),Y=G.Symbol,K=Object.prototype,$=K.hasOwnProperty,X=K.toString,Z=Y?Y.toStringTag:void 0,J=Object.prototype.toString,Q=Y?Y.toStringTag:void 0,ee=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Q&&Q in Object(e)?function(e){var t=$.call(e,Z),n=e[Z];try{e[Z]=void 0;var l=!0}catch(e){}var i=X.call(e);return l&&(t?e[Z]=n:delete e[Z]),i}(e):function(e){return J.call(e)}(e)},te=function(e){return null!=e&&"object"==typeof e},ne=function(e){return"symbol"==typeof e||te(e)&&"[object Symbol]"==ee(e)},le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ie=/^\w*$/,oe=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},re=function(e){if(!oe(e))return!1;var t=ee(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ae=G["__core-js_shared__"],ue=(W=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",se=Function.prototype.toString,ce=function(e){if(null!=e){try{return se.call(e)}catch(e){}try{return e+""}catch(e){}}return""},de=/^\[object .+?Constructor\]$/,pe=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),me=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!oe(e)||(t=e,ue&&ue in t))&&(re(e)?pe:de).test(ce(e));var t}(n)?n:void 0},ve=me(Object,"create"),fe=Object.prototype.hasOwnProperty,Ee=Object.prototype.hasOwnProperty;function he(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])}}he.prototype.clear=function(){this.__data__=ve?ve(null):{},this.size=0},he.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},he.prototype.get=function(e){var t=this.__data__;if(ve){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return fe.call(t,e)?t[e]:void 0},he.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:Ee.call(t,e)},he.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ve&&void 0===t?"__lodash_hash_undefined__":t,this};var ge=he,ye=function(e,t){return e===t||e!=e&&t!=t},_e=function(e,t){for(var n=e.length;n--;)if(ye(e[n][0],t))return n;return-1},Se=Array.prototype.splice;function be(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])}}be.prototype.clear=function(){this.__data__=[],this.size=0},be.prototype.delete=function(e){var t=this.__data__,n=_e(t,e);return!(n<0||(n==t.length-1?t.pop():Se.call(t,n,1),--this.size,0))},be.prototype.get=function(e){var t=this.__data__,n=_e(t,e);return n<0?void 0:t[n][1]},be.prototype.has=function(e){return _e(this.__data__,e)>-1},be.prototype.set=function(e,t){var n=this.__data__,l=_e(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Te=be,Ce=me(G,"Map"),Ae=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 De(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])}}De.prototype.clear=function(){this.size=0,this.__data__={hash:new ge,map:new(Ce||Te),string:new ge}},De.prototype.delete=function(e){var t=Ae(this,e).delete(e);return this.size-=t?1:0,t},De.prototype.get=function(e){return Ae(this,e).get(e)},De.prototype.has=function(e){return Ae(this,e).has(e)},De.prototype.set=function(e,t){var n=Ae(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Ne=De;function Pe(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(Pe.Cache||Ne),n}Pe.Cache=Ne;var xe,Ie,we=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Re=/\\(\\)?/g,Le=(xe=Pe(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(we,function(e,n,l,i){t.push(l?i.replace(Re,"$1"):n||e)}),t},function(e){return 500===Ie.size&&Ie.clear(),e}),Ie=xe.cache,xe),Oe=Y?Y.prototype:void 0,ke=Oe?Oe.toString:void 0,Fe=function(e){if("string"==typeof e||ne(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},Me=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return z(e)?e:function(e,t){if(z(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ne(e))||ie.test(e)||!le.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Le(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(z(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(ne(t))return ke?ke.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[Fe(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Be=["tenantId","payments"],Ue=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})},He=e=>{const{t:r}=i.useTranslation(),a=[{text:r("ES_TITLE_NEW_PET_REGISTRATION"),link:"/digit-ui/employee/ptr/petservice/new-application",roles:[]},{text:"PTR_SEARCH_PET",link:"/digit-ui/employee/ptr/petservice/search",roles:[]}],[u,s]=n.useState([]);return Digit.UserService.getUser(),n.useEffect(()=>{s(a)},[]),l.createElement(t.Card,{className:"employeeCard filter inboxLinks"},l.createElement("div",{className:"complaint-links-container"},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.PropertyHouse,null))," ",l.createElement("span",{className:"text"},r("PET_SERVICE"))),l.createElement("div",{className:"body"},u.map((e,t)=>{let{link:n,text:i,hyperlink:a=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},a?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},r(i)))}))))},je={date:t.DatePicker,mobileNumber:t.MobileNumber},We=e=>{var n;let{onSearch:o,type:a,onClose:u,searchFields:s,searchParams:d,isInboxPage:p,clearSearch:m}=e;const{t:v}=i.useTranslation(),{handleSubmit:f,reset:E,watch:h,control:g,formState:y,setValue:_}=r.useForm({defaultValues:p?d:c({locality:null,city:null},d)}),S=h(),b=innerWidth<=640;function T(){const e=s.reduce((e,t)=>c({},e,{[null==t?void 0:t.name]:""}),{});if(E(e),p){const e=c({},d);e.delete=[],s.forEach(t=>{e.delete.push(null==t?void 0:t.name)}),o(c({},e))}else m()}const C=e=>l.createElement(t.LinkLabel,{style:c({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=[],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: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:u},l.createElement(t.CloseSvg,null))),l.createElement("div",{className:"complaint-input-container for-pt "+(p?"":"for-search"),style:{width:"100%",display:"grid"}},null==s||null===(n=s.filter(e=>!0))||void 0===n?void 0:n.map((e,n)=>{var i,o,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==je?void 0:je[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==s||!s.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}))))},ze=["tableConfig","filterComponent"],Ve=e=>{let{tableConfig:o,filterComponent:r}=e,a=d(e,ze);const{data:u,useNewInboxAPI:s}=a,{t:c}=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)}),[E,h]=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):E?y=null:!u||0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?y=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&&(y=l.createElement(Ue,{t:c,data:u,columns:g,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(He,{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:s,statusMap:s?null==u?void 0:u[0].statusMap:null,moduleCode:a.moduleCode}))),l.createElement("div",{style:{flex:1}},l.createElement(We,{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}},y)))},qe=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")}]})))))},Ge=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:E,filterComponent:h}=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(h)});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:E||"/digit-ui/employee/ptr/"})):D=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},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(qe,{type:"mobile",sortParams:f,onClose:A,onSort:u})),"SEARCH"===g&&l.createElement("div",{className:"popup-module"},l.createElement(We,{type:"mobile",onClose:A,onSearch:a,isFstpOperator:c,searchParams:m,searchFields:v}))))},Ye=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))}))))},Ke=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:E}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(Ye,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),l.createElement(Ge,{t:E,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}))))},$e=["isFetching","isLoading","searchResponseKey","data","searchFields"],Xe=e=>{var o,r,a,u,s;let{useNewInboxAPI:p,parentRoute:m,moduleCode:v="PTR",initialStates:f={},filterComponent:E,isInbox:h,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(()=>h?{}:{enabled:!1}),[I,w]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent("PTRInboxTableConfig")}),[R,L]=n.useState(f.pageOffset||0),[O,k]=n.useState(f.pageSize||10),[F,M]=n.useState(f.sortParams||[{id:"createdTime",desc:!0}]),[B,U]=n.useState(f.searchParams||{});let H=window.Digit.Utils.browser.isMobile(),j=H?{limit:100,offset:0,sortBy:null==F||null===(o=F[0])||void 0===o?void 0:o.id,sortOrder:null!=F&&null!==(r=F[0])&&void 0!==r&&r.desc?"DESC":"ASC"}:{limit:O,offset:R,sortBy:null==F||null===(a=F[0])||void 0===a?void 0:a.id,sortOrder:null!=F&&null!==(u=F[0])&&void 0!==u&&u.desc?"DESC":"ASC"};const W=p?Digit.Hooks.useNewInboxGeneral({tenantId:D,ModuleCode:v,filters:c({},B,j,{sortParams:F})}):Digit.Hooks.useInboxGeneral({tenantId:D,businessService:v,isInbox:h,filters:c({},B,j,{sortParams:F}),rawWfHandler:g,rawSearchHandler:y,combineResponse:_,wfConfig:S,searchConfig:c({},P,b),middlewaresWf:T,middlewareSearch:C}),{isLoading:z,data:V,searchFields:q}=W,G=d(W,$e);n.useEffect(()=>{L(0)},[B]);const Y=e=>{let t=e.delete,n=c({},B,e);t&&t.forEach(e=>delete n[e]),delete e.delete,U(c({},n)),x({enabled:!0})},K=n.useCallback(e=>{0!==e.length&&M(e)},[]);var $,X;if(null!==(null==G||null===(s=G.data)||void 0===s?void 0:s.length))return H?l.createElement(Ke,{data:V,isLoading:z,isSearch:!h,searchFields:q,onFilterChange:Y,onSearch:Y,onSort:K,parentRoute:m,searchParams:B,sortParams:F,linkPrefix:m+"/application-details/",tableConfig:null!=G&&G.tableConfig?null===($=res)||void 0===$?void 0:$.tableConfig:I(N).PTR,filterComponent:E,EmptyResultInboxComp:A,useNewInboxAPI:p}):l.createElement("div",null,h&&l.createElement(t.Header,null,N("ES_COMMON_INBOX")),l.createElement(Ve,{moduleCode:v,data:V,tableConfig:I(N).PTR,isLoading:z,defaultSearchParams:f.searchParams,isSearch:!h,onFilterChange:Y,searchFields:q,onSearch:Y,onSort:K,onNextPage:()=>{L(e=>e+O)},onPrevPage:()=>{L(e=>e-O)},currentPage:Math.floor(R/O),pageSizeLimit:O,disableSort:!1,onPageSizeChange:e=>{k(Number(e.target.value))},parentRoute:m,searchParams:B,sortParams:F,totalRecords:Number(null==V||null===(X=V[0])||void 0===X?void 0:X.totalCount),filterComponent:E,EmptyResultInboxComp:A,useNewInboxAPI:p}))},Ze=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:E,handleSubmit:h,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")),h(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:h},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:E,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:E})),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:E})),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)),h(c)()},currentPage:y("offset")/y("limit"),onNextPage:function(){g("offset",y("offset")+y("limit")),h(c)()},onPrevPage:P,pageSizeLimit:y("limit"),onSort:N,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},Je=e=>{o.useParams();const{t:r}=i.useTranslation(),a=Digit.ULBService.getCurrentTenantId(),[u,s]=n.useState({}),[d,p]=n.useState(null),m={enabled:!!(u&&Object.keys(u).length>0)},{isLoading:v,isSuccess:f,data:{PetRegistrationApplications:E,Count:h}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:u},m);return l.createElement(l.Fragment,null,l.createElement(Ze,{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=c({},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)=>c({},e,{[t]:"object"==typeof l[t]?l[t].code:l[t]}),{});!(Object.entries(i).length>0)||i.applicationNumber||i.creationReason||i.fromDate||i.mobileNumber||i.applicationNumber||i.status||i.toDate?!(Object.entries(i).length>0&&(i.creationReason||i.status))||i.applicationNumber||i.fromDate||i.mobileNumber||i.applicationNumber||i.toDate?Object.entries(i).length>0&&i.fromDate&&!i.toDate||!i.fromDate&&i.toDate?p({warning:!0,label:"ERR_PROVIDE_BOTH_FORM_TO_DATE"}):s(i):p({warning:!0,label:"ERR_PROVIDE_MORE_PARAM_WITH_TYPE_STATUS"}):p({warning:!0,label:"ERR_PTR_FILL_VALID_FIELDS"})},data:f&&!v?E.length>0?E:{display:"ES_COMMON_NO_DATA"}:"",count:h}),d&&l.createElement(t.Toast,{error:d.error,warning:d.warning,label:r(d.label),isDleteBtn:!0,onClose:()=>{p(null)}}))},Qe=e=>{var n,r,a,u,s,d,p,m,v,f;let{path:E,userType:h}=e;const{t:g}=i.useTranslation(),y=o.useLocation();sessionStorage.removeItem("revalidateddone");const _=window.Digit.Utils.browser.isMobile(),S={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},b=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:_?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},T=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NewPTRStepperForm"),C=(null===(a=Digit)||void 0===a||null===(u=a.ComponentRegistryService)||void 0===u||u.getComponent("PTRNewApplication"),null===(s=Digit)||void 0===s||null===(d=s.ComponentRegistryService)||void 0===d?void 0:d.getComponent("ApplicationDetails")),A=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("PTRResponse"),D=(null===(v=Digit)||void 0===v||null===(f=v.ComponentRegistryService)||void 0===f||f.getComponent("PTRDocsRequired"),window.location.href.includes("ptr/response")),N=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return console.log("path",E),l.createElement(o.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},D?null:l.createElement("div",{style:N?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(b,{location:y})),l.createElement(t.PrivateRoute,{exact:!0,path:E+"/",component:()=>l.createElement(Ei,{matchPath:E,userType:h})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/inbox",component:()=>l.createElement(Xe,{useNewInboxAPI:!0,parentRoute:E,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:S,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/new-application",component:T}),l.createElement(t.PrivateRoute,{path:E+"/petservice/application-details/:id",component:()=>l.createElement(C,{parentRoute:E})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(C,{parentRoute:E})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/response",component:e=>l.createElement(A,c({},e,{parentRoute:E}))}),l.createElement(t.PrivateRoute,{path:E+"/petservice/search",component:e=>l.createElement(Search,c({},e,{t:g,parentRoute:E}))}),l.createElement(t.PrivateRoute,{path:E+"/searchold",component:()=>l.createElement(Xe,{parentRoute:E,businessService:"ptr",middlewareSearch:searchMW,initialStates:S,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/my-applications",component:e=>l.createElement(Je,c({},e,{parentRoute:E}))}))))},et=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(c({},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)||"-")+")"})},tt=e=>{var o,r,a,u,s;let{onAssignmentChange:d,searchParams:p,businessServices:m,statusMap:v}=e;const{t:f}=i.useTranslation(),[E,h]=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(et,{businessServices:m,key:t,onAssignmentChange:d,status:c({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,E&&(null==_||null===(u=_.filter(e=>!e.isTerminateState))||void 0===u||null===(s=u.slice(4))||void 0===s?void 0:s.map((e,t)=>l.createElement(et,{businessServices:m,key:e.uuid,onAssignmentChange:d,status:c({name:S(e,f),code:e.applicationStatus},e),searchParams:p,statusMap:v}))),l.createElement("div",{className:"filter-button",onClick:()=>h(!E)}," ",f(E?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},nt=["searchParams","onFilterChange","defaultSearchParams","statusMap","moduleCode"],lt=e=>{var o;let{searchParams:r,onFilterChange:u,defaultSearchParams:s,statusMap:p,moduleCode:m}=e,v=d(e,nt);const{t:f}=i.useTranslation(),E=a.useQueryClient(),[h,g]=n.useState(()=>c({},r,{services:[]})),y=[{label:"PTR_NEW_REGISTRATION",value:"ptr"}],_=e=>{let t=e.delete,n=c({},h,e);t&&t.forEach(e=>delete n[e]),delete e.delete,g(c({},n))},S=()=>{g(c({},s,{services:[]})),u(c({},s))},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==h?void 0:h.locality)||[],e]})},tenantId:b,boundaryType:"revenue"}),l.createElement("div",{className:"tag-container"},null==h||null===(o=h.locality)||void 0===o?void 0:o.map((e,n)=>l.createElement(t.RemoveableTag,{key:n,text:f(e.i18nkey),onClick:()=>{_({locality:null==h?void 0:h.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==h||null===(i=h.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(h.services)?[...h.services,t]:[t]}:{services:h.services.filter(e=>e!==t),applicationStatus:null===(n=h.applicationStatus)||void 0===n?void 0:n.filter(e=>e.stateBusinessService!==t)})})(t,e.value)})})),l.createElement("div",null,l.createElement(tt,{searchParams:h,businessServices:h.services,statusMap:p||E.getQueryData("INBOX_STATUS_MAP_"+m),moduleCode:m,onAssignmentChange:(e,t)=>{if(e.target.checked)_({applicationStatus:[...null==h?void 0:h.applicationStatus,t]});else{let e=null==h?void 0:h.applicationStatus.filter(e=>e.state!==t.state);_({applicationStatus:e})}}})),l.createElement("div",null,l.createElement(t.SubmitBar,{onSubmit:()=>{u(0===h.services.length?c({},h,{services:y.map(e=>e.value)}):h)},label:f("ES_COMMON_APPLY")}))))))},it=e=>l.createElement("span",{className:"cell-text"},e),ot=e=>l.createElement("span",{className:"sla-cell"},e),rt=[{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:"CS_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"}]}],at=e=>l.createElement("h1",{className:"heading-m"},e.label),ut=()=>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"})),st=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ut,null)),ct=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;const{data:f,isLoading:E}=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:g}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[y,_]=n.useState({}),[S,T]=n.useState({}),[C,A]=n.useState([]),[D,N]=n.useState(null),[P,x]=n.useState(null),[I,w]=n.useState(null),[R,L]=n.useState(null),[O,k]=n.useState([]),[F,M]=n.useState(null),[B,U]=n.useState(!1);function H(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{L(null);const e=function(){if(P){const e=function(){if(P.size>=5242880)L(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(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?w(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):L(r("CS_FILE_UPLOAD_ERROR"))})},function(){L(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&&_(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:F,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: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:H,uploadedFile:I,setUploadedFile:w,businessService:m}))},[a,C,O,F,I]),a&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(at,{label:r(y.label.heading)}),headerBarEnd:l.createElement(st,{onClick:s}),actionCancelLabel:r(y.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(y.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!F:E||(null==a?void 0:a.docUploadRequired)&&!I,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"};p.creationReason="STATUS",d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Property:c({},p,{workflow:t})})}else if(null!=a&&a.showFinancialYearsModal)d({customFunctionToExecute:null==a?void 0:a.customFunctionToExecute,Assessment:{financialYear:null==F?void 0:F.name,propertyId:null==p?void 0:p.propertyId,tenantId:u,source:null==p?void 0:p.source,channel:null==p?void 0:p.channel,assessmentDate:Date.now()}});else{let t={action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,businessService:m,moduleName:v};t.assignes=null!=a&&a.isTerminateState||!D?[]:[D],I&&(t.documents=[{documentType:(null==a?void 0:a.action)+" DOC",fileName:null==P?void 0:P.name,fileStoreId:I}]),d({Property:c({},p,{workflow:t})})}},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},dt=e=>l.createElement("h1",{className:"heading-m"},e.label),pt=()=>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(pt,null)),vt=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m}=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:f,data:E}=Digit.Hooks.pt.useMDMS(u,m,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'TL')]"}]}]}}),[h,g]=n.useState({}),[y,_]=n.useState({}),[S,T]=n.useState([]),[C,A]=n.useState({}),[D,N]=n.useState(null),[P,x]=n.useState(null),[I,w]=n.useState(null),[R,L]=n.useState([]),[O,k]=n.useState(null);n.useEffect(()=>{var e;E&&E["egf-master"]&&L(null===(e=E["egf-master"])||void 0===e?void 0:e.FinancialYear)},[E]);const{data:F}=Digit.Hooks.useCustomMDMS(u,"common-masters",[{name:"Department"}]);function M(e){N(e.target.files[0])}return n.useEffect(()=>{if(v&&F){var e;const t=F["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{w(null);const e=function(){if(D){const e=function(){if(D.size>=5242880)w(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(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):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)}}()},[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:S,selectedApprover:C,setSelectedApprover:A,selectFile:M,uploadedFile:P,setUploadedFile:x,businessService:m}))},[a,S,R,O,P]),a&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dt,{label:r(h.label.heading)}),headerBarEnd:l.createElement(mt,{onClick:s}),actionCancelLabel:r(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(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){p=c({},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:y,formId:"modal-action"})):l.createElement(t.Loader,null)},ft=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Et=()=>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(Et,null)),gt=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m}=e;const{data:v,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)}),[E,h]=n.useState({}),[g,y]=n.useState({}),[_,S]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),w=!!Digit.Utils.browser.isMobile();function R(e){D(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{I(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))I(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=b(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",A,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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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&&h((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:_,selectedApprover:T,setSelectedApprover:C,selectFile:R,uploadedFile:N,setUploadedFile:P,businessService:m,error:x}))},[a,_,N,x]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ft,{label:r(E.label.heading)}),headerBarEnd:l.createElement(ht,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(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"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){p=c({},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)},yt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),_t=()=>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"})),St=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(_t,null)),bt=e=>{var i,o,r,u,s,d,p,m,v,f,E,h;let{t:g,action:y,tenantId:_,closeModal:S,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===(u=A)||void 0===u||null===(s=u.landInfo)||void 0===s||null===(d=s.address)||void 0===d?void 0:d.city:_,!1);const{data:x,isLoading:I}=Digit.Hooks.useEmployeeSearch(_,{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==y?void 0:y.action)))||void 0===f||null===(E=f[0])||void 0===E||null===(h=E.assigneeRoles)||void 0===h?void 0:h.map(e=>({code:e})),isActive:!0},{enabled:!(null!=y&&y.isTerminateState)}),[w,R]=(a.useQueryClient(),n.useState({})),[L,O]=n.useState({}),[k,F]=n.useState([]),[M,B]=n.useState([]),[U,H]=n.useState({}),[j,W]=n.useState({}),[z,V]=n.useState(null),[q,G]=n.useState(null),[Y,K]=n.useState(null),[$,X]=n.useState(null),Z=!!Digit.Utils.browser.isMobile();function J(e){V(e.target.files[0])}n.useEffect(()=>{var e;F(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{K(null);const e=function(){if(z){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(z.size>=5242880)K(g("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=z&&z.type&&!e.test(null==z?void 0:z.type))K(g("NOT_SUPPORTED_FILE_TYPE"));else{const e=b(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",z,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?G(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):K(g("CS_FILE_UPLOAD_ERROR"))})},function(){K(g("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[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}))),y&&R((e=>{var n,i,o,r,a,u,s;let{t:c,action:d,approvers:p,selectedApprover:m,setSelectedApprover:v,selectedBlockReason:f,setBlockReason:E,selectFile:h,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:E,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:h,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:y,approvers:k,selectedApprover:U,setSelectedApprover:H,selectedBlockReason:j,setBlockReason:W,selectFile:J,uploadedFile:q,setUploadedFile:G,businessService:D,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:Y,blockReasonFiltered:M}))},[y,k,$,q,Y]),y&&w.form?l.createElement(t.Modal,{headerBarMain:l.createElement(yt,{label:g(w.label.heading)}),headerBarEnd:l.createElement(St,{onClick:S}),actionCancelLabel:g(w.label.cancel),actionCancelOnSubmit:S,actionSaveLabel:g(w.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"}:{}},I?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:w.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,d,p,m,v,f,E,h,b,D,P,x,I,w,R,L,O,k,F;A=c({},A,{documents:ne(),additionalDetails:c({},null===(t=A)||void 0===t?void 0:t.additionalDetails,{fieldinspection_pending:te(A),pendingapproval:le(),blockingReason:null==j?void 0:j.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==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===(u=N.data)||void 0===u||null===(s=u.processInstances)||void 0===s||null===(d=s[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===(E=f.state)||void 0===E?void 0:E.applicationStatus)?[null==N||null===(h=N.data)||void 0===h||null===(b=h.processInstances)||void 0===b||null===(D=b[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==y?void 0:y.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:q}]:null},action:null==y?void 0:y.action,comment:null==e?void 0:e.comments,assignee:"FIELDINSPECTION_INPROGRESS"===(null==N||null===(x=N.data)||void 0===x||null===(I=x.processInstances)||void 0===I||null===(w=I[0])||void 0===w||null===(R=w.state)||void 0===R?void 0:R.applicationStatus)?[null==N||null===(L=N.data)||void 0===L||null===(O=L.processInstances)||void 0===O||null===(k=O[0])||void 0===k||null===(F=k.assigner)||void 0===F?void 0:F.uuid]:null!=U&&U.uuid?[null==U?void 0:U.uuid]:null,wfDocuments:q?[{documentType:(null==y?void 0:y.action)+" DOC",fileName:null==z?void 0:z.name,fileStoreId:q}]:null});const M=function(e,t,n,l,i,o,r,a,u,s,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===(u=a.selfCertificationCharges)||void 0===u?void 0:u.BPA_WATER_CHARGES)+parseInt(null===(s=A)||void 0===s||null===(d=s.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:c({},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(_,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}):(S(),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})})}S(),alert(g("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(M&&M.then?M.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:L,formId:"modal-action"})):l.createElement(t.Loader,null)},Tt=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),Ct=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),At=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Ct,null)),Dt=e=>{var i,r;let{t:u,action:s,tenantId:d,closeModal:p,submitAction:m,applicationData:v,businessService:f}=e;const{data:E,isLoading:h}=Digit.Hooks.useEmployeeSearch(d,{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)}),[g,y]=(a.useQueryClient(),n.useState({})),[_,S]=n.useState({}),[T,C]=n.useState([]),[A,D]=n.useState({}),[N,P]=n.useState(null),[x,I]=n.useState(null),[w,R]=n.useState(null),L=!!Digit.Utils.browser.isMobile();function O(e){P(e.target.files[0])}return o.useHistory(),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(()=>{!function(){try{R(null);const e=function(){if(N){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(N.size>=5242880)R(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=N&&N.type&&!e.test(null==N?void 0:N.type))R(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=b(function(){return Promise.resolve(Digit.UploadServices.Filestorage("NOC",N,Digit.ULBService.getStateId()||(null==d?void 0:d.split(".")[0]))).then(function(e){var t,n,l,i;(null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0?I(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):R(u("CS_FILE_UPLOAD_ERROR"))})},function(){R(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)}}()},[N]),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:m,error:v}=e,f=!1;"REVOCATE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)||(f=!0);let E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+m+"_"+(null==o?void 0:o.action),cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option: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:u,action:s,approvers:T,selectedApprover:A,setSelectedApprover:D,selectFile:O,uploadedFile:x,setUploadedFile:I,businessService:f,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:w}))},[s,T,x,w]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Tt,{label:u(g.label.heading)}),headerBarEnd:l.createElement(At,{onClick:p}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:L?{width:"720px"}:{},style:L?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:L?{paddingLeft:"5px"}:{}},h?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=c({},v,{workflow:{action:null==s?void 0:s.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==s?void 0:s.action)+" DOC",fileName:null==N?void 0:N.name,fileStoreId:x}]:null},documents:o}),m({Noc:v},!1,{isNoc:!0})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)};function Nt(e){var t=this.__data__=new Te(e);this.size=t.size}Nt.prototype.clear=function(){this.__data__=new Te,this.size=0},Nt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Nt.prototype.get=function(e){return this.__data__.get(e)},Nt.prototype.has=function(e){return this.__data__.has(e)},Nt.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Te){var l=n.__data__;if(!Ce||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ne(l)}return n.set(e,t),this.size=n.size,this};var Pt=Nt,xt=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),It=function(e,t,n){"__proto__"==t&&xt?xt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},wt=Object.prototype.hasOwnProperty,Rt=function(e,t,n){var l=e[t];wt.call(e,t)&&ye(l,n)&&(void 0!==n||t in e)||It(e,t,n)},Lt=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?It(n,a,u):Rt(n,a,u)}return n},Ot=function(e){return te(e)&&"[object Arguments]"==ee(e)},kt=Object.prototype,Ft=kt.hasOwnProperty,Mt=kt.propertyIsEnumerable,Bt=Ot(function(){return arguments}())?Ot:function(e){return te(e)&&Ft.call(e,"callee")&&!Mt.call(e,"callee")},Ut=function(){return!1},Ht=m(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?G.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Ut}),jt=/^(?:0|[1-9]\d*)$/,Wt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&jt.test(e))&&e>-1&&e%1==0&&e<t},zt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Vt={};Vt["[object Float32Array]"]=Vt["[object Float64Array]"]=Vt["[object Int8Array]"]=Vt["[object Int16Array]"]=Vt["[object Int32Array]"]=Vt["[object Uint8Array]"]=Vt["[object Uint8ClampedArray]"]=Vt["[object Uint16Array]"]=Vt["[object Uint32Array]"]=!0,Vt["[object Arguments]"]=Vt["[object Array]"]=Vt["[object ArrayBuffer]"]=Vt["[object Boolean]"]=Vt["[object DataView]"]=Vt["[object Date]"]=Vt["[object Error]"]=Vt["[object Function]"]=Vt["[object Map]"]=Vt["[object Number]"]=Vt["[object Object]"]=Vt["[object RegExp]"]=Vt["[object Set]"]=Vt["[object String]"]=Vt["[object WeakMap]"]=!1;var qt=function(e){return function(t){return e(t)}},Gt=m(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&V.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),Yt=Gt&&Gt.isTypedArray,Kt=Yt?qt(Yt):function(e){return te(e)&&zt(e.length)&&!!Vt[ee(e)]},$t=Object.prototype.hasOwnProperty,Xt=function(e,t){var n=z(e),l=!n&&Bt(e),i=!n&&!l&&Ht(e),o=!n&&!l&&!i&&Kt(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&&!$t.call(e,s)||r&&("length"==s||i&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Wt(s,u))||a.push(s);return a},Zt=Object.prototype,Jt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Zt)},Qt=function(e,t){return function(n){return e(t(n))}},en=Qt(Object.keys,Object),tn=Object.prototype.hasOwnProperty,nn=function(e){return null!=e&&zt(e.length)&&!re(e)},ln=function(e){return nn(e)?Xt(e):function(e){if(!Jt(e))return en(e);var t=[];for(var n in Object(e))tn.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},on=Object.prototype.hasOwnProperty,rn=function(e){return nn(e)?Xt(e,!0):function(e){if(!oe(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&&on.call(e,l))&&n.push(l);return n}(e)},an=m(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?G.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}}),un=function(){return[]},sn=Object.prototype.propertyIsEnumerable,cn=Object.getOwnPropertySymbols,dn=cn?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];sn.call(e,a)&&(r[o++]=a)}return r}(cn(e)))}:un,pn=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},mn=Qt(Object.getPrototypeOf,Object),vn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)pn(t,dn(e)),e=mn(e);return t}:un,fn=function(e,t,n){var l=t(e);return z(e)?l:pn(l,n(e))},En=function(e){return fn(e,ln,dn)},hn=function(e){return fn(e,rn,vn)},gn=me(G,"DataView"),yn=me(G,"Promise"),_n=me(G,"Set"),Sn=me(G,"WeakMap"),bn=ce(gn),Tn=ce(Ce),Cn=ce(yn),An=ce(_n),Dn=ce(Sn),Nn=ee;(gn&&"[object DataView]"!=Nn(new gn(new ArrayBuffer(1)))||Ce&&"[object Map]"!=Nn(new Ce)||yn&&"[object Promise]"!=Nn(yn.resolve())||_n&&"[object Set]"!=Nn(new _n)||Sn&&"[object WeakMap]"!=Nn(new Sn))&&(Nn=function(e){var t=ee(e),n="[object Object]"==t?e.constructor:void 0,l=n?ce(n):"";if(l)switch(l){case bn:return"[object DataView]";case Tn:return"[object Map]";case Cn:return"[object Promise]";case An:return"[object Set]";case Dn:return"[object WeakMap]"}return t});var Pn=Nn,xn=Object.prototype.hasOwnProperty,In=G.Uint8Array,wn=function(e){var t=new e.constructor(e.byteLength);return new In(t).set(new In(e)),t},Rn=/\w*$/,Ln=Y?Y.prototype:void 0,On=Ln?Ln.valueOf:void 0,kn=Object.create,Fn=function(){function e(){}return function(t){if(!oe(t))return{};if(kn)return kn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Mn=Gt&&Gt.isMap,Bn=Mn?qt(Mn):function(e){return te(e)&&"[object Map]"==Pn(e)},Un=Gt&&Gt.isSet,Hn=Un?qt(Un):function(e){return te(e)&&"[object Set]"==Pn(e)},jn={};jn["[object Arguments]"]=jn["[object Array]"]=jn["[object ArrayBuffer]"]=jn["[object DataView]"]=jn["[object Boolean]"]=jn["[object Date]"]=jn["[object Float32Array]"]=jn["[object Float64Array]"]=jn["[object Int8Array]"]=jn["[object Int16Array]"]=jn["[object Int32Array]"]=jn["[object Map]"]=jn["[object Number]"]=jn["[object Object]"]=jn["[object RegExp]"]=jn["[object Set]"]=jn["[object String]"]=jn["[object Symbol]"]=jn["[object Uint8Array]"]=jn["[object Uint8ClampedArray]"]=jn["[object Uint16Array]"]=jn["[object Uint32Array]"]=!0,jn["[object Error]"]=jn["[object Function]"]=jn["[object WeakMap]"]=!1;var Wn=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(!oe(t))return t;var d=z(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&xn.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=Pn(t),m="[object Function]"==p||"[object GeneratorFunction]"==p;if(Ht(t))return an(t,u);if("[object Object]"==p||"[object Arguments]"==p||m&&!o){if(a=s||m?{}:function(e){return"function"!=typeof e.constructor||Jt(e)?{}:Fn(mn(e))}(t),!u)return s?function(e,t){return Lt(e,vn(e),t)}(t,function(e,t){return e&&Lt(t,rn(t),e)}(a,t)):function(e,t){return Lt(e,dn(e),t)}(t,function(e,t){return e&&Lt(t,ln(t),e)}(a,t))}else{if(!jn[p])return o?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return wn(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?wn(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?wn(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,Rn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return On?Object(On.call(e)):{}}}(t,p,u)}}r||(r=new Pt);var v=r.get(t);if(v)return v;r.set(t,a),Hn(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,r))}):Bn(t)&&t.forEach(function(i,o){a.set(o,e(i,n,l,o,t,r))});var f=d?void 0:(c?s?hn:En:s?rn:ln)(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]),Rt(a,o,e(i,n,l,o,t,r))}),a},zn=function(e){return Wn(e,5)};const 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)),Yn=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}},Kn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m}=e;const{data:v,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)}),[E,h]=n.useState({}),[g,y]=n.useState({}),[_,S]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),w=window.Digit.Utils.browser.isMobile(),R=window.location.href.includes("/employee");function L(e){D(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{I(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))I(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=b(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):I(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),I(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&&h((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:p,businessService:m,error:v}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:"WF_"+(null==o?void 0:o.action)+"_APPLICATION",submit:"WF_"+(null==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:u,selected:a}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:_,selectedApprover:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:m,error:x})):a&&h((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:_,selectedApprover:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:m,error:x}))},[a,_,N,x]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Vn,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Gn,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:w&&R?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,r,s,m,v,f;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var E,h,g,y,_,S,b,C,D;const t=c({},null===(E=p)||void 0===E||null===(h=E.billAmendmentDetails)||void 0===h?void 0:h.additionalDetails,{comments:null!=e&&e.comments?e.comments:null}),n=c({},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:u,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=c({},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:c({},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=zn(null==e?void 0:e.date);p.disconnectionExecutionDate=Yn(t)}else if(null!=e&&e.date){const t=zn(null==e?void 0:e.date);p.connectionExecutionDate=Yn(t)}var P;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(r=o.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(s=p)||void 0===s||null===(m=s.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,I,w,R,L,O,k,F,M,B,U,H,j;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===(I=t.value)||void 0===I?void 0:I.adhocPenalty)||""),null!=t&&null!==(w=t.value)&&void 0!==w&&w.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(R=t.value)||void 0===R?void 0:R.adhocPenaltyComment)||""),null!=t&&null!==(L=t.value)&&void 0!==L&&L.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(O=t.value)||void 0===O?void 0:O.adhocPenaltyReason)||""),null!=t&&null!==(k=t.value)&&void 0!==k&&k.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(F=t.value)||void 0===F?void 0:F.adhocRebate)||""),null!=t&&null!==(M=t.value)&&void 0!==M&&M.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(B=t.value)||void 0===B?void 0:B.adhocRebateComment)||""),null!=t&&null!==(U=t.value)&&void 0!==U&&U.adhocRebateReason&&(p.additionalDetails.adhocRebateReason=(null==t||null===(H=t.value)||void 0===H?void 0:H.adhocRebateReason)||""),"WATER"==(null===(j=p)||void 0===j?void 0:j.serviceType)?d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!1}):d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!1})}}},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},$n=e=>l.createElement("h1",{className:"heading-m"},e.label),Xn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Zn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Xn,null)),Jn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;console.log("applicationData",p);const{data: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)}),[E,h]=n.useState({}),[g,y]=n.useState({}),[_,S]=n.useState([]),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),[w,R]=n.useState(!1);function L(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(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):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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&&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:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:m}))},[a,_,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement($n,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Zn,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.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:[c({},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:[c({},p,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},Qn=e=>l.createElement("h1",{className:"heading-m"},e.label),el=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),tl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(el,null)),nl=e=>{var i,o,r;let{t:a,action:u,closeModal:s,submitAction:d,applicationData:p,businessService:m}=e;const v=Digit.ULBService.getStateId(),{data:f,isLoading:E}=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[h,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 I=n.useMemo(()=>{var e;if(E||!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"]},[E,f,x]);return console.log("years",I),n.useEffect(()=>{u&&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:u,years:I,selectedApprover:T,setSelectedApprover:C,businessService:m}))},[u,I,A,N]),u&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Qn,{label:a(h.label.heading)}),headerBarEnd:l.createElement(tl,{onClick:s}),actionCancelLabel:a(h.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(h.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){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=c({},p,{financialYear:i,action:"INITIATE",additionalDetail:c({},p.additionalDetail,{validityYears:T.length>0?parseInt(T):""})}),d({Licenses:[p]})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)},ll=e=>l.createElement("h1",{className:"heading-m"},e.label),il=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ol=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(il,null)),rl=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;const{data: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?void 0:a.isTerminateState}),[E,h]=n.useState({}),[g,y]=n.useState({}),[_,S]=n.useState([]),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),[w,R]=n.useState(!1);function L(e){R(!0),D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=b(function(){return Promise.resolve(Digit.UploadServices.Filestorage("StreetVending",A,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?P(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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(R(!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(()=>{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:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:m,isUploading:w}))},[a,_,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ll,{label:r(E.label.heading)}),headerBarEnd:l.createElement(ol,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t;let n={action:null==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:c({},p,{workflow:n})})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},al=e=>l.createElement("h1",{className:"heading-m"},e.label),ul=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),sl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ul,null)),cl=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m,moduleCode:v}=e;console.log("applicationData",p);const{data: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)}),[E,h]=n.useState({}),[g,y]=n.useState({}),[_,S]=n.useState([]),[T,C]=n.useState(null),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),[w,R]=n.useState(!1);function L(e){D(e.target.files[0])}return n.useEffect(()=>{var e;S(null==f||null===(e=f.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[f]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(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):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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&&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:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:m}))},[a,_,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(al,{label:r(E.label.heading)}),headerBarEnd:l.createElement(sl,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==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:[c({},p,{workflow:t})]})},defaultValues:g,formId:"modal-action"})):l.createElement(t.Loader,null)},dl=e=>l.createElement("h1",{className:"heading-m"},e.label),pl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ml=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(pl,null)),vl=e=>{var i,r,a;let{t:u,action:s,tenantId:d,closeModal:p,submitAction:m,applicationData:v,businessService:f,moduleCode:E}=e;const{data:h}=Digit.Hooks.useEmployeeSearch(d,{roles:null==s||null===(i=s.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!=s&&s.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==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(()=>{"INITIATED"===(null==s?void 0:s.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{label:{heading:"WF_"+(null==n?void 0:n.action)+"_APPLICATION",submit:"WF_"+l+"_"+(null==n?void 0:n.action),cancel:"ES_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:T,selectedApprover:A,setSelectedApprover:D,uploadedFile:N,setUploadedFile:P,businessService:f}))},[s,T,N]),s&&y.form?l.createElement(t.Modal,{headerBarMain:l.createElement(dl,{label:u(y.label.heading)}),headerBarEnd:l.createElement(ml,{onClick:p}),actionCancelLabel:u(y.label.cancel),actionCancelOnSubmit:p,actionSaveLabel:u(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==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:f,moduleName:E};N&&(t.documents=[]),m({Asset:c({},v,{workflow:t})})},defaultValues:S,formId:"modal-action"})):l.createElement(t.Loader,null)},fl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(ct,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(vt,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(nl,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(gt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(bt,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(Dt,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Kn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(rl,e):null!=e&&e.businessService.includes("chb")?l.createElement(cl,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(vl,e):void 0;function El(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 hl=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,E]=n.useState(null),[h,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;h.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==h?void 0:h.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(gl,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:v,documents:m,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:h,checkEnablingDocs:T}))))};function gl(e){var i,o;let{t:r,document:a,setDocuments:u,documents:s,index:d,bpaTaxDocuments:p,checkEnablingDocs:m}=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],f=Digit.ULBService.getStateId(),[E,h]=n.useState(v?c({},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!=E&&E.code&&u(e=>{var t;const n=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==E?void 0:E.code));return 0===(null==_?void 0:_.length)||null===_?n:[...null==n?void 0:n.filter(e=>(null==e?void 0:e.fileStoreId)!==_),{documentType:null==E?void 0:E.code,fileStoreId:_,documentUid:_,fileName:(null==g?void 0:g.name)||"",id:s?null===(t=s.find(e=>e.documentType===(null==E?void 0:E.code)))||void 0===t?void 0:t.id:void 0}]})},[_,E]),n.useEffect(()=>{try{b.length>0&&(sessionStorage.removeItem("BPA_DOCUMENTS"),a.newUploadedDocs=[],b.map(e=>{var t,n,l;null!=E&&E.code&&a.newUploadedDocs.push({documentType:null==E?void 0:E.code,fileStoreId:null==e||null===(t=e.fileStoreId)||void 0===t?void 0:t.fileStoreId,documentUid:null==e||null===(n=e.fileStoreId)||void 0===n?void 0:n.fileStoreId,tenantId:null==e||null===(l=e.fileStoreId)||void 0===l?void 0:l.tenantId})}),p[d]=a,sessionStorage.setItem("BPA_DOCUMENTS",JSON.stringify(p)))}catch(e){Promise.reject(e)}},[b,E]),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(El,{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:E,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: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 yl(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(El,{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 _l(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,E]=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=b(function(){return E(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?E(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 Sl=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:E}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:h}=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==h||null===(e=h["common-masters"])||void 0===e?void 0:e.DocumentType)},[h]),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==E||null===(c=E.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(El,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==_?void 0:_.map((e,t)=>l.createElement(_l,{key:t,document:e,t:o,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},bl=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,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?c({},e,{checked:l}):e))})(e,0,n),isLabelFirst:!0,index:n})),null==s?void 0:s.map((e,n)=>l.createElement("div",null,l.createElement(t.TextInput,{key:n,value:null==e?void 0:e.label,onChange:e=>((e,t)=>{d(()=>null==s?void 0:s.map((n,l)=>{var i;return t===l?{label:null==e||null===(i=e.target)||void 0===i?void 0:i.value}:n}))})(e,n),textInputStyle:{maxWidth: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=[...s];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([...s,{label:""}])}}))};function Tl(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 Al(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"},d={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=c({},u,{maxWidth:"950px"}),u=c({},u,{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: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:d}))}))))})))}const Dl=e=>{var o,r,a,u,s,c,d,p,m,v,f,E,h,g,y,_,S,T,C,A,D,N,P;let{scrutinyDetails:x,paymentsList:I=[],additionalDetails:w,applicationData:R}=e;const L=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==R?void 0:R.status))&&window.location.href.includes("bpa"),[O,k]=n.useState(),[F,M]=n.useState(),[B,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,V]=n.useState(),[q,G]=n.useState([]),[Y,K]=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(Y&&null!=Y&&Y.type){const e=function(e,t,n){if(null!==(e=".pdf".split(","))&&void 0!==e&&e.includes("."+(null==Y||null===(t=Y.type)||void 0===t||null===(n=t.split("/"))||void 0===n?void 0:n.pop()))){const e=function(){if(Y.size>=2e6)J(re("PT_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=b(function(){return Promise.resolve(Digit.UploadServices.Filestorage("property-upload",Y,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)}}()},[Y]),n.useEffect(()=>{sessionStorage.setItem("uploadedFileLess",JSON.stringify(q))},[q]),n.useEffect(()=>{var e,t,n,l,i,o,r;if(null!=w&&null!==(e=w.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==w?void 0:w.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==w||null===(n=w.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==w||null===(l=w.lessAdjustmentFeeFiles[(null==w||null===(i=w.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==w||null===(t=w.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==w||null===(n=w.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),M(null==w||null===(l=w.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==w||null===(i=w.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==w||null===(o=w.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==w||null===(r=w.selfCertificationCharges)||void 0===r?void 0:r.BPA_LESS_ADJUSMENT_PLOT),W(null==w?void 0:w.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==w?void 0:w.otherFeesDiscription),G(null==w?void 0:w.lessAdjustmentFeeFiles)},[w]);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==w?void 0:w.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:re("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==w?void 0:w.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==w||null===(s=w.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==w||null===(c=w.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==w||null===(d=w.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==w||null===(p=w.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==w||null===(m=w.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:O,disabled:!L,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==w||null===(v=w.selfCertificationCharges)||void 0===v?void 0:v.BPA_OTHER_CHARGES)||0,value:F,disabled:!L,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(M(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>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==w||null===(f=w.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!L,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==w||null===(E=w.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)||"",value:B,disabled:!L,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(O)?parseFloat(O):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==w||null===(t=w.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==w||null===(n=w.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==w||null===(l=w.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==w||null===(i=w.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&&L?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]),K(e.target.files[0])},disabled:!L,onDelete:()=>{V(null),K("")},message:z?"1 "+re("FILEUPLOADED"):re("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:$})):null,(null==Q||null===(h=Q.fileStoreIds)||void 0===h?void 0:h.length)&&parseInt(null==w||null===(g=w.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===(y=Q.fileStoreIds)||void 0===y?void 0:y.length)&&parseInt(null==w||null===(_=w.selfCertificationCharges)||void 0===_?void 0:_.BPA_LESS_ADJUSMENT_PLOT)>0&&l.createElement("a",{target:"_blank",href:null==Q||null===(S=Q.fileStoreIds[(null==Q||null===(T=Q.fileStoreIds)||void 0===T?void 0:T.length)-1])||void 0===S?void 0:S.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(O)?parseFloat(O):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==w||null===(C=w.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==w||null===(A=w.selfCertificationCharges)||void 0===A?void 0:A.BPA_LABOUR_CESS)+parseFloat(null==w||null===(D=w.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==w||null===(N=w.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))))))))},Nl=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]},E=n.useMemo(()=>v.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function h(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:h(e),columns:E,getCellProps:e=>({style:{}})})))})))},Pl=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))},xl=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(Pl,{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 Il(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 wl(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 Rl=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:E,roadCuttingDetails:h,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==E?void 0:E.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==h?void 0:h.map(e=>{var n;return l.createElement("div",{style:(null==h?void 0:h.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:""})))))))},Ll=[{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"}],Ol=[{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"}],kl=e=>{var o,r,a,u;let{wsAdditionalDetails:s}=e;const{t:d}=i.useTranslation(),[p,m,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,h]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[C,A]=n.useState(null),[D,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[P,x]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i=c({},null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails);if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var o,r,a,u,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===(u=a[0])||void 0===u?void 0:u.charge)},{title:"WS_TAX_HEADER",value:l.createElement("span",null,"₹",null==p||null===(d=p.billDetails)||void 0===d||null===(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 w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),O=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,null)),k=function(e,t,n){void 0===t&&(t=!1);let l=c({},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!=s&&null!==(r=s.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(R,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(O,{onClick:()=>{T(p),S(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{T(p),S(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,r,a,u,p,v,f,h,g,y;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(r=o.appDetails)||void 0===r?void 0:r.applicationNo,t=null==s||null===(a=s.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n=c({},null==s||null===(p=s.additionalDetails)||void 0===p||null===(v=p.appDetails)||void 0===v?void 0:v.additionalDetails,b);s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(f=s.additionalDetails)||void 0===f||null===(h=f.appDetails)||void 0===h?void 0:h.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(g=s.additionalDetails)||void 0===g||null===(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,h,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(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}];E(zn(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:Ll,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,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},w={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,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},w={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:Ol,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===(u=b.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},w={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,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},w={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})))},Fl=e=>{let{style:t}=e;return l.createElement("span",null,l.createElement("svg",{style:c({},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"})))},Ml=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(Fl,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},Bl=e=>{var o,r,a,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:m}=i.useTranslation(),[v,f]=n.useState(!1),[E,h]=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),h(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==E||null===(r=E.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==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.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==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(c=E.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==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Ul={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:{}},Hl=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:Ul.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Ul.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:c({},Ul.cell,Ul.cellLeft,Ul.cellHeader)},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:c({},Ul.cell,n.length==t+1?Ul.cellRight:{},Ul.cellHeader),key:t},a(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:c({},Ul.cell,Ul.cellLeft),component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:c({},Ul.cell,{textAlign:"left"},n.length==i+1?Ul.cellRight:{},{whiteSpace:"pre"}),key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:c({},Ul.cell,Ul.cellLeft)}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:c({},Ul.cell,Ul.cellRight,{textAlign:"left",fontWeight:"700",whiteSpace:"pre"}),key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:c({},Ul.cell,{textAlign:"left"}),key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Ul.cell,key:t,numeric:!0})))))))},jl={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))"}},Wl=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 m={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{m[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let v=[];v=Object.keys(m),v.sort((e,t)=>m[e]-m[t]);const[f,E]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:jl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Hl,{headers:[...v],values:s,arrears:p}),!f&&l.createElement("div",{style:jl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:jl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},zl=e=>{let{assessmentData: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"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},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:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),n!==t.length-1&&l.createElement("hr",null)))))},Vl=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},ql=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 Gl(e){var r,a,u,s,d,p,m,v,f,E,h,g,y,S,b,T;let{applicationDetails:C,demandData:A,workflowDetails:D,isDataLoading:N,applicationData:P,timelineStatusPrefix:x,showTimeLine:I=!0,statusAttribute:w="status",paymentsList:R,oldValue:L,isInfoLabel:O=!1,propertyId:k}=e;const{t:F}=i.useTranslation(),M=o.useHistory(),B=Digit.ULBService.getCurrentTenantId(),[U,H]=n.useState(null),[j,W]=n.useState([]);let z=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function V(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",C);const[q,G]=n.useState({}),[Y,K]=n.useState(),[$,X]=n.useState([]),[Z,J]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==P?void 0:P.status)||Z.loading||Z.loaded||Z.canLoad||J({loading:!1,loaded:!1,canLoad:!0}),null==Z||!Z.canLoad||Z.loading||Z.loaded||(J({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){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 X(o),console.log(o),K(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==P?void 0:P.tenantId)||B,null==P?void 0:P.propertyId,G,J));const Q=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()},ee=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:Q(null==P||null===(i=P.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==P?void 0:P.channel)||""};return l.createElement(xl,{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,E,h,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==C?void 0:C.tenantId,businessIds:null==C?void 0:C.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}}},A=n[t-1],D={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==P||null===(c=P.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!=P&&null!==(f=P.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(h=E[0])&&void 0!==h&&h.mobileNumber?null==P||null===(g=P.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:F(null==e?void 0:e.comment),wfComment:A?A.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(xl,{data:D,OpenImage:V,privacy:i})}{var A,D,N,x,I;const t={date:Q(null==P||null===(A=P.auditDetails)||void 0===A?void 0:A.lastModifiedTime),name:null==e||null===(D=e.assignes)||void 0===D||null===(N=D[0])||void 0===N?void 0:N.name,wfComment:null==e?void 0:e.wfComment,mobileNumber:null==e||null===(x=e.assignes)||void 0===x||null===(I=x[0])||void 0===I?void 0:I.mobileNumber};return l.createElement(xl,{data:t})}},te=(e,t)=>e?t?e:F(e):F("NA"),ne=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/noc"),ie=window.location.href.includes("employee/obps"),oe=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ne?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),re=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?te(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)+" "+F(null==e?void 0:e.isUnit):F("N/A"):null!=e&&e.value?te(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):F("N/A"),[ae,ue]=n.useState(!1);console.log("demand Data arr",A),null==A||A.reduce((e,t)=>e+t.demandInterest,0),null==A||A.reduce((e,t)=>e+t.demandPenality,0),null==A||A.reduce((e,t)=>e+t.collectionTax,0),null==A||A.reduce((e,t)=>e+t.collectionInterest,0),null==A||A.reduce((e,t)=>e+t.collectionPenality,0),null==A||A.reduce((e,t)=>e+t.balanceTax,0),null==A||A.reduce((e,t)=>e+t.balanceInterest,0),null==A||A.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=c({},e,{status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:c({},e.additionalDetails,{propertytobestatus:t}),workflow:c({},e.workflow,{businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"})});return Promise.resolve(Digit.PTService.updatePT({Property:c({},l)},B,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},ce=null==C?void 0:C.applicationData,de=(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.propertyId)||"",pe=null==C||null===(a=C.additionalDetails)||void 0===a?void 0:a.propertytobestatus;return console.log("applicationDetails?.applicationDetails",C),console.log("infolabel",O),console.log("assessment details",Y),n.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:B,filters:{consumerCodes:k},auth:!0}).then(e=>{W(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},O?l.createElement(Ml,{t:F,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==C||null===(u=C.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var r,a,u,s,c,d,p,m,v,f,E,h,g,y,_,S,b,T,A,N,P,x,I,w,O,k,M,B,U,H,j,W,V,G,Y,K,$,X;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"}:ne?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&ne?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},le?""+F(e.title):F(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},F(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"}},F(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"}},F(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},F(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||ne?{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:F(n.title),label:F(n.title),text:l.createElement("img",{src:F(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:F(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"}},F(null==n?void 0:n.title)))):le||ie?""+F(n.title):F(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:oe(),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:""+F(""+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:F(n.title),label:F(n.title),text:re(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:oe(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Wl,{bill:null===(a=q.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(Dl,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:R,additionalDetails:null==C||null===(u=C.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==C||null===(s=C.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(yl,{fiReport:null==C||null===(m=C.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(Cl,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.owners)&&l.createElement(Al,{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(wl,{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(Il,{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==D||null===(A=D.data)||void 0===A||null===(N=A.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(bl,{applicationData:null==C?void 0:C.applicationData,t:F,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(hl,{t:F,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:D})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(Sl,{t:F,isNoc:!0,NOCdata:e.values,applicationData:null==C?void 0:C.applicationData,docs:e.additionalDetails.noc,noc:null===(w=e.additionalDetails)||void 0===w?void 0:w.data,bpaActionsDetails:D}),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.scruntinyDetails)&&l.createElement(Dl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(k=e.additionalDetails)||void 0===k?void 0:k.buildingExtractionDetails)&&l.createElement(Dl,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.subOccupancyTableDetails)&&l.createElement(Nl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==C?void 0:C.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(El,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation)&&l.createElement(Tl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Rl,{wsAdditionalDetails:e,oldValue:L}),(null==e||null===(W=e.additionalDetails)||void 0===W?void 0:W.redirectUrl)&&l.createElement("div",{style:{fontSize:"16px",lineHeight:"24px",fontWeight:"400",padding:"10px 0px"}},l.createElement(o.Link,{to:null==e||null===(V=e.additionalDetails)||void 0===V||null===(G=V.redirectUrl)||void 0===G?void 0:G.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(Y=e.additionalDetails)||void 0===Y||null===(K=Y.redirectUrl)||void 0===K?void 0:K.title))),(null==e||null===($=e.additionalDetails)||void 0===$?void 0:$.estimationDetails)&&l.createElement(kl,{wsAdditionalDetails:e,workflowDetails:D}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Bl,{wsAdditionalDetails:e,workflowDetails:D}))}),(null==Y?void 0:Y.length)>0&&l.createElement(zl,{assessmentData:$}),l.createElement(ql,{payments:j}),l.createElement(Vl,{applicationData:null==C?void 0:C.applicationData}),I&&(null==D||null===(s=D.data)||void 0===s||null===(d=s.timeline)||void 0===d?void 0:d.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==D?void 0:D.isLoading)||N)&&l.createElement(t.Loader,null),!(null!=D&&D.isLoading)&&!N&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},F("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=D&&null!==(p=D.data)&&void 0!==p&&p.timeline&&1===(null==D||null===(m=D.data)||void 0===m||null===(v=m.timeline)||void 0===v?void 0:v.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:F(""+x+(null==D||null===(f=D.data)||void 0===f||null===(E=f.timeline[0])||void 0===E?void 0:E.state)),customChild:ee(null==D||null===(h=D.data)||void 0===h?void 0:h.timeline[0],null==D||null===(g=D.data)||void 0===g?void 0:g.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==D||null===(y=D.data)||void 0===y?void 0:y.timeline)&&(null==D||null===(S=D.data)||void 0===S?void 0:S.timeline.slice(0,ae?null==D?void 0:D.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!=D&&null!==(a=D.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!=D&&null!==(c=D.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:F(""+x+("REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[w])+r),customChild:ee(e,n,null==D||null===(o=D.data)||void 0===o?void 0:o.timeline)}))}))),(null==D||null===(b=D.data)||void 0===b||null===(T=b.timeline)||void 0===T?void 0:T.length)>2&&l.createElement(t.LinkButton,{label:F(ae?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ue(e=>!e)}})))),window.location.href.includes("/pt/")?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("employee")?"INACTIVE"==pe?se(ce,"ACTIVE",de):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==pe?se(ce,"INACTIVE",de):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==C||null===(e=C.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==C||null===(n=C.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(l=C.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(i=C.applicationData)||void 0===i?void 0:i.status)&&M.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,r,a;if("INACTIVE"===(null==C||null===(o=C.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==C||null===(r=C.applicationData)||void 0===r?void 0:r.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==C||null===(a=C.applicationData)||void 0===a?void 0:a.status)&&M.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),U&&l.createElement(t.Toast,{error:U.isError,label:F(U.label),onClose:()=>{H(null)},isDleteBtn:"false"}))}function Yl(e){var n,i,o,r,a,u,s,c,d,p,m,v,f,E,h,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===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.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 Kl(e){var o,r,a,u,s,d,p,m,v,f,E,h,g,y,_,S;let{workflowDetails:b,displayMenu:T,onActionSelect:C,setDisplayMenu:A,businessService:D,forcedActionPrefix:N,ActionBarStyle:P={},MenuStyle:x={}}=e;const{t:I}=i.useTranslation();let w=Digit.UserService.getUser();const R=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):{};w=null==t?void 0:t.value}const L=null===(o=w)||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,k=!1,F=(null==b||null===(u=b.data)||void 0===u||null===(s=u.actionState)||void 0===s||null===(d=s.nextActions)||void 0===d?void 0:d.filter(e=>(null==L?void 0:L.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==L?void 0:L.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(R,()=>{A(!1)},T),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==F?void 0:F.length)||null!=F&&null!==(v=F[0])&&void 0!==v&&null!==(f=v.redirectionUrl)&&void 0!==f&&f.pathname.includes("/pt/property-details/")&&1==(null==F?void 0:F.length)?(k=!1,O=!0):(null==F?void 0:F.length)>0&&(k=!0,O=!1),l.createElement(l.Fragment,null,!(null!=b&&b.isLoading)&&k&&!O&&l.createElement(t.ActionBar,{style:c({},P)},T&&(null!=b&&null!==(E=b.data)&&void 0!==E&&null!==(h=E.actionState)&&void 0!==h&&h.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:F,optionKey:"action",t:I,onSelect:C,style:x}):null,l.createElement(t.SubmitBar,{ref:R,label:I("WF_TAKE_ACTION"),onSubmit:()=>A(!T)})),!(null!=b&&b.isLoading)&&!k&&O&&l.createElement(t.ActionBar,{style:c({},P)},l.createElement("button",{style:{color:"#FFFFFF",fontSize:"18px"},className:"submit-bar",name:null==F||null===(y=F[0])||void 0===y?void 0:y.action,value:null==F||null===(_=F[0])||void 0===_?void 0:_.action,onClick:e=>{C((null==F?void 0:F[0])||{})}},I((N||"WF_EMPLOYEE_"+(null==D?void 0:D.toUpperCase()))+"_"+(null==F||null===(S=F[0])||void 0===S?void 0:S.action)))))}const $l=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Xl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement($l,null));function Zl(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(Xl,{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 Jl=e=>{var r,u;console.log("props",e);let s=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:E}=o.useParams();const[h,g]=n.useState(!1),[y,_]=n.useState(null),[S,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:I,totalDemandTax:w,totalBalanceTax:R,showToast:L,setShowToast:O,isLoading:k,isDataLoading:F,applicationData:M,mutate:B,nocMutation:U,workflowDetails:H,id:j,businessService:W,closeToast:z,moduleCode:V,timelineStatusPrefix:q,forcedActionPrefix:G,statusAttribute:Y,ActionBarStyle:K,MenuStyle:$,paymentsList:X,showTimeLine:Z=!0,oldValue:J,isInfoLabel:Q=!1,clearDataDetails:ee,propertyId:te}=e;n.useEffect(()=>{L&&H.revalidate()},[L]);const ne=a.useQueryClient(),le=()=>{_(null),T(!1)};return k||C?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,k?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Gl,{applicationDetails:x,demandData:I,id:j,workflowDetails:H,isDataLoading:F,applicationData:M,totalDemandTax:w,totalBalanceTax:R,businessService:W,timelineStatusPrefix:q,statusAttribute:Y,paymentsList:X,showTimeLine:Z,oldValue:J,isInfoLabel:Q,propertyId:te}),S?l.createElement(fl,{t:v,action:y,tenantId:d,state:p,id:E,applicationDetails:x,applicationData:null==x?void 0:x.applicationData,closeModal:le,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,d,p,m,E,h,g,_,S,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===(u=a[0])||void 0===u?void 0:u.action)?0==(null==e||null===(s=e.Licenses)||void 0===s||null===(d=s[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===(E=e.Licenses)||void 0===E||null===(h=E[0])||void 0===h||null===(g=h.comment)||void 0===g?void 0:g.length))||0==(null==e||null===(_=e.WaterConnection)||void 0===_||null===(S=_.comment)||void 0===S?void 0:S.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,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;B&&(A(!0),B(e,{onError:(e,t)=>{A(!1),O({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=y,f.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=y,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,E,h,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!==(m=t.AmendmentUpdate)&&void 0!==m&&null!==(E=m.workflow)&&void 0!==E&&E.action.includes("APPROVE")?O({key:"success",label:v("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(h=t.AmendmentUpdate)&&void 0!==h&&null!==(g=h.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 f.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(_=e.Licenses[0])||void 0===_?void 0:_.applicationNumber));O({key:"success",action:y}),ee&&setTimeout(ee,3e3),setTimeout(z,5e3),ne.clear(),ne.refetchQueries("APPLICATION_SEARCH")}}})),le()}A(!0),"function"==typeof(null==e?void 0:e.customFunctionToExecute)&&(null==e||e.customFunctionToExecute(c({},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=b(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;le(),O({key:"error",error:{message:f}}),setTimeout(z,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==H||null===(r=H.data)||void 0===r?void 0:r.timeline,businessService:W,workflowDetails:H,moduleCode:V,blockReason:null==m||null===(u=m.BPA)||void 0===u?void 0:u.BlockReason}):null,D?l.createElement(Zl,{action:y,workflowDetails:H,businessService:W,isWarningPop:D,closeWarningPopup:()=>{N(!1)}}):null,l.createElement(Yl,{t:v,showToast:L,closeToast:z,businessService:W}),l.createElement("div",null,s?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==M?void 0:M.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}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(Kl,{workflowDetails:H,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]);else if(null!=e&&e.isWarningPopUp)N(!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))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===(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,d;f.push(""+(null==e||null===(s=e.redirectionUrll)||void 0===s?void 0:s.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:c({},null===(v=e.redirectionUrl)||void 0===v?void 0:v.state)})}else T(!0);_(e),g(!1)},setDisplayMenu:g,businessService:W,forcedActionPrefix:G,ActionBarStyle:K,MenuStyle:$}))))},Ql=["tenantId","payments"];var ei=l.memo(()=>{var e,r,a,u,s,p,m,f,E,h,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({}),[I,w]=n.useState(!1),[R,L]=n.useState(!1),[O,k]=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 H=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:O,role:"PT_CEMP"});var j,W;console.log("workkkkflooowowow",H),Digit.Hooks.ptr.usePTRSearch({tenantId:T,filters:{applicationNumber:A,audit:!0}}),n.useEffect(()=>{B&&x(v.cloneDeep(B))},[B]),n.useEffect(()=>{var e,t,n;null==H||null===(e=H.data)||void 0===e||!e.applicationBusinessService||"ptr"===(null==H||null===(t=H.data)||void 0===t?void 0:t.applicationBusinessService)&&"ptr"===O||k(null==H||null===(n=H.data)||void 0===n?void 0:n.applicationBusinessService)},[H.data]),!Digit.UserService.hasAccess(["PT_CEMP"])||"ptr"!==(null==H||null===(u=H.data)||void 0===u?void 0:u.applicationBusinessService)||null==H||null===(s=H.data)||void 0===s||null===(p=s.actionState)||void 0===p||null===(m=p.nextActions)||void 0===m||!m.find(e=>"PAY"===e.action)||(H.data.actionState.nextActions=null==H||null===(j=H.data)||void 0===j||null===(W=j.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(M(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===(E=f.applicationData)||void 0===E?void 0:E.applicationNumber,isEmployee:!1},{enabled:!(null==P||null===(h=P.applicationData)||void 0===h||null===(g=h.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;d(e,Ql);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},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:()=>w(!I),displayOptions:I,options:z,downloadBtnClassName:"employee-download-btn-className",optionsClassName:"employee-options-btn-className"})),l.createElement(Jl,{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:H,businessService:O,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 ti=(e,t,n,l,i)=>i((l?"E":"C")+"S_PTR_RESPONSE_"+(t||"CREATE")+"_"+e+(n?"":"_ERROR")),ni=(e,t,n,l)=>ti("LABEL",e,t,n,l),li=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,ti("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:ni((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})},ii=e=>{const{t:t}=i.useTranslation();return t(null!=e&&e.isSuccess?"CS_PROPERTY_FEEDBACK_SUCCESS":"CS_PROPERTY_FEEDBACK_FAILED")},oi=e=>l.createElement(t.Banner,{message:ii(e),applicationNumber:"",style:e.isMobile?{width:"unset"}:{width:"740px"},successful:null==e?void 0:e.isSuccess}),ri={step:1,isValid:!1,formData:{}},ai=function(e,t){switch(void 0===e&&(e=ri),t.type){case"UPDATE_PTRNewApplication_FORM":return c({},e,{formData:c({},e.formData,{[t.payload.key]:t.payload.value})});case"SET_PTRNewApplication_STEP":return c({},e,{step:t.payload});case"RESET_PTR_NEW_APPLICATION_FORM":return ri;default:return e}},ui=e=>{let{children:t,currentStep:n=1,stepsList:o=[]}=e;const{t:r}=i.useTranslation(),a=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},s={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),o.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(i=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:i?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},r(o[t].stepLabel))),l.createElement("div",{className:"step-circle",style:a(t+1)},t+1,t<d-1&&l.createElement("div",{style:c})));var i})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},si=e=>{let{stepsList:t=[],onSubmit:n,step:o,setStep:r}=e;const a=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function s(){o<a.length?d():o===a.length&&n()}function c(){o>1&&p()}const d=()=>r(o+1),p=()=>r(o-1);return l.createElement(ui,{currentStep:o,nextStep:d,prevStep:p,stepsList:a},(()=>{var e,t;const n=a[o-1],{component:i,key:r,texts:d,currStepConfig:p}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(i);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:r,texts:d,component:i,currStepNumber:o,currStepConfig:p},onGoNext:s,onBackClick:c,t:u}))})())},ci=[{head:"ES_TITILE_OWNER_DETAILS",stepNumber:1,body:[{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_PET_DETAILS",stepNumber:2,body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"PTRSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],di=(e,t)=>({type:"UPDATE_PTRNewApplication_FORM",payload:{key:e,value:t}}),pi=e=>({type:"SET_PTRNewApplication_STEP",payload:e}),mi=[{head:"OWNER DETAILS",stepLabel:"ES_TITILE_OWNER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewPTRStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"PET DETAILS",stepLabel:"ES_TITILE_PET_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewPTRStepFormTwo",key:"petDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewPTRStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewPTRStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>c({},e,{currStepConfig:ci.filter(t=>t.stepNumber===e.stepNumber)}));console.log("updatedCreateEmployeeconfig: ",mi);const vi={PTRCheckPage:e=>{var r,a,u,s;let{onSubmit:c,value:d={}}=e;const{t:p}=i.useTranslation(),{address:m,pets:v,isEditPET:E,isUpdatePET:h,ownerss:g}=(o.useHistory(),d),y=E||h?"edit-application":"new-application",[_,S]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(A,{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(f(null==g?void 0:g.applicantName)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:p("PTR_FATHER_HUSBAND_NAME"),text:""+p(f(null==g?void 0:g.fatherName)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:p("PTR_MOBILE_NUMBER"),text:""+p(f(null==g?void 0:g.mobileNumber)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/owners"})}),l.createElement(t.Row,{label:p("PTR_EMAIL_ID"),text:""+p(f(null==g?void 0:g.emailId)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/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(f(null==v||null===(r=v.petType)||void 0===r?void 0:r.value)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_SEARCH_BREED_TYPE"),text:""+p(f(null==v||null===(a=v.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_PET_NAME"),text:""+p(f(null==v?void 0:v.petName)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_DOCTOR_NAME"),text:""+p(f(null==v?void 0:v.doctorName)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_CLINIC_NAME"),text:""+p(f(null==v?void 0:v.clinicName)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pet-details"})}),l.createElement(t.Row,{label:p("PTR_VACCINATED_DATE"),text:""+p(f(null==v?void 0:v.lastVaccineDate)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/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(f(null==m?void 0:m.doorNo)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/street"})}),l.createElement(t.Row,{label:p("PTR_STREET_NAME"),text:""+p(f(null==m?void 0:m.street)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/street"})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_LINE1"),text:""+p(f(null==m?void 0:m.addressLine1)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/street"})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_PINCODE"),text:""+p(f(null==m?void 0:m.pincode)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/pincode"})}),l.createElement(t.Row,{label:p("MYCITY_CODE_LABEL"),text:""+p(f(null==m||null===(u=m.city)||void 0===u?void 0:u.name)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})}),l.createElement(t.Row,{label:p("PTR_LOCALITY"),text:""+p(f(null==m||null===(s=m.locality)||void 0===s?void 0:s.name)),actionButton:l.createElement(O,{jumpTo:"/digit-ui/citizen/ptr/petservice/"+y+"/address"})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:p("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{S(!_)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:p("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:c,disabled:!_})))},PTRAcknowledgement:e=>{var r,a;let{data:u,onSuccess:s}=e;const{t:d}=i.useTranslation(),p=(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:m}=Digit.Hooks.useStore.getInitData(),{tenants:v}=(o.useRouteMatch(),m||{});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 e=(e=>{var t,n,l;let{pets:i}=e,o=c({},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=c({},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=c({},t);return e.ownerss=n,e})(e=(e=>{let{documents:t}=e,n=c({},t);return e.documents=n,e})(e)))),{PetRegistrationApplications:[c({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"}})]}})(u);p.mutate(n,{onSuccess:s})}catch(e){}},[]),p.isLoading||p.isIdle?l.createElement(t.Loader,null):l.createElement(t.Card,null,l.createElement(H,{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:U,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(M(c({},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:x,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(),[d,p,m]=Digit.Hooks.useSessionStorage("store-data",null),[v,f,E]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[h,g,y]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{});n.useEffect(()=>{f(!1),y()},[]);const _=rt;return l.createElement(t.FormComposer,{heading:r("ES_TITLE_NEW_PET_REGISTARTION"),isDisabled:!a,label:r("ES_COMMON_APPLICATION_SUBMIT"),config:_.map(e=>c({},e,{body:e.body.filter(e=>!e.hideInEmployee)})),fieldStyle:{marginRight:0},onSubmit:t=>{var n,l,i,o,r,a,u,d,p,m,v,f,E;const h=[c({tenantId:e},null==t?void 0:t.owners[0],{petDetails:c({},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:c({},null==t?void 0:t.address,{city:null==t||null===(u=t.address)||void 0===u||null===(d=u.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===(E=t.documents)||void 0===E?void 0:E.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:ei,PTRResponse:e=>{const{t:r}=i.useTranslation(),u=a.useQueryClient(),[s,d]=(o.useHistory(),n.useState(null)),[p,m]=n.useState(null),[v,f]=n.useState(!1),[E,h,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(()=>{E||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 h(!0),u.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&&!E?l.createElement(t.Loader,null):l.createElement("div",null,l.createElement(t.Card,null,l.createElement(li,{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&&!E||(null==C?void 0:C.isLoading),isEmployee:e.parentRoute.includes("employee")}),l.createElement(t.CardText,null,((e,t,n,l)=>ti("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(M(c({},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:s,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:E,data:h}=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==h||null===(n=h.Service)||void 0===n?void 0:n.find(e=>{var n;return null==e||null===(n=e.referenceId)||void 0===n?void 0:n.includes(null==t?void 0:t.applicationNumber)});return e(l?"CS_CF_VIEW":"CS_CF_TRACK")}return d||E?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,e("CS_TITLE_MY_APPLICATIONS")+" "+(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(j,{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,u,s,p,m,v,f,E,h,g;const{t:y}=i.useTranslation(),{acknowledgementIds:_,tenantId:S}=(o.useHistory(),o.useParams()),[b,T]=n.useState([]),[C,A]=n.useState(!1),[D,N]=n.useState(!1),[P,x]=n.useState(null),{data:w}=Digit.Hooks.useStore.getInitData(),{tenants:R}=w||{},{isLoading:L,data:O}=Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:_}}),[k,F]=n.useState(null),B=Me(O,"PetRegistrationApplications",[]),U=Me(O,"PetRegistrationApplications[0].applicationNumber",[]);let H=B&&B.length>0&&B[0]||{};const j=H;sessionStorage.setItem("ptr-pet",JSON.stringify(j));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(H.workflow||(H.workflow={id:null,tenantId:S,businessService:"pet-services",businessId:null==j?void 0:j.applicationNumber,action:"",moduleName:"pet-services",state:null,comment:null,documents:null,assignes:null}),L||V)return l.createElement(t.Loader,null);let Y=y("CS_NA");if(null!=H&&null!==(e=H.additionalDetails)&&void 0!==e&&e.documentDate){var K;const e=new Date(null==H||null===(K=H.additionalDetails)||void 0===K?void 0:K.documentDate),t=Digit.Utils.date.monthNames[e.getMonth()];Y=e.getDate()+" "+t+" "+e.getFullYear()}let $=[];return $.push({label:y("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=j||{},t=R.find(t=>t.code===e.tenantId);return Promise.resolve(M(c({},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;d(e,Be);try{let e={filestoreIds:[null==n?void 0:n.fileStoreId]};return Promise.resolve(Digit.PaymentService.generatePdf(t,{Payments:[c({},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==O||null===(e=O.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:()=>A(!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==H?void 0:H.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==H||null===(a=H.address)||void 0===a?void 0:a.pincode)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_CITY"),text:(null==H||null===(u=H.address)||void 0===u?void 0:u.city)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_STREET_NAME"),text:(null==H||null===(s=H.address)||void 0===s?void 0:s.street)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_HOUSE_NO"),text:(null==H||null===(p=H.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==H?void 0:H.applicantName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_FATHER/HUSBAND_NAME"),text:(null==H?void 0:H.fatherName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_APPLICANT_MOBILE_NO"),text:(null==H?void 0:H.mobileNumber)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_APPLICANT_EMAILID"),text:(null==H?void 0:H.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==H||null===(m=H.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==H||null===(v=H.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==H||null===(f=H.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==H||null===(E=H.petDetails)||void 0===E?void 0:E.clinicName)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_VACCINATED_DATE"),text:(null==H||null===(h=H.petDetails)||void 0===h?void 0:h.lastVaccineDate)||y("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:y("PTR_VACCINATION_NUMBER"),text:(null==H||null===(g=H.petDetails)||void 0===g?void 0:g.vaccinationNumber)||y("CS_NA")})),l.createElement(I,{application:j,id:null==j?void 0:j.applicationNumber,userType:"citizen"}),P&&l.createElement(t.Toast,{error:P.key,label:y(P.label),style:{bottom:"0px"},onClose:()=>{x(null)}})),D&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:N,setShowToast:x,data:O})))},SelectOtp:e=>{let{config:i,otp:o,onOtpChange:r,onResend:a,onSelect:u,t:s,error:d,userType:p="citizen",canSubmit:m}=e;const[v,f]=n.useState(30),E={type:"register"},[h,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=>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:c({},t,E)})).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)}},_=()=>{a(),f(30)},S=function(e){return Promise.resolve(b(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,s("CS_RESEND_ANOTHER_OTP")+" "+v+" "+s("CS_RESEND_SECONDS")):l.createElement("p",{className:"card-text-button",onClick:_},s("CS_RESEND_OTP")),!d&&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)&&m)},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",{style:{cursor:"pointer"},className:"card-text-button",onClick:_},s("CS_RESEND_OTP")),!d&&l.createElement(t.CardLabelError,null,s("CS_INVALID_OTP")),!h&&l.createElement(t.CardLabelError,{style:{cursor:"pointer"}},s("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()),E=(Digit.Hooks.useStore.getInitData(),window.Digit.Utils.browser.isMobile());return l.createElement("form",null,l.createElement(t.Card,{style:E?{padding:"unset"}:{}},l.createElement(oi,{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:E,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,u,s;let{popup:d=!1,onClose:p,setShowToast:m,data:v}=e;const{t:f}=i.useTranslation(),E=o.useHistory(),h=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(""),[I,w]=n.useState(0);if(N)return l.createElement(t.Loader,null);const R=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(R("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(R("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===(u=v.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId)})||f("PT_RATE_TEXT")),l.createElement(t.Rating,{styles:{justifyContent:"center"},currentRating:I,maxRating:5,onFeedback:(e,t,n)=>{w(n)}}),0!==I&&l.createElement("div",null,l.createElement(t.CardLabel,null,f((null==D||null===(L=D.headerByRating)||void 0===L||null===(O=L.filter(e=>I>=(null==e?void 0:e.minvalue)&&I<=(null==e?void 0:e.maxvalue)))||void 0===O||null===(k=O[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,u,s,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===(u=v.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId),additionalDetails:{}},{attributeCode:"rating",value:I,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==h||null===(A=h.info)||void 0===A?void 0:A.uuid},i=c({},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:c({},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"})):E.push({pathname:"/digit-ui/citizen/feedback-acknowledgement",state:{rating:I,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)||!I}),!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 L,O,k},PTRPetdetails:e=>{let{config:t,onSelect:r,formData:a,setError:u,formState:s,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()}])),[f,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:f,allOwners:m,setFocusIndex:E,formData:a,formState:s,setPets:v,t:p,setError:u,clearErrors:d,config:t,menu:S,breed_type:b,pet_sex:C};return l.createElement(l.Fragment,null,m.map((e,t)=>l.createElement(h,c({key:e.key,index:t,pets:e},A))))},PTROwnerDetails:e=>{let{config:t,onSelect:r,formData:a,setError:u,formState:s,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 h={focusIndex:f,allOwners:m,setFocusIndex:E,formData:a,formState:s,setOwners:v,t:p,setError:u,clearErrors:d,config:t};return l.createElement(l.Fragment,null,m.map((e,t)=>l.createElement(g,c({key:e.key,index:t,owner:e},h))))},PTRCreatePet:e=>{var n,r,u,s;const d=a.useQueryClient(),p=o.useRouteMatch(),{t:m}=i.useTranslation(),{pathname:v}=o.useLocation(),f=o.useHistory(),E=Digit.ULBService.getStateId();let h=[];const[g,y,_]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:S,isLoading:b}=Digit.Hooks.pt.useMDMS(E,"PropertyTax","CommonFieldsConfig");function T(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=g.owners||[];n[l]=t,y(c({},g,{[e]:[...n]}))}else if("units"===e){let e=g.units||[];e=t,y(c({},g,{units:e}))}else y(c({},g,{[e]:c({},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={}}=h.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 C=()=>{},A=()=>{};if(b)return l.createElement(t.Loader,null);S=D,S.forEach(e=>{h=h.concat(e.body.filter(e=>!e.hideInCitizen))}),h.indexRoute="info";const N=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("PTRCheckPage"),P=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:p.path+"/"+e.route,key:t},l.createElement(u,{config:{texts:i,inputs:r,key:a},onSelect:T,onSkip:C,t:m,formData:g,onAdd:A}))}),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+"/"+h.indexRoute})))},PTRDocumentUpload:e=>{var i,r;let{t:a,config:u,onSelect:s,formData:d,setError:p,clearErrors:m,formState:v}=e;Digit.ULBService.getCurrentTenantId();const f=Digit.ULBService.getStateId(),[E,h]=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:S}=Digit.Hooks.ptr.usePetMDMS(f,"PetService","Documents"),b=null==S||null===(r=S.PetService)||void 0===r?void 0:r.Documents.map(e=>c({},e,{hasDropdown:!0}));return n.useEffect(()=>{s(u.key,{documents:E,PTRDocumentLength:null==b?void 0:b.length})},[E]),_?l.createElement(t.Loader,null):l.createElement("div",null,null==b?void 0:b.map((e,t)=>l.createElement(T,{key:t,document:e,action:"create",t:a,id:"ptr-document-"+t,error:g,setError:y,setDocuments:h,accept:".pdf, .jpeg, .jpg, .png",documents:E,formData:d,setFormError:p,clearFormErrors:m,config:u,formState:v})),g&&l.createElement(t.Toast,{label:g,onClose:()=>y(null),error:!0}))},PTRSelectStreet:e=>{let{t:i,config:o,onSelect:a,userType:u,formData:s,formState:d,setError:p,clearErrors:m}=e;const[f,E]=n.useState({index:-1,type:""}),{control:h,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"===u&&(Object.keys(b).length&&!v.isEqual((null===(e=d.errors[o.key])||void 0===e?void 0:e.type)||{},b)?p(o.key,{type:b}):!Object.keys(b).length&&d.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=s[o.key])||void 0===n?void 0:n[e]}),v.isEqual(S,t)||(a(o.key,c({},s[o.key],S)),_())},[S]),"employee"===u?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:h,defaultValue:null==s||null===(a=s.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,c({id:e.name,key:e.name,value:i.value,onChange:e=>{E({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:c({},o,{inputs:C}),_defaultValues:{street:null==s?void 0:s.address.street,doorNo:null==s?void 0:s.address.doorNo},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRCitizenDetails:N,PTRCitizenPet:S,PTRCitizenAddress:e=>{let{t:i,config:o,onSelect:a,userType:u,formData:s,formState:d,setError:p,clearErrors:m}=e;const[f,E]=n.useState({index:-1,type:""}),{control:h,formState:g,watch:y,trigger:_}=r.useForm(),S=y(),{errors:b}=g,T=window.location.href.includes("ptr/petservice/new-application");let C;C=[{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(()=>{_()},[]),n.useEffect(()=>{var e;"employee"===u&&(Object.keys(b).length&&!v.isEqual((null===(e=d.errors[o.key])||void 0===e?void 0:e.type)||{},b)?p(o.key,{type:b}):!Object.keys(b).length&&d.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=s[o.key])||void 0===n?void 0:n[e]}),v.isEqual(S,t)||(a(o.key,c({},s[o.key],S)),_())},[S]),"employee"===u?null===(N=C)||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"},T?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:h,defaultValue:null==s||null===(a=s.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:D(e)},render:i=>l.createElement(t.TextInput,c({id:e.name,key:e.name,value:i.value,onChange:e=>{E({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(A,{currentStep:3}):null,l.createElement(t.FormStep,{config:c({},o,{inputs:C}),_defaultValues:{street:null==s?void 0:s.address.street,doorNo:null==s?void 0:s.address.doorNo,buildingName:null==s?void 0:s.address.buildingName,addressLine1:null==s?void 0:s.address.addressLine1,addressLine2:null==s?void 0:s.address.addressLine2,landmark:null==s?void 0:s.address.landmark},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRSelectPincode:e=>{var i;let{t:r,config:a,onSelect:u,formData:s={},userType:d}=e;const p=Digit.Hooks.ptr.useTenants(),{pathname:m}=o.useLocation(),v=m.includes("modify");console.log("formData in oincode ",s);const[f,E]=n.useState(()=>{var e,t,n;return v&&"employee"===d?(null==s||null===(e=s.originalData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.pincode)||"":(null==s||null===(n=s.address)||void 0===n?void 0:n.pincode)||""}),h=[{label:"PTR_ADDRESS_PINCODE",type:"text",name:"pincode",validation:{minlength:6,maxlength:7,pattern:"[0-9]+",max:"9999999",title:r("PTR_ADDRESS_PINCODE_INVALID")}}],[g,y]=n.useState(null),[_,S]=n.useState("");function b(e){E(e.target.value),y(null),S("");let t=Digit.Utils.getPattern("Pincode").test(e.target.value);"employee"===d&&(e.target.value&&!t&&S(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)}))||S(r("PTR_COMMON_PINCODE_NOT_SERVICABLE"))),u(a.key,c({},s.address,{pincode:e.target.value})))}return n.useEffect(()=>{var e;null!=s&&null!==(e=s.address)&&void 0!==e&&e.pincode&&E(s.address.pincode)},[null==s||null===(i=s.address)||void 0===i?void 0:i.pincode]),"employee"===d?null==h?void 0:h.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,c({key:e.name,value:f,onChange:b},e.validation,{disable:v,autoFocus:v})))),_?l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},_):null)):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(A,{currentStep:3}):null,l.createElement(t.FormStep,{t:r,config:c({},a,{inputs:h}),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))}))?u(a.key,{pincode:f}):y("PTR_COMMON_PINCODE_NOT_SERVICABLE"),Promise.resolve()}catch(e){return Promise.reject(e)}},_defaultValues:{pincode:f},onChange:b,onSkip:()=>u(),forcedError:r(g)}))},PTRSelectAddress:e=>{var i;let{t:a,config:u,onSelect:s,userType:d,formData:p}=e;const m=Digit.Hooks.ptr.useTenants();let f=Digit.ULBService.getCurrentTenantId();const{pathname:E}=o.useLocation(),h=E.includes("modify");let g=(null==p?void 0:p.isEditAddress)||!1;h&&(g=!0);const{pincode:y}=(null==p?void 0:p.address)||"",_="employee"===d?m.filter(e=>e.code===f):y?m.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==y)}):m,[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,D]=n.useState(),[N,P]=n.useState();n.useEffect(()=>{if("employee"===d&&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];R("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&&P(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||P()),D(()=>i.length>0?i:l),1===i.length&&P(i[0])}},[S,null==p||null===(i=p.address)||void 0===i?void 0:i.pincode,T]);const{control:x,formState:I,watch:w,setValue:R}=r.useForm(),L=w(),{errors:O}=I,k={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};var F,M;return n.useEffect(()=>{if("employee"===d){let e=Object.keys(L);const t={};e.forEach(e=>{var n;return t[e]=null===(n=p[u.key])||void 0===n?void 0:n[e]}),v.isEqual(L,t)||s(u.key,c({},p[u.key],L))}},[L]),n.useEffect(()=>{},[I]),"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==_?void 0:_.length)?_[0]:S,control:x,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:k},I.touched.city?null==O||null===(F=O.city)||void 0===F?void 0:F.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:C,select:e.onChange,onBlur:e.onBlur,optionKey:"i18nkey",t:a,disable:g||!1})})),l.createElement(t.CardLabelError,{style:k},I.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(A,{currentStep:3}):null,l.createElement(t.FormStep,{config:u,onSelect:function(){s(u.key,{city:S,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:_.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:S,optionKey:"i18nKey",onSelect:function(e){P(null),D(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:N,optionKey:"i18nkey",onSelect:function(e){var t;null!=p&&null!==(t=p.address)&&void 0!==t&&t.locality&&(p.address.locality=e),P(e),"employee"===d&&s(u.key,c({},p[u.key],{locality:e}))},t:a,labelKey:"",disabled:g})))))},PTRSelectProofIdentity:e=>{var i,o,r;let{t:a,config:u,onSelect:s,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),[E,h]=n.useState(!0),[g,y]=n.useState(!1),_=Digit.ULBService.getStateId(),{isLoading:S,data:b}=Digit.Hooks.pt.usePropertyMDMS(_,"NDC",["Documents"]);console.log("formDataINPTRDOCUMENT",p,d);const T=()=>{let e;e=c({},d.documents,{documents:p}),s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==b||null===(e=b.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==p||p.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),h("0"!=n&&0!=n||!((null==p?void 0:p.length)>0))},[p,g]),l.createElement("div",null,S?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:a,config:u,onSelect:T,onSkip:()=>s(),isDisabled:E,onAdd:function(){}},null==b||null===(o=b.NDC)||void 0===o||null===(r=o.Documents)||void 0===r?void 0:r.map((e,t)=>l.createElement(P,{key:t,document:e,t:a,error:v,setError:f,setDocuments:m,documents:p,setCheckRequiredFields:y,handleSubmit:T})),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(E(o,".","_"))),r.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(E(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("CS_COMMON_NEXT"),onSubmit:r}))))},PTRWFApplicationTimeline:I,NewPTRStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),r=s.useDispatch(),[a,u]=n.useState(null),c=s.useSelector(e=>e.ptr.PTRNewApplicationFormReducer),d=c.step;return Digit.ULBService.getCurrentTenantId(),console.log("formStatePTR: ",c),n.useEffect(()=>{r({type:"RESET_PTR_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("PET_REGISTRATION_APPLICATION")),l.createElement(si,{stepsList:mi,onSubmit:()=>{},step:d,setStep:e=>{r(pi(e))}}),a&&l.createElement(t.Toast,{error:a.key,label:e(a.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewPTRStepFormOne:e=>{let{config:o,onGoNext:r,onBackClick:a}=e;const u=s.useDispatch(),{t:c}=i.useTranslation(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(N,{onGoBack:function(e){a(o.key,e)},goNext:function(e){u(di(o.key,e)),r()},currentStepData:f,t:c}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewPTRStepFormTwo:e=>{let{config:o,onGoNext:r,onBackClick:a}=e;const u=s.useDispatch(),{t:c}=i.useTranslation(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(S,{onGoBack:function(e){a(o.key,e)},goNext:function(e){u(di(o.key,e)),r()},currentStepData:f,t:c}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewPTRStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:r,t:a}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,m]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData&&e.ptr.PTRNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.ptr.PTRNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:f,config:i.currStepConfig,onSubmit:function(e){console.log("goNext data in NewPTRStepFormThree: ",e);const{missingFields:t}={missingFields:[],notFormattedFields:[]};if(t.length>0)return m("Please fill the following field: "+t[0]),void d(!0);o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!v.isEqual(t,f)),v.isEqual(t,f)||u(di(i.key,t))},label:a(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){r(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),m("")}}))},NewPTRStepFormFour:e=>{let{config:i,onGoNext:o,onBackClick:r,t:a}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,m]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData||{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:f,config:i.currStepConfig,onSubmit:function(e){o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!v.isEqual(t,f)),v.isEqual(t,f)||u(di(i.key,t))},label:a(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){r(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),m("")}}))},PTRSummary:function(e){var n,i,r,a,u,c,d,p,m,v,f,E,h,g,y,_,S,b,T,C,A,D,N,P,x,I,w,R,L,O,k,F;let{formData:M,t:B}=e;o.useLocation(),o.useHistory();const U=s.useDispatch();return l.createElement("div",{className:"application-summary"},l.createElement("h2",{style:{fontSize:"20px",fontWeight:"bold"}},B("Application Summary")),l.createElement(t.Card,{className:"summary-section",style:{padding:"2px"}},l.createElement("div",{className:"section-header"},l.createElement("h3",null,B("Owner Details")),l.createElement("label",{onClick:()=>U(pi(1))},B("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("First Name")),l.createElement("div",null,(null==M||null===(n=M.ownerss)||void 0===n||null===(i=n.ownerss)||void 0===i?void 0:i.firstName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Last Name")),l.createElement("div",null,(null==M||null===(r=M.ownerss)||void 0===r||null===(a=r.ownerss)||void 0===a?void 0:a.lastName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Father's Name")),l.createElement("div",null,(null==M||null===(u=M.ownerss)||void 0===u||null===(c=u.ownerss)||void 0===c?void 0:c.fatherName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Mobile Number")),l.createElement("div",null,(null==M||null===(d=M.ownerss)||void 0===d||null===(p=d.ownerss)||void 0===p?void 0:p.mobileNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Email ID")),l.createElement("div",null,(null==M||null===(m=M.ownerss)||void 0===m||null===(v=m.ownerss)||void 0===v?void 0:v.emailId)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Address")),l.createElement("div",null,(null==M||null===(f=M.ownerss)||void 0===f||null===(E=f.ownerss)||void 0===E?void 0:E.address)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,B("Pet Details")),l.createElement("label",{onClick:()=>U(pi(2))},B("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Pet Name")),l.createElement("div",null,(null==M||null===(h=M.pets)||void 0===h||null===(g=h.pets)||void 0===g?void 0:g.petName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Pet Type")),l.createElement("div",null,(null==M||null===(y=M.pets)||void 0===y||null===(_=y.pets)||void 0===_||null===(S=_.petType)||void 0===S?void 0:S.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Breed Type")),l.createElement("div",null,(null==M||null===(b=M.pets)||void 0===b||null===(T=b.pets)||void 0===T||null===(C=T.breedType)||void 0===C?void 0:C.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Pet Gender")),l.createElement("div",null,(null==M||null===(A=M.pets)||void 0===A||null===(D=A.pets)||void 0===D||null===(N=D.petGender)||void 0===N?void 0:N.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Color")),l.createElement("div",null,(null==M||null===(P=M.pets)||void 0===P||null===(x=P.pets)||void 0===x?void 0:x.color)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Vaccination Number")),l.createElement("div",null,(null==M||null===(I=M.pets)||void 0===I||null===(w=I.pets)||void 0===w?void 0:w.vaccinationNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Last Vaccine Date")),l.createElement("div",null,(null==M||null===(R=M.pets)||void 0===R||null===(L=R.pets)||void 0===L?void 0:L.lastVaccineDate)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,B("Documents")),l.createElement("label",{onClick:()=>U(pi(3))},B("EDIT"))),l.createElement("div",{className:"section-content"},null==M||null===(O=M.documents)||void 0===O||null===(k=O.documents)||void 0===k||null===(F=k.documents)||void 0===F?void 0:F.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Document Type")),l.createElement("div",null,B(null==e?void 0:e.documentType)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Document UID")),l.createElement("div",null,(null==e?void 0:e.documentUid)||"NA")))))))}},fi=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(vi).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(Qe,{path:a,url:u,userType:i}):l.createElement(L,null)},Ei=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:fi,PTRLinks:Ei,PTR_INBOX_FILTER:e=>l.createElement(lt,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 ot(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 it(""+(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 ot(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 it(""+(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 ot(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 it(""+(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 ot(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 it(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 ot(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=Ei,exports.PTRModule=fi,exports.PTRReducers=()=>u.combineReducers({PTRNewApplicationFormReducer:ai});
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"),u=require("redux"),s=require("react-redux");function c(){return(c=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 d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var m=p(function(e,t){(function(){var n="Expected a function",l="__lodash_placeholder__",i=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],o="[object Arguments]",r="[object Array]",a="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",p="[object GeneratorFunction]",m="[object Map]",v="[object Number]",f="[object Object]",E="[object RegExp]",h="[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]",I="[object Uint32Array]",w=/\b__p \+= '';/g,R=/\b(__p \+=) '' \+/g,L=/(__e\(.*?\)|\b__t\)) \+\n'';/g,O=/&(?:amp|lt|gt|quot|#39);/g,k=/[&<>"']/g,F=RegExp(O.source),M=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,V=/[\\^$.*+?()[\]{}|]/g,$=RegExp(V.source),q=/^\s+/,G=/\s/,Y=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,K=/\{\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]",Ee="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",he="\\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+"|"+Ee+")",Te="(?:"+Se+"|"+Ee+")",Ce="(?:"+me+"|"+he+")?",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"),Ie=RegExp(he+"(?="+he+")|"+Ne+Ae,"g"),we=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"),Re=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Oe=["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,Fe={};Fe[T]=Fe[C]=Fe[A]=Fe[D]=Fe[N]=Fe[P]=Fe["[object Uint8ClampedArray]"]=Fe[x]=Fe[I]=!0,Fe[o]=Fe[r]=Fe[S]=Fe[a]=Fe[b]=Fe[u]=Fe[s]=Fe[c]=Fe[m]=Fe[v]=Fe[f]=Fe[E]=Fe[h]=Fe[g]=Fe[_]=!1;var Me={};Me[o]=Me[r]=Me[S]=Me[b]=Me[a]=Me[u]=Me[T]=Me[C]=Me[A]=Me[D]=Me[N]=Me[m]=Me[v]=Me[f]=Me[E]=Me[h]=Me[g]=Me[y]=Me[P]=Me["[object Uint8ClampedArray]"]=Me[x]=Me[I]=!0,Me[s]=Me[c]=Me[_]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ue=parseFloat,He=parseInt,je="object"==typeof d&&d&&d.Object===Object&&d,We="object"==typeof self&&self&&self.Object===Object&&self,ze=je||We||Function("return this")(),Ve=t&&!t.nodeType&&t,$e=Ve&&e&&!e.nodeType&&e,qe=$e&&$e.exports===Ve,Ge=qe&&je.process,Ye=function(){try{return $e&&$e.require&&$e.require("util").types||Ge&&Ge.binding&&Ge.binding("util")}catch(e){}}(),Ke=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)&&ht(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 Et(e,t,n,l){for(var i=e.length,o=n+(l?1:-1);l?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function ht(e,t,n){return t==t?function(e,t,n){for(var l=n-1,i=e.length;++l<i;)if(e[l]===t)return l;return-1}(e,t,n):Et(e,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(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 It(e,t){for(var n=-1,l=e.length;++n<l&&ht(t,e[n],0)>-1;);return n}function wt(e,t){for(var n=e.length;n--&&ht(t,e[n],0)>-1;);return n}function Rt(e,t){for(var n=e.length,l=0;n--;)e[n]===t&&++l;return l}var Lt=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"}),Ot=bt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function kt(e){return"\\"+Be[e]}function Ft(e){return Re.test(e)}function Mt(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 Ft(e)?function(e){for(var t=Ie.lastIndex=0;Ie.test(e);)++t;return t}(e):vt(e)}function zt(e){return Ft(e)?function(e){return e.match(Ie)||[]}(e):function(e){return e.split("")}(e)}function Vt(e){for(var t=e.length;t--&&G.test(e.charAt(t)););return t}var $t=bt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),qt=function e(t){var d,G=(t=null==t?ze:qt.defaults(ze.Object(),t,qt.pick(ze,Oe))).Array,ce=t.Date,de=t.Error,pe=t.Function,me=t.Math,ve=t.Object,fe=t.RegExp,Ee=t.String,he=t.TypeError,ge=G.prototype,ye=ve.prototype,_e=t["__core-js_shared__"],Se=pe.prototype.toString,be=ye.hasOwnProperty,Te=0,Ce=(d=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",Ae=ye.toString,De=Se.call(ve),Ne=ze._,Ie=fe("^"+Se.call(be).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Re=qe?t.Buffer:void 0,Be=t.Symbol,je=t.Uint8Array,We=Re?Re.allocUnsafe:void 0,Ve=Bt(ve.getPrototypeOf,ve),$e=ve.create,Ge=ye.propertyIsEnumerable,Ye=ge.splice,vt=Be?Be.isConcatSpreadable:void 0,bt=Be?Be.iterator:void 0,Gt=Be?Be.toStringTag:void 0,Yt=function(){try{var e=Ji(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=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=Re?Re.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"),En=Ji(t,"WeakMap"),hn=Ji(ve,"create"),gn=En&&new En,yn={},_n=Po(pn),Sn=Po(mn),bn=Po(vn),Tn=Po(fn),Cn=Po(En),An=Be?Be.prototype:void 0,Dn=An?An.valueOf:void 0,Nn=An?An.toString:void 0;function Pn(e){if($r(e)&&!Or(e)&&!(e instanceof Rn)){if(e instanceof wn)return e;if(be.call(e,"__wrapped__"))return xo(e)}return new wn(e)}var xn=function(){function e(){}return function(t){if(!Vr(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function In(){}function wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Rn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ln(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}function 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 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 Fn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new kn;++t<n;)this.add(e[t])}function Mn(e){var t=this.__data__=new On(e);this.size=t.size}function Bn(e,t){var n=Or(e),l=!n&&Lr(e),i=!n&&!l&&Br(e),o=!n&&!l&&!i&&Qr(e),r=n||l||i||o,a=r?At(e.length,Ee):[],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(Ei(e),Kn(t,0,e.length))}function jn(e){return To(Ei(e))}function Wn(e,t,n){(void 0!==n&&!Ir(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)&&Ir(l,n)&&(void 0!==n||t in e)||Gn(e,t,n)}function Vn(e,t){for(var n=e.length;n--;)if(Ir(e[n][0],t))return n;return-1}function $n(e,t,n,l){return el(e,function(e,i,o){t(l,e,n(e),o)}),l}function qn(e,t){return e&&hi(t,Sa(t),e)}function Gn(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=G(l),o=null==e;++n<l;)i[n]=o?void 0:Ea(e,t[n]);return i}function Kn(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,d=1&t,_=2&t,w=4&t;if(n&&(s=i?n(e,l,i,r):n(e)),void 0!==s)return s;if(!Vr(e))return e;var R=Or(e);if(R){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),!d)return Ei(e,s)}else{var L=to(e),O=L==c||L==p;if(Br(e))return ci(e,d);if(L==f||L==o||O&&!i){if(s=_||O?{}:lo(e),!d)return _?function(e,t){return hi(e,eo(e),t)}(e,function(e,t){return e&&hi(t,ba(t),e)}(s,e)):function(e,t){return hi(e,Qi(e),t)}(e,qn(s,e))}else{if(!Me[L])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 I:return pi(e,n);case m:return new l;case v:case g:return new l(e);case E:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return new l;case y:return Dn?ve(Dn.call(e)):{}}}(e,L,d)}}r||(r=new Mn);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 F=R?void 0:(w?_?$i:Vi:_?ba:Sa)(e);return lt(F||e,function(l,i){F&&(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 he(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 Fn(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=In.prototype).constructor=Pn,(wn.prototype=xn(In.prototype)).constructor=wn,(Rn.prototype=xn(In.prototype)).constructor=Rn,Ln.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},Ln.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ln.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return be.call(t,e)?t[e]:void 0},Ln.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:be.call(t,e)},Ln.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},On.prototype.clear=function(){this.__data__=[],this.size=0},On.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))},On.prototype.get=function(e){var t=this.__data__,n=Vn(t,e);return n<0?void 0:t[n][1]},On.prototype.has=function(e){return Vn(this.__data__,e)>-1},On.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 Ln,map:new(mn||On),string:new Ln}},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},Fn.prototype.add=Fn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Fn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.clear=function(){this.__data__=new On,this.size=0},Mn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Mn.prototype.get=function(e){return this.__data__.get(e)},Mn.prototype.has=function(e){return this.__data__.has(e)},Mn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof On){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 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 Or(e)?l:ct(l,n(e))}function ml(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Gt&&Gt in ve(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 vl(e,t){return e>t}function fl(e,t){return null!=e&&be.call(e,t)}function El(e,t){return null!=e&&t in ve(e)}function hl(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 Fn(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(Ho(t))];return null==l?void 0:tt(l,e,n)}function yl(e){return $r(e)&&ml(e)==o}function _l(e,t,n,l,i){return e===t||(null==e||null==t||!$r(e)&&!$r(t)?e!=e&&t!=t:function(e,t,n,l,i,c){var d=Or(e),p=Or(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 Mn),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 je(e),new je(t)));case a:case u:case v:return Ir(+e,+t);case s:return e.name==t.name&&e.message==t.message;case E:case g:return e==t+"";case m:var c=Mt;case h:if(c||(c=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(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,I=P?t.value():t;return c||(c=new Mn),i(x,I,n,l,c)}}return!!D&&(c||(c=new Mn),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]],E=t[c];if(l)var h=r?l(E,f,c,t,e,o):l(f,E,c,e,t,o);if(!(void 0===h?f===E||i(f,E,n,l,o):h)){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 Mn;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))&&(jr(e)?Ie:ie).test(Po(e));var t}function Tl(e){return"function"==typeof e?e:null==e?Ga:"object"==typeof e?Or(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=Fr(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]?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=Ea(n,e);return void 0===l&&l===t?ha(n,e):_l(t,l,3)}}function xl(e,t,n,l,i){e!==t&&rl(t,function(o,r){if(i||(i=new Mn),Vr(o))!function(e,t,n,l,i,o,r){var a=ho(e,n),u=ho(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=Or(u),m=!p&&Br(u),v=!p&&!m&&Qr(u);c=u,p||m||v?Or(a)?c=a:Mr(a)?c=Ei(a):m?(d=!1,c=ci(u,!0)):v?(d=!1,c=pi(u,!0)):c=[]:Yr(u)||Lr(u)?(c=a,Lr(a)?c=aa(a):Vr(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(ho(e,r),o,r+"",e,t,i):void 0;void 0===a&&(a=o),Wn(e,r,a)}},ba)}function Il(e,t){var n=e.length;if(n)return oo(t+=t<0?n:0,n)?e[t]:void 0}function wl(e,t,n){t=t.length?st(t,function(e){return Or(e)?function(t){return dl(t,1===e.length?e[0]:e)}:e}):[Ga];var l=-1;return t=st(t,Nt(Ki())),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 Rl(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 Ll(e,t,n,l){var i=l?gt:ht,o=-1,r=t.length,a=e;for(e===t&&(t=Ei(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 Ol(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 Fl(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 Ml(e,t){return _o(vo(e,t,Ga),e+"")}function Bl(e){return Un(Ia(e))}function Ul(e,t){var n=Ia(e);return To(n,Kn(t,0,n.length))}function Hl(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 jl=gn?function(e,t){return gn.set(e,t),e}:Ga,Wl=Yt?function(e,t){return Yt(e,"toString",{configurable:!0,enumerable:!1,value:Va(t),writable:!0})}:Ga;function zl(e){return To(Ia(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=G(i);++l<i;)o[l]=e[l+t];return o}function $l(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,m=null===d,v=d==d,f=Jr(d);if(r)var E=l||v;else E=s?v&&(l||p):a?v&&p&&(l||!m):u?v&&p&&!m&&(l||!f):!m&&!f&&(l?d<=t:d<t);E?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||!Ir(a,u)){var u=a;o[i++]=0===r?0:r}}return o}function Kl(e){return"number"==typeof e?e:Jr(e)?NaN:+e}function Xl(e){if("string"==typeof e)return e;if(Or(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:Fi(e);if(s)return Ht(s);r=!1,i=xt,u=new Fn}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?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 Rn&&(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 Mr(e)?e:[]}function oi(e){return"function"==typeof e?e:Ga}function ri(e,t){return Or(e)?e:ao(e,t)?[e]:Do(ua(e))}var ai=Ml;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=Kt||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 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=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 m=i;++u<s;)d[m+u]=t[u];for(;++r<a;)(p||i<o)&&(d[m+n[r]]=e[i++]);return d}function Ei(e,t){var n=-1,l=e.length;for(t||(t=G(l));++n<l;)t[n]=e[n];return t}function hi(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=Or(n)?nt:$n,o=t?t():{};return i(n,e,Ki(l,2),o)}}function yi(e){return Ml(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(!Fr(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=Ft(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(La(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(!Fr(t)){var o=Ki(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=wn.prototype.thru;for(e&&t.reverse();i--;){var r=t[i];if("function"!=typeof r)throw new he(n);if(o&&!a&&"wrapper"==Gi(r))var a=new wn([],!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&&Or(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 E(){for(var h=arguments.length,g=G(h),y=h;y--;)g[y]=arguments[y];if(m)var _=Yi(E),S=Rt(g,_);if(l&&(g=vi(g,l,i,m)),o&&(g=fi(g,o,r,m)),h-=S,m&&h<s){var b=Ut(g,_);return Oi(e,t,Ni,E.placeholder,n,g,b,a,u,s-h)}var T=d?n:this,C=p?T[e]:e;return h=g.length,a?g=Eo(g,a):v&&h>1&&g.reverse(),c&&u<h&&(g.length=u),this&&this!==ze&&this instanceof E&&(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=Kl(n),l=Kl(l)),i=e(n,l)}return i}}function Ii(e){return zi(function(t){return t=st(t,Nt(Ki())),Ml(function(n){var l=this;return e(t,function(e){return tt(e,l,n)})})})}function wi(e,t){var n=(t=void 0===t?" ":Xl(t)).length;if(n<2)return n?Fl(t,e):t;var l=Fl(t,Jt(e/Wt(t)));return Ft(t)?ui(zt(l),0,e).join(""):l.slice(0,e)}function Ri(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 Li(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ra(t),n=ra(n)),e(t,n)}}function Oi(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 Fi=fn&&1/Ht(new fn([,-0]))[1]==1/0?function(e){return new fn(e)}:Ja;function Mi(e){return function(t){var n=to(t);return n==m?Mt(t):n==h?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 he(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:qi(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)E=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=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 Oi(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 E=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?jl:go)(E,f),e,t)}function Ui(e,t,n,l){return void 0===e||Ir(e,ye[n])&&!be.call(l,n)?t:e}function Hi(e,t,n,l,i,o){return Vr(e)&&Vr(t)&&(o.set(t,e),xl(e,t,void 0,Hi,o),o.delete(t)),e}function ji(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 Fn:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var v=e[d],f=t[d];if(l)var E=r?l(f,v,d,t,e,o):l(v,f,d,e,t,o);if(void 0!==E){if(E)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 $i(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 Yi(e){return(be.call(Pn,"placeholder")?Pn:e).placeholder}function Ki(){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 Ge.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)&&(Or(e)||Lr(e))}function lo(e){return"function"!=typeof e.constructor||co(e)?{}:xn(Ve(e))}function io(e){return Or(e)||Lr(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?Fr(n)&&oo(t,n.length):"string"==l&&t in n)&&Ir(n[t],e)}function ao(e,t){if(Or(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 ve(t)}function uo(e){var t=Gi(e),n=Pn[t];if("function"!=typeof n||!(t in Rn.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||mn&&to(new mn)!=m||vn&&"[object Promise]"!=to(vn.resolve())||fn&&to(new fn)!=h||En&&to(new En)!=_)&&(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 h;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&&!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=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,Vl(t,0,-1))}function Eo(e,t){for(var n=e.length,l=an(t.length,n),i=Ei(e);l--;){var o=t[l];e[l]=oo(o,n)?i[o]:void 0}return e}function ho(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(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(K);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 Rn)return e.clone();var t=new wn(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Ml(function(e,t){return Mr(e)?Qn(e,ol(t,1,Mr,!0)):[]}),wo=Ml(function(e,t){var n=Ho(t);return Mr(n)&&(n=void 0),Mr(e)?Qn(e,ol(t,1,Mr,!0),Ki(n,2)):[]}),Ro=Ml(function(e,t){var n=Ho(t);return Mr(n)&&(n=void 0),Mr(e)?Qn(e,ol(t,1,Mr,!0),void 0,n):[]});function Lo(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var i=null==n?0:ia(n);return i<0&&(i=rn(l+i,0)),Et(e,Ki(t,3),i)}function Oo(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)),Et(e,Ki(t,3),i,!0)}function ko(e){return null!=e&&e.length?ol(e,1):[]}function Fo(e){return e&&e.length?e[0]:void 0}var Mo=Ml(function(e){var t=st(e,ii);return t.length&&t[0]===e[0]?hl(t):[]}),Bo=Ml(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]?hl(n,Ki(t,2)):[]}),Uo=Ml(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]?hl(n,void 0,t):[]});function Ho(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var jo=Ml(Wo);function Wo(e,t){return e&&e.length&&t&&t.length?Ll(e,t):e}var zo=zi(function(e,t){var n=null==e?0:e.length,l=Yn(e,t);return Ol(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 $o=Ml(function(e){return Zl(ol(e,1,Mr,!0))}),qo=Ml(function(e){var t=Ho(e);return Mr(t)&&(t=void 0),Zl(ol(e,1,Mr,!0),Ki(t,2))}),Go=Ml(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,Zl(ol(e,1,Mr,!0),void 0,t)});function Yo(e){if(!e||!e.length)return[];var t=0;return e=rt(e,function(e){if(Mr(e))return t=rn(e.length,t),!0}),At(t,function(t){return st(e,St(t))})}function Ko(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=Ml(function(e,t){return Mr(e)?Qn(e,t):[]}),Zo=Ml(function(e){return ni(rt(e,Mr))}),Jo=Ml(function(e){var t=Ho(e);return Mr(t)&&(t=void 0),ni(rt(e,Mr),Ki(t,2))}),Qo=Ml(function(e){var t=Ho(e);return t="function"==typeof t?t:void 0,ni(rt(e,Mr),void 0,t)}),er=Ml(Yo),tr=Ml(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Ko(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 Rn&&oo(n)?((l=l.slice(n,+n+(t?1:0))).__actions__.push({func:lr,args:[i],thisArg:void 0}),new wn(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(Lo),ar=Ai(Oo);function ur(e,t){return(Or(e)?lt:el)(e,Ki(t,3))}function sr(e,t){return(Or(e)?it:tl)(e,Ki(t,3))}var cr=gi(function(e,t,n){be.call(e,n)?e[n].push(t):Gn(e,n,[t])}),dr=Ml(function(e,t,n){var l=-1,i="function"==typeof t,o=Fr(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 mr(e,t){return(Or(e)?st:Dl)(e,Ki(t,3))}var vr=gi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),fr=Ml(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]]),wl(e,ol(t,1),[])}),Er=Xt||function(){return ze.Date.now()};function hr(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 he(n);return e=ia(e),function(){return--e>0&&(l=t.apply(this,arguments)),e<=1&&(t=void 0),l}}var yr=Ml(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=Ml(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 he(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(h,t),d?v(e):a}function E(e){var n=e-s;return void 0===s||n>=t||n<0||p&&e-c>=r}function h(){var e=Er();if(E(e))return g(e);u=yo(h,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=Er(),n=E(e);if(i=arguments,o=this,s=e,n){if(void 0===u)return f(s);if(p)return si(u),u=yo(h,t),v(s)}return void 0===u&&(u=yo(h,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(Er())},y}var br=Ml(function(e,t){return Jn(e,1,t)}),Tr=Ml(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 he(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 he(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&&Or(t[0])?st(t[0],Nt(Ki())):st(ol(t,1),Nt(Ki()))).length;return Ml(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=Ml(function(e,t){return Bi(e,32,void 0,t,Ut(t,Yi(Nr)))}),Pr=Ml(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 Ir(e,t){return e===t||e!=e&&t!=t}var wr=Li(vl),Rr=Li(function(e,t){return e>=t}),Lr=yl(function(){return arguments}())?yl:function(e){return $r(e)&&be.call(e,"callee")&&!Ge.call(e,"callee")},Or=G.isArray,kr=Ke?Nt(Ke):function(e){return $r(e)&&ml(e)==S};function Fr(e){return null!=e&&zr(e.length)&&!jr(e)}function Mr(e){return $r(e)&&Fr(e)}var Br=tn||ru,Ur=Xe?Nt(Xe):function(e){return $r(e)&&ml(e)==u};function Hr(e){if(!$r(e))return!1;var t=ml(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Yr(e)}function jr(e){if(!Vr(e))return!1;var t=ml(e);return t==c||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 $r(e){return null!=e&&"object"==typeof e}var qr=Ze?Nt(Ze):function(e){return $r(e)&&to(e)==m};function Gr(e){return"number"==typeof e||$r(e)&&ml(e)==v}function Yr(e){if(!$r(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 Kr=Je?Nt(Je):function(e){return $r(e)&&ml(e)==E},Xr=Qe?Nt(Qe):function(e){return $r(e)&&to(e)==h};function Zr(e){return"string"==typeof e||!Or(e)&&$r(e)&&ml(e)==g}function Jr(e){return"symbol"==typeof e||$r(e)&&ml(e)==y}var Qr=et?Nt(et):function(e){return $r(e)&&zr(e.length)&&!!Fe[ml(e)]},ea=Li(Al),ta=Li(function(e,t){return e<=t});function na(e){if(!e)return[];if(Fr(e))return Zr(e)?zt(e):Ei(e);if(bt&&e[bt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[bt]());var t=to(e);return(t==m?Mt:t==h?Ht:Ia)(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?Kn(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)?He(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return hi(e,ba(e))}function ua(e){return null==e?"":Xl(e)}var sa=yi(function(e,t){if(co(t)||Fr(t))hi(t,Sa(t),e);else for(var n in t)be.call(t,n)&&zn(e,n,t[n])}),ca=yi(function(e,t){hi(t,ba(t),e)}),da=yi(function(e,t,n,l){hi(t,ba(t),e,l)}),pa=yi(function(e,t,n,l){hi(t,Sa(t),e,l)}),ma=zi(Yn),va=Ml(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||Ir(c,ye[s])&&!be.call(e,s))&&(e[s]=o[s])}return e}),fa=Ml(function(e){return e.push(void 0,Hi),tt(Ca,void 0,e)});function Ea(e,t,n){var l=null==e?void 0:dl(e,t);return void 0===l?n:l}function ha(e,t){return null!=e&&no(e,t,El)}var ga=Pi(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ae.call(t)),e[t]=n},Va(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]},Ki),_a=Ml(gl);function Sa(e){return Fr(e)?Bn(e):Cl(e)}function ba(e){return Fr(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}),hi(e,$i(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 Rl(e,t,function(t,n){return ha(e,n)})}(e,t)});function Na(e,t){if(null==e)return{};var n=st($i(e),function(e){return[e]});return t=Ki(t),Rl(e,n,function(e,n){return t(e,n[0])})}var Pa=Mi(Sa),xa=Mi(ba);function Ia(e){return null==e?[]:Pt(e,Sa(e))}var wa=Ti(function(e,t,n){return t=t.toLowerCase(),e+(n?Ra(t):t)});function Ra(e){return Ha(ua(e).toLowerCase())}function La(e){return(e=ua(e))&&e.replace(ae,Lt).replace(xe,"")}var Oa=Ti(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),ka=Ti(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fa=bi("toLowerCase"),Ma=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 Le.test(e)}(e)?function(e){return e.match(we)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var Wa=Ml(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 Va(e){return function(){return e}}var $a=Di(),qa=Di(!0);function Ga(e){return e}function Ya(e){return Tl("function"==typeof e?e:Xn(e,1))}var Ka=Ml(function(e,t){return function(n){return gl(n,e,t)}}),Xa=Ml(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=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__=Ei(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=Ii(st),eu=Ii(ot),tu=Ii(mt);function nu(e){return ao(e)?St(No(e)):function(e){return function(t){return dl(t,e)}}(e)}var lu=Ri(),iu=Ri(!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 he(n);return e=ia(e),function(){if(--e<1)return t.apply(this,arguments)}},Pn.ary=hr,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 Or(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++]=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=G(e-1),n=arguments[0],l=e;l--;)t[l-1]=arguments[l];return ct(Or(n)?Ei(n):[n],ol(t,1))},Pn.cond=function(e){var t=null==e?0:e.length,l=Ki();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new he(n);return[l(e[0]),e[1]]}):[],Ml(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: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=va,Pn.defaultsDeep=fa,Pn.defer=br,Pn.delay=Tr,Pn.difference=Io,Pn.differenceBy=wo,Pn.differenceWith=Ro,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,Ki(t,3),!0,!0):[]},Pn.dropWhile=function(e,t){return e&&e.length?ei(e,Ki(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(Or(e)?rt:il)(e,Ki(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=$a,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?Vl(e,0,-1):[]},Pn.intersection=Mo,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=Ki(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=Ki(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=Ka,Pn.methodOf=Xa,Pn.mixin=Za,Pn.negate=Ar,Pn.nthArg=function(e){return e=ia(e),Ml(function(t){return Il(t,e)})},Pn.omit=Aa,Pn.omitBy=function(e,t){return Na(e,Ar(Ki(t)))},Pn.once=function(e){return gr(2,e)},Pn.orderBy=function(e,t,n,l){return null==e?[]:(Or(t)||(t=null==t?[]:[t]),Or(n=l?void 0:n)||(n=null==n?[]:[n]),wl(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=jo,Pn.pullAll=Wo,Pn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,Ki(n,2)):e},Pn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ll(e,t,void 0,n):e},Pn.pullAt=zo,Pn.range=lu,Pn.rangeRight=iu,Pn.rearg=xr,Pn.reject=function(e,t){return(Or(e)?rt:il)(e,Ar(Ki(t,3)))},Pn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var l=-1,i=[],o=e.length;for(t=Ki(t,3);++l<o;){var r=e[l];t(r,l,e)&&(n.push(r),i.push(l))}return Ol(e,i),n},Pn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ml(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),(Or(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(Or(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)),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,Ki(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&&!Kr(t))&&!(t=Xl(t))&&Ft(e)?ui(zt(e),0,n):e.split(t,n):[]},Pn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:rn(ia(t),0),Ml(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,Ki(t,3),!1,!0):[]},Pn.takeWhile=function(e,t){return e&&e.length?ei(e,Ki(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 he(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 Or(e)?st(e,No):Jr(e)?[e]:Ei(Do(ua(e)))},Pn.toPlainObject=aa,Pn.transform=function(e,t,n){var l=Or(e),i=l||Br(e)||Qr(e);if(t=Ki(t,4),null==n){var o=e&&e.constructor;n=i?l?new o:[]:Vr(e)&&jr(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 hr(e,1)},Pn.union=$o,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,Ki(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=Ko,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=Ia,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=wa,Pn.capitalize=Ra,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),Kn(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=La,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:Kn(ia(n),0,l);return(n-=t.length)>=0&&e.slice(n,i)==t},Pn.eq=Ir,Pn.escape=function(e){return(e=ua(e))&&M.test(e)?e.replace(k,Ot):e},Pn.escapeRegExp=function(e){return(e=ua(e))&&$.test(e)?e.replace(V,"\\$&"):e},Pn.every=function(e,t,n){var l=Or(e)?ot:nl;return n&&ro(e,t,n)&&(t=void 0),l(e,Ki(t,3))},Pn.find=rr,Pn.findIndex=Lo,Pn.findKey=function(e,t){return ft(e,Ki(t,3),ul)},Pn.findLast=ar,Pn.findLastIndex=Oo,Pn.findLastKey=function(e,t){return ft(e,Ki(t,3),sl)},Pn.floor=du,Pn.forEach=ur,Pn.forEachRight=sr,Pn.forIn=function(e,t){return null==e?e:rl(e,Ki(t,3),ba)},Pn.forInRight=function(e,t){return null==e?e:al(e,Ki(t,3),ba)},Pn.forOwn=function(e,t){return e&&ul(e,Ki(t,3))},Pn.forOwnRight=function(e,t){return e&&sl(e,Ki(t,3))},Pn.get=Ea,Pn.gt=wr,Pn.gte=Rr,Pn.has=function(e,t){return null!=e&&no(e,t,fl)},Pn.hasIn=ha,Pn.head=Fo,Pn.identity=Ga,Pn.includes=function(e,t,n,l){e=Fr(e)?e:Ia(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&&ht(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)),ht(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=Lr,Pn.isArray=Or,Pn.isArrayBuffer=kr,Pn.isArrayLike=Fr,Pn.isArrayLikeObject=Mr,Pn.isBoolean=function(e){return!0===e||!1===e||$r(e)&&ml(e)==a},Pn.isBuffer=Br,Pn.isDate=Ur,Pn.isElement=function(e){return $r(e)&&1===e.nodeType&&!Yr(e)},Pn.isEmpty=function(e){if(null==e)return!0;if(Fr(e)&&(Or(e)||"string"==typeof e||"function"==typeof e.splice||Br(e)||Qr(e)||Lr(e)))return!e.length;var t=to(e);if(t==m||t==h)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=Vr,Pn.isObjectLike=$r,Pn.isPlainObject=Yr,Pn.isRegExp=Kr,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 $r(e)&&to(e)==_},Pn.isWeakSet=function(e){return $r(e)&&"[object WeakSet]"==ml(e)},Pn.join=function(e,t){return null==e?"":ln.call(e,t)},Pn.kebabCase=Oa,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):Et(e,yt,i,!0)},Pn.lowerCase=ka,Pn.lowerFirst=Fa,Pn.lt=ea,Pn.lte=ta,Pn.max=function(e){return e&&e.length?ll(e,Ga,vl):void 0},Pn.maxBy=function(e,t){return e&&e.length?ll(e,Ki(t,2),vl):void 0},Pn.mean=function(e){return _t(e,Ga)},Pn.meanBy=function(e,t){return _t(e,Ki(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,Ki(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?Il(e,ia(t)):void 0},Pn.noConflict=function(){return ze._===this&&(ze._=Ne),this},Pn.noop=Ja,Pn.now=Er,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 wi(Qt(i),n)+e+wi(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+wi(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?wi(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=Or(e)?dt:Tt,i=arguments.length<3;return l(e,Ki(t,4),n,i,el)},Pn.reduceRight=function(e,t,n){var l=Or(e)?pt:Tt,i=arguments.length<3;return l(e,Ki(t,4),n,i,tl)},Pn.repeat=function(e,t,n){return t=(n?ro(e,t,n):void 0===t)?1:ia(t),Fl(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=mu,Pn.runInContext=e,Pn.sample=function(e){return(Or(e)?Un:Bl)(e)},Pn.size=function(e){if(null==e)return 0;if(Fr(e))return Zr(e)?Wt(e):e.length;var t=to(e);return t==m||t==h?e.size:Cl(e).length},Pn.snakeCase=Ma,Pn.some=function(e,t,n){var l=Or(e)?mt:$l;return n&&ro(e,t,n)&&(t=void 0),l(e,Ki(t,3))},Pn.sortedIndex=function(e,t){return ql(e,t)},Pn.sortedIndexBy=function(e,t,n){return Gl(e,t,Ki(n,2))},Pn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var l=ql(e,t);if(l<n&&Ir(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,Ki(n,2),!0)},Pn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ql(e,t,!0)-1;if(Ir(e[n],t))return n}return-1},Pn.startCase=Ba,Pn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Kn(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,Ga):0},Pn.sumBy=function(e,t){return e&&e.length?Ct(e,Ki(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"),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(w,""):d).replace(R,"$1").replace(L,"$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,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=Ki(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?Kn(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,It(l,i),wt(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,wt(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,It(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(Ft(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),Kr(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))&&F.test(e)?e.replace(O,$t):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=Fo,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){Rn.prototype[e]=function(n){n=void 0===n?1:rn(ia(n),0);var l=this.__filtered__&&!t?new Rn(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},Rn.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;Rn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ki(e,3),type:n}),t.__filtered__=t.__filtered__||l,t}}),lt(["head","last"],function(e,t){var n="take"+(t?"Right":"");Rn.prototype[e]=function(){return this[n](1).value()[0]}}),lt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Rn.prototype[e]=function(){return this.__filtered__?new Rn(this):this[n](1)}}),Rn.prototype.compact=function(){return this.filter(Ga)},Rn.prototype.find=function(e){return this.filter(e).head()},Rn.prototype.findLast=function(e){return this.reverse().find(e)},Rn.prototype.invokeMap=Ml(function(e,t){return"function"==typeof e?new Rn(this):this.map(function(n){return gl(n,e,t)})}),Rn.prototype.reject=function(e){return this.filter(Ar(Ki(e)))},Rn.prototype.slice=function(e,t){e=ia(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Rn(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)},Rn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Rn.prototype.toArray=function(){return this.take(4294967295)},ul(Rn.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 Rn,u=r[0],s=a||Or(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 Rn(this);var f=e.apply(t,r);return f.__actions__.push({func:lr,args:[c],thisArg:void 0}),new wn(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(Or(i)?i:[],e)}return this[n](function(n){return t.apply(Or(n)?n:[],e)})}}),ul(Rn.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}],Rn.prototype.clone=function(){var e=new Rn(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(this.__views__),e},Rn.prototype.reverse=function(){if(this.__filtered__){var e=new Rn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Rn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Or(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,E=e[s+=t];++f<d;){var h=c[f],g=h.type,y=(0,h.iteratee)(E);if(2==g)E=y;else if(!y){if(1==g)continue e;break e}}v[p++]=E}return v},Pn.prototype.at=ir,Pn.prototype.chain=function(){return nr(this)},Pn.prototype.commit=function(){return new wn(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 In;){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 Rn){var t=e;return this.__actions__.length&&(t=new Rn(this)),(t=t.reverse()).__actions__.push({func:lr,args:[Vo],thisArg:void 0}),new wn(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}();$e?(($e.exports=qt)._=qt,Ve._=qt):ze._=qt}).call(d)});const v=function(e){return void 0===e&&(e=""),function(e){return void 0===e&&(e=""),!(!e||null==e||null==e||""==e)}(e)?e:"PTR_NA"},f=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},E=e=>{var i,o,a,u,s,c,d,p,v,f;const{pets:E,focusIndex:h,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,[I,w]=n.useState(null),{control:R,formState:L,watch:O,trigger:k}=r.useForm(),F=O(),{errors:M}=L,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;m.isEqual(U,F)||(H({...F}),_(t=>t.map(t=>t.key&&t.key===E.key?{...t,...F,...e}:{...t})),k())},[F]),n.useEffect(()=>{var e;Object.keys(M).length&&!m.isEqual((null===(e=D.errors[T.key])||void 0===e?void 0:e.type)||{},M)?C(T.key,{type:M}):!Object.keys(M).length&&D.errors[T.key]&&A(T.key)},[M]);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:R,name:"petType",defaultValue:null==E?void 0:E.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},L.touched.petType?null==M||null===(o=M.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:R,name:"breedType",defaultValue:null==E?void 0:E.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},L.touched.breedType?null==M||null===(a=M.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:R,name:"petName",defaultValue:null==E?void 0:E.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:h.index===(null==E?void 0:E.key)&&"petName"===h.type,onChange:t=>{e.onChange(t.target.value),y({index:E.key,type:"petName"})},onBlur:t=>{y({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:j},L.touched.petName?null==M||null===(u=M.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:R,name:"petAge",defaultValue:null==E?void 0:E.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:h.index===(null==E?void 0:E.key)&&"petAge"===h.type,onChange:t=>{e.onChange(t),y({index:E.key,type:"petAge"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur,placeholder:"in months"})}))),l.createElement("div",{style:{textAlign:"center"}},Math.floor(O("petAge")/12)," ",1===Math.floor(O("petAge")/12)?"YEAR":"YEARS","  ",O("petAge")%12," ",O("petAge")%12==1?"MONTH":"MONTHS"),l.createElement("br",null),l.createElement(t.CardLabelError,{style:j},L.touched.petAge?null==M||null===(s=M.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:R,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:x,optionKey:"i18nKey",t:S})})),l.createElement(t.CardLabelError,{style:j},L.touched.petGender?null==M||null===(c=M.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:R,name:"doctorName",defaultValue:null==E?void 0:E.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:h.index===(null==E?void 0:E.key)&&"doctorName"===h.type,onChange:t=>{e.onChange(t.target.value),y({index:E.key,type:"doctorName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},L.touched.doctorName?null==M||null===(d=M.doctorName)||void 0===d?void 0:d.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:R,name:"clinicName",defaultValue:null==E?void 0:E.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:h.index===(null==E?void 0:E.key)&&"clinicName"===h.type,onChange:t=>{e.onChange(t.target.value),y({index:E.key,type:"clinicName"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},L.touched.clinicName?null==M||null===(p=M.clinicName)||void 0===p?void 0:p.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:R,name:"lastVaccineDate",defaultValue:null==E?void 0:E.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},L.touched.lastVaccineDate?null==M||null===(v=M.lastVaccineDate)||void 0===v?void 0:v.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:R,name:"vaccinationNumber",defaultValue:null==E?void 0:E.vaccinationNumber,render:e=>l.createElement(t.TextInput,{value:e.value,autoFocus:h.index===(null==E?void 0:E.key)&&"vaccinationNumber"===h.type,onChange:t=>{e.onChange(t.target.value),y({index:E.key,type:"vaccinationNumber"})},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:j},L.touched.vaccinationNumber?null==M||null===(f=M.vaccinationNumber)||void 0===f?void 0:f.message:""))),(null==I?void 0:I.label)&&l.createElement(t.Toast,{label:null==I?void 0:I.label,onClose:e=>{w(e=>null)}}))},h=e=>{var i,o,a,u,s;const{owner:c,focusIndex:d,allOwners:p,setFocusIndex:v,setOwners:f,t:E,config:h,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,I]=l.useState({});n.useEffect(()=>{m.isEqual(x,N)||(I({...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&&!m.isEqual((null===(e=_.errors[h.key])||void 0===e?void 0:e.type)||{},P)?g(h.key,{type:P}):!Object.keys(P).length&&_.errors[h.key]&&y(h.key)},[P]);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==p?void 0:p.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:T,name:"applicantName",defaultValue:null==c?void 0:c.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:d.index===(null==c?void 0:c.key)&&"applicantName"===d.type,onChange:t=>{e.onChange(t.target.value),v({index:c.key,type:"applicantName"})},onBlur:t=>{v({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},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"},E("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: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:d.index===(null==c?void 0:c.key)&&"fatherName"===d.type,onChange:t=>{e.onChange(t.target.value),v({index:c.key,type:"fatherName"})},onBlur:t=>{v({index:-1}),e.onBlur(t)}})}))),l.createElement(t.CardLabelError,{style:w},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"},E("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: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:d.index===(null==c?void 0:c.key)&&"mobileNumber"===d.type,onChange:t=>{e.onChange(t),v({index:c.key,type:"mobileNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:w},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"},E("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:E("CORE_COMMON_REQUIRED_ERRMSG"),validate:e=>/^[6789]\d{9}$/.test(e)},render:e=>l.createElement(t.MobileNumber,{value:e.value,autoFocus:d.index===(null==c?void 0:c.key)&&"alternateNumber"===d.type,onChange:t=>{e.onChange(t),v({index:c.key,type:"alternateNumber"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:w},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"},E("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:d.index===(null==c?void 0:c.key)&&"emailId"===d.type,onChange:t=>{e.onChange(t),v({index:c.key,type:"emailId"})},labelStyle:{marginTop:"unset"},onBlur:e.onBlur})}))),l.createElement(t.CardLabelError,{style:w},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)}}))},g=[{i18nKey:"PTR_GENDER",code:"123",name:"test"}],y=e=>{let{onGoBack:i,goNext:o,currentStepData:a,t:u}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const{control:s,handleSubmit:c,setValue:d}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.petDetails;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;d(t,n)}))},[a,d]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:c(e=>{console.log("data in first step",e),o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,""+u("PTR_PET_NAME")),l.createElement(r.Controller,{control:s,name:"petName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,""+u("PTR_SEARCH_PET_TYPE")),l.createElement(r.Controller,{control:s,name:"petType",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:g,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,""+u("PTR_SEARCH_BREED_TYPE")),l.createElement(r.Controller,{control:s,name:"breedType",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:g,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,""+u("PTR_PET_GENDER")),l.createElement(r.Controller,{control:s,name:"petGender",render:e=>l.createElement(t.Dropdown,{className:"form-field",select:e.onChange,selected:e.value,option:g,optionKey:"i18nKey"})}),l.createElement(t.CardLabel,null,""+u("PTR_COLOR")),l.createElement(r.Controller,{control:s,name:"color",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,""+u("PTR_VACCINATED_DATE")),l.createElement(r.Controller,{control:s,name:"lastVaccineDate",render:e=>l.createElement(t.TextInput,{type:"date",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})}),l.createElement(t.CardLabel,null,""+u("PTR_VACCINATION_NUMBER")),l.createElement(r.Controller,{control:s,name:"vaccinationNumber",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)}})})),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{style:{background:" white",color:"black",border:"1px solid",marginRight:"10px"},label:"Back",onSubmit:i}),l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))};function S(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function b(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:c,formData:d,setFormError:p,clearFormErrors:m,config:v,formState:f,id:E}=e;const h=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],[g,y]=(Digit.ULBService.getCurrentTenantId(),n.useState(h?{...h,active:"ACTIVE"===(null==h?void 0:h.status),code:null==h?void 0:h.documentType}:1===(null==r||null===(i=r.dropdownData)||void 0===i?void 0:i.length)?null==r?void 0:r.dropdownData[0]:{})),[_,b]=n.useState(null),[T,C]=n.useState(()=>(null==h?void 0:h.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[v.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(v.key,{type:n}):m(v.key))};return n.useEffect(()=>{null!=g&&g.code&&a(e=>{const t=null==e?void 0:e.filter(e=>(null==e?void 0:e.documentType)!==(null==g?void 0:g.code));return 0===(null==T?void 0:T.length)||null===T?t:[...null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==T),{documentType:null==g?void 0:g.code,filestoreId:T,documentUid:T}]}),N?N&&x():T&&null!=g&&g.code?T&&null!=g&&g.code&&x():(()=>{var e,t;let n=null===(e=f.errors)||void 0===e||null===(t=e[v.key])||void 0===t?void 0:t.type;Array.isArray(n)||(n=[]),n.includes(r.code)||(n.push(r.code),p(v.key,{type:n}))})()},[T,g,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?(y(l),C(null==n?void 0:n.fileStoreId)):P(!0)}},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(_){const e=function(){if(_.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=S(function(){return C(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",_,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)}}()},[_]),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:g,option:D.map(e=>{var t;return{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>y(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:E,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")));let T=[];const C=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":T=[];break;default:T=["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"}},T.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")}))))},A=[{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:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_PET_DETAILS",body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents",texts:{submitBarLabel:"CS_COMMON_NEXT"}}]},{head:"ES_TITILE_DOCUMENT_DETAILS",body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null,texts:{submitBarLabel:"CS_COMMON_NEXT"}}]}];p(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:d,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},E=e.document,h={type:!0,src:!0,nonce:!0,noModule:!0};function g(e,t,n){var l,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(l in h)(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,E,h,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,I=[],w=I.pop,R=I.push,L=I.push,O=I.slice,k=function(e,t){for(var n=0,l=e.length;n<l;n++)if(e[n]===t)return n;return-1},F="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+M+"*("+B+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+M+"*\\]",H=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp(M+"+","g"),W=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),z=new RegExp("^"+M+"*,"+M+"*"),V=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),$=new RegExp(M+"|>"),q=new RegExp(H),G=new RegExp("^"+B+"$"),Y={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)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+F+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},K=/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}"+M+"?|\\\\([^\\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{L.apply(I=O.call(S.childNodes),S.childNodes)}catch(e){L={apply:I.length?function(e,t){R.apply(e,O.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,h,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 L.apply(l,t.getElementsByTagName(e)),l;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(l,t.getElementsByClassName(o)),l}if(n.qsa&&!N[e+" "]&&(!E||!E.test(e))&&(1!==S||"object"!==t.nodeName.toLowerCase())){if(h=e,g=t,1===S&&($.test(e)||V.test(e))){for((g=ee.test(e)&&he(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]);h=v.join(",")}try{return L.apply(l,g.querySelectorAll(h)),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 Ee(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 he(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!K.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)},h=[],E=[],(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&&E.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||E.push("\\["+M+"*(?:value|"+F+")"),e.querySelectorAll("[id~="+_+"-]").length||E.push("~="),(t=m.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||E.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||E.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||E.push(".#.+[+~]"),e.querySelectorAll("\\\f"),E.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&&E.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&E.push(":enabled",":disabled"),v.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&E.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),E.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"),h.push("!=",H)}),E=E.length&&new RegExp(E.join("|")),h=h.length&&new RegExp(h.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+" "]&&(!h||!h.test(t))&&(!E||!E.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&&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("(^|"+M+")"+e+"("+M+"|$)"))&&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,m,v,f=o!==r?"nextSibling":"previousSibling",E=t.parentNode,h=a&&t.nodeName.toLowerCase(),g=!u&&!a,y=!1;if(E){if(o){for(;f;){for(p=t;p=p[f];)if(a?p.nodeName.toLowerCase()===h:1===p.nodeType)return!1;v=f="only"===e&&!v&&"nextSibling"}return!0}if(v=[r?E.firstChild:E.lastChild],r&&g){for(y=(m=(s=(c=(d=(p=E)[_]||(p[_]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===b&&s[1])&&s[2],p=m&&E.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()!==h: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===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:Ee(function(){return[0]}),last:Ee(function(e,t){return[t-1]}),eq:Ee(function(e,t,n){return[n<0?n+t:n]}),even:Ee(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Ee(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Ee(function(e,t,n){for(var l=n<0?n+t:n>t?t:n;--l>=0;)e.push(l);return e}),gt:Ee(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,[]),E=!e||!o&&t?f:be(f,p,e,a,u),h=n?i||(o?e:v||l)?[]:r:E;if(n&&n(E,h,a,u),l)for(s=be(h,m),l(s,[],a,u),c=s.length;c--;)(d=s[c])&&(h[m[c]]=!(E[m[c]]=d));if(o){if(i||e){if(i){for(s=[],c=h.length;c--;)(d=h[c])&&s.push(E[c]=d);i(null,h=[],s,u)}for(c=h.length;c--;)(d=h[c])&&(s=i?k(o,d):p[c])>-1&&(o[s]=!(r[s]=d))}}else h=be(h===r?h.splice(v,h.length):h),i?i(null,r,h,u):L.apply(r,h)})}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,E,h=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);E=e[v++];)if(E(d,r||m,a)){u.push(d);break}c&&(b=C)}n&&((d=!E&&d)&&h--,o&&y.push(d))}if(h+=g,n&&g!==h){for(v=0;E=t[v++];)E(y,_,r,a);if(o){if(h>0)for(;g--;)y[g]||_[g]||(_[g]=w.call(u));_=be(_)}L.apply(u,_),c&&!o&&_.length>0&&h+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)&&he(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ye(u)))return L.apply(n,i),n;break}}return(p||a(e,m))(i,t,!f,n,!t||ee.test(e)&&he(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(F,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,I=/^(?:\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]:I.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:E,!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=E.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=_(E);var w=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function L(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 L(e,"nextSibling")},prev:function(e){return L(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&&(R[e]||_.uniqueSort(i),w.test(e)&&i.reverse()),this.pushStack(i)}});var O=/[^\x20\t\r\n\f]+/g;function k(e){return e}function F(e){throw e}function M(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(O)||[],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,F,i)):(o++,s.call(e,r(o,n,k,i),r(o,n,F,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!==F&&(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:F))}).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&&(M(e,r.done(a(n)).resolve,r.reject,!t),"pending"===r.state()||v(o[n]&&o[n].then)))return r.then();for(;n--;)M(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(){E.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(E,[_]))}}),_.ready.then=U.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?e.setTimeout(_.ready):(E.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,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 $(e){return e.replace(W,"ms-").replace(z,V)}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[$(t)]=n;else for(l in t)i[$(l)]=t[l];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][$(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($):(t=$(t))in l?[t]:t.match(O)||[]).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 G,K=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){}K.set(e,t,n)}else n=void 0;return n}_.extend({hasData:function(e){return K.hasData(e)||Y.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.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=K.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){for(n=r.length;n--;)r[n]&&0===(l=r[n].name).indexOf("data-")&&(l=$(l.slice(5)),J(o,l,i[l]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):j(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=K.get(o,e))||void 0!==(n=J(o,e))?n:void 0;this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.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=E.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=E.createDocumentFragment().appendChild(E.createElement("div")),(de=E.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 Ee(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 he(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=Ee(d.appendChild(o),"script"),s&&he(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 E.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,E=Y.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=E.events)||(u=E.events=Object.create(null)),(r=E.handle)||(r=E.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),s=(t=(t||"").match(O)||[""]).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,E=Y.hasData(e)&&Y.get(e);if(E&&(u=E.events)){for(s=(t=(t||"").match(O)||[""]).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,E.handle)||_.removeEvent(e,m,E.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 Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function we(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Re(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]);K.hasData(e)&&(o=K.access(e),r=_.extend({},o),K.set(t,r))}}function Le(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 Oe(e,t,n,l){t=o(t);var i,r,a,u,s,c,d=0,p=e.length,f=p-1,E=t[0],h=v(E);if(h||p>1&&"string"==typeof E&&!m.checkClone&&Ne.test(E))return e.each(function(i){var o=e.eq(i);h&&(t[0]=E.call(this,i,o.html())),Oe(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(Ee(i,"script"),Ie)).length;d<p;d++)s=i,d!==f&&(s=_.clone(s,!0,!0),u&&_.merge(a,Ee(s,"script"))),n.call(e[d],s,d);if(u)for(c=a[a.length-1].ownerDocument,_.map(a,we),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(Ee(l)),l.parentNode&&(n&&le(l)&&he(Ee(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=Ee(a),l=0,i=(o=Ee(e)).length;l<i;l++)Le(o[l],r[l]);if(t)if(n)for(o=o||Ee(e),r=r||Ee(a),l=0,i=o.length;l<i;l++)Re(o[l],r[l]);else Re(e,a);return(r=Ee(a,"script")).length>0&&he(r,!u&&Ee(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[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[K.expando]&&(n[K.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 Oe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||xe(this,e).appendChild(e)})},prepend:function(){return Oe(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 Oe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Oe(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(Ee(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[(me.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n<l;n++)1===(t=this[n]||{}).nodeType&&(_.cleanData(Ee(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,function(t){var n=this.parentNode;_.inArray(this,e)<0&&(_.cleanData(Ee(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 Fe=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),Me=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||Me(e))&&(""!==(r=n.getPropertyValue(t)||n[t])||le(e)||(r=_.style(e,t)),!m.pixelBoxStyles()&&Fe.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=E.createElement("div"),c=E.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=E.createElement("table"),n=E.createElement("tr"),l=E.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=E.createElement("div").style,Ve={};function $e(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 qe=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Ke={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=Me(e),i=(!m.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(Fe.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=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=$(t),u=Ge.test(t),s=e.style;if(u||(t=$e(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=$(t);return Ge.test(t)||(t=$e(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 Ke&&(i=Ke[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,Ye,function(){return Je(e,t,l)})},set:function(e,n,l){var i,o=Me(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=je(m.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=Me(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[$e(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===E.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=$(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(O);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),E=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||!E||void 0===E[l])continue;f=!0}m[l]=E&&E[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=E&&E.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||(E?"hidden"in E&&(f=E.hidden):E=Y.access(e,"fxshow",{display:s}),o&&(E.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?E[l]:0,l,p),l in E||(E[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&&lt.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=E.createElement("input"),t=E.createElement("select").appendChild(E.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=E.createElement("input")).value="t",e.type="radio",m.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(!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(O);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(O)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function ft(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(O)||[]}_.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"}}),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 Et=/\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(Et,""):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 ht=/^(?:focusinfocus|focusoutblur)$/,gt=function(e){e.stopPropagation()};_.extend(_.event,{trigger:function(t,n,l,i){var o,r,a,u,s,d,p,m,h=[l||E],g=c.call(t,"type")?t.type:t,y=c.call(t,"namespace")?t.namespace.split("."):[];if(r=m=a=l=l||E,3!==l.nodeType&&8!==l.nodeType&&!ht.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(ht.test((u=p.delegateType||g)+g)||(r=r.parentNode);r;r=r.parentNode)h.push(r),a=r;a===(l.ownerDocument||E)&&h.push(a.defaultView||a.parentWindow||e)}for(o=0;(r=h[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&&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(h.pop(),n)||!q(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=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,wt=/^(?:GET|HEAD)$/,Rt=/^\/\//,Lt={},Ot={},kt="*/".concat("*"),Ft=E.createElement("a");function Mt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var l,i=0,o=t.toLowerCase().match(O)||[];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===Ot;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}Ft.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:Mt(Lt),ajaxTransport:Mt(Ot),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,h=_.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=It.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(h.promise(C),m.url=((t||m.url||yt.href)+"").replace(Rt,yt.protocol+"//"),m.type=n.method||n.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(O)||[""],null==m.crossDomain){u=E.createElement("a");try{u.href=m.url,u.href=u.href,m.crossDomain=Ft.protocol+"//"+Ft.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(Lt,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=!wt.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(Ot,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,E,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=!(E=S.error))):(E=T,!t&&T||(T="error",t<0&&(t=0))),C.status=t,C.statusText=(n||T)+"",d?h.resolveWith(v,[p,T,C]):h.rejectWith(v,[C,T,E]),C.statusCode(y),y=void 0,c&&f.trigger(d?"ajaxSuccess":"ajaxError",[C,m,d?p:E]),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 Ht={0:200,1223:204},jt=_.ajaxSettings.xhr();m.cors=!!jt&&"withCredentials"in jt,m.ajax=jt=!!jt,_.ajaxTransport(function(t){var n,l;if(m.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)}),E.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=E.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=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(l)):t=E),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 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(m.pixelPosition,function(e,n){if(n)return n=He(e,t),Fe.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 $t=/^[\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=$,_.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($t,"")};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 D=e=>{let{t:i,goNext:o,currentStepData:a}=e;Digit.ULBService.getCurrentTenantId(),Digit.ULBService.getStateId();const{control:u,handleSubmit:s,setValue:c}=r.useForm();return n.useEffect(()=>{console.log("currentStepData",a);const e=null==a?void 0:a.ownerDetails;e&&(console.log("coming here",e),Object.entries(e).forEach(e=>{let[t,n]=e;c(t,n)}))},[a,c]),l.createElement(l.Fragment,null,l.createElement("form",{onSubmit:s(e=>{console.log("data in first step",e),o(e)})},l.createElement("div",null,l.createElement(t.CardLabel,null,""+i("NDC_FIRST_NAME")),l.createElement(r.Controller,{control:u,name:"firstName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NDC_LAST_NAME")),l.createElement(r.Controller,{control:u,name:"lastName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_EMAIL_LABEL")),l.createElement(r.Controller,{control:u,name:"emailId",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("NOC_APPLICANT_MOBILE_NO_LABEL")),l.createElement(r.Controller,{control:u,name:"mobileNumber",render:e=>l.createElement(t.MobileNumber,{value:e.value,onChange:e.onChange,onBlur:e.onBlur,t:i})}),l.createElement(t.CardLabel,null,""+i("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_FATHER_HUSBAND")),l.createElement(r.Controller,{control:u,name:"fatherName",render:e=>l.createElement(t.TextInput,{value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})}),l.createElement(t.CardLabel,null,""+i("PT_COMMON_COL_ADDRESS")),l.createElement(r.Controller,{control:u,name:"address",render:e=>l.createElement(t.TextArea,{name:"address",value:e.value,onChange:t=>{e.onChange(t.target.value)},onBlur:t=>{e.onBlur(t)},t:i})})),l.createElement(t.ActionBar,null,l.createElement(t.SubmitBar,{label:"Next",submit:"submit"}))))};function N(e){var i;let{t:o,document:r,setDocuments:a,setError:u,documents:s,action:c,formData:d,handleSubmit:p,id:m}=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],[f,E]=(Digit.ULBService.getCurrentTenantId(),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,g]=n.useState(null),[y,_]=n.useState(()=>(null==v?void 0:v.filestoreId)||null),{dropdownData:b}=r;var T=b;const[C,A]=n.useState(!1),[D,N]=n.useState(!1);return n.useEffect(()=>{null!=f&&f.code&&(console.log("selectedDocument",s),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==y?void 0:y.length)||null===y?t:[...(null==t?void 0:t.filter(e=>(null==e?void 0:e.fileStoreId)!==y))||[],{documentType:null==f?void 0:f.code,filestoreId:y,documentUid:y}]}))},[y,f]),n.useEffect(()=>{(null==s?void 0:s.length)>0&&(console.log("documents",s),p())},[s]),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=T.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?(E(l),_(null==n?void 0:n.fileStoreId)):A(!0)}},[]),n.useEffect(()=>{var e;null!=r&&r.hasDropdown||E({code:null==r?void 0:r.code,i18nKey:null==r||null===(e=r.code)||void 0===e?void 0:e.replaceAll(".","_")})},[]),n.useEffect(()=>{!function(){try{u(null);const e=function(){if(h){N(!0);const e=function(){if(h.size>=5242880)u(o("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=S(function(){return _(null),Promise.resolve(Digit.UploadServices.Filestorage("PTR",h,Digit.ULBService.getStateId())).then(function(e){var t,n,l,i;N(!1),(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(){N(!1),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(()=>{C&&_(null)},[C]),l.createElement("div",{style:{marginBottom:"24px"}},D&&l.createElement(t.Loader,null),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{...e,i18nKey:null===(t=e.code)||void 0===t?void 0:t.replaceAll(".","_")}}),select:e=>E(e),optionKey:"i18nKey",t:o})):null,null!=r&&r.hasDropdown?null:l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{className:"card-label-smaller"},o(null==r?void 0:r.code.replaceAll(".","_"))+" *")),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:()=>{_(null)},id:m,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}))))}const P=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)},x=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:E}=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 h(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(P,{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(P,{data:e,OpenImage:h})}{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(P,{data:n})}};return f?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,!f&&l.createElement(n.Fragment,null,(null==E||null===(c=E.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!=E&&E.timeline&&1===(null==E||null===(d=E.timeline)||void 0===d?void 0:d.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:m((null==E||null===(p=E.timeline[0])||void 0===p?void 0:p.state)&&`WF_${v}_${E.timeline[0].state}`||"NA"),customChild:g(null==E?void 0:E.timeline[0])}):l.createElement(t.ConnectingCheckPoints,null,(null==E?void 0:E.timeline)&&(null==E?void 0:E.timeline.map((e,n,i)=>{var o;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==E||null===(o=E.processInstances[n].state)||void 0===o?void 0:o.state}${r}`),customChild:g(e)}))})))),E&&(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==E?void 0:E.nextActions))},I=[{screenPath:"petservice/new-application/acknowledgement"},{screenPath:"petservice/edit-application/acknowledgement"}],w=()=>{var e,n,r,a,u,s;const{path:d,...p}=o.useRouteMatch(),{t:m}=i.useTranslation(),v=null===(e=Digit)||void 0===e||null===(n=e.ComponentRegistryService)||void 0===n?void 0:n.getComponent("PTRApplicationDetails"),f=null===(r=Digit)||void 0===r||null===(a=r.ComponentRegistryService)||void 0===a?void 0:a.getComponent("PTRMyApplications"),E=null===(u=Digit)||void 0===u||null===(s=u.ComponentRegistryService)||void 0===s?void 0:s.getComponent("NewPTRStepperForm");return l.createElement("span",{className:"pet-citizen",style:{width:"100%"}},l.createElement(o.Switch,null,l.createElement(t.AppContainer,null,(void 0===(h=I)&&(h=[]),h.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:E}),l.createElement(t.PrivateRoute,{path:d+"/petservice/application/:acknowledgementIds/:tenantId",component:v}),l.createElement(t.PrivateRoute,{path:d+"/petservice/my-applications",component:f}),l.createElement(t.PrivateRoute,{path:d+"/petservice/search",component:e=>l.createElement(Search,c({},e,{t:m,parentRoute:d}))}))));var h},R=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)}})},L=e=>e.substr(0,1).toUpperCase()+e.substr(1),O=(e,t)=>{let n=[{title:t("PTR_PET_NAME"),value:null==e?void 0:e.petDetails.petName},{title:t("PTR_PET_TYPE"),value:null==e?void 0:e.petDetails.petType},{title:t("PTR_BREED_TYPE"),value:null==e?void 0:e.petDetails.breedType},{title:t("PTR_VACCINATED_DATE"),value:null==e?void 0:e.petDetails.lastVaccineDate},{title:t("PTR_VACCINATION_NUMBER"),value:null==e?void 0:e.petDetails.vaccinationNumber},{title:t("PTR_DOCTOR_NAME"),value:null==e?void 0:e.petDetails.doctorName},{title:t("PTR_CLINIC_NAME"),value:null==e?void 0:e.petDetails.clinicName},{title:t("PTR_PET_AGE"),value:null==e?void 0:e.petDetails.petAge},{title:t("PTR_PET_SEX"),value:null==e?void 0:e.petDetails.petGender}];return{title:t("ES_TITILE_PET_DETAILS"),values:n}},k=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(L).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}]},O(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)}},F=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")},M={padding:"4px 0px",justifyContent:"space-between"},B=e=>{var n;return l.createElement(t.Banner,{message:F(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%"}})},U=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 H,j=Array.isArray,W="object"==typeof d&&d&&d.Object===Object&&d,z="object"==typeof self&&self&&self.Object===Object&&self,V=W||z||Function("return this")(),$=V.Symbol,q=Object.prototype,G=q.hasOwnProperty,Y=q.toString,K=$?$.toStringTag:void 0,X=Object.prototype.toString,Z=$?$.toStringTag:void 0,J=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Z&&Z in Object(e)?function(e){var t=G.call(e,K),n=e[K];try{e[K]=void 0;var l=!0}catch(e){}var i=Y.call(e);return l&&(t?e[K]=n:delete e[K]),i}(e):function(e){return X.call(e)}(e)},Q=function(e){return null!=e&&"object"==typeof e},ee=function(e){return"symbol"==typeof e||Q(e)&&"[object Symbol]"==J(e)},te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,le=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ie=function(e){if(!le(e))return!1;var t=J(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},oe=V["__core-js_shared__"],re=(H=/[^.]+$/.exec(oe&&oe.keys&&oe.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"",ae=Function.prototype.toString,ue=function(e){if(null!=e){try{return ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""},se=/^\[object .+?Constructor\]$/,ce=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),de=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!le(e)||(t=e,re&&re in t))&&(ie(e)?ce:se).test(ue(e));var t}(n)?n:void 0},pe=de(Object,"create"),me=Object.prototype.hasOwnProperty,ve=Object.prototype.hasOwnProperty;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__=pe?pe(null):{},this.size=0},fe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},fe.prototype.get=function(e){var t=this.__data__;if(pe){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return me.call(t,e)?t[e]:void 0},fe.prototype.has=function(e){var t=this.__data__;return pe?void 0!==t[e]:ve.call(t,e)},fe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=pe&&void 0===t?"__lodash_hash_undefined__":t,this};var Ee=fe,he=function(e,t){return e===t||e!=e&&t!=t},ge=function(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1},ye=Array.prototype.splice;function _e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var l=e[t];this.set(l[0],l[1])}}_e.prototype.clear=function(){this.__data__=[],this.size=0},_e.prototype.delete=function(e){var t=this.__data__,n=ge(t,e);return!(n<0||(n==t.length-1?t.pop():ye.call(t,n,1),--this.size,0))},_e.prototype.get=function(e){var t=this.__data__,n=ge(t,e);return n<0?void 0:t[n][1]},_e.prototype.has=function(e){return ge(this.__data__,e)>-1},_e.prototype.set=function(e,t){var n=this.__data__,l=ge(n,e);return l<0?(++this.size,n.push([e,t])):n[l][1]=t,this};var Se=_e,be=de(V,"Map"),Te=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 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.size=0,this.__data__={hash:new Ee,map:new(be||Se),string:new Ee}},Ce.prototype.delete=function(e){var t=Te(this,e).delete(e);return this.size-=t?1:0,t},Ce.prototype.get=function(e){return Te(this,e).get(e)},Ce.prototype.has=function(e){return Te(this,e).has(e)},Ce.prototype.set=function(e,t){var n=Te(this,e),l=n.size;return n.set(e,t),this.size+=n.size==l?0:1,this};var Ae=Ce;function De(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(De.Cache||Ae),n}De.Cache=Ae;var Ne,Pe,xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ie=/\\(\\)?/g,we=(Ne=De(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(xe,function(e,n,l,i){t.push(l?i.replace(Ie,"$1"):n||e)}),t},function(e){return 500===Pe.size&&Pe.clear(),e}),Pe=Ne.cache,Ne),Re=$?$.prototype:void 0,Le=Re?Re.toString:void 0,Oe=function(e){if("string"==typeof e||ee(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},ke=function(e,t,n){var l=null==e?void 0:function(e,t){for(var n=0,l=(t=function(e,t){return j(e)?e:function(e,t){if(j(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ee(e))||ne.test(e)||!te.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:we(function(e){return null==e?"":function e(t){if("string"==typeof t)return t;if(j(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(ee(t))return Le?Le.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}(e)}(e))}(t,e)).length;null!=e&&n<l;)e=e[Oe(t[n++])];return n&&n==l?e:void 0}(e,t);return void 0===l?n:l};const Fe=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})},Me=e=>{const{t:r}=i.useTranslation(),a=[{text:r("ES_TITLE_NEW_PET_REGISTRATION"),link:"/digit-ui/employee/ptr/petservice/new-application",roles:[]},{text:"PTR_SEARCH_PET",link:"/digit-ui/employee/ptr/petservice/search",roles:[]}],[u,s]=n.useState([]);return Digit.UserService.getUser(),n.useEffect(()=>{s(a)},[]),l.createElement(t.Card,{className:"employeeCard filter inboxLinks"},l.createElement("div",{className:"complaint-links-container"},l.createElement("div",{className:"header"},l.createElement("span",{className:"logo"},l.createElement(t.PropertyHouse,null))," ",l.createElement("span",{className:"text"},r("PET_SERVICE"))),l.createElement("div",{className:"body"},u.map((e,t)=>{let{link:n,text:i,hyperlink:a=!1,roles:u=[]}=e;return l.createElement("span",{className:"link",key:t},a?l.createElement("a",{href:n},i):l.createElement(o.Link,{to:n},r(i)))}))))},Be={date:t.DatePicker,mobileNumber:t.MobileNumber},Ue=e=>{var n;let{onSearch:o,type:a,onClose:u,searchFields:s,searchParams:c,isInboxPage:d,clearSearch:p}=e;const{t:m}=i.useTranslation(),{handleSubmit:v,reset:f,watch:E,control:h,formState:g,setValue:y}=r.useForm({defaultValues:d?c:{locality:null,city:null,...c}}),_=E(),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},m("ES_COMMON_CLEAR_SEARCH"));return l.createElement("form",{onSubmit:v(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,m("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,m(e.label)+" "+(e.isMendatory?"*":"")),l.createElement(r.Controller,e.type?{render:t=>l.createElement(null==Be?void 0:Be[e.type],{formValue:_,setValue:y,onChange:t.onChange,value:t.value}),name:e.name,control:h,defaultValue:""}:{render:e=>l.createElement(t.TextInput,{onChange:e.onChange,value:e.value}),name:e.name,control:h,defaultValue:""})),null!=g&&null!==(i=g.dirtyFields)&&void 0!==i&&i[e.name]?l.createElement("span",{style:{fontWeight:"700",color:"rgba(212, 53, 28)",paddingLeft:"8px",marginTop:"-20px",fontSize:"12px"},className:"inbox-search-form-error"},null==g||null===(o=g.errors)||void 0===o||null===(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:m("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:m("ES_COMMON_SEARCH"),style:{flex:1},submit:!0}))))},He=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)}),[m,v]=n.useState(()=>{var e;return null===(e=Digit.ComponentRegistryService)||void 0===e?void 0:e.getComponent(a.EmptyResultInboxComp)}),[f,E]=n.useState(!1),h=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=m&&l.createElement(m,{data:u})||(0===(null==u?void 0:u.length)||s&&null!=u&&u[0].dataEmpty?l.createElement(t.Card,{style:{marginTop:20}},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(Fe,{t:c,data:u,columns:h,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(Me,{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(Ue,{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}},g)))},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")}]})))))},We=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:E,filterComponent:h}=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(h)});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:E||"/digit-ui/employee/ptr/"})):D=l.createElement(t.Card,{style:{marginTop:20}},i("CS_MYAPPLICATIONS_NO_APPLICATION").split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))),l.createElement(l.Fragment,null,l.createElement("div",{className:"searchBox"},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(Ue,{type:"mobile",onClose:A,onSearch:a,isFstpOperator:c,searchParams:m,searchFields:v}))))},ze=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))}))))},Ve=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:E}=i.useTranslation();return l.createElement("div",{style:{padding:0}},l.createElement("div",{className:"inbox-container"},l.createElement("div",{className:"filters-container"},!o&&l.createElement(ze,{classNameForMobileView:"linksWrapperForMobileInbox",linkPrefix:c,isMobile:!0}),l.createElement(We,{t:E,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}))))},$e=e=>{var o,r,a,u,s;let{useNewInboxAPI:c,parentRoute:d,moduleCode:p="PTR",initialStates:m={},filterComponent:v,isInbox:f,rawWfHandler:E,rawSearchHandler:h,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")}),[I,w]=n.useState(m.pageOffset||0),[R,L]=n.useState(m.pageSize||10),[O,k]=n.useState(m.sortParams||[{id:"createdTime",desc:!0}]),[F,M]=n.useState(m.searchParams||{});let B=window.Digit.Utils.browser.isMobile(),U=B?{limit:100,offset:0,sortBy:null==O||null===(o=O[0])||void 0===o?void 0:o.id,sortOrder:null!=O&&null!==(r=O[0])&&void 0!==r&&r.desc?"DESC":"ASC"}:{limit:R,offset:I,sortBy:null==O||null===(a=O[0])||void 0===a?void 0:a.id,sortOrder:null!=O&&null!==(u=O[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:{...F,...U,sortParams:O}}):Digit.Hooks.useInboxGeneral({tenantId:C,businessService:p,isInbox:f,filters:{...F,...U,sortParams:O},rawWfHandler:E,rawSearchHandler:h,combineResponse:g,wfConfig:y,searchConfig:{...D,..._},middlewaresWf:S,middlewareSearch:b});n.useEffect(()=>{w(0)},[F]);const V=e=>{let t=e.delete,n={...F,...e};t&&t.forEach(e=>delete n[e]),delete e.delete,M({...n}),N({enabled:!0})},$=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(Ve,{data:j,isLoading:H,isSearch:!f,searchFields:W,onFilterChange:V,onSearch:V,onSort:$,parentRoute:d,searchParams:F,sortParams:O,linkPrefix:d+"/application-details/",tableConfig:null!=z&&z.tableConfig?null===(q=res)||void 0===q?void 0:q.tableConfig:P(A).PTR,filterComponent:v,EmptyResultInboxComp:T,useNewInboxAPI:c}):l.createElement("div",null,f&&l.createElement(t.Header,null,A("ES_COMMON_INBOX")),l.createElement(He,{moduleCode:p,data:j,tableConfig:P(A).PTR,isLoading:H,defaultSearchParams:m.searchParams,isSearch:!f,onFilterChange:V,searchFields:W,onSearch:V,onSort:$,onNextPage:()=>{w(e=>e+R)},onPrevPage:()=>{w(e=>e-R)},currentPage:Math.floor(I/R),pageSizeLimit:R,disableSort:!1,onPageSizeChange:e=>{L(Number(e.target.value))},parentRoute:d,searchParams:F,sortParams:O,totalRecords:Number(null==j||null===(G=j[0])||void 0===G?void 0:G.totalCount),filterComponent:v,EmptyResultInboxComp:T,useNewInboxAPI:c}))},qe=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:E,handleSubmit:h,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")),h(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:h},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:E,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:E})),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:E})),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)),h(c)()},currentPage:y("offset")/y("limit"),onNextPage:function(){g("offset",y("offset")+y("limit")),h(c)()},onPrevPage:P,pageSizeLimit:y("limit"),onSort:N,disableSort:!1,sortParams:[{id:y("sortBy"),desc:"DESC"===y("sortOrder")}]})))},Ge=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:m,isSuccess:v,data:{PetRegistrationApplications:f,Count:E}={}}=Digit.Hooks.ptr.usePTRSearch({tenantId:a,filters:u},p);return l.createElement(l.Fragment,null,l.createElement(qe,{t:r,isLoading:m,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:v&&!m?f.length>0?f:{display:"ES_COMMON_NO_DATA"}:"",count:E}),c&&l.createElement(t.Toast,{error:c.error,warning:c.warning,label:r(c.label),isDleteBtn:!0,onClose:()=>{d(null)}}))},Ye=e=>{var n,r,a,u,s,d,p,m,v,f;let{path:E,userType:h}=e;const{t:g}=i.useTranslation(),y=o.useLocation();sessionStorage.removeItem("revalidateddone");const _=window.Digit.Utils.browser.isMobile(),S={searchParams:{uuid:{code:"ASSIGNED_TO_ALL",name:"ES_INBOX_ASSIGNED_TO_ALL"},services:["ptr"],applicationStatus:[],locality:[]}},b=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:_?{display:"flex"}:{},spanStyle:{maxWidth:"min-content"},crumbs:u})},T=null===(n=Digit)||void 0===n||null===(r=n.ComponentRegistryService)||void 0===r?void 0:r.getComponent("NewPTRStepperForm"),C=(null===(a=Digit)||void 0===a||null===(u=a.ComponentRegistryService)||void 0===u||u.getComponent("PTRNewApplication"),null===(s=Digit)||void 0===s||null===(d=s.ComponentRegistryService)||void 0===d?void 0:d.getComponent("ApplicationDetails")),A=null===(p=Digit)||void 0===p||null===(m=p.ComponentRegistryService)||void 0===m?void 0:m.getComponent("PTRResponse"),D=(null===(v=Digit)||void 0===v||null===(f=v.ComponentRegistryService)||void 0===f||f.getComponent("PTRDocsRequired"),window.location.href.includes("ptr/response")),N=window.location.href.includes("new-application")||window.location.href.includes("modify-application")||window.location.href.includes("ptr/application-details");return console.log("path",E),l.createElement(o.Switch,null,l.createElement(l.Fragment,null,l.createElement("div",{className:"ground-container"},D?null:l.createElement("div",{style:N?{marginLeft:"12px"}:{marginLeft:"-4px"}},l.createElement(b,{location:y})),l.createElement(t.PrivateRoute,{exact:!0,path:E+"/",component:()=>l.createElement(si,{matchPath:E,userType:h})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/inbox",component:()=>l.createElement($e,{useNewInboxAPI:!0,parentRoute:E,businessService:"ptr",filterComponent:"PTR_INBOX_FILTER",initialStates:S,isInbox:!0})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/new-application",component:T}),l.createElement(t.PrivateRoute,{path:E+"/petservice/application-details/:id",component:()=>l.createElement(C,{parentRoute:E})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/applicationsearch/application-details/:id",component:()=>l.createElement(C,{parentRoute:E})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/response",component:e=>l.createElement(A,c({},e,{parentRoute:E}))}),l.createElement(t.PrivateRoute,{path:E+"/petservice/search",component:e=>l.createElement(Search,c({},e,{t:g,parentRoute:E}))}),l.createElement(t.PrivateRoute,{path:E+"/searchold",component:()=>l.createElement($e,{parentRoute:E,businessService:"ptr",middlewareSearch:searchMW,initialStates:S,isInbox:!1,EmptyResultInboxComp:"PTEmptyResultInbox"})}),l.createElement(t.PrivateRoute,{path:E+"/petservice/my-applications",component:e=>l.createElement(Ge,c({},e,{parentRoute:E}))}))))},Ke=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)||"-"})`})},Xe=e=>{var o,r,a,u,s;let{onAssignmentChange:c,searchParams:d,businessServices:p,statusMap:m}=e;const{t:v}=i.useTranslation(),[f,E]=n.useState(!1),{data:h,isLoading:g}=Digit.Hooks.useApplicationStatusGeneral({businessServices:p},{}),{userRoleStates:y}=h||{},_=(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"}},v("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(Ke,{businessServices:p,key:t,onAssignmentChange:c,status:{name:_(e,v),code:e.applicationStatus,...e},searchParams:d,statusMap:m})),(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(Ke,{businessServices:p,key:e.uuid,onAssignmentChange:c,status:{name:_(e,v),code:e.applicationStatus,...e},searchParams:d,statusMap:m}))),l.createElement("div",{className:"filter-button",onClick:()=>E(!f)}," ",v(f?"ES_COMMON_LESS":"ES_COMMON_MORE")," ")):null):null},Ze=e=>{var o;let{searchParams:r,onFilterChange:u,defaultSearchParams:s,statusMap:c,moduleCode:d,...p}=e;const{t:m}=i.useTranslation(),v=a.useQueryClient(),[f,E]=n.useState(()=>({...r,services:[]})),h=[{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,E({...n})},y=()=>{E({...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"}},m("ES_COMMON_FILTER_BY"),":")),l.createElement("div",{className:"clearAll",onClick:y},m("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"}},m("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:m(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"}},m("ES_PTR_APP_TYPE")),h.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:m(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(Xe,{searchParams:f,businessServices:f.services,statusMap:c||v.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:h.map(e=>e.value)}:f)},label:m("ES_COMMON_APPLY")}))))))},Je=e=>l.createElement("span",{className:"cell-text"},e),Qe=e=>l.createElement("span",{className:"sla-cell"},e),et=[{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:"CS_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"}]}],tt=e=>l.createElement("h1",{className:"heading-m"},e.label),nt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),lt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nt,null)),it=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=e;const{data:v,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:E,data:h}=Digit.Hooks.pt.useMDMS(u,p,"FINANCIAL_YEARLS",{},{details:{tenantId:Digit.ULBService.getStateId(),moduleDetails:[{moduleName:"egf-master",masterDetails:[{name:"FinancialYear",filter:"[?(@.module == 'PT')]"}]}]}}),[g,y]=n.useState({}),[_,b]=n.useState({}),[T,C]=n.useState([]),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),[w,R]=n.useState(null),[L,O]=n.useState([]),[k,F]=n.useState(null),[M,B]=n.useState(!1);function U(e){P(e.target.files[0])}return n.useEffect(()=>{var e;h&&h["egf-master"]&&O(null===(e=h["egf-master"])||void 0===e?void 0:e.FinancialYear)},[h]),n.useEffect(()=>{var e;C(null==v||null===(e=v.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[v]),n.useEffect(()=>{!function(){try{R(null);const e=function(){if(N){const e=function(){if(N.size>=5242880)R(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=S(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?I(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)}}()},[N]),n.useEffect(()=>{a&&y(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:k,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:T,selectedApprover:A,setSelectedApprover:D,selectFile:U,uploadedFile:x,setUploadedFile:I,businessService:p}))},[a,T,L,k,x]),a&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tt,{label:r(g.label.heading)}),headerBarEnd:l.createElement(lt,{onClick:s}),actionCancelLabel:r(g.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(g.label.submit),actionSaveOnSubmit:()=>{},isDisabled:a.showFinancialYearsModal?!k:f||(null==a?void 0:a.docUploadRequired)&&!x,formId:"modal-action"},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){if("INACTIVE_PROPERTY"==(null==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:m};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:_,formId:"modal-action"})):l.createElement(t.Loader,null)},ot=e=>l.createElement("h1",{className:"heading-m"},e.label),rt=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),at=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rt,null)),ut=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;console.log("ActionModalActions: ",a);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)}),{isLoading:v,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')]"}]}]}}),[E,h]=n.useState({}),[g,y]=n.useState({}),[_,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),[w,R]=n.useState([]),[L,O]=n.useState(null);n.useEffect(()=>{var e;f&&f["egf-master"]&&R(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 F(e){D(e.target.files[0])}return n.useEffect(()=>{if(m&&k){var e;const t=k["common-masters"].Department;b(null==m||null===(e=m.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}`}}))}},[m]),n.useEffect(()=>{!function(){try{I(null);const e=function(){if(A){const e=function(){if(A.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=S(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):I(r("CS_FILE_UPLOAD_ERROR"))})},function(){I(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&&h((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:_,selectedApprover:T,setSelectedApprover:C,selectFile:F,uploadedFile:N,setUploadedFile:P,businessService:p}))},[a,_,w,L,N]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ot,{label:r(E.label.heading)}),headerBarEnd:l.createElement(at,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},v?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){d={...d,action:null==a?void 0:a.action,comment:null==e?void 0:e.comments,assignee:null!=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:g,formId:"modal-action"})):l.createElement(t.Loader,null)},st=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),ct=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),dt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(ct,null)),pt=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const{data:m,isLoading: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)}),[f,E]=n.useState({}),[h,g]=n.useState({}),[y,_]=n.useState([]),[b,T]=n.useState({}),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),I=!!Digit.Utils.browser.isMobile();function w(e){A(e.target.files[0])}return n.useEffect(()=>{var e;_(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=/(.*?)(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=S(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&&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:y,selectedApprover:b,setSelectedApprover:T,selectFile:w,uploadedFile:D,setUploadedFile:N,businessService:p,error:P}))},[a,y,D,P]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(st,{label:r(f.label.heading)}),headerBarEnd:l.createElement(dt,{onClick:s}),actionCancelLabel:r(f.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(f.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",isOBPSFlow:!0,popupStyles:I?{width:"720px"}:{},style:I?{height:"45px",width:"44%"}:{height:"45px",width:"107px",paddingLeft:"0px",paddingRight:"0px"},popupModuleMianStyles:I?{paddingLeft:"5px"}:{}},v?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:h,formId:"modal-action"})):l.createElement(t.Loader,null)},mt=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"})),ft=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(vt,null)),Et=e=>{var i,o,r,u,s,c,d,p,m,v,f,E;let{t:h,action:g,tenantId:y,closeModal:_,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:y,!1);const{data:P,isLoading:x}=Digit.Hooks.useEmployeeSearch(y,{roles:null==D||null===(d=D.data)||void 0===d||null===(p=d.initialActionState)||void 0===p||null===(m=p.nextActions)||void 0===m||null===(v=m.filter(e=>(null==e?void 0:e.action)==(null==g?void 0:g.action)))||void 0===v||null===(f=v[0])||void 0===f||null===(E=f.assigneeRoles)||void 0===E?void 0:E.map(e=>({code:e})),isActive:!0},{enabled:!(null!=g&&g.isTerminateState)}),[I,w]=(a.useQueryClient(),n.useState({})),[R,L]=n.useState({}),[O,k]=n.useState([]),[F,M]=n.useState([]),[B,U]=n.useState({}),[H,j]=n.useState({}),[W,z]=n.useState(null),[V,$]=n.useState(null),[q,G]=n.useState(null),[Y,K]=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(h("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=W&&W.type&&!e.test(null==W?void 0:W.type))G(h("NOT_SUPPORTED_FILE_TYPE"));else{const e=S(function(){return Promise.resolve(Digit.UploadServices.Filestorage("OBPS",W,Digit.ULBService.getStateId()||(null==y?void 0:y.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?$(null==e||null===(l=e.data)||void 0===l||null===(i=l.files[0])||void 0===i?void 0:i.fileStoreId):G(h("CS_FILE_UPLOAD_ERROR"))})},function(){G(h("CS_FILE_UPLOAD_ERROR"))});if(e&&e.then)return e.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();if(t&&t.then)return t.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[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(()=>{M(null==N?void 0:N.map(e=>({code:null==e?void 0:e.code,name:null==e?void 0:e.value}))),g&&w((e=>{var n,i,o,r,a,u,s;let{t:c,action:d,approvers:p,selectedApprover:m,setSelectedApprover:v,selectedBlockReason:f,setBlockReason:E,selectFile:h,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:E,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:h,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:h,action:g,approvers:O,selectedApprover:B,setSelectedApprover:U,selectedBlockReason:H,setBlockReason:j,selectFile:Z,uploadedFile:V,setUploadedFile:$,businessService:A,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL_BPA",error:q,blockReasonFiltered:F}))},[g,O,Y,V,q]),g&&I.form?l.createElement(t.Modal,{headerBarMain:l.createElement(mt,{label:h(I.label.heading)}),headerBarEnd:l.createElement(ft,{onClick:_}),actionCancelLabel:h(I.label.cancel),actionCancelOnSubmit:_,actionSaveLabel:h(I.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:I.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){try{var t,n,l,i,o,r,a,u,s,c,d,p,m,v,f,E,S,A,N,P,x,I,w,R,L,O,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==g?void 0:g.action,comment:(null==e||null===(n=e.comments)||void 0===n?void 0:n.length)>0?null==e?void 0:e.comments:null,comments:(null==e||null===(l=e.comments)||void 0===l?void 0:l.length)>0?null==e?void 0:e.comments:null,assignee:"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===(m=p.processInstances)||void 0===m||null===(v=m[0])||void 0===v||null===(f=v.state)||void 0===f?void 0:f.applicationStatus)?[null==D||null===(E=D.data)||void 0===E||null===(S=E.processInstances)||void 0===S||null===(A=S[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:V?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]:null},action:null==g?void 0:g.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===(I=x[0])||void 0===I||null===(w=I.state)||void 0===w?void 0:w.applicationStatus)?[null==D||null===(R=D.data)||void 0===R||null===(L=R.processInstances)||void 0===L||null===(O=L[0])||void 0===O||null===(k=O.assigner)||void 0===k?void 0:k.uuid]:null!=B&&B.uuid?[null==B?void 0:B.uuid]:null,wfDocuments:V?[{documentType:(null==g?void 0:g.action)+" DOC",fileName:null==W?void 0:W.name,fileStoreId:V}]:null};const F=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,m,v;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===(m=e[0])||void 0===m||null===(v=m.Noc)||void 0===v?void 0:v.sourceRefId};return Promise.resolve(Digit.NOCSearch.all(y,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"==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}):(_(),alert(h("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})})}_(),alert(h("Enterd Less Adjustment amount is invalid"))}();return Promise.resolve(F&&F.then?F.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},defaultValues:R,formId:"modal-action"})):l.createElement(t.Loader,null)},ht=e=>l.createElement("h1",{style:{marginLeft:"22px"},className:"heading-m BPAheading-m"},e.label),gt=()=>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"})),yt=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(gt,null)),_t=e=>{var i,r;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:m,businessService:v}=e;const{data:f,isLoading:E}=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)}),[h,g]=(a.useQueryClient(),n.useState({})),[y,_]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState({}),[D,N]=n.useState(null),[P,x]=n.useState(null),[I,w]=n.useState(null),R=!!Digit.Utils.browser.isMobile();function L(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{w(null);const e=function(){if(D){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(D.size>=5242880)w(u("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=D&&D.type&&!e.test(null==D?void 0:D.type))w(u("NOT_SUPPORTED_FILE_TYPE"));else{const e=S(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):w(u("CS_FILE_UPLOAD_ERROR"))})},function(){w(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&&g((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 E=!1;return"APPROVE"!=(null==o?void 0:o.action)&&"REJECT"!=(null==o?void 0:o.action)&&"AUTO_APPROVE"!=o.action&&"AUTO_REJECT"!=o.action||(E=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${m}_${null==o?void 0:o.action}`,cancel:"CORE_LOGOUTPOPUP_CANCEL"},form:[{body:[{label:o.isTerminateState||E?null:i(p||"WF_ROLE_"+(null===(n=o.assigneeRoles)||void 0===n?void 0:n[0])),type:"dropdown",populators:o.isTerminateState||E?null:l.createElement(t.Dropdown,{option: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:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:A,selectFile:L,uploadedFile:P,setUploadedFile:x,businessService:v,assigneeLabel:"WF_ASSIGNEE_NAME_LABEL",error:I}))},[s,b,P,I]),s&&h.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ht,{label:u(h.label.heading)}),headerBarEnd:l.createElement(yt,{onClick:d}),actionCancelLabel:u(h.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(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"}:{}},E?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:h.form,cardStyle:{marginLeft:"0px",marginRight:"0px",marginTop:"-25px"},className:"BPAemployeeCard",noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l;let i=JSON.parse(sessionStorage.getItem("NewNOCDocs")),o=(null===(t=m)||void 0===t||null===(n=t.documents)||void 0===n?void 0:n.length)>0?[...null===(l=m)||void 0===l?void 0:l.documents]:[];i.map((e,t)=>{o.push(e)}),m={...m,workflow:{action:null==s?void 0:s.action,comment:null!=e&&e.comments?null==e?void 0:e.comments:null,assignee:null!=C&&C.uuid?[null==C?void 0:C.uuid]:null,documents:P?[{documentType:(null==s?void 0:s.action)+" DOC",fileName:null==D?void 0:D.name,fileStoreId:P}]:null},documents:o},p({Noc:m},!1,{isNoc:!0})},defaultValues:y,formId:"modal-action"})):l.createElement(t.Loader,null)};function St(e){var t=this.__data__=new Se(e);this.size=t.size}St.prototype.clear=function(){this.__data__=new Se,this.size=0},St.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},St.prototype.get=function(e){return this.__data__.get(e)},St.prototype.has=function(e){return this.__data__.has(e)},St.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Se){var l=n.__data__;if(!be||l.length<199)return l.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ae(l)}return n.set(e,t),this.size=n.size,this};var bt=St,Tt=function(){try{var e=de(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ct=function(e,t,n){"__proto__"==t&&Tt?Tt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},At=Object.prototype.hasOwnProperty,Dt=function(e,t,n){var l=e[t];At.call(e,t)&&he(l,n)&&(void 0!==n||t in e)||Ct(e,t,n)},Nt=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?Ct(n,a,u):Dt(n,a,u)}return n},Pt=function(e){return Q(e)&&"[object Arguments]"==J(e)},xt=Object.prototype,It=xt.hasOwnProperty,wt=xt.propertyIsEnumerable,Rt=Pt(function(){return arguments}())?Pt:function(e){return Q(e)&&It.call(e,"callee")&&!wt.call(e,"callee")},Lt=function(){return!1},Ot=p(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?V.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||Lt}),kt=/^(?:0|[1-9]\d*)$/,Ft=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&kt.test(e))&&e>-1&&e%1==0&&e<t},Mt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Bt={};Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=!0,Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object Boolean]"]=Bt["[object DataView]"]=Bt["[object Date]"]=Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object WeakMap]"]=!1;var Ut=function(e){return function(t){return e(t)}},Ht=p(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n&&W.process,o=function(){try{return l&&l.require&&l.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=o}),jt=Ht&&Ht.isTypedArray,Wt=jt?Ut(jt):function(e){return Q(e)&&Mt(e.length)&&!!Bt[J(e)]},zt=Object.prototype.hasOwnProperty,Vt=function(e,t){var n=j(e),l=!n&&Rt(e),i=!n&&!l&&Ot(e),o=!n&&!l&&!i&&Wt(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&&!zt.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},$t=Object.prototype,qt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||$t)},Gt=function(e,t){return function(n){return e(t(n))}},Yt=Gt(Object.keys,Object),Kt=Object.prototype.hasOwnProperty,Xt=function(e){return null!=e&&Mt(e.length)&&!ie(e)},Zt=function(e){return Xt(e)?Vt(e):function(e){if(!qt(e))return Yt(e);var t=[];for(var n in Object(e))Kt.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},Jt=Object.prototype.hasOwnProperty,Qt=function(e){return Xt(e)?Vt(e,!0):function(e){if(!le(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=qt(e),n=[];for(var l in e)("constructor"!=l||!t&&Jt.call(e,l))&&n.push(l);return n}(e)},en=p(function(e,t){var n=t&&!t.nodeType&&t,l=n&&e&&!e.nodeType&&e,i=l&&l.exports===n?V.Buffer:void 0,o=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,l=o?o(n):new e.constructor(n);return e.copy(l),l}}),tn=function(){return[]},nn=Object.prototype.propertyIsEnumerable,ln=Object.getOwnPropertySymbols,on=ln?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var l=-1,i=null==t?0:t.length,o=0,r=[];++l<i;){var a=t[l];nn.call(e,a)&&(r[o++]=a)}return r}(ln(e)))}:tn,rn=function(e,t){for(var n=-1,l=t.length,i=e.length;++n<l;)e[i+n]=t[n];return e},an=Gt(Object.getPrototypeOf,Object),un=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)rn(t,on(e)),e=an(e);return t}:tn,sn=function(e,t,n){var l=t(e);return j(e)?l:rn(l,n(e))},cn=function(e){return sn(e,Zt,on)},dn=function(e){return sn(e,Qt,un)},pn=de(V,"DataView"),mn=de(V,"Promise"),vn=de(V,"Set"),fn=de(V,"WeakMap"),En=ue(pn),hn=ue(be),gn=ue(mn),yn=ue(vn),_n=ue(fn),Sn=J;(pn&&"[object DataView]"!=Sn(new pn(new ArrayBuffer(1)))||be&&"[object Map]"!=Sn(new be)||mn&&"[object Promise]"!=Sn(mn.resolve())||vn&&"[object Set]"!=Sn(new vn)||fn&&"[object WeakMap]"!=Sn(new fn))&&(Sn=function(e){var t=J(e),n="[object Object]"==t?e.constructor:void 0,l=n?ue(n):"";if(l)switch(l){case En:return"[object DataView]";case hn:return"[object Map]";case gn:return"[object Promise]";case yn:return"[object Set]";case _n:return"[object WeakMap]"}return t});var bn=Sn,Tn=Object.prototype.hasOwnProperty,Cn=V.Uint8Array,An=function(e){var t=new e.constructor(e.byteLength);return new Cn(t).set(new Cn(e)),t},Dn=/\w*$/,Nn=$?$.prototype:void 0,Pn=Nn?Nn.valueOf:void 0,xn=Object.create,In=function(){function e(){}return function(t){if(!le(t))return{};if(xn)return xn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),wn=Ht&&Ht.isMap,Rn=wn?Ut(wn):function(e){return Q(e)&&"[object Map]"==bn(e)},Ln=Ht&&Ht.isSet,On=Ln?Ut(Ln):function(e){return Q(e)&&"[object Set]"==bn(e)},kn={};kn["[object Arguments]"]=kn["[object Array]"]=kn["[object ArrayBuffer]"]=kn["[object DataView]"]=kn["[object Boolean]"]=kn["[object Date]"]=kn["[object Float32Array]"]=kn["[object Float64Array]"]=kn["[object Int8Array]"]=kn["[object Int16Array]"]=kn["[object Int32Array]"]=kn["[object Map]"]=kn["[object Number]"]=kn["[object Object]"]=kn["[object RegExp]"]=kn["[object Set]"]=kn["[object String]"]=kn["[object Symbol]"]=kn["[object Uint8Array]"]=kn["[object Uint8ClampedArray]"]=kn["[object Uint16Array]"]=kn["[object Uint32Array]"]=!0,kn["[object Error]"]=kn["[object Function]"]=kn["[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(!le(t))return t;var d=j(t);if(d){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Tn.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=bn(t),m="[object Function]"==p||"[object GeneratorFunction]"==p;if(Ot(t))return en(t,u);if("[object Object]"==p||"[object Arguments]"==p||m&&!o){if(a=s||m?{}:function(e){return"function"!=typeof e.constructor||qt(e)?{}:In(an(e))}(t),!u)return s?function(e,t){return Nt(e,un(e),t)}(t,function(e,t){return e&&Nt(t,Qt(t),e)}(a,t)):function(e,t){return Nt(e,on(e),t)}(t,function(e,t){return e&&Nt(t,Zt(t),e)}(a,t))}else{if(!kn[p])return o?t:{};a=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return An(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return function(e,t){var n=t?An(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?An(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Dn.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Set]":return new l;case"[object Symbol]":return Pn?Object(Pn.call(e)):{}}}(t,p,u)}}r||(r=new bt);var v=r.get(t);if(v)return v;r.set(t,a),On(t)?t.forEach(function(i){a.add(e(i,n,l,i,t,r))}):Rn(t)&&t.forEach(function(i,o){a.set(o,e(i,n,l,o,t,r))});var f=d?void 0:(c?s?dn:cn:s?Qt:Zt)(t);return function(e,t){for(var n=-1,l=null==e?0:e.length;++n<l&&!1!==t(e[n],n););}(f||t,function(i,o){f&&(i=t[o=i]),Dt(a,o,e(i,n,l,o,t,r))}),a},Mn=function(e){return Fn(e,5)};const Bn=e=>l.createElement("h1",{className:"heading-m"},e.label),Un=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Hn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Un,null)),jn=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}},Wn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:d,applicationData:p,businessService:m}=e;const{data:v,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)}),[E,h]=n.useState({}),[g,y]=n.useState({}),[_,b]=n.useState([]),[T,C]=n.useState({}),[A,D]=n.useState(null),[N,P]=n.useState(null),[x,I]=n.useState(null),w=window.Digit.Utils.browser.isMobile(),R=window.location.href.includes("/employee");function L(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{I(null);const e=function(){if(A){const e=/(.*?)(jpg|jpeg|png|image|pdf)$/i,t=function(){if(A.size>=5242880)I(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const t=function(){if(null!=A&&A.type&&!e.test(null==A?void 0:A.type))I(r("NOT_SUPPORTED_FILE_TYPE"));else{const e=S(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):I(r("CS_FILE_UPLOAD_ERROR"))})},function(e){console.error("Modal -> err ",e),I(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&&h((e=>{var n;let{t:i,action:o,approvers:r,selectedApprover:a,setSelectedApprover:u,selectFile:s,uploadedFile:d,setUploadedFile:p,businessService:m,error:v}=e,f=!0,E=!1;return(null!=o&&null!==(n=o.action)&&void 0!==n&&n.includes("SEND_BACK")||"APPROVE_FOR_DISCONNECTION"==(null==o?void 0:o.action)||"RESUBMIT_APPLICATION"==(null==o?void 0:o.action))&&(f=!1),o.isTerminateState&&(f=!1),"EXECUTE_DISCONNECTION"!=(null==o?void 0:o.action)&&"DISCONNECTION_EXECUTED"!=(null==o?void 0:o.action)||(E=!0),{label:{heading:`WF_${null==o?void 0:o.action}_APPLICATION`,submit:`WF_${null==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:u,selected:a}):null},E&&{label:i("ES_FSM_ACTION_SERVICE_DATE"),isMandatory:!!E,type:"custom",populators:E?{name:"date",validation:{required:!0},defaultValue:Digit.Utils.date.getDate(),component:(e,n)=>l.createElement(t.DatePicker,c({onChange:e.onChange,date:e.value},n))}:null},{label:i("WF_COMMON_COMMENTS"),type:"textarea",populators:{name:"comments"}},{label:i("WS_APPROVAL_CHECKLIST_BUTTON_UP_FILE"),populators:l.createElement(t.UploadFile,{id:"workflow-doc",accept:".jpg,.pdf,.png,.jpeg",onUpload:s,onDelete:()=>{p(null)},message:d?"1 "+i("ES_PT_ACTION_FILEUPLOADED"):i("CS_ACTION_NO_FILEUPLOADED"),error:v,iserror:v,showHintBelow:!0,hintText:"WS_HINT_TEXT_LABEL"})}]}]}})({t:r,action:a,approvers:_,selectedApprover:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:m,error:x})):a&&h((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:_,selectedApprover:T,setSelectedApprover:C,selectFile:L,uploadedFile:N,setUploadedFile:P,businessService:m,error:x}))},[a,_,N,x]),a&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Bn,{label:r(E.label.heading)}),headerBarEnd:l.createElement(Hn,{onClick:s}),actionCancelLabel:r(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:r(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action",style:w&&R?{width:"100%",height:"auto"}:{}},f?l.createElement(t.Loader,null):l.createElement(t.FormComposer,{config:E.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){var t,n,l,i,o,r,s,c,m,v;if(null!==(t=p)&&void 0!==t&&t.isBillAmend){var f,E,h,g,y,_,S,b,C;const t={...null===(f=p)||void 0===f||null===(E=f.billAmendmentDetails)||void 0===E?void 0:E.additionalDetails,comments:null!=e&&e.comments?e.comments:null},n={...null===(h=p)||void 0===h?void 0:h.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:u,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=Mn(null==e?void 0:e.date);p.disconnectionExecutionDate=jn(t)}else if(null!=e&&e.date){const t=Mn(null==e?void 0:e.date);p.connectionExecutionDate=jn(t)}var D;if("DisconnectWSConnection"==(null===(o=p)||void 0===o||null===(r=o.processInstance)||void 0===r?void 0:r.businessService)||"DisconnectSWConnection"==(null===(s=p)||void 0===s||null===(c=s.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===(m=p)||void 0===m?void 0:m.applicationType))d({SewerageConnection:p,disconnectRequest:!1,reconnectRequest:!0});else if("WATER_RECONNECTION"==(null===(v=p)||void 0===v?void 0:v.applicationType))d({WaterConnection:p,disconnectRequest:!1,reconnectRequest:!0});else{var P,x,I,w,R,L,O,k,F,M,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!==(I=t.value)&&void 0!==I&&I.adhocPenaltyComment&&(p.additionalDetails.adhocPenaltyComment=(null==t||null===(w=t.value)||void 0===w?void 0:w.adhocPenaltyComment)||""),null!=t&&null!==(R=t.value)&&void 0!==R&&R.adhocPenaltyReason&&(p.additionalDetails.adhocPenaltyReason=(null==t||null===(L=t.value)||void 0===L?void 0:L.adhocPenaltyReason)||""),null!=t&&null!==(O=t.value)&&void 0!==O&&O.adhocRebate&&(p.additionalDetails.adhocRebate=parseInt(null==t||null===(k=t.value)||void 0===k?void 0:k.adhocRebate)||""),null!=t&&null!==(F=t.value)&&void 0!==F&&F.adhocRebateComment&&(p.additionalDetails.adhocRebateComment=(null==t||null===(M=t.value)||void 0===M?void 0:M.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:g,formId:"modal-action"})):l.createElement(t.Loader,null)},zn=e=>l.createElement("h1",{className:"heading-m"},e.label),Vn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),$n=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Vn,null)),qn=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=e;console.log("applicationData",d);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)}),[f,E]=n.useState({}),[h,g]=n.useState({}),[y,_]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[I,w]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;_(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=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=S(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&&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:y,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,y,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(zn,{label:r(f.label.heading)}),headerBarEnd:l.createElement($n,{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:m};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:h,formId:"modal-action"})):l.createElement(t.Loader,null)},Gn=e=>l.createElement("h1",{className:"heading-m"},e.label),Yn=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),Kn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Yn,null)),Xn=e=>{var i,o,r;let{t:a,action:u,closeModal:s,submitAction:c,applicationData:d,businessService:p}=e;const m=Digit.ULBService.getStateId(),{data:v,isLoading:f}=Digit.Hooks.tl.useTradeLicenseMDMS(m,"TradeLicense","TradeUnits","[?(@.type=='TL')]");console.log("tradeMdmsData",null==v||null===(i=v.TradeLicense)||void 0===i?void 0:i.TradeType),console.log("applicationData",d);const[E,h]=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||!v||!P.length)return[];const t=new Set(P.map(e=>e.tradeType)),n=(null===(e=v.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,v,P]);return console.log("years",x),n.useEffect(()=>{u&&h((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&&E.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Gn,{label:a(E.label.heading)}),headerBarEnd:l.createElement(Kn,{onClick:s}),actionCancelLabel:a(E.label.cancel),actionCancelOnSubmit:s,actionSaveLabel:a(E.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},f?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=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)},Zn=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"})),Qn=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(Jn,null)),el=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=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?void 0:a.isTerminateState}),[f,E]=n.useState({}),[h,g]=n.useState({}),[y,_]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[I,w]=n.useState(!1);function R(e){w(!0),A(e.target.files[0])}return n.useEffect(()=>{var e;_(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=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=function(e,t){try{var n=S(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(w(!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(()=>{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:y,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:D,setUploadedFile:N,businessService:p,isUploading:I}))},[a,y,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(Zn,{label:r(f.label.heading)}),headerBarEnd:l.createElement(Qn,{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:m,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:h,formId:"modal-action"})):l.createElement(t.Loader,null)},tl=e=>l.createElement("h1",{className:"heading-m"},e.label),nl=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),ll=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(nl,null)),il=e=>{var i,o;let{t:r,action:a,tenantId:u,closeModal:s,submitAction:c,applicationData:d,businessService:p,moduleCode:m}=e;console.log("applicationData",d);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)}),[f,E]=n.useState({}),[h,g]=n.useState({}),[y,_]=n.useState([]),[b,T]=n.useState(null),[C,A]=n.useState(null),[D,N]=n.useState(null),[P,x]=n.useState(null),[I,w]=n.useState(!1);function R(e){A(e.target.files[0])}return n.useEffect(()=>{var e;_(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=function(){if(C.size>=5242880)x(r("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=S(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&&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:y,selectedApprover:b,setSelectedApprover:T,selectFile:R,uploadedFile:D,setUploadedFile:N,businessService:p}))},[a,y,D]),a&&f.form?l.createElement(t.Modal,{headerBarMain:l.createElement(tl,{label:r(f.label.heading)}),headerBarEnd:l.createElement(ll,{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:m};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:h,formId:"modal-action"})):l.createElement(t.Loader,null)},ol=e=>l.createElement("h1",{className:"heading-m"},e.label),rl=()=>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"})),al=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(rl,null)),ul=e=>{var i,r,a;let{t:u,action:s,tenantId:c,closeModal:d,submitAction:p,applicationData:m,businessService:v,moduleCode:f}=e;const{data:E}=Digit.Hooks.useEmployeeSearch(c,{roles:null==s||null===(i=s.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!=s&&s.isTerminateState)}),h=o.useHistory(),[g,y]=n.useState({}),[_,S]=n.useState({}),[b,T]=n.useState([]),[C,A]=n.useState(null),[D,N]=n.useState(null);return n.useEffect(()=>{var e;T(null==E||null===(e=E.Employees)||void 0===e?void 0:e.map(e=>{var t;return{uuid:null==e?void 0:e.uuid,name:null==e||null===(t=e.user)||void 0===t?void 0:t.name}}))},[E]),n.useEffect(()=>{"INITIATED"===(null==s?void 0:s.state)?h.push("/digit-ui/employee/asset/assetservice/edit/"+(null==m?void 0:m.applicationNo)):y((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_AST_COMMON_CANCEL"},form:[{body:[{label:t("AST_ACTION_COMMENTS"),type:"textarea",populators:{name:"comments"}}]}]}})({t:u,action:s,approvers:b,selectedApprover:C,setSelectedApprover:A,uploadedFile:D,setUploadedFile:N,businessService:v}))},[s,b,D]),s&&g.form?l.createElement(t.Modal,{headerBarMain:l.createElement(ol,{label:u(g.label.heading)}),headerBarEnd:l.createElement(al,{onClick:d}),actionCancelLabel:u(g.label.cancel),actionCancelOnSubmit:d,actionSaveLabel:u(g.label.submit),actionSaveOnSubmit:()=>{},formId:"modal-action"},l.createElement(t.FormComposer,{config:g.form,noBoxShadow:!0,inline:!0,childrenAtTheBottom:!0,onSubmit:function(e){let t={action:null==s?void 0:s.action,comment:null==e?void 0:e.comments,businessService:v,moduleName:f};D&&(t.documents=[]),p({Asset:{...m,workflow:t}})},defaultValues:_,formId:"modal-action"})):l.createElement(t.Loader,null)},sl=e=>null!=e&&e.businessService.includes("PT")?l.createElement(it,e):null!=e&&e.businessService.includes("ptr")?l.createElement(qn,e):null!=e&&e.businessService.includes("NewTL")||null!=e&&e.businessService.includes("TL")||null!=e&&e.businessService.includes("EDITRENEWAL")?l.createElement(ut,e):null!=e&&e.businessService.includes("DIRECTRENEWAL")?l.createElement(Xn,e):null!=e&&e.moduleCode.includes("BPAREG")?l.createElement(pt,e):null!=e&&e.moduleCode.includes("BPA")?l.createElement(Et,e):null!=e&&e.moduleCode.includes("NOC")?l.createElement(_t,e):null!=e&&e.moduleCode.includes("WS")?l.createElement(Wn,e):null!=e&&e.businessService.includes("street-vending")?l.createElement(el,e):null!=e&&e.businessService.includes("chb")?l.createElement(il,e):null!=e&&e.businessService.includes("asset-create")?l.createElement(ul,e):void 0;function cl(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 dl=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,E]=n.useState(null),[h,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;h.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==h?void 0:h.map((e,t)=>l.createElement("div",{style:{padding:"20px"}},l.createElement(pl,{key:t,index:t,document:e,t:o,error:f,setError:E,setDocuments:v,documents:m,setCheckRequiredFields:b,applicationStatus:c,actions:d,bpaTaxDocuments:h,checkEnablingDocs:T}))))};function pl(e){var i,o;let{t:r,document:a,setDocuments:u,documents:s,index:c,bpaTaxDocuments:d,checkEnablingDocs:p}=e;const m=null==s?void 0:s.filter(e=>{var t;return null==e||null===(t=e.documentType)||void 0===t?void 0:t.includes(null==a?void 0:a.code)})[0],v=Digit.ULBService.getStateId(),[f,E]=n.useState(m?{...m,active:!0,code:null==m?void 0:m.documentType,i18nKey:null==m?void 0:m.documentType}:1===(null==a||null===(i=a.dropdownData)||void 0===i?void 0:i.length)?null==a?void 0:a.dropdownData[0]:{}),[h,g]=n.useState(null),[y,_]=n.useState(()=>(null==m?void 0:m.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==h?void 0:h.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(()=>{},[h]),l.createElement("div",{style:{marginBottom:"24px",maxWidth:"950px",minWidth:"280px",background:"#FAFAFA",borderRadius:"4px",border:"1px solid #D6D5D4",padding:"8px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},""+r(null==a?void 0:a.code)),(null==a||null===(o=a.uploadedDocuments)||void 0===o?void 0:o.length)&&l.createElement(cl,{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=>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:v,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 ml(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(cl,{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 vl(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,E]=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=S(function(){return E(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?E(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 fl=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:E}=Digit.Hooks.obps.useMDMS(p,"BPA",["DocTypeMapping"],{enabled:!u}),{data:h}=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==h||null===(e=h["common-masters"])||void 0===e?void 0:e.DocumentType)},[h]),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==E||null===(c=E.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(cl,{documents:a,svgStyles:{width:"80px",height:"100px",viewBox:"0 0 25 25",minWidth:"80px"}}),b&&(null==_?void 0:_.map((e,t)=>l.createElement(vl,{key:t,document:e,t:o,error:D,setError:N,setNocDocuments:A,nocDocuments:C,checkEnablingDocs:b}))))},El=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 hl(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 gl(e){let{floors:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map(e=>{var n;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",color:"#505A5F",fontSize:"24px"}},o(null==e?void 0:e.title)),null==e||null===(n=e.values)||void 0===n?void 0:n.map((e,n)=>{var i;return l.createElement(l.Fragment,{key:n},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",color:"#505A5F",fontSize:"16px",marginTop:0!==n?"16px":"revert"}},o(e.title)),l.createElement(t.StatusTable,{style:{position:"relative",padding:"8px"}},l.createElement("div",{style:{border:"1px solid #D6D5D4",padding:"16px",marginTop:"8px",borderRadius:"4px",background:"#FAFAFA",maxWidth:"100%"}},null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title),text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none"})}))))}))}))}function yl(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 _l=e=>{var o,r,a,u,s,c,d,p,m,v,f,E,h,g,y,_,b,T,C,A,D,N,P;let{scrutinyDetails:x,paymentsList:I=[],additionalDetails:w,applicationData:R}=e;const L=(window.location.href.includes("editApplication")||"FIELDINSPECTION_INPROGRESS"==(null==R?void 0:R.status))&&window.location.href.includes("bpa"),[O,k]=n.useState(),[F,M]=n.useState(),[B,U]=n.useState(),H=Digit.ULBService.getStateId(),[j,W]=n.useState(),[z,V]=n.useState(),[$,q]=n.useState([]),[G,Y]=n.useState(),[K,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=S(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([...$,{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($))},[$]),n.useEffect(()=>{var e,t,n,l,i,o,r;if(null!=w&&null!==(e=w.lessAdjustmentFeeFiles)&&void 0!==e&&e.length){const e=null==w?void 0:w.lessAdjustmentFeeFiles.map((e,t)=>{var n,l,i;return t===(null==w||null===(n=w.lessAdjustmentFeeFiles)||void 0===n?void 0:n.length)-1?null==w||null===(l=w.lessAdjustmentFeeFiles[(null==w||null===(i=w.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==w||null===(t=w.selfCertificationCharges)||void 0===t?void 0:t.BPA_DEVELOPMENT_CHARGES),sessionStorage.setItem("development",null==w||null===(n=w.selfCertificationCharges)||void 0===n?void 0:n.BPA_DEVELOPMENT_CHARGES),M(null==w||null===(l=w.selfCertificationCharges)||void 0===l?void 0:l.BPA_OTHER_CHARGES),sessionStorage.setItem("otherCharges",null==w||null===(i=w.selfCertificationCharges)||void 0===i?void 0:i.BPA_OTHER_CHARGES),U(null==w||null===(o=w.selfCertificationCharges)||void 0===o?void 0:o.BPA_LESS_ADJUSMENT_PLOT),sessionStorage.setItem("lessAdjusment",null==w||null===(r=w.selfCertificationCharges)||void 0===r?void 0:r.BPA_LESS_ADJUSMENT_PLOT),W(null==w?void 0:w.otherFeesDiscription),sessionStorage.setItem("otherChargesDisc",null==w?void 0:w.otherFeesDiscription),q(null==w?void 0:w.lessAdjustmentFeeFiles)},[w]);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==w?void 0:w.builtUpArea)*2.5)}),l.createElement(t.Row,{className:"border-none",label:re("BOUNDARY_WALL_FEES"),text:"₹ "+2.5*(null==w?void 0:w.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==w||null===(s=w.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==w||null===(c=w.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==w||null===(d=w.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==w||null===(p=w.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==w||null===(m=w.selfCertificationCharges)||void 0===m?void 0:m.BPA_DEVELOPMENT_CHARGES)||0,value:O,disabled:!L,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==w||null===(v=w.selfCertificationCharges)||void 0===v?void 0:v.BPA_OTHER_CHARGES)||0,value:F,disabled:!L,onChange:e=>{!function(e){/^[0-9]*$/.test(e)&&(M(e),sessionStorage.setItem("otherCharges",e))}(e.target.value)},required:!0,pattern:"^[0-9]*$",type:"text"}),parseInt(F)>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==w||null===(f=w.selfCertificationCharges)||void 0===f?void 0:f.BPA_COMMON_OTHER_AMT_DISCRIPTION,value:j,disabled:!L,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==w||null===(E=w.selfCertificationCharges)||void 0===E?void 0:E.BPA_LESS_ADJUSMENT_PLOT)||"",value:B,disabled:!L,onChange:e=>{!function(e){var t,n,l,i;/^[0-9]*$/.test(e)&&(parseFloat(e)>(parseFloat(O)?parseFloat(O):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==w||null===(t=w.selfCertificationCharges)||void 0===t?void 0:t.BPA_MALBA_CHARGES)+parseFloat(null==w||null===(n=w.selfCertificationCharges)||void 0===n?void 0:n.BPA_LABOUR_CESS)+parseFloat(null==w||null===(l=w.selfCertificationCharges)||void 0===l?void 0:l.BPA_WATER_CHARGES)+parseFloat(null==w||null===(i=w.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&&L?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:!L,onDelete:()=>{V(null),Y("")},message:z?"1 "+re("FILEUPLOADED"):re("ES_NO_FILE_SELECTED_LABEL"),error:Z,uploadMessage:K})):null,(null==Q||null===(h=Q.fileStoreIds)||void 0===h?void 0:h.length)&&parseInt(null==w||null===(g=w.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===(y=Q.fileStoreIds)||void 0===y?void 0:y.length)&&parseInt(null==w||null===(_=w.selfCertificationCharges)||void 0===_?void 0:_.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(O)?parseFloat(O):0)+parseFloat(F?parseFloat(F):0)+parseFloat(null==w||null===(C=w.selfCertificationCharges)||void 0===C?void 0:C.BPA_MALBA_CHARGES)+parseFloat(null==w||null===(A=w.selfCertificationCharges)||void 0===A?void 0:A.BPA_LABOUR_CESS)+parseFloat(null==w||null===(D=w.selfCertificationCharges)||void 0===D?void 0:D.BPA_WATER_CHARGES)+parseFloat(null==w||null===(N=w.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))))))))},Sl=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]},E=n.useMemo(()=>v.map(e=>({Header:p(""+e.name),accessor:f(e.id),id:e.id})));function h(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:h(e),columns:E,getCellProps:e=>({style:{}})})))})))},bl=e=>{let{headComment:t,otherComment:n}=e;return l.createElement("div",{className:"checkpoint-comments-wrap"},l.createElement("h4",null,t),l.createElement("p",null,n))},Tl=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(bl,{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 Cl(e){let{units:n}=e;const{t:o}=i.useTranslation();return l.createElement(l.Fragment,null,n.map((e,n)=>{var i;return l.createElement("div",{key:o(null==e?void 0:e.title),style:{marginTop:"19px",background:"#FAFAFA",border:"1px solid #D6D5D4",borderRadius:"4px",padding:"8px",lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}},l.createElement(t.CardSubHeader,{style:{marginBottom:"8px",paddingBottom:"9px",color:"#0B0C0C",fontSize:"16px",lineHeight:"19px"}},`${o(null==e?void 0:e.title)} ${n+1}`),l.createElement(l.Fragment,{key:n},l.createElement(t.StatusTable,{style:{position:"relative",marginTop:"19px"}},l.createElement("div",{style:{position:"absolute",maxWidth:"640px",top:0,left:0,bottom:0,right:0,width:"auto"}}),null==e||null===(i=e.values)||void 0===i?void 0:i.map((e,n)=>{var i;return l.createElement(t.Row,!0===e.map&&"N/A"!==e.value?{key:o(e.title),label:o(e.title),text:l.createElement("img",{src:o(e.value),alt:""})}:{key:o(e.title),label:o(e.title)+":",text:o(e.value)||"N/A",last:n===(null==e||null===(i=e.values)||void 0===i?void 0:i.length)-1,caption:e.caption,className:"border-none",rowContainerStyle:{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}})}))))}))}function Al(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 Dl=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:E,roadCuttingDetails:h,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==E?void 0:E.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==h?void 0:h.map(e=>{var n;return l.createElement("div",{style:(null==h?void 0:h.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:""})))))))},Nl=[{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"}],Pl=[{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"}],xl=e=>{var o,r,a,u;let{wsAdditionalDetails:s}=e;const{t:d}=i.useTranslation(),[p,m,v]=Digit.Hooks.useSessionStorage("ADHOC_ADD_REBATE_DATA",{}),[f,E,h]=Digit.Hooks.useSessionStorage("ADHOC_BILL_ADD_REBATE_DATA",{}),g=!(null==s||null===(o=s.additionalDetails)||void 0===o||!o.isPaid),[y,S]=n.useState(!1),[b,T]=n.useState(p||{}),[C,A]=n.useState(null),[D,N]=n.useState(s.additionalDetails.data?s.additionalDetails.data:{}),[P,x]=n.useState(s.additionalDetails.values?s.additionalDetails.values:[]),I=Digit.ULBService.getStateId();Digit.Hooks.ws.useMDMS(I,"BillingService",["TaxHeadMaster"]),n.useEffect(()=>{var e,t,n;const i={...null==s||null===(e=s.additionalDetails)||void 0===e||null===(t=e.appDetails)||void 0===t?void 0:t.additionalDetails};if((null==p||null===(n=p.billDetails)||void 0===n?void 0:n.length)>0){var o,r,a,u,c,d,v;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===(c=p.billDetails)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.taxAmount)}];x(e),N(null==p||null===(v=p.billDetails)||void 0===v?void 0:v[0])}else m(i),T(i)},[]);let w={};const R=e=>l.createElement("h1",{className:"heading-m"},e.label),L=()=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"#FFFFFF"},l.createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"}),l.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})),O=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(L,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!=s&&null!==(r=s.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(R,{label:d("PT_ADD_REBATE_PENALITY")}),headerBarEnd:l.createElement(O,{onClick:()=>{T(p),S(!1)}}),actionCancelLabel:d("PT_CANCEL"),actionCancelOnSubmit:()=>{T(p),S(!1)},actionSaveLabel:d("PT_ADD"),actionSaveOnSubmit:e=>(e=>{const t=null!=b&&b.adhocPenalty?Number(null==b?void 0:b.adhocPenalty):0,n=null!=b&&b.adhocRebate?Number(null==b?void 0:b.adhocRebate):0;var l,i;if(t||n)if(n>(null==s||null===(l=s.additionalDetails)||void 0===l||null===(i=l.data)||void 0===i?void 0:i.totalAmount))A({isError:!1,isWarning:!0,key:"error",message:d("ERR_WS_REBATE_GREATER_THAN_AMOUNT")});else{var o,r,a,u,c,p,v,f,h,g;const e=null==s||null===(o=s.additionalDetails)||void 0===o||null===(r=o.appDetails)||void 0===r?void 0:r.applicationNo,t=null==s||null===(a=s.additionalDetails)||void 0===a||null===(u=a.appDetails)||void 0===u?void 0:u.tenantId,n={...null==s||null===(c=s.additionalDetails)||void 0===c||null===(p=c.appDetails)||void 0===p?void 0:p.additionalDetails,...b};s.additionalDetails.appDetails.additionalDetails=n;const l={CalculationCriteria:"WATER"==(null==s||null===(v=s.additionalDetails)||void 0===v||null===(f=v.appDetails)||void 0===f?void 0:f.service)?[{applicationNo:e,tenantId:t,waterConnection:s.additionalDetails.appDetails}]:[{applicationNo:e,tenantId:t,sewerageConnection:s.additionalDetails.appDetails}],isconnectionCalculation:!1};let i="WATER"==(null==s||null===(h=s.additionalDetails)||void 0===h||null===(g=h.appDetails)||void 0===g?void 0:g.service)?"WS":"SW";Digit.WSService.wsCalculationEstimate(l,i).then((e,t)=>{var n,l,i,o,r,a,u,s,c,d,p,v,f,h,g;(null==e||null===(n=e.Calculation)||void 0===n||null===(l=n[0])||void 0===l||null===(i=l.taxHeadEstimates)||void 0===i?void 0:i.length)>0&&(null==e||null===(f=e.Calculation)||void 0===f||null===(h=f[0])||void 0===h||null===(g=h.taxHeadEstimates)||void 0===g||g.forEach(e=>e.amount=e.estimateAmount)),e.Calculation[0].billSlabData=_.groupBy(null==e||null===(o=e.Calculation)||void 0===o||null===(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}];E(Mn(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:Nl,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,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocPenaltyComment",value:(null==b?void 0:b.adhocPenaltyComment)||"",onChange:e=>k("adhocPenaltyComment",!1,e)},w={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,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocPenalty",value:(null==b?void 0:b.adhocPenalty)||"",onChange:e=>k("adhocPenalty",!1,e)},w={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:Pl,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===(u=b.adhocRebateReason_data)||void 0===u?void 0:u.title)&&l.createElement("div",{className:"field"},l.createElement(t.CardLabel,null,d("PT_REASON")),l.createElement(t.TextInput,c({style:{background:"#FAFAFA"},t:d,type:"text",isMandatory:!1,name:"adhocRebateComment",value:(null==b?void 0:b.adhocRebateComment)||"",onChange:e=>k("adhocRebateComment",!1,e)},w={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,c({style:{background:"#FAFAFA"},t:d,type:"number",isMandatory:!1,name:"adhocRebate",value:(null==b?void 0:b.adhocRebate)||"",onChange:e=>k("adhocRebate",!1,e)},w={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})))},Il=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"})))},wl=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(Il,{style:{display:"inline",marginBottom:"5px"}})," "+n(a),l.createElement("div",null," "+n(u)))))},Rl=e=>{var o,r,a,u,s,c,d;let{wsAdditionalDetails:p}=e;const{t:m}=i.useTranslation(),[v,f]=n.useState(!1),[E,h]=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),h(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==E||null===(r=E.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==E?void 0:E.fee)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),l.createElement(t.CardSectionHeader,{style:{margin:"10px 0px"}},m("WS_SERVICE_FEE_HEADER")),null==E||null===(u=E.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==E?void 0:E.charge)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}}),null==E||null===(c=E.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==E?void 0:E.totalAmount)||0),textStyle:{textAlign:"right",fontWeight:"700",fontSize:"24px"}})))))},Ll={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:{}},Ol=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:Ll.root},l.createElement("table",{className:"table-fixed-column-common-pay",style:Ll.table},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",{style:{...Ll.cell,...Ll.cellLeft,...Ll.cellHeader}},a("CS_BILL_PERIOD")),n.map((e,t)=>l.createElement("th",{style:{...Ll.cell,...n.length==t+1?Ll.cellRight:{},...Ll.cellHeader},key:t},a(e))))),l.createElement("tbody",null,Object.values(o).map((e,t)=>l.createElement("tr",{key:t},l.createElement("td",{style:{...Ll.cell,...Ll.cellLeft},component:"th",scope:"row"},Object.keys(o)[t]),n.map((t,i)=>l.createElement("td",{style:{...Ll.cell,textAlign:"left",...n.length==i+1?Ll.cellRight:{},whiteSpace:"pre"},key:i,numeric:!0},i>1&&"₹",e[t]&&e[t].value||"0")))),l.createElement("tr",null,l.createElement("td",{style:{...Ll.cell,...Ll.cellLeft}}),n.map((e,t)=>t==n.length-1?l.createElement("td",{style:{...Ll.cell,...Ll.cellRight,textAlign:"left",fontWeight:"700",whiteSpace:"pre"},key:t,numeric:!0},r):t==n.length-2?l.createElement("td",{style:{...Ll.cell,textAlign:"left"},key:t,numeric:!0},a("COMMON_ARREARS_TOTAL")):l.createElement("td",{style:Ll.cell,key:t,numeric:!0})))))))},kl={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))"}},Fl=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 m={};!s||Object.keys(s).map((e,t)=>{Object.keys(s[e]).map(t=>{m[t]=s[e]&&s[e][t]&&s[e][t].order||0})});let v=[];v=Object.keys(m),v.sort((e,t)=>m[e]-m[t]);const[f,E]=n.useState(!1);return 0==d||d<0?l.createElement("span",null):l.createElement(l.Fragment,null,l.createElement("div",{style:kl.headerStyle},u("CS_ARREARS_DETAILS")),f&&l.createElement(Ol,{headers:[...v],values:s,arrears:p}),!f&&l.createElement("div",{style:kl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!0)}},u("CS_SHOW_CARD"))),f&&l.createElement("div",{style:kl.buttonStyle},l.createElement("button",{type:"button",onClick:()=>{E(!1)}},u("CS_HIDE_CARD"))))},Ml=e=>{let{assessmentData: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"}},"Assessment History"),l.createElement("span",{style:{fontSize:"1.2em"}},i?"<":">"))),i&&l.createElement("div",{className:"accordion-body",style:{padding:" 15px",backgroundColor:"#fff"}},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:()=>alert("Re-assessing "+e.number)},"Re-assess"),"          ",l.createElement("button",{style:{display:"flex",borderRadius:"8px",border:"1px solid red",padding:"10px"},onClick:()=>alert("Cancelled "+e.number)},"Cancel"),"        ")),n!==t.length-1&&l.createElement("hr",null)))))},Bl=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},Ul=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 Hl(e){var r,a,u,s,c,d,p,m,v,f,E,h,g,y,S,b;let{applicationDetails:T,demandData:C,workflowDetails:A,isDataLoading:D,applicationData:N,timelineStatusPrefix:P,showTimeLine:x=!0,statusAttribute:I="status",paymentsList:w,oldValue:R,isInfoLabel:L=!1,propertyId:O}=e;const{t:k}=i.useTranslation(),F=o.useHistory(),M=Digit.ULBService.getCurrentTenantId(),[B,U]=n.useState(null),[H,j]=n.useState([]);let W=window.location.href.includes("editApplication")&&window.location.href.includes("bpa");function z(e,t,n){var l;window.open(null==n||null===(l=n.fullImage)||void 0===l?void 0:l[0],"_blank")}console.log("appl",T);const[V,$]=n.useState({}),[q,G]=n.useState(),[Y,K]=n.useState([]),[X,Z]=n.useState({loading:!1,loaded:!1,canLoad:!1});"ACTIVE"!=(null==N?void 0:N.status)||X.loading||X.loaded||X.canLoad||Z({loading:!1,loaded:!1,canLoad:!0}),null==X||!X.canLoad||X.loading||X.loaded||(Z({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){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 K(o),console.log(o),G(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==N?void 0:N.tenantId)||M,null==N?void 0:N.propertyId,$,Z));const J=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()}`},Q=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:J(null==N||null===(i=N.auditDetails)||void 0===i?void 0:i.createdTime),source:(null==N?void 0:N.channel)||""};return l.createElement(Tl,{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,E,h,g,y,S,b,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==T?void 0:T.tenantId,businessIds:null==T?void 0:T.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}}},A=n[t-1],D={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==N||null===(c=N.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!=N&&null!==(f=N.processInstance)&&void 0!==f&&null!==(E=f.assignes)&&void 0!==E&&null!==(h=E[0])&&void 0!==h&&h.mobileNumber?null==N||null===(g=N.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===(C=b[0])||void 0===C?void 0:C.mobileNumber,comment:k(null==e?void 0:e.comment),wfComment:A?A.wfComment:[],thumbnailsToShow:null==e?void 0:e.thumbnailsToShow};return l.createElement(Tl,{data:D,OpenImage:z,privacy:i})}{var A,D,P,x,I;const t={date:J(null==N||null===(A=N.auditDetails)||void 0===A?void 0:A.lastModifiedTime),name:null==e||null===(D=e.assignes)||void 0===D||null===(P=D[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===(I=x[0])||void 0===I?void 0:I.mobileNumber};return l.createElement(Tl,{data:t})}},ee=(e,t)=>e?t?e:k(e):k("NA"),te=window.location.href.includes("employee/tl")||window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc"),ne=window.location.href.includes("employee/noc"),le=window.location.href.includes("employee/obps"),ie=(window.location.href.includes("employee/ws"),()=>window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{justifyContent:"space-between",fontSize:"16px",lineHeight:"19px",color:"#0B0C0C"}:{}),oe=e=>null!=e&&e.skip?e.value:null!=e&&e.isUnit?null!=e&&e.value?`${ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated)} ${k(null==e?void 0:e.isUnit)}`:k("N/A"):null!=e&&e.value?ee(null==e?void 0:e.value,null==e?void 0:e.isNotTranslated):k("N/A"),[re,ae]=n.useState(!1);console.log("demand Data arr",C),null==C||C.reduce((e,t)=>e+t.demandInterest,0),null==C||C.reduce((e,t)=>e+t.demandPenality,0),null==C||C.reduce((e,t)=>e+t.collectionTax,0),null==C||C.reduce((e,t)=>e+t.collectionInterest,0),null==C||C.reduce((e,t)=>e+t.collectionPenality,0),null==C||C.reduce((e,t)=>e+t.balanceTax,0),null==C||C.reduce((e,t)=>e+t.balanceInterest,0),null==C||C.reduce((e,t)=>e+t.balancePenality,0);const ue=function(e,t,n){try{if(!window.confirm(`Are you sure you want to make this property ${t}?`))return Promise.resolve();const l={...e,status:t,isactive:"ACTIVE"===t,isinactive:"INACTIVE"===t,creationReason:"STATUS",additionalDetails:{...e.additionalDetails,propertytobestatus:t},workflow:{...e.workflow,businessService:"PT.CREATE",action:"OPEN",moduleName:"PT"}};return Promise.resolve(Digit.PTService.updatePT({Property:{...l}},M,n)).then(function(e){console.log("response from inactive/active",e)})}catch(e){return Promise.reject(e)}},se=null==T?void 0:T.applicationData,ce=(null==T||null===(r=T.applicationData)||void 0===r?void 0:r.propertyId)||"",de=null==T||null===(a=T.additionalDetails)||void 0===a?void 0:a.propertytobestatus;return console.log("applicationDetails?.applicationDetails",T),console.log("infolabel",L),console.log("assessment details",q),n.useEffect(()=>{try{Digit.PTService.paymentsearch({tenantId:M,filters:{consumerCodes:O},auth:!0}).then(e=>{j(null==e?void 0:e.Payments),console.log(e)})}catch(e){console.log(e)}},[]),l.createElement(t.Card,{style:{position:"relative"},className:"employeeCard-override"},L?l.createElement(wl,{t:k,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==T||null===(u=T.applicationDetails)||void 0===u?void 0:u.map((e,i)=>{var r,a,u,s,c,d,p,m,v,f,E,h,g,y,_,S,b,C,D,N,P,x,I,L,O,F,M,B,U,H,j,z,$,q,G,Y,K,X;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"}:te?{lineHeight:"19px",maxWidth:"600px",minWidth:"280px"}:{}},0!==i||e.asSectionHeader?l.createElement(l.Fragment,null,l.createElement(t.CardSectionHeader,{style:0==i&&te?{marginBottom:"16px",fontSize:"24px"}:{marginBottom:"16px",marginTop:"32px",fontSize:"24px"}},ne?""+k(e.title):k(e.title),null!=e&&e.Component?l.createElement(e.Component,null):null)):l.createElement(t.CardSubHeader,{style:{marginBottom:"16px",fontSize:"24px"}},k(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"}},k(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"}},k(e))))):l.createElement("tr",null,t.map(e=>l.createElement("td",{style:{paddingTop:"20px",textAlign:"left"}},k(e)))))),l.createElement(t.StatusTable,{style:window.location.href.includes("employee/obps")||window.location.href.includes("employee/noc")||te?{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:k(n.title),label:k(n.title),text:l.createElement("img",{src:k(n.value),alt:"",privacy:null==n?void 0:n.privacy})}):1==(null==n?void 0:n.isLink)?l.createElement(t.Row,{key:k(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"}},k(null==n?void 0:n.title)))):ne||le?""+k(n.title):k(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:ie(),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:""+k(""+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:k(n.title),label:k(n.title),text:oe(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:ie(),labelStyle:{wordBreak:"break-all"},textStyle:{wordBreak:"break-all"}}),"PT_TOTAL_DUES"===n.title?l.createElement(Fl,{bill:null===(a=V.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(_l,{scrutinyDetails:null==e?void 0:e.additionalDetails,paymentsList:w,additionalDetails:null==T||null===(u=T.applicationData)||void 0===u?void 0:u.additionalDetails,applicationData:null==T?void 0:T.applicationData}),(null==T||null===(s=T.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(ml,{fiReport:null==T||null===(m=T.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(gl,{floors:null==e||null===(E=e.additionalDetails)||void 0===E?void 0:E.floors}),(null==e||null===(h=e.additionalDetails)||void 0===h?void 0:h.owners)&&l.createElement(yl,{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(Al,{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(Cl,{units:null==e||null===(b=e.additionalDetails)||void 0===b?void 0:b.accessories}),!W&&(null==e||null===(C=e.additionalDetails)||void 0===C?void 0:C.permissions)&&(null==A||null===(D=A.data)||void 0===D||null===(N=D.nextActions)||void 0===N?void 0:N.length)>0&&l.createElement(El,{applicationData:null==T?void 0:T.applicationData,t:k,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(dl,{t:k,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.obpsDocuments,bpaActionsDetails:A})),(null==e||null===(I=e.additionalDetails)||void 0===I?void 0:I.noc)&&l.createElement(fl,{t:k,isNoc:!0,NOCdata:e.values,applicationData:null==T?void 0:T.applicationData,docs:e.additionalDetails.noc,noc:null===(L=e.additionalDetails)||void 0===L?void 0:L.data,bpaActionsDetails:A}),(null==e||null===(O=e.additionalDetails)||void 0===O?void 0:O.scruntinyDetails)&&l.createElement(_l,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(F=e.additionalDetails)||void 0===F?void 0:F.buildingExtractionDetails)&&l.createElement(_l,{scrutinyDetails:null==e?void 0:e.additionalDetails}),(null==e||null===(M=e.additionalDetails)||void 0===M?void 0:M.subOccupancyTableDetails)&&l.createElement(Sl,{edcrDetails:null==e?void 0:e.additionalDetails,applicationData:null==T?void 0:T.applicationData}),(null==e||null===(B=e.additionalDetails)||void 0===B?void 0:B.documentsWithUrl)&&l.createElement(cl,{documents:null==e||null===(U=e.additionalDetails)||void 0===U?void 0:U.documentsWithUrl}),(null==e||null===(H=e.additionalDetails)||void 0===H?void 0:H.taxHeadEstimatesCalculation)&&l.createElement(hl,{taxHeadEstimatesCalculation:null==e||null===(j=e.additionalDetails)||void 0===j?void 0:j.taxHeadEstimatesCalculation}),(null==e?void 0:e.isWaterConnectionDetails)&&l.createElement(Dl,{wsAdditionalDetails:e,oldValue:R}),(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===($=e.additionalDetails)||void 0===$||null===(q=$.redirectUrl)||void 0===q?void 0:q.url},l.createElement("span",{className:"link",style:{color:"#a82227"}},null==e||null===(G=e.additionalDetails)||void 0===G||null===(Y=G.redirectUrl)||void 0===Y?void 0:Y.title))),(null==e||null===(K=e.additionalDetails)||void 0===K?void 0:K.estimationDetails)&&l.createElement(xl,{wsAdditionalDetails:e,workflowDetails:A}),(null==e||null===(X=e.additionalDetails)||void 0===X?void 0:X.estimationDetails)&&l.createElement(Rl,{wsAdditionalDetails:e,workflowDetails:A}))}),(null==q?void 0:q.length)>0&&l.createElement(Ml,{assessmentData:Y}),l.createElement(Ul,{payments:H}),l.createElement(Bl,{applicationData:null==T?void 0:T.applicationData}),x&&(null==A||null===(s=A.data)||void 0===s||null===(c=s.timeline)||void 0===c?void 0:c.length)>0&&l.createElement(l.Fragment,null,l.createElement(t.BreakLine,null),((null==A?void 0:A.isLoading)||D)&&l.createElement(t.Loader,null),!(null!=A&&A.isLoading)&&!D&&l.createElement(n.Fragment,null,l.createElement("div",{id:"timeline"},l.createElement(t.CardSectionHeader,{style:{marginBottom:"16px",marginTop:"32px"}},k("ES_APPLICATION_DETAILS_APPLICATION_TIMELINE")),null!=A&&null!==(d=A.data)&&void 0!==d&&d.timeline&&1===(null==A||null===(p=A.data)||void 0===p||null===(m=p.timeline)||void 0===m?void 0:m.length)?l.createElement(t.CheckPoint,{isCompleted:!0,label:k(`${P}${null==A||null===(v=A.data)||void 0===v||null===(f=v.timeline[0])||void 0===f?void 0:f.state}`),customChild:Q(null==A||null===(E=A.data)||void 0===E?void 0:E.timeline[0],null==A||null===(h=A.data)||void 0===h?void 0:h.timeline)}):l.createElement(t.ConnectingCheckPoints,null,(null==A||null===(g=A.data)||void 0===g?void 0:g.timeline)&&(null==A||null===(y=A.data)||void 0===y?void 0:y.timeline.slice(0,re?null==A?void 0:A.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!=A&&null!==(a=A.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!=A&&null!==(c=A.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:k(`${P}${"REOPEN"===(null==e?void 0:e.performedAction)?null==e?void 0:e.performedAction:null==e?void 0:e[I]}${r}`),customChild:Q(e,n,null==A||null===(o=A.data)||void 0===o?void 0:o.timeline)}))}))),(null==A||null===(S=A.data)||void 0===S||null===(b=S.timeline)||void 0===b?void 0:b.length)>2&&l.createElement(t.LinkButton,{label:k(re?"COLLAPSE":"VIEW_TIMELINE"),onClick:()=>{ae(e=>!e)}})))),window.location.href.includes("/pt/")?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("employee")?"INACTIVE"==de?ue(se,"ACTIVE",ce):alert("Property is already active."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Make Property Inactive",style:{marginLeft:"20px"},onSubmit:()=>{window.location.href.includes("employee")?"ACTIVE"==de?ue(se,"INACTIVE",ce):alert("Property is already inactive."):alert("You are not authorized to change the property status.")}}),l.createElement(t.SubmitBar,{label:"Edit Property",style:{marginLeft:"20px"},onSubmit:()=>{var e;const t=null==T||null===(e=T.applicationData)||void 0===e?void 0:e.propertyId;if(t)if(window.location.href.includes("employee")){var n,l,i;if("INACTIVE"===(null==T||null===(n=T.applicationData)||void 0===n?void 0:n.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==T||null===(l=T.applicationData)||void 0===l?void 0:l.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==T||null===(i=T.applicationData)||void 0===i?void 0:i.status)&&F.push({pathname:"/digit-ui/employee/pt/edit-application/"+t})}else{var o,r,a;if("INACTIVE"===(null==T||null===(o=T.applicationData)||void 0===o?void 0:o.status))return void alert("Property is inactive, cannot edit.");if("INWORKFLOW"===(null==T||null===(r=T.applicationData)||void 0===r?void 0:r.status))return void alert("Property is in workflow, cannot edit.");"ACTIVE"===(null==T||null===(a=T.applicationData)||void 0===a?void 0:a.status)&&F.push({pathname:"/digit-ui/citizen/pt/property/edit-application/"+t})}}}),l.createElement(t.SubmitBar,{label:"Access Property",style:{marginLeft:"20px"},onSubmit:()=>{alert("access property")}})):l.createElement("div",null),B&&l.createElement(t.Toast,{error:B.isError,label:k(B.label),onClose:()=>{U(null)},isDleteBtn:"false"}))}function jl(e){var n,i,o,r,a,u,s,c,d,p,m,v,f,E,h,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===(E=b.error)||void 0===E?void 0:E.message:e(["BPA_APPROVAL_REJECTED_MESSAGE_HEAD","BPA_OC_APPROVAL_REJECTED_MESSAGE_HEAD"]);break;case"FORWARD":n="error"===(null==b?void 0:b.key)?null==b||null===(h=b.error)||void 0===h?void 0:h.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 Wl(e){var o,r,a,u,s,c,d,p,m,v,f,E,h,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 I=Digit.UserService.getUser();const w=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):{};I=null==t?void 0:t.value}const R=null===(o=I)||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,O=!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==R?void 0:R.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==R?void 0:R.some(t=>{var n;return null===(n=e.roles)||void 0===n?void 0:n.includes(t)}))||!e.roles));return Digit.Hooks.useClickOutside(w,()=>{C(!1)},b),(window.location.href.includes("/obps")||window.location.href.includes("/noc"))&&1==(null==k?void 0:k.length)||null!=k&&null!==(m=k[0])&&void 0!==m&&null!==(v=m.redirectionUrl)&&void 0!==v&&v.pathname.includes("/pt/property-details/")&&1==(null==k?void 0:k.length)?(O=!1,L=!0):(null==k?void 0:k.length)>0&&(O=!0,L=!1),l.createElement(l.Fragment,null,!(null!=S&&S.isLoading)&&O&&!L&&l.createElement(t.ActionBar,{style:{...N}},b&&(null!=S&&null!==(f=S.data)&&void 0!==f&&null!==(E=f.actionState)&&void 0!==E&&E.nextActions||null!=S&&null!==(h=S.data)&&void 0!==h&&h.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:w,label:x("WF_TAKE_ACTION"),onSubmit:()=>C(!b)})),!(null!=S&&S.isLoading)&&!O&&L&&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 zl=()=>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"})),Vl=e=>l.createElement("div",{className:"icon-bg-secondary",onClick:e.onClick},l.createElement(zl,null));function $l(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(Vl,{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 ql=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:m}=i.useTranslation(),v=o.useHistory();let{id:f}=o.useParams();const[E,h]=n.useState(!1),[g,y]=n.useState(null),[_,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:I,totalBalanceTax:w,showToast:R,setShowToast:L,isLoading:O,isDataLoading:k,applicationData:F,mutate:M,nocMutation:B,workflowDetails:U,id:H,businessService:j,closeToast:W,moduleCode:z,timelineStatusPrefix:V,forcedActionPrefix:$,statusAttribute:q,ActionBarStyle:G,MenuStyle:Y,paymentsList:K,showTimeLine:X=!0,oldValue:Z,isInfoLabel:J=!1,clearDataDetails:Q,propertyId:ee}=e;n.useEffect(()=>{R&&U.revalidate()},[R]);const te=a.useQueryClient(),ne=()=>{y(null),b(!1)};return O||T?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,O?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(Hl,{applicationDetails:P,demandData:x,id:H,workflowDetails:U,isDataLoading:k,applicationData:F,totalDemandTax:I,totalBalanceTax:w,businessService:j,timelineStatusPrefix:V,statusAttribute:q,paymentsList:K,showTimeLine:X,oldValue:Z,isInfoLabel:J,propertyId:ee}),_?l.createElement(sl,{t:m,action:g,tenantId:c,state:d,id:f,applicationDetails:P,applicationData:null==P?void 0:P.applicationData,closeModal:ne,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,E,h,y,_,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===(E=f[0])||void 0===E||null===(h=E.comment)||void 0===h?void 0:h.length))||0==(null==e||null===(y=e.WaterConnection)||void 0===y||null===(_=y.comment)||void 0===_?void 0:_.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(m("Please fill in the validity before submitting")):alert(m("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;M&&(C(!0),M(e,{onError:(e,t)=>{C(!1),L({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=g,v.replace("/digit-ui/employee/obps/response",{data:e})),null!==(i=n)&&void 0!==i&&i.isStakeholder&&(e.selectedAction=g,v.push("/digit-ui/employee/obps/stakeholder-response",{data:e})),null!==(o=n)&&void 0!==o&&o.isNoc&&v.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,E,h,y;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:m("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:m("ES_MODIFYSWCONNECTION_RE_SUBMIT_UPDATE_SUCCESS")}):null!=t&&null!==(f=t.AmendmentUpdate)&&void 0!==f&&null!==(E=f.workflow)&&void 0!==E&&E.action.includes("APPROVE")?L({key:"success",label:m("ES_MODIFYSWCONNECTION_APPROVE_UPDATE_SUCCESS")}):null!=t&&null!==(h=t.AmendmentUpdate)&&void 0!==h&&null!==(y=h.workflow)&&void 0!==y&&y.action.includes("REJECT")&&L({key:"success",label:m("ES_MODIFYWSCONNECTION_REJECT_UPDATE_SUCCESS")})}else{var _,S,b;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 null!=e&&null!==(_=e.Licenses[0])&&void 0!==_&&null!==(S=_.businessService)&&void 0!==S&&S.includes("BPAREG")?(L({key:"success",action:g}),e.selectedAction=g,void v.push("/digit-ui/employee/obps/stakeholder-response",{data:e})):(L({key:"success",action:g}),void v.replace("/digit-ui/employee/tl/application-details/"+(null==e||null===(b=e.Licenses[0])||void 0===b?void 0:b.applicationNumber)));L({key:"success",action:g}),Q&&setTimeout(Q,3e3),setTimeout(W,5e3),te.clear(),te.refetchQueries("APPLICATION_SEARCH")}}})),ne()}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=S(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,v;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?m(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===(v=p[0])||void 0===v?void 0:v.message)||e;ne(),L({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(m("Please select Blocking reason"))}();if(i&&i.then)return i.then(function(){})}}();return Promise.resolve(i&&i.then?i.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},actionData:null==U||null===(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($l,{action:g,workflowDetails:U,businessService:j,isWarningPop:A,closeWarningPopup:()=>{D(!1)}}):null,l.createElement(jl,{t:m,showToast:R,closeToast:W,businessService:j}),l.createElement("div",null,s?l.createElement(t.SubmitBar,{style:{marginRight:20},label:m("BPA_EDIT_UPDATE"),onSubmit:function(e){try{return Promise.resolve(Digit.OBPSService.BPASearch(c,{applicationNo:null==F?void 0:F.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,v){if(!(parseInt(sessionStorage.getItem("lessAdjusment"))>parseInt(sessionStorage.getItem("development"))+parseInt(sessionStorage.getItem("otherCharges"))+parseInt(null==u||null===(e=u.BPA)||void 0===e||null===(t=e.additionalDetails)||void 0===t||null===(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===(v=p.selfCertificationCharges)||void 0===v?void 0:v.BPA_GAUSHALA_CHARGES_CESS)))return Promise.resolve(Digit.OBPSService.update(u,c)).then(function(e){window.location.assign(window.location.href.split("/editApplication")[0]+window.location.href.split("editApplication")[1])});alert(m("Enterd Less Adjustment amount is invalid"))}();if(s&&s.then)return s.then(function(){})})}catch(e){return Promise.reject(e)}},id:!0}):!(window.location.href.includes("citizen")&&window.location.href.includes("/pt/"))&&l.createElement(Wl,{workflowDetails:U,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]);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))v.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;v.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,m;v.push({pathname:null===(p=e.redirectionUrl)||void 0===p?void 0:p.pathname,state:{...null===(m=e.redirectionUrl)||void 0===m?void 0:m.state}})}else b(!0);y(e),h(!1)},setDisplayMenu:h,businessService:j,forcedActionPrefix:$,ActionBarStyle:G,MenuStyle:Y}))))};var Gl=l.memo(()=>{var e,r,a,u,s,c,d,p,v,f,E,h,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),[R,L]=n.useState("ptr");console.log("gggggg",D),sessionStorage.setItem("applicationNoinAppDetails",T);const{isLoading:O,data:F}=Digit.Hooks.ptr.usePtrApplicationDetail(y,S,T),{mutate:M}=Digit.Hooks.ptr.usePTRApplicationAction(S);let B=Digit.Hooks.useWorkflowDetails({tenantId:(null==F||null===(e=F.applicationData)||void 0===e?void 0:e.tenantId)||S,id:null==F||null===(r=F.applicationData)||void 0===r||null===(a=r.applicationData)||void 0===a?void 0:a.applicationNumber,moduleCode:R,role:"PT_CEMP"});var U,H;console.log("workkkkflooowowow",B),Digit.Hooks.ptr.usePTRSearch({tenantId:S,filters:{applicationNumber:T,audit:!0}}),n.useEffect(()=>{F&&N(m.cloneDeep(F))},[F]),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"===R||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===(d=c.nextActions)||void 0===d||!d.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(k(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===(p=D.applicationData)||void 0===p||null===(v=p.applicationData)||void 0===v?void 0:v.applicationNumber,isEmployee:!1},{enabled:!(null==D||null===(f=D.applicationData)||void 0===f||null===(E=f.applicationData)||void 0===E||!E.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===(h=W.Payments[0])||void 0===h?void 0:h.instrumentStatus)&&j.push({label:y("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(S,{PetRegistrationApplications:[null==F||null===(e=F.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(ql,{applicationDetails:null==D?void 0:D.applicationData,isLoading:O,isDataLoading:O,applicationData:null==D||null===(g=D.applicationData)||void 0===g?void 0:g.applicationData,mutate:M,workflowDetails:B,businessService:R,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 Yl=(e,t,n,l,i)=>i(`${l?"E":"C"}S_PTR_RESPONSE_${t||"CREATE"}_${e}${n?"":"_ERROR"}`),Kl=(e,t,n,l)=>Yl("LABEL",e,t,n,l),Xl=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,Yl("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:Kl((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})},Zl=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:Zl(e),applicationNumber:"",style:e.isMobile?{width:"unset"}:{width:"740px"},successful:null==e?void 0:e.isSuccess}),Ql={step:1,isValid:!1,formData:{}},ei=function(e,t){switch(void 0===e&&(e=Ql),t.type){case"UPDATE_PTRNewApplication_FORM":return{...e,formData:{...e.formData,[t.payload.key]:t.payload.value}};case"SET_PTRNewApplication_STEP":return{...e,step:t.payload};case"RESET_PTR_NEW_APPLICATION_FORM":return Ql;default:return e}},ti=e=>{let{children:t,currentStep:n=1,stepsList:o=[]}=e;const{t:r}=i.useTranslation(),a=e=>{let t;return t=e<=n?"#0D43A7":"#FFFFFF",{width:"60px",height:"60px",borderRadius:"50%",backgroundColor:t,color:e<=n?"white":"black",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"10px",fontWeight:"normal",fontSize:"18px",border:e>n?"1px solid black":"",position:"relative"}},u={fontSize:"18px",color:"#1E1E1E",fontWeight:"500",fontFamily:"Noto Sans,sans-serif",marginRight:"6px"},s={fontSize:"18px",color:"#263238",fontWeight:"400",fontFamily:"Noto Sans,sans-serif",margin:"0px 6px 0px 0px"},c={position:"absolute",width:"2px",height:"50px",backgroundColor:"grey",left:"50%",top:"100%",transform:"translateX(-50%)"},d=(window.Digit.Utils.browser.isMobile(),o.length);return l.createElement("div",{className:"stepper",style:{width:"100%",display:"flex",flexDirection:"row",alignItems:"top",justifyContent:"flex-start"}},l.createElement("div",{className:"stepper-navigation-bar",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",height:"50%",marginBottom:"20px"}},[...Array(d)].map((e,t)=>{return l.createElement("div",{className:"step-content",key:t,style:(i=t+1<=n,{display:"flex",alignItems:"center",justifyContent:"flex-end",flex:1,color:i?"#3f51b5":"#ccc",padding:"10px 10px",width:"260px"})},l.createElement("div",{className:"step-sub-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end",margin:"10px"}},t+1===d?null:l.createElement("div",{className:"step-number",style:s}),l.createElement("div",{className:"step-label",style:u},r(o[t].stepLabel))),l.createElement("div",{className:"step-circle",style:a(t+1)},t+1,t<d-1&&l.createElement("div",{style:c})));var i})),l.createElement("div",{className:"stepper-body",style:{width:"100%",marginBottom:"20px"}},t))},ni=e=>{let{stepsList:t=[],onSubmit:n,step:o,setStep:r}=e;const a=t.filter(e=>e.isStepEnabled),{t:u}=i.useTranslation();function s(){o<a.length?d():o===a.length&&n()}function c(){o>1&&p()}const d=()=>r(o+1),p=()=>r(o-1);return l.createElement(ti,{currentStep:o,nextStep:d,prevStep:p,stepsList:a},(()=>{var e,t;const n=a[o-1],{component:i,key:r,texts:d,currStepConfig:p}=n,m=null===(e=Digit)||void 0===e||null===(t=e.ComponentRegistryService)||void 0===t?void 0:t.getComponent(i);return l.createElement(l.Fragment,null,l.createElement(m,{config:{key:r,texts:d,component:i,currStepNumber:o,currStepConfig:p},onGoNext:s,onBackClick:c,t:u}))})())},li=[{head:"ES_TITILE_OWNER_DETAILS",stepNumber:1,body:[{route:"owners",component:"PTRCitizenDetails",withoutLabel:!0,key:"ownerss",type:"component",nextStep:"pet-details",hideInEmployee:!0,isMandatory:!0}]},{head:"ES_TITILE_PET_DETAILS",stepNumber:2,body:[{route:"pet-details",component:"PTRCitizenPet",withoutLabel:!0,key:"pets",type:"component",isMandatory:!0,hideInEmployee:!0,nextStep:"documents"}]},{head:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,body:[{route:"documents",component:"PTRSelectProofIdentity",withoutLabel:!0,key:"documents",type:"component",nextStep:null}]},{head:"ES_TITILE_AUMMARY_DETAILS",stepNumber:4,body:[{route:"summary",component:"PTRSummary",withoutLabel:!0,key:"summary",type:"component",nextStep:null}]}],ii=(e,t)=>({type:"UPDATE_PTRNewApplication_FORM",payload:{key:e,value:t}}),oi=e=>({type:"SET_PTRNewApplication_STEP",payload:e}),ri=[{head:"OWNER DETAILS",stepLabel:"ES_TITILE_OWNER_DETAILS",stepNumber:1,isStepEnabled:!0,type:"component",component:"NewPTRStepFormOne",key:"ownerDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"PET DETAILS",stepLabel:"ES_TITILE_PET_DETAILS",stepNumber:2,isStepEnabled:!0,type:"component",component:"NewPTRStepFormTwo",key:"petDetails",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"DOCUMENT DETAILS",stepLabel:"ES_TITILE_DOCUMENT_DETAILS",stepNumber:3,isStepEnabled:!0,type:"component",component:"NewPTRStepFormThree",key:"documents",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_NEXT"}},{head:"SUMMARY DETAILS",stepLabel:"ES_TITILE_SUMMARY_DETAILS",stepNumber:4,isStepEnabled:!0,type:"component",component:"NewPTRStepFormFour",key:"summary",withoutLabel:!0,texts:{submitBarLabel:"CS_COMMON_SUBMIT"}}].map(e=>({...e,currStepConfig:li.filter(t=>t.stepNumber===e.stepNumber)}));console.log("updatedCreateEmployeeconfig: ",ri);const ai={PTRCheckPage:e=>{var r,a,u,s;let{onSubmit:c,value:d={}}=e;const{t:p}=i.useTranslation(),{address:m,pets:f,isEditPET:E,isUpdatePET:h,ownerss:g}=(o.useHistory(),d),y=E||h?"edit-application":"new-application",[_,S]=n.useState(!1);return l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(C,{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(v(null==g?void 0:g.applicantName)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/owners`})}),l.createElement(t.Row,{label:p("PTR_FATHER_HUSBAND_NAME"),text:""+p(v(null==g?void 0:g.fatherName)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/owners`})}),l.createElement(t.Row,{label:p("PTR_MOBILE_NUMBER"),text:""+p(v(null==g?void 0:g.mobileNumber)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/owners`})}),l.createElement(t.Row,{label:p("PTR_EMAIL_ID"),text:""+p(v(null==g?void 0:g.emailId)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/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(v(null==f||null===(r=f.petType)||void 0===r?void 0:r.value)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/pet-details`})}),l.createElement(t.Row,{label:p("PTR_SEARCH_BREED_TYPE"),text:""+p(v(null==f||null===(a=f.breedType)||void 0===a?void 0:a.value)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/pet-details`})}),l.createElement(t.Row,{label:p("PTR_PET_NAME"),text:""+p(v(null==f?void 0:f.petName)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/pet-details`})}),l.createElement(t.Row,{label:p("PTR_DOCTOR_NAME"),text:""+p(v(null==f?void 0:f.doctorName)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/pet-details`})}),l.createElement(t.Row,{label:p("PTR_CLINIC_NAME"),text:""+p(v(null==f?void 0:f.clinicName)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/pet-details`})}),l.createElement(t.Row,{label:p("PTR_VACCINATED_DATE"),text:""+p(v(null==f?void 0:f.lastVaccineDate)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/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(v(null==m?void 0:m.doorNo)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/street`})}),l.createElement(t.Row,{label:p("PTR_STREET_NAME"),text:""+p(v(null==m?void 0:m.street)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/street`})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_LINE1"),text:""+p(v(null==m?void 0:m.addressLine1)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/street`})}),l.createElement(t.Row,{label:p("PTR_ADDRESS_PINCODE"),text:""+p(v(null==m?void 0:m.pincode)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/pincode`})}),l.createElement(t.Row,{label:p("MYCITY_CODE_LABEL"),text:""+p(v(null==m||null===(u=m.city)||void 0===u?void 0:u.name)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/address`})}),l.createElement(t.Row,{label:p("PTR_LOCALITY"),text:""+p(v(null==m||null===(s=m.locality)||void 0===s?void 0:s.name)),actionButton:l.createElement(R,{jumpTo:`/digit-ui/citizen/ptr/petservice/${y}/address`})})),l.createElement("br",null),l.createElement(t.CheckBox,{label:p("PTR_FINAL_DECLARATION_MESSAGE"),onChange:()=>{S(!_)},styles:{height:"auto"}})),l.createElement(t.SubmitBar,{label:p("PTR_COMMON_BUTTON_SUBMIT"),onSubmit:c,disabled:!_})))},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:m}=(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(B,{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:M,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=m.find(e=>e.code===t.tenantId);return Promise.resolve(k({...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:P,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),[m,v,f]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_HAPPENED",!1),[E,h,g]=Digit.Hooks.useSessionStorage("EMPLOYEE_MUTATION_SUCCESS_DATA",{});n.useEffect(()=>{v(!1),g()},[]);const y=et;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,m,v,f;const E=[{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===(m=t.address)||void 0===m||null===(v=m.locality)||void 0===v?void 0:v.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:E})},defaultValues:{},onFormValueChange:(e,t,n)=>{u(!Object.keys(n.errors).length)}})},ApplicationDetails:Gl,PTRResponse:e=>{const{t:r}=i.useTranslation(),u=a.useQueryClient(),[s,c]=(o.useHistory(),n.useState(null)),[d,p]=n.useState(null),[m,v]=n.useState(!1),[f,E,h]=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:m,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 E(!0),u.clear(),"CREATE"===(null==e||null===(t=e.PetRegistrationApplications[0])||void 0===t?void 0:t.creationReason)&&v(!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(Xl,{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)=>Yl("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(k({...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: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:E,data:h}=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==h||null===(n=h.Service)||void 0===n?void 0:n.find(e=>{var n;return null==e||null===(n=e.referenceId)||void 0===n?void 0:n.includes(null==t?void 0:t.applicationNumber)});return e(l?"CS_CF_VIEW":"CS_CF_TRACK")}return d||E?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement(t.Header,null,`${e("CS_TITLE_MY_APPLICATIONS")} ${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(U,{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,u,s,c,d,p,m,v,f,E;const{t:h}=i.useTranslation(),{acknowledgementIds:g,tenantId:y}=(o.useHistory(),o.useParams()),[_,S]=n.useState([]),[b,T]=n.useState(!1),[C,A]=n.useState(!1),[D,N]=n.useState(null),{data:P}=Digit.Hooks.useStore.getInitData(),{tenants:I}=P||{},{isLoading:w,data:R}=Digit.Hooks.ptr.usePTRSearch({tenantId:y,filters:{applicationNumber:g}}),[L,O]=n.useState(null),F=ke(R,"PetRegistrationApplications",[]),M=ke(R,"PetRegistrationApplications[0].applicationNumber",[]);let B=F&&F.length>0&&F[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){O(e),j(!1)})}catch(e){return Promise.reject(e)}}()},[y,g]);const{isLoading:W}=Digit.Hooks.ptr.usePTRSearch({tenantId:y,filters:{applicationNumber:M,audit:!0}},{enabled:!0}),{data:z,isLoading:V}=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 $=h("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()];$=`${e.getDate()} ${t} ${e.getFullYear()}`}let G=[];return G.push({label:h("PTR_PET_DOWNLOAD_ACK_FORM"),onClick:()=>function(){try{const e=U||{},t=I.find(t=>t.code===e.tenantId);return Promise.resolve(k({...e},t,h)).then(function(e){Digit.Utils.pdf.generate(e)})}catch(e){return Promise.reject(e)}}()}),z&&(null==z?void 0:z.Payments.length)>0&&0==V&&G.push({label:h("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:h("PTR_CERTIFICATE"),onClick:()=>function(){try{var e;return Promise.resolve(Digit.PaymentService.generatePdf(y,{PetRegistrationApplications:[null==R||null===(e=R.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"}},h("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:h("PTR_APPLICATION_NO_LABEL"),text:null==B?void 0:B.applicationNumber})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("PTR_ADDRESS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:h("PTR_PINCODE"),text:(null==B||null===(a=B.address)||void 0===a?void 0:a.pincode)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_CITY"),text:(null==B||null===(u=B.address)||void 0===u?void 0:u.city)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_STREET_NAME"),text:(null==B||null===(s=B.address)||void 0===s?void 0:s.street)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_HOUSE_NO"),text:(null==B||null===(c=B.address)||void 0===c?void 0:c.doorNo)||h("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("PTR_APPLICANT_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:h("PTR_APPLICANT_NAME"),text:(null==B?void 0:B.applicantName)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_FATHER/HUSBAND_NAME"),text:(null==B?void 0:B.fatherName)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_APPLICANT_MOBILE_NO"),text:(null==B?void 0:B.mobileNumber)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_APPLICANT_EMAILID"),text:(null==B?void 0:B.emailId)||h("CS_NA")})),l.createElement(t.CardSubHeader,{style:{fontSize:"24px"}},h("PTR_PET_DETAILS_HEADER")),l.createElement(t.StatusTable,null,l.createElement(t.Row,{className:"border-none",label:h("PTR_PET_TYPE"),text:(null==B||null===(d=B.petDetails)||void 0===d?void 0:d.petType)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_BREED_TYPE"),text:(null==B||null===(p=B.petDetails)||void 0===p?void 0:p.breedType)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_DOCTOR_NAME"),text:(null==B||null===(m=B.petDetails)||void 0===m?void 0:m.doctorName)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_CLINIC_NAME"),text:(null==B||null===(v=B.petDetails)||void 0===v?void 0:v.clinicName)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_VACCINATED_DATE"),text:(null==B||null===(f=B.petDetails)||void 0===f?void 0:f.lastVaccineDate)||h("CS_NA")}),l.createElement(t.Row,{className:"border-none",label:h("PTR_VACCINATION_NUMBER"),text:(null==B||null===(E=B.petDetails)||void 0===E?void 0:E.vaccinationNumber)||h("CS_NA")})),l.createElement(x,{application:U,id:null==U?void 0:U.applicationNumber,userType:"citizen"}),D&&l.createElement(t.Toast,{error:D.key,label:h(D.label),style:{bottom:"0px"},onClose:()=>{N(null)}})),C&&l.createElement(PTCitizenFeedbackPopUp,{setpopup:A,setShowToast:N,data:R})))},SelectOtp:e=>{let{config:i,otp:o,onOtpChange:r,onResend:a,onSelect:u,t:s,error:c,userType:d="citizen",canSubmit:p}=e;const[m,v]=n.useState(30),f={type:"register"},[E,h]=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])}(()=>{v(m-1)},m>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=>g(e))})}return Promise.resolve()}catch(e){return Promise.reject(e)}},[]);const g=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(_({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])),h(!0),setTimeout(()=>{window.location.href=window.location.href.split("/otp")[0]},3e3))})}catch(e){return Promise.reject(e)}},y=()=>{a(),v(30)},_=function(e){return Promise.resolve(S(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}),m>0?l.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${m} ${s("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:y},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}),m>0?l.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${m} ${s("CS_RESEND_SECONDS")}`):l.createElement("p",{style:{cursor:"pointer"},className:"card-text-button",onClick:y},s("CS_RESEND_OTP")),!c&&l.createElement(t.CardLabelError,null,s("CS_INVALID_OTP")),!E&&l.createElement(t.CardLabelError,{style:{cursor:"pointer"}},s("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()),E=(Digit.Hooks.useStore.getInitData(),window.Digit.Utils.browser.isMobile());return l.createElement("form",null,l.createElement(t.Card,{style:E?{padding:"unset"}:{}},l.createElement(Jl,{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:E,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,u,s;let{popup:c=!1,onClose:d,setShowToast:p,data:m}=e;const{t:v}=i.useTranslation(),f=o.useHistory(),E=Digit.UserService.getUser();let{redirectedFrom:h,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,I]=n.useState(0);if(D)return l.createElement(t.Loader,null);const w=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==h?void 0:h.includes(null==e?void 0:e.screenfrom))||(null==e||null===(t=e.bussinessService)||void 0===t?void 0:t.includes(null==m||null===(n=m.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,v(w("Header"))||v("PT_RATE_HELP_TEXT")),c&&l.createElement("span",{style:{marginTop:"8px"},onClick:()=>d(!1)},l.createElement(t.CloseSvg,null))),l.createElement(t.CardText,null,v(w("Text"),{acknowldgementNumber:y||(null==m||null===(r=m.Properties)||void 0===r||null===(a=r[0])||void 0===a?void 0:a.acknowldgementNumber),propertyId:g||(null==m||null===(u=m.Properties)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.propertyId)})||v("PT_RATE_TEXT")),l.createElement(t.Rating,{styles:{justifyContent:"center"},currentRating:x,maxRating:5,onFeedback:(e,t,n)=>{I(n)}}),0!==x&&l.createElement("div",null,l.createElement(t.CardLabel,null,v((null==A||null===(R=A.headerByRating)||void 0===R||null===(L=R.filter(e=>x>=(null==e?void 0:e.minvalue)&&x<=(null==e?void 0:e.maxvalue)))||void 0===L||null===(O=L[0])||void 0===O?void 0:O.code)||v("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"}},v("CS_MIN_LENGTH_64"))),l.createElement(t.SubmitBar,{label:v("PT_SUBMIT"),onSubmit:()=>{var e,t,n,l;let i={},o={tenantId:(null==m||null===(e=m.Properties)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.tenantId)||S,code:["PT_"+(null!=h&&h.includes("payment")?"PAYMENT":_||(null==m||null===(n=m.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,v,h,_,T,C,A,D;(null==e||null===(n=e.ServiceDefinition)||void 0===n?void 0:n.length)>0&&(i={tenantId:(null==m||null===(l=m.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==m||null===(u=m.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==m||null===(v=m.Properties)||void 0===v||null===(h=v[0])||void 0===h||null===(_=h.address)||void 0===_||null===(T=_.locality)||void 0===T?void 0:T.code)||""},accountId:null==E||null===(C=E.info)||void 0===C?void 0:C.uuid},i={...i,referenceId:y||(null==m||null===(A=m.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"},v("CS_GO_BACK_HOME"))))));var R,L,O},PTRPetdetails:e=>{let{config:t,onSelect:r,formData:a,setError:u,formState:s,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()}])),[f,h]=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:f,allOwners:m,setFocusIndex:h,formData:a,formState:s,setPets:v,t:p,setError:u,clearErrors:d,config:t,menu:S,breed_type:b,pet_sex:C};return l.createElement(l.Fragment,null,m.map((e,t)=>l.createElement(E,c({key:e.key,index:t,pets:e},A))))},PTROwnerDetails:e=>{let{config:t,onSelect:r,formData:a,setError:u,formState:s,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:s,setOwners:v,t:p,setError:u,clearErrors:d,config:t};return l.createElement(l.Fragment,null,m.map((e,t)=>l.createElement(h,c({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:m}=o.useLocation(),v=o.useHistory(),f=Digit.ULBService.getStateId();let E=[];const[h,g,y]=Digit.Hooks.useSessionStorage("PTR_CREATE_PET",{});let{data:_,isLoading:S}=Digit.Hooks.pt.useMDMS(f,"PropertyTax","CommonFieldsConfig");function b(e,t,n,l,i){if(void 0===i&&(i=!1),"owners"===e){let n=h.owners||[];n[l]=t,g({...h,[e]:[...n]})}else if("units"===e){let e=h.units||[];e=t,g({...h,units:e})}else g({...h,[e]:{...h[e],...t}});((e,t,n,l)=>{let i,o=m.split("/").pop(),r=o.charAt(o.length-1),a=!1;Number(parseInt(o))||"0"==o||"-1"==o?"-1"==o||"-2"==o?(o=m.slice(0,-3),o=o.split("/").pop(),a=!0):(o=m.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=v.push;if(e&&(s=v.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)}h&&Object.keys(h).length>0&&window.location.href.includes("/info")&&"true"!==sessionStorage.getItem("docReqScreenByBack")&&(y(),c.invalidateQueries("PTR_CREATE_PET"));const T=()=>{},C=()=>{};if(S)return l.createElement(t.Loader,null);_=A,_.forEach(e=>{E=E.concat(e.body.filter(e=>!e.hideInCitizen))}),E.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,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:`${d.path}/${e.route}`,key:t},l.createElement(u,{config:{texts:i,inputs:r,key:a},onSelect:b,onSkip:T,t:p,formData:h,onAdd:C}))}),l.createElement(o.Route,{path:d.path+"/check"},l.createElement(D,{onSubmit:function(){try{return v.push(d.path+"/acknowledgement"),Promise.resolve()}catch(e){return Promise.reject(e)}},value:h})),l.createElement(o.Route,{path:d.path+"/acknowledgement"},l.createElement(N,{data:h,onSuccess:()=>{y(),c.invalidateQueries("PTR_CREATE_PET")}})),l.createElement(o.Route,null,l.createElement(o.Redirect,{to:`${d.path}/${E.indexRoute}`})))},PTRDocumentUpload:e=>{var i,r;let{t:a,config:u,onSelect:s,formData:c,setError:d,clearErrors:p,formState:m}=e;Digit.ULBService.getCurrentTenantId();const v=Digit.ULBService.getStateId(),[f,E]=n.useState((null==c||null===(i=c.documents)||void 0===i?void 0:i.documents)||[]),[h,g]=n.useState(null);o.useLocation();const{isLoading:y,data:_}=Digit.Hooks.ptr.usePetMDMS(v,"PetService","Documents"),S=null==_||null===(r=_.PetService)||void 0===r?void 0:r.Documents.map(e=>({...e,hasDropdown:!0}));return n.useEffect(()=>{s(u.key,{documents:f,PTRDocumentLength:null==S?void 0:S.length})},[f]),y?l.createElement(t.Loader,null):l.createElement("div",null,null==S?void 0:S.map((e,t)=>l.createElement(b,{key:t,document:e,action:"create",t:a,id:"ptr-document-"+t,error:h,setError:g,setDocuments:E,accept:".pdf, .jpeg, .jpg, .png",documents:f,formData:c,setFormError:d,clearFormErrors:p,config:u,formState:m})),h&&l.createElement(t.Toast,{label:h,onClose:()=>g(null),error:!0}))},PTRSelectStreet:e=>{let{t:i,config:o,onSelect:a,userType:u,formData:s,formState:d,setError:p,clearErrors:v}=e;const[f,E]=n.useState({index:-1,type:""}),{control:h,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"===u&&(Object.keys(b).length&&!m.isEqual((null===(e=d.errors[o.key])||void 0===e?void 0:e.type)||{},b)?p(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=s[o.key])||void 0===n?void 0:n[e]}),m.isEqual(S,t)||(a(o.key,{...s[o.key],...S}),_())},[S]),"employee"===u?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:h,defaultValue:null==s||null===(a=s.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,c({id:e.name,key:e.name,value:i.value,onChange:e=>{E({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==s?void 0:s.address.street,doorNo:null==s?void 0:s.address.doorNo},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRCitizenDetails:D,PTRCitizenPet:y,PTRCitizenAddress:e=>{let{t:i,config:o,onSelect:a,userType:u,formData:s,formState:d,setError:p,clearErrors:v}=e;const[f,E]=n.useState({index:-1,type:""}),{control:h,formState:g,watch:y,trigger:_}=r.useForm(),S=y(),{errors:b}=g,T=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(()=>{_()},[]),n.useEffect(()=>{var e;"employee"===u&&(Object.keys(b).length&&!m.isEqual((null===(e=d.errors[o.key])||void 0===e?void 0:e.type)||{},b)?p(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=s[o.key])||void 0===n?void 0:n[e]}),m.isEqual(S,t)||(a(o.key,{...s[o.key],...S}),_())},[S]),"employee"===u?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"},T?i(e.label)+":":i(e.label),o.isMandatory?" * ":null),l.createElement("div",{className:"field"},l.createElement(r.Controller,{control:h,defaultValue:null==s||null===(a=s.address)||void 0===a?void 0:a[e.name],name:e.name,rules:{validate:D(e)},render:i=>l.createElement(t.TextInput,c({id:e.name,key:e.name,value:i.value,onChange:e=>{E({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(C,{currentStep:3}):null,l.createElement(t.FormStep,{config:{...o,inputs:A},_defaultValues:{street:null==s?void 0:s.address.street,doorNo:null==s?void 0:s.address.doorNo,buildingName:null==s?void 0:s.address.buildingName,addressLine1:null==s?void 0:s.address.addressLine1,addressLine2:null==s?void 0:s.address.addressLine2,landmark:null==s?void 0:s.address.landmark},onSelect:e=>a(o.key,e),onSkip:()=>a(),t:i}))},PTRSelectPincode:e=>{var i;let{t:r,config:a,onSelect:u,formData:s={},userType:d}=e;const p=Digit.Hooks.ptr.useTenants(),{pathname:m}=o.useLocation(),v=m.includes("modify");console.log("formData in oincode ",s);const[f,E]=n.useState(()=>{var e,t,n;return v&&"employee"===d?(null==s||null===(e=s.originalData)||void 0===e||null===(t=e.address)||void 0===t?void 0:t.pincode)||"":(null==s||null===(n=s.address)||void 0===n?void 0:n.pincode)||""}),h=[{label:"PTR_ADDRESS_PINCODE",type:"text",name:"pincode",validation:{minlength:6,maxlength:7,pattern:"[0-9]+",max:"9999999",title:r("PTR_ADDRESS_PINCODE_INVALID")}}],[g,y]=n.useState(null),[_,S]=n.useState("");function b(e){E(e.target.value),y(null),S("");let t=Digit.Utils.getPattern("Pincode").test(e.target.value);"employee"===d&&(e.target.value&&!t&&S(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)}))||S(r("PTR_COMMON_PINCODE_NOT_SERVICABLE"))),u(a.key,{...s.address,pincode:e.target.value}))}return n.useEffect(()=>{var e;null!=s&&null!==(e=s.address)&&void 0!==e&&e.pincode&&E(s.address.pincode)},[null==s||null===(i=s.address)||void 0===i?void 0:i.pincode]),"employee"===d?null==h?void 0:h.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,c({key:e.name,value:f,onChange:b},e.validation,{disable:v,autoFocus:v})))),_?l.createElement(t.CardLabelError,{style:{width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"}},_):null)):l.createElement(l.Fragment,null,window.location.href.includes("/citizen")?l.createElement(C,{currentStep:3}):null,l.createElement(t.FormStep,{t:r,config:{...a,inputs:h},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))}))?u(a.key,{pincode:f}):y("PTR_COMMON_PINCODE_NOT_SERVICABLE"),Promise.resolve()}catch(e){return Promise.reject(e)}},_defaultValues:{pincode:f},onChange:b,onSkip:()=>u(),forcedError:r(g)}))},PTRSelectAddress:e=>{var i;let{t:a,config:u,onSelect:s,userType:c,formData:d}=e;const p=Digit.Hooks.ptr.useTenants();let v=Digit.ULBService.getCurrentTenantId();const{pathname:f}=o.useLocation(),E=f.includes("modify");let h=(null==d?void 0:d.isEditAddress)||!1;E&&(h=!0);const{pincode:g}=(null==d?void 0:d.address)||"",y="employee"===c?p.filter(e=>e.code===v):g?p.filter(e=>{var t;return null==e||null===(t=e.pincode)||void 0===t?void 0:t.some(e=>e==g)}):p,[_,S]=n.useState(()=>{var e;return(null==d||null===(e=d.address)||void 0===e?void 0:e.city)||null}),{data:b}=Digit.Hooks.useBoundaryLocalities(null==_?void 0:_.code,"revenue",{enabled:!!_},a),[T,A]=n.useState(),[D,N]=n.useState();n.useEffect(()=>{if("employee"===c&&E&&null!=T&&T.length){var e,t,n;const l=null==d||null===(e=d.originalData)||void 0===e||null===(t=e.address)||void 0===t||null===(n=t.locality)||void 0===n?void 0:n.code,i=null==T?void 0:T.filter(e=>e.code===l)[0];w("locality",i)}},[T]),n.useEffect(()=>{y&&1===y.length&&S(y[0])},[y]),n.useEffect(()=>{if(_&&b){var e,t;let l=b,i=[];var n;null!=d&&null!==(e=d.address)&&void 0!==e&&e.locality&&N(d.address.locality),null!=d&&null!==(t=d.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==d.address.pincode)}),null!=d&&null!==(n=d.address)&&void 0!==n&&n.locality||N()),A(()=>i.length>0?i:l),1===i.length&&N(i[0])}},[_,null==d||null===(i=d.address)||void 0===i?void 0:i.pincode,b]);const{control:P,formState:x,watch:I,setValue:w}=r.useForm(),R=I(),{errors:L}=x,O={width:"70%",marginLeft:"30%",fontSize:"12px",marginTop:"-21px"};var k,F;return n.useEffect(()=>{if("employee"===c){let e=Object.keys(R);const t={};e.forEach(e=>{var n;return t[e]=null===(n=d[u.key])||void 0===n?void 0:n[e]}),m.isEqual(R,t)||s(u.key,{...d[u.key],...R})}},[R]),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==y?void 0:y.length)?y[0]:_,control:P,render:e=>l.createElement(t.Dropdown,{className:"form-field",selected:e.value,disable:h||1===(null==y?void 0:y.length),option:y,select:e.onChange,optionKey:"code",onBlur:e.onBlur,t:a})})),l.createElement(t.CardLabelError,{style:O},x.touched.city?null==L||null===(k=L.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:T,select:e.onChange,onBlur:e.onBlur,optionKey:"i18nkey",t:a,disable:h||!1})})),l.createElement(t.CardLabelError,{style:O},x.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(C,{currentStep:3}):null,l.createElement(t.FormStep,{config:u,onSelect:function(){s(u.key,{city:_,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:y.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:_,optionKey:"i18nKey",onSelect:function(e){N(null),A(null),S(e)},t:a,isPTFlow:!0,disabled:h})),_&&T&&l.createElement(t.CardLabel,null,a("PTR_LOCALITY")+" "),_&&T&&l.createElement("span",{className:"form-ptr-dropdown-only"},l.createElement(t.RadioOrSelect,{dropdownStyle:{paddingBottom:"20px"},isMandatory:u.isMandatory,options:T.sort((e,t)=>e.name.localeCompare(t.name)),selectedOption:D,optionKey:"i18nkey",onSelect:function(e){var t;null!=d&&null!==(t=d.address)&&void 0!==t&&t.locality&&(d.address.locality=e),N(e),"employee"===c&&s(u.key,{...d[u.key],locality:e})},t:a,labelKey:"",disabled:h})))))},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),[m,v]=n.useState(null),[f,E]=n.useState(!0),[h,g]=n.useState(!1),y=Digit.ULBService.getStateId(),{isLoading:_,data:S}=Digit.Hooks.pt.usePropertyMDMS(y,"NDC",["Documents"]);console.log("formDataINPTRDOCUMENT",d,c);const b=()=>{let e;e={...c.documents,documents:d},s(u.key,e)};return n.useEffect(()=>{var e,t;let n=0;null==S||null===(e=S.PetService)||void 0===e||null===(t=e.Documents)||void 0===t||t.map(e=>{e.hasDropdown=!0;let t=!1;null==d||d.map(n=>{e.required&&null!=n&&n.documentType.includes(e.code)&&(t=!0)}),!t&&e.required&&(n+=1)}),E("0"!=n&&0!=n||!((null==d?void 0:d.length)>0))},[d,h]),l.createElement("div",null,_?l.createElement(t.Loader,null):l.createElement(t.FormStep,{t:a,config:u,onSelect:b,onSkip:()=>s(),isDisabled:f,onAdd:function(){}},null==S||null===(o=S.NDC)||void 0===o||null===(r=o.Documents)||void 0===r?void 0:r.map((e,t)=>l.createElement(N,{key:t,document:e,t:a,error:m,setError:v,setDocuments:p,documents:d,setCheckRequiredFields:g,handleSubmit:b})),m&&l.createElement(t.Toast,{label:m,onClose:()=>v(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(f(o,".","_"))),r.map((e,n)=>l.createElement(t.CardText,{className:"primaryColor"},""+(n+1),". ",i(f(null==e?void 0:e.code,".","_")))))}):null)),l.createElement("span",null,l.createElement(t.SubmitBar,{label:i("CS_COMMON_NEXT"),onSubmit:r}))))},PTRWFApplicationTimeline:x,NewPTRStepperForm:()=>{o.useHistory();const{t:e}=i.useTranslation(),r=s.useDispatch(),[a,u]=n.useState(null),c=s.useSelector(e=>e.ptr.PTRNewApplicationFormReducer),d=c.step;return Digit.ULBService.getCurrentTenantId(),console.log("formStatePTR: ",c),n.useEffect(()=>{r({type:"RESET_PTR_NEW_APPLICATION_FORM"})},[]),l.createElement("div",{className:"pageCard"},l.createElement(t.CardHeader,{styles:{fontSize:"28px",fontWeight:"400",color:"#1C1D1F"},divider:!0},e("PET_REGISTRATION_APPLICATION")),l.createElement(ni,{stepsList:ri,onSubmit:()=>{},step:d,setStep:e=>{r(oi(e))}}),a&&l.createElement(t.Toast,{error:a.key,label:e(a.label),onClose:()=>{u(null)},isDleteBtn:"true"}))},NewPTRStepFormOne:e=>{let{config:o,onGoNext:r,onBackClick:a}=e;const u=s.useDispatch(),{t:c}=i.useTranslation(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(D,{onGoBack:function(e){a(o.key,e)},goNext:function(e){u(ii(o.key,e)),r()},currentStepData:f,t:c}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewPTRStepFormTwo:e=>{let{config:o,onGoNext:r,onBackClick:a}=e;const u=s.useDispatch(),{t:c}=i.useTranslation(),[d,p]=n.useState(!1),[m,v]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData});return l.createElement(l.Fragment,null,l.createElement(y,{onGoBack:function(e){a(o.key,e)},goNext:function(e){u(ii(o.key,e)),r()},currentStepData:f,t:c}),d&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:m,onClose:()=>{p(!1),v("")}}))},NewPTRStepFormThree:e=>{let{config:i,onGoNext:o,onBackClick:r,t:a}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,v]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData&&e.ptr.PTRNewApplicationFormReducer.formData[null==i?void 0:i.key]?e.ptr.PTRNewApplicationFormReducer.formData[null==i?void 0:i.key]:{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:f,config:i.currStepConfig,onSubmit:function(e){console.log("goNext data in NewPTRStepFormThree: ",e);const{missingFields:t}={missingFields:[],notFormattedFields:[]};if(t.length>0)return v("Please fill the following field: "+t[0]),void d(!0);o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!m.isEqual(t,f)),m.isEqual(t,f)||u(ii(i.key,t))},label:a(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){r(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),v("")}}))},NewPTRStepFormFour:e=>{let{config:i,onGoNext:o,onBackClick:r,t:a}=e;const u=s.useDispatch(),[c,d]=n.useState(!1),[p,v]=n.useState(""),f=s.useSelector(function(e){return e.ptr.PTRNewApplicationFormReducer.formData||{}});return l.createElement(l.Fragment,null,l.createElement(t.FormComposer,{defaultValues:f,config:i.currStepConfig,onSubmit:function(e){o()},onFormValueChange:function(e,t){console.log("onFormValueChange data in AdministrativeDetails: ",t,"\n Bool: ",!m.isEqual(t,f)),m.isEqual(t,f)||u(ii(i.key,t))},label:a(""+i.texts.submitBarLabel),currentStep:i.currStepNumber,onBackClick:function(e){r(i.key,e)}}),c&&l.createElement(t.Toast,{isDleteBtn:!0,error:!0,label:p,onClose:()=>{d(!1),v("")}}))},PTRSummary:function(e){var n,i,r,a,u,c,d,p,m,v,f,E,h,g,y,_,S,b,T,C,A,D,N,P,x,I,w,R,L,O,k,F;let{formData:M,t:B}=e;o.useLocation(),o.useHistory();const U=s.useDispatch();return l.createElement("div",{className:"application-summary"},l.createElement("h2",{style:{fontSize:"20px",fontWeight:"bold"}},B("Application Summary")),l.createElement(t.Card,{className:"summary-section",style:{padding:"2px"}},l.createElement("div",{className:"section-header"},l.createElement("h3",null,B("Owner Details")),l.createElement("label",{onClick:()=>U(oi(1))},B("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("First Name")),l.createElement("div",null,(null==M||null===(n=M.ownerss)||void 0===n||null===(i=n.ownerss)||void 0===i?void 0:i.firstName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Last Name")),l.createElement("div",null,(null==M||null===(r=M.ownerss)||void 0===r||null===(a=r.ownerss)||void 0===a?void 0:a.lastName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Father's Name")),l.createElement("div",null,(null==M||null===(u=M.ownerss)||void 0===u||null===(c=u.ownerss)||void 0===c?void 0:c.fatherName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Mobile Number")),l.createElement("div",null,(null==M||null===(d=M.ownerss)||void 0===d||null===(p=d.ownerss)||void 0===p?void 0:p.mobileNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Email ID")),l.createElement("div",null,(null==M||null===(m=M.ownerss)||void 0===m||null===(v=m.ownerss)||void 0===v?void 0:v.emailId)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Address")),l.createElement("div",null,(null==M||null===(f=M.ownerss)||void 0===f||null===(E=f.ownerss)||void 0===E?void 0:E.address)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,B("Pet Details")),l.createElement("label",{onClick:()=>U(oi(2))},B("EDIT"))),l.createElement("div",{className:"section-content"},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Pet Name")),l.createElement("div",null,(null==M||null===(h=M.pets)||void 0===h||null===(g=h.pets)||void 0===g?void 0:g.petName)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Pet Type")),l.createElement("div",null,(null==M||null===(y=M.pets)||void 0===y||null===(_=y.pets)||void 0===_||null===(S=_.petType)||void 0===S?void 0:S.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Breed Type")),l.createElement("div",null,(null==M||null===(b=M.pets)||void 0===b||null===(T=b.pets)||void 0===T||null===(C=T.breedType)||void 0===C?void 0:C.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Pet Gender")),l.createElement("div",null,(null==M||null===(A=M.pets)||void 0===A||null===(D=A.pets)||void 0===D||null===(N=D.petGender)||void 0===N?void 0:N.i18nKey)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Color")),l.createElement("div",null,(null==M||null===(P=M.pets)||void 0===P||null===(x=P.pets)||void 0===x?void 0:x.color)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Vaccination Number")),l.createElement("div",null,(null==M||null===(I=M.pets)||void 0===I||null===(w=I.pets)||void 0===w?void 0:w.vaccinationNumber)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Last Vaccine Date")),l.createElement("div",null,(null==M||null===(R=M.pets)||void 0===R||null===(L=R.pets)||void 0===L?void 0:L.lastVaccineDate)||"NA")))),l.createElement(t.Card,{className:"summary-section"},l.createElement("div",{className:"section-header"},l.createElement("h3",null,B("Documents")),l.createElement("label",{onClick:()=>U(oi(3))},B("EDIT"))),l.createElement("div",{className:"section-content"},null==M||null===(O=M.documents)||void 0===O||null===(k=O.documents)||void 0===k||null===(F=k.documents)||void 0===F?void 0:F.map((e,n)=>l.createElement("div",{key:n},l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Document Type")),l.createElement("div",null,B(null==e?void 0:e.documentType)||"NA")),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,null,B("Document UID")),l.createElement("div",null,(null==e?void 0:e.documentUid)||"NA")))))))}},ui=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(ai).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(w,null)},si=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:ui,PTRLinks:si,PTR_INBOX_FILTER:e=>l.createElement(Ze,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 Qe(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicationNumber)}},{Header:e("PTR_APPLICANT_NAME"),Cell:e=>{var t,n,l,i;return Je(""+(null==e||null===(t=e.cell)||void 0===t||null===(n=t.row)||void 0===n||null===(l=n.original)||void 0===l||null===(i=l.searchData)||void 0===i?void 0:i.applicantName))},mobileCell:e=>{var t;return Qe(null==e||null===(t=e.searchData)||void 0===t?void 0:t.applicantName)}},{Header:e("PTR_PET_TYPE"),Cell:e=>{var t,n,l;let{row:i}=e;return Je(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.petType))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.petType)}},{Header:e("PTR_BREED_TYPE"),Cell:e=>{var t,n,l;let{row:i}=e;return Je(""+(null===(t=i.original)||void 0===t||null===(n=t.searchData)||void 0===n||null===(l=n.petDetails)||void 0===l?void 0:l.breedType))},mobileCell:e=>{var t,n;return Qe(null==e||null===(t=e.searchData)||void 0===t||null===(n=t.petDetails)||void 0===n?void 0:n.breedType)}},{Header:e("PTR_STATUS"),Cell:t=>{var n,l,i;let{row:o}=t;return Je(e(""+(null==o||null===(n=o.original)||void 0===n||null===(l=n.workflowData)||void 0===l||null===(i=l.state)||void 0===i?void 0:i.applicationStatus)))},mobileCell:t=>{var n,l;return Qe(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=si,exports.PTRModule=ui,exports.PTRReducers=()=>u.combineReducers({PTRNewApplicationFormReducer:ei});